diff --git a/votingpool/example_test.go b/votingpool/example_test.go index b1d8ef3..b865e65 100644 --- a/votingpool/example_test.go +++ b/votingpool/example_test.go @@ -22,6 +22,7 @@ import ( "io/ioutil" "os" "path/filepath" + "time" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/txscript" @@ -42,7 +43,7 @@ var ( func createWaddrmgr(ns walletdb.ReadWriteBucket, params *chaincfg.Params) (*waddrmgr.Manager, error) { err := waddrmgr.Create(ns, seed, pubPassphrase, privPassphrase, params, - fastScrypt) + fastScrypt, time.Now()) if err != nil { return nil, err } diff --git a/votingpool/factory_test.go b/votingpool/factory_test.go index ca00df7..992785d 100644 --- a/votingpool/factory_test.go +++ b/votingpool/factory_test.go @@ -348,7 +348,7 @@ func TstCreatePool(t *testing.T) (tearDownFunc func(), db walletdb.DB, pool *Poo } fastScrypt := &waddrmgr.ScryptOptions{N: 16, R: 8, P: 1} err = waddrmgr.Create(addrmgrNs, seed, pubPassphrase, privPassphrase, - &chaincfg.MainNetParams, fastScrypt) + &chaincfg.MainNetParams, fastScrypt, time.Now()) if err != nil { return err } diff --git a/votingpool/withdrawal_wb_test.go b/votingpool/withdrawal_wb_test.go index 53fb7eb..4cb009a 100644 --- a/votingpool/withdrawal_wb_test.go +++ b/votingpool/withdrawal_wb_test.go @@ -329,7 +329,7 @@ func TestRollbackLastOutput(t *testing.T) { } lastInput := initialInputs[len(initialInputs)-1] if !reflect.DeepEqual(removedInputs[0], lastInput) { - t.Fatalf("Wrong rolled back input; got %s want %s", removedInputs[0], lastInput) + t.Fatalf("Wrong rolled back input; got %v want %v", removedInputs[0], lastInput) } // Now check that the inputs and outputs left in the tx match what we @@ -1474,7 +1474,7 @@ func checkTxInputs(t *testing.T, tx *withdrawalTx, inputs []credit) { } for i, input := range tx.inputs { if !reflect.DeepEqual(input, inputs[i]) { - t.Fatalf("Unexpected input; got %s, want %s", input, inputs[i]) + t.Fatalf("Unexpected input; got %v, want %v", input, inputs[i]) } } } diff --git a/waddrmgr/manager.go b/waddrmgr/manager.go index dcc910e..3be1387 100644 --- a/waddrmgr/manager.go +++ b/waddrmgr/manager.go @@ -524,7 +524,7 @@ func (m *Manager) ActiveScopedKeyManagers() []*ScopedKeyManager { return scopedManagers } -// ScopesForExternalAddrTypes returns the set of key scopes that are able to +// ScopesForExternalAddrType returns the set of key scopes that are able to // produce the target address type as external addresses. func (m *Manager) ScopesForExternalAddrType(addrType AddressType) []KeyScope { m.mtx.RLock() diff --git a/waddrmgr/manager_test.go b/waddrmgr/manager_test.go index 8d929d0..932f50a 100644 --- a/waddrmgr/manager_test.go +++ b/waddrmgr/manager_test.go @@ -1783,7 +1783,7 @@ func TestManager(t *testing.T) { // manager after they've completed scopedMgr, err := mgr.FetchScopedKeyManager(waddrmgr.KeyScopeBIP0044) if err != nil { - t.Fatal("unable to fetch default scope: %v", err) + t.Fatalf("unable to fetch default scope: %v", err) } testManagerAPI(&testContext{ t: t, @@ -1825,7 +1825,7 @@ func TestManager(t *testing.T) { scopedMgr, err = mgr.FetchScopedKeyManager(waddrmgr.KeyScopeBIP0044) if err != nil { - t.Fatal("unable to fetch default scope: %v", err) + t.Fatalf("unable to fetch default scope: %v", err) } tc := &testContext{ t: t, @@ -2248,11 +2248,10 @@ func TestRootHDKeyNeutering(t *testing.T) { ExternalAddrType: waddrmgr.NestedWitnessPubKey, InternalAddrType: waddrmgr.WitnessPubKey, } - var scopedMgr *waddrmgr.ScopedKeyManager err = walletdb.Update(db, func(tx walletdb.ReadWriteTx) error { ns := tx.ReadWriteBucket(waddrmgrNamespaceKey) - scopedMgr, err = mgr.NewScopedKeyManager(ns, testScope, addrSchema) + _, err := mgr.NewScopedKeyManager(ns, testScope, addrSchema) if err != nil { return err } @@ -2282,7 +2281,7 @@ func TestRootHDKeyNeutering(t *testing.T) { err = walletdb.Update(db, func(tx walletdb.ReadWriteTx) error { ns := tx.ReadWriteBucket(waddrmgrNamespaceKey) - scopedMgr, err = mgr.NewScopedKeyManager(ns, testScope, addrSchema) + _, err := mgr.NewScopedKeyManager(ns, testScope, addrSchema) if err != nil { return err } diff --git a/wtxmgr/tx_test.go b/wtxmgr/tx_test.go index 88e40a7..388436c 100644 --- a/wtxmgr/tx_test.go +++ b/wtxmgr/tx_test.go @@ -117,7 +117,7 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) { // Create a "signed" (with invalid sigs) tx that spends output 0 of // the double spend. spendingTx := wire.NewMsgTx(wire.TxVersion) - spendingTxIn := wire.NewTxIn(wire.NewOutPoint(TstDoubleSpendTx.Hash(), 0), []byte{0, 1, 2, 3, 4}) + spendingTxIn := wire.NewTxIn(wire.NewOutPoint(TstDoubleSpendTx.Hash(), 0), []byte{0, 1, 2, 3, 4}, nil) spendingTx.AddTxIn(spendingTxIn) spendingTxOut1 := wire.NewTxOut(1e7, []byte{5, 6, 7, 8, 9}) spendingTxOut2 := wire.NewTxOut(9e7, []byte{10, 11, 12, 13, 14})