mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-23 17:47:29 +00:00
wtxmgr: update tests to use db timeout param
This commit is contained in:
parent
f6ea9d4d7b
commit
368301866e
1 changed files with 10 additions and 2 deletions
|
@ -45,6 +45,10 @@ var (
|
||||||
Block: Block{Hash: *TstSignedTxBlockHash, Height: TstSpendingTxBlockHeight},
|
Block: Block{Hash: *TstSignedTxBlockHash, Height: TstSpendingTxBlockHeight},
|
||||||
Time: time.Unix(1389114091, 0),
|
Time: time.Unix(1389114091, 0),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// defaultDBTimeout specifies the timeout value when opening the wallet
|
||||||
|
// database.
|
||||||
|
defaultDBTimeout = 10 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
func testDB() (walletdb.DB, func(), error) {
|
func testDB() (walletdb.DB, func(), error) {
|
||||||
|
@ -52,7 +56,9 @@ func testDB() (walletdb.DB, func(), error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, func() {}, err
|
return nil, func() {}, err
|
||||||
}
|
}
|
||||||
db, err := walletdb.Create("bdb", filepath.Join(tmpDir, "db"), true)
|
db, err := walletdb.Create(
|
||||||
|
"bdb", filepath.Join(tmpDir, "db"), true, defaultDBTimeout,
|
||||||
|
)
|
||||||
return db, func() { os.RemoveAll(tmpDir) }, err
|
return db, func() { os.RemoveAll(tmpDir) }, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +70,9 @@ func testStore() (*Store, walletdb.DB, func(), error) {
|
||||||
return nil, nil, func() {}, err
|
return nil, nil, func() {}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err := walletdb.Create("bdb", filepath.Join(tmpDir, "db"), true)
|
db, err := walletdb.Create(
|
||||||
|
"bdb", filepath.Join(tmpDir, "db"), true, defaultDBTimeout,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.RemoveAll(tmpDir)
|
os.RemoveAll(tmpDir)
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, err
|
||||||
|
|
Loading…
Add table
Reference in a new issue