mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 08:41:42 +02:00
kvdb+etcd: enable channeldb testing with both bdb/etcd
This commit is contained in:
@@ -98,13 +98,22 @@ func makeTestDB() (*DB, func(), error) {
|
||||
}
|
||||
|
||||
// Next, create channeldb for the first time.
|
||||
cdb, err := Open(tempDirName, OptionClock(testClock))
|
||||
backend, backendCleanup, err := kvdb.GetTestBackend(tempDirName, "cdb")
|
||||
if err != nil {
|
||||
backendCleanup()
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
cdb, err := CreateWithBackend(backend, OptionClock(testClock))
|
||||
if err != nil {
|
||||
backendCleanup()
|
||||
os.RemoveAll(tempDirName)
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
cleanUp := func() {
|
||||
cdb.Close()
|
||||
backendCleanup()
|
||||
os.RemoveAll(tempDirName)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user