From 9320e2ef89deb8832ec56dcb83ae9fecfd649d5b Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 22 Jul 2019 02:20:07 -0500 Subject: [PATCH] release: Introduce database v2 module. --- database/cmd/dbtool/fetchblock.go | 4 ++-- database/cmd/dbtool/fetchblockregion.go | 4 ++-- database/cmd/dbtool/globalconfig.go | 4 ++-- database/cmd/dbtool/insecureimport.go | 2 +- database/cmd/dbtool/loadheaders.go | 4 ++-- database/cmd/dbtool/main.go | 4 ++-- database/driver_test.go | 6 +++--- database/error_test.go | 4 ++-- database/example_test.go | 8 ++++---- database/ffldb/bench_test.go | 2 +- database/ffldb/blockio.go | 2 +- database/ffldb/db.go | 4 ++-- database/ffldb/dbcache.go | 4 ++-- database/ffldb/driver.go | 4 ++-- database/ffldb/driver_test.go | 4 ++-- database/ffldb/export_test.go | 4 ++-- database/ffldb/interface_test.go | 2 +- database/ffldb/ldbtreapiter.go | 4 ++-- database/ffldb/reconcile.go | 4 ++-- database/ffldb/whitebox_test.go | 2 +- database/go.mod | 2 +- 21 files changed, 39 insertions(+), 39 deletions(-) diff --git a/database/cmd/dbtool/fetchblock.go b/database/cmd/dbtool/fetchblock.go index d24b8b79..bb679747 100644 --- a/database/cmd/dbtool/fetchblock.go +++ b/database/cmd/dbtool/fetchblock.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -11,7 +11,7 @@ import ( "time" "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" ) // fetchBlockCmd defines the configuration options for the fetchblock command. diff --git a/database/cmd/dbtool/fetchblockregion.go b/database/cmd/dbtool/fetchblockregion.go index 3d16d223..880bba86 100644 --- a/database/cmd/dbtool/fetchblockregion.go +++ b/database/cmd/dbtool/fetchblockregion.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -12,7 +12,7 @@ import ( "time" "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" ) // blockRegionCmd defines the configuration options for the fetchblockregion diff --git a/database/cmd/dbtool/globalconfig.go b/database/cmd/dbtool/globalconfig.go index 4425a89f..8e00cbff 100644 --- a/database/cmd/dbtool/globalconfig.go +++ b/database/cmd/dbtool/globalconfig.go @@ -12,8 +12,8 @@ import ( "path/filepath" "github.com/decred/dcrd/chaincfg/v2" - "github.com/decred/dcrd/database" - _ "github.com/decred/dcrd/database/ffldb" + "github.com/decred/dcrd/database/v2" + _ "github.com/decred/dcrd/database/v2/ffldb" "github.com/decred/dcrd/dcrutil/v2" ) diff --git a/database/cmd/dbtool/insecureimport.go b/database/cmd/dbtool/insecureimport.go index 53277c52..4168a92b 100644 --- a/database/cmd/dbtool/insecureimport.go +++ b/database/cmd/dbtool/insecureimport.go @@ -14,7 +14,7 @@ import ( "time" "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" "github.com/decred/dcrd/dcrutil/v2" "github.com/decred/dcrd/wire" ) diff --git a/database/cmd/dbtool/loadheaders.go b/database/cmd/dbtool/loadheaders.go index 1ba7a6f7..8a4c7ff1 100644 --- a/database/cmd/dbtool/loadheaders.go +++ b/database/cmd/dbtool/loadheaders.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -9,7 +9,7 @@ import ( "time" "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" ) // headersCmd defines the configuration options for the loadheaders command. diff --git a/database/cmd/dbtool/main.go b/database/cmd/dbtool/main.go index 410101b9..317a6bd3 100644 --- a/database/cmd/dbtool/main.go +++ b/database/cmd/dbtool/main.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016-2018 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -11,7 +11,7 @@ import ( "runtime" "strings" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" "github.com/decred/slog" flags "github.com/jessevdk/go-flags" ) diff --git a/database/driver_test.go b/database/driver_test.go index 3773a14a..04d6ae5f 100644 --- a/database/driver_test.go +++ b/database/driver_test.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -9,8 +9,8 @@ import ( "fmt" "testing" - "github.com/decred/dcrd/database" - _ "github.com/decred/dcrd/database/ffldb" + "github.com/decred/dcrd/database/v2" + _ "github.com/decred/dcrd/database/v2/ffldb" ) var ( diff --git a/database/error_test.go b/database/error_test.go index 7d3ede19..34ffd003 100644 --- a/database/error_test.go +++ b/database/error_test.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -9,7 +9,7 @@ import ( "errors" "testing" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" ) // TestErrorCodeStringer tests the stringized output for the ErrorCode type. diff --git a/database/example_test.go b/database/example_test.go index 3d68e76e..f086e3cf 100644 --- a/database/example_test.go +++ b/database/example_test.go @@ -12,8 +12,8 @@ import ( "path/filepath" "github.com/decred/dcrd/chaincfg/v2" - "github.com/decred/dcrd/database" - _ "github.com/decred/dcrd/database/ffldb" + "github.com/decred/dcrd/database/v2" + _ "github.com/decred/dcrd/database/v2/ffldb" "github.com/decred/dcrd/dcrutil/v2" "github.com/decred/dcrd/wire" ) @@ -50,7 +50,7 @@ func Example_basicUsage() { // // import ( // "github.com/decred/dcrd/database2" - // _ "github.com/decred/dcrd/database/ffldb" + // _ "github.com/decred/dcrd/database/v2/ffldb" // ) // Create a database and schedule it to be closed and removed on exit. @@ -116,7 +116,7 @@ func Example_blockStorageAndRetrieval() { // // import ( // "github.com/decred/dcrd/database2" - // _ "github.com/decred/dcrd/database/ffldb" + // _ "github.com/decred/dcrd/database/v2/ffldb" // ) // Create a database and schedule it to be closed and removed on exit. diff --git a/database/ffldb/bench_test.go b/database/ffldb/bench_test.go index 35a0d046..4865627c 100644 --- a/database/ffldb/bench_test.go +++ b/database/ffldb/bench_test.go @@ -11,7 +11,7 @@ import ( "testing" "github.com/decred/dcrd/chaincfg/v2" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" "github.com/decred/dcrd/dcrutil/v2" ) diff --git a/database/ffldb/blockio.go b/database/ffldb/blockio.go index c44a2a44..ce28f812 100644 --- a/database/ffldb/blockio.go +++ b/database/ffldb/blockio.go @@ -19,7 +19,7 @@ import ( "sync" "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" "github.com/decred/dcrd/wire" ) diff --git a/database/ffldb/db.go b/database/ffldb/db.go index 56389da7..eb7d3c11 100644 --- a/database/ffldb/db.go +++ b/database/ffldb/db.go @@ -23,8 +23,8 @@ import ( "github.com/btcsuite/goleveldb/leveldb/opt" "github.com/btcsuite/goleveldb/leveldb/util" "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/decred/dcrd/database" - "github.com/decred/dcrd/database/internal/treap" + "github.com/decred/dcrd/database/v2" + "github.com/decred/dcrd/database/v2/internal/treap" "github.com/decred/dcrd/wire" ) diff --git a/database/ffldb/dbcache.go b/database/ffldb/dbcache.go index 81758645..bf212e2c 100644 --- a/database/ffldb/dbcache.go +++ b/database/ffldb/dbcache.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -14,7 +14,7 @@ import ( "github.com/btcsuite/goleveldb/leveldb" "github.com/btcsuite/goleveldb/leveldb/iterator" "github.com/btcsuite/goleveldb/leveldb/util" - "github.com/decred/dcrd/database/internal/treap" + "github.com/decred/dcrd/database/v2/internal/treap" ) const ( diff --git a/database/ffldb/driver.go b/database/ffldb/driver.go index 84f1a932..8a15da82 100644 --- a/database/ffldb/driver.go +++ b/database/ffldb/driver.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016-2018 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -8,7 +8,7 @@ package ffldb import ( "fmt" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" "github.com/decred/dcrd/wire" "github.com/decred/slog" ) diff --git a/database/ffldb/driver_test.go b/database/ffldb/driver_test.go index 98e06f88..8474b369 100644 --- a/database/ffldb/driver_test.go +++ b/database/ffldb/driver_test.go @@ -14,8 +14,8 @@ import ( "testing" "github.com/decred/dcrd/chaincfg/v2" - "github.com/decred/dcrd/database" - "github.com/decred/dcrd/database/ffldb" + "github.com/decred/dcrd/database/v2" + "github.com/decred/dcrd/database/v2/ffldb" "github.com/decred/dcrd/dcrutil/v2" ) diff --git a/database/ffldb/export_test.go b/database/ffldb/export_test.go index 58d038d0..9c21de2d 100644 --- a/database/ffldb/export_test.go +++ b/database/ffldb/export_test.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -12,7 +12,7 @@ The functions are only exported while the tests are being run. package ffldb -import "github.com/decred/dcrd/database" +import "github.com/decred/dcrd/database/v2" // TstRunWithMaxBlockFileSize runs the passed function with the maximum allowed // file size for the database set to the provided value. The value will be set diff --git a/database/ffldb/interface_test.go b/database/ffldb/interface_test.go index 2f3c8adb..469c5237 100644 --- a/database/ffldb/interface_test.go +++ b/database/ffldb/interface_test.go @@ -26,7 +26,7 @@ import ( "time" "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" "github.com/decred/dcrd/dcrutil/v2" "github.com/decred/dcrd/wire" ) diff --git a/database/ffldb/ldbtreapiter.go b/database/ffldb/ldbtreapiter.go index 1970f064..3441c030 100644 --- a/database/ffldb/ldbtreapiter.go +++ b/database/ffldb/ldbtreapiter.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -8,7 +8,7 @@ package ffldb import ( "github.com/btcsuite/goleveldb/leveldb/iterator" "github.com/btcsuite/goleveldb/leveldb/util" - "github.com/decred/dcrd/database/internal/treap" + "github.com/decred/dcrd/database/v2/internal/treap" ) // ldbTreapIter wraps a treap iterator to provide the additional functionality diff --git a/database/ffldb/reconcile.go b/database/ffldb/reconcile.go index f7f0de8e..b6299c64 100644 --- a/database/ffldb/reconcile.go +++ b/database/ffldb/reconcile.go @@ -1,5 +1,5 @@ // Copyright (c) 2015-2016 The btcsuite developers -// Copyright (c) 2016 The Decred developers +// Copyright (c) 2016-2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -9,7 +9,7 @@ import ( "fmt" "hash/crc32" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" ) // The serialized write cursor location format is: diff --git a/database/ffldb/whitebox_test.go b/database/ffldb/whitebox_test.go index ff3a9135..48190eba 100644 --- a/database/ffldb/whitebox_test.go +++ b/database/ffldb/whitebox_test.go @@ -21,7 +21,7 @@ import ( "github.com/btcsuite/goleveldb/leveldb" ldberrors "github.com/btcsuite/goleveldb/leveldb/errors" - "github.com/decred/dcrd/database" + "github.com/decred/dcrd/database/v2" "github.com/decred/dcrd/dcrutil/v2" "github.com/decred/dcrd/wire" ) diff --git a/database/go.mod b/database/go.mod index bf4df192..110247bd 100644 --- a/database/go.mod +++ b/database/go.mod @@ -1,4 +1,4 @@ -module github.com/decred/dcrd/database +module github.com/decred/dcrd/database/v2 go 1.11