multi: fix linter errors

This commit is contained in:
Olaoluwa Osuntokun 2018-05-23 19:09:09 -07:00
parent e9b145c524
commit 2b856b5200
6 changed files with 11 additions and 11 deletions

View file

@ -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
}

View file

@ -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
}

View file

@ -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])
}
}
}

View file

@ -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()

View file

@ -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
}

View file

@ -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})