mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
walletunlocker: accept recovery window from InitWallet
This commit is contained in:
@@ -37,8 +37,10 @@ var (
|
||||
|
||||
func createTestWallet(t *testing.T, dir string, netParams *chaincfg.Params) {
|
||||
netDir := btcwallet.NetworkDir(dir, netParams)
|
||||
loader := wallet.NewLoader(netParams, netDir)
|
||||
_, err := loader.CreateNewWallet(testPassword, testPassword, testSeed)
|
||||
loader := wallet.NewLoader(netParams, netDir, 0)
|
||||
_, err := loader.CreateNewWallet(
|
||||
testPassword, testPassword, testSeed, time.Time{},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("failed creating wallet: %v", err)
|
||||
}
|
||||
@@ -340,10 +342,10 @@ func TestUnlockWallet(t *testing.T) {
|
||||
|
||||
// Password should be sent over the channel.
|
||||
select {
|
||||
case pw := <-service.UnlockPasswords:
|
||||
if !bytes.Equal(pw, testPassword) {
|
||||
case unlockMsg := <-service.UnlockMsgs:
|
||||
if !bytes.Equal(unlockMsg.Passphrase, testPassword) {
|
||||
t.Fatalf("expected to receive password %x, got %x",
|
||||
testPassword, pw)
|
||||
testPassword, unlockMsg.Passphrase)
|
||||
}
|
||||
case <-time.After(3 * time.Second):
|
||||
t.Fatalf("password not received")
|
||||
|
Reference in New Issue
Block a user