update tests to use the new Account type and catch rand.Read errors
This commit is contained in:
parent
fcc4871351
commit
37109bfe0d
2 changed files with 9 additions and 3 deletions
|
@ -17,7 +17,7 @@ func TestFakeTxs(t *testing.T) {
|
||||||
t.Errorf("Can not create encrypted wallet: %s", err)
|
t.Errorf("Can not create encrypted wallet: %s", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
btcw := &BtcWallet{
|
btcw := &Account{
|
||||||
Wallet: w,
|
Wallet: w,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,16 @@ func TestBtcAddressSerializer(t *testing.T) {
|
||||||
mem: 1024,
|
mem: 1024,
|
||||||
nIter: 5,
|
nIter: 5,
|
||||||
}
|
}
|
||||||
rand.Read(kdfp.salt[:])
|
if _, err := rand.Read(kdfp.salt[:]); err != nil {
|
||||||
|
t.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
key := Key([]byte("banana"), kdfp)
|
key := Key([]byte("banana"), kdfp)
|
||||||
privKey := make([]byte, 32)
|
privKey := make([]byte, 32)
|
||||||
rand.Read(privKey)
|
if _, err := rand.Read(privKey); err != nil {
|
||||||
|
t.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
addr, err := newBtcAddress(privKey, nil, &BlockStamp{})
|
addr, err := newBtcAddress(privKey, nil, &BlockStamp{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err.Error())
|
t.Error(err.Error())
|
||||||
|
|
Loading…
Reference in a new issue