multi: support sync freelist option within btcwallet

This commit is contained in:
Wilmer Paulino
2019-10-04 11:10:49 -04:00
parent 6765b8668a
commit 194a9dea81
12 changed files with 49 additions and 32 deletions

View File

@@ -36,7 +36,7 @@ var (
func createTestWallet(t *testing.T, dir string, netParams *chaincfg.Params) {
netDir := btcwallet.NetworkDir(dir, netParams)
loader := wallet.NewLoader(netParams, netDir, 0)
loader := wallet.NewLoader(netParams, netDir, true, 0)
_, err := loader.CreateNewWallet(
testPassword, testPassword, testSeed, time.Time{},
)
@@ -62,7 +62,7 @@ func TestGenSeed(t *testing.T) {
}
defer os.RemoveAll(testDir)
service := walletunlocker.New(testDir, testNetParams, nil)
service := walletunlocker.New(testDir, testNetParams, true, nil)
// Now that the service has been created, we'll ask it to generate a
// new seed for us given a test passphrase.
@@ -103,7 +103,7 @@ func TestGenSeedGenerateEntropy(t *testing.T) {
defer func() {
os.RemoveAll(testDir)
}()
service := walletunlocker.New(testDir, testNetParams, nil)
service := walletunlocker.New(testDir, testNetParams, true, nil)
// Now that the service has been created, we'll ask it to generate a
// new seed for us given a test passphrase. Note that we don't actually
@@ -143,7 +143,7 @@ func TestGenSeedInvalidEntropy(t *testing.T) {
defer func() {
os.RemoveAll(testDir)
}()
service := walletunlocker.New(testDir, testNetParams, nil)
service := walletunlocker.New(testDir, testNetParams, true, nil)
// Now that the service has been created, we'll ask it to generate a
// new seed for us given a test passphrase. However, we'll be using an
@@ -181,7 +181,7 @@ func TestInitWallet(t *testing.T) {
}()
// Create new UnlockerService.
service := walletunlocker.New(testDir, testNetParams, nil)
service := walletunlocker.New(testDir, testNetParams, true, nil)
// Once we have the unlocker service created, we'll now instantiate a
// new cipher seed instance.
@@ -282,7 +282,7 @@ func TestCreateWalletInvalidEntropy(t *testing.T) {
}()
// Create new UnlockerService.
service := walletunlocker.New(testDir, testNetParams, nil)
service := walletunlocker.New(testDir, testNetParams, true, nil)
// We'll attempt to init the wallet with an invalid cipher seed and
// passphrase.
@@ -315,7 +315,7 @@ func TestUnlockWallet(t *testing.T) {
}()
// Create new UnlockerService.
service := walletunlocker.New(testDir, testNetParams, nil)
service := walletunlocker.New(testDir, testNetParams, true, nil)
ctx := context.Background()
req := &lnrpc.UnlockWalletRequest{
@@ -389,7 +389,7 @@ func TestChangeWalletPassword(t *testing.T) {
}
// Create a new UnlockerService with our temp files.
service := walletunlocker.New(testDir, testNetParams, tempFiles)
service := walletunlocker.New(testDir, testNetParams, true, tempFiles)
ctx := context.Background()
newPassword := []byte("hunter2???")