Fix tests.

This commit is contained in:
Josh Rickmar 2014-05-27 18:22:03 -05:00
parent 4495a523d8
commit 55cf6c3b22

View file

@ -717,7 +717,10 @@ func TestWatchingWalletExport(t *testing.T) {
return return
} }
pk, _ := btcec.PrivKeyFromBytes(btcec.S256(), make([]byte, 32)) pk, _ := btcec.PrivKeyFromBytes(btcec.S256(), make([]byte, 32))
wif := btcutil.NewWIF(pk, tstNetParams, true) wif, err := btcutil.NewWIF(pk, tstNetParams, true)
if err != nil {
t.Fatal(err)
}
if _, err := ww.ImportPrivateKey(wif, createdAt); err != ErrWalletIsWatchingOnly { if _, err := ww.ImportPrivateKey(wif, createdAt); err != ErrWalletIsWatchingOnly {
t.Errorf("Nonsensical func ImportPrivateKey returned no or incorrect error: %v", err) t.Errorf("Nonsensical func ImportPrivateKey returned no or incorrect error: %v", err)
return return
@ -758,7 +761,10 @@ func TestImportPrivateKey(t *testing.T) {
} }
// import priv key // import priv key
wif := btcutil.NewWIF((*btcec.PrivateKey)(pk), tstNetParams, false) wif, err := btcutil.NewWIF((*btcec.PrivateKey)(pk), tstNetParams, false)
if err != nil {
t.Fatal(err)
}
importHeight := int32(50) importHeight := int32(50)
importedAt := &BlockStamp{Height: importHeight} importedAt := &BlockStamp{Height: importHeight}
address, err := w.ImportPrivateKey(wif, importedAt) address, err := w.ImportPrivateKey(wif, importedAt)