From 37109bfe0daa52ee2925a336548ea628ea5c6dff Mon Sep 17 00:00:00 2001 From: David Hill Date: Fri, 15 Nov 2013 12:03:52 -0500 Subject: [PATCH] update tests to use the new Account type and catch rand.Read errors --- createtx_test.go | 2 +- wallet/wallet_test.go | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/createtx_test.go b/createtx_test.go index 583dd59..d1d3d6d 100644 --- a/createtx_test.go +++ b/createtx_test.go @@ -17,7 +17,7 @@ func TestFakeTxs(t *testing.T) { t.Errorf("Can not create encrypted wallet: %s", err) return } - btcw := &BtcWallet{ + btcw := &Account{ Wallet: w, } diff --git a/wallet/wallet_test.go b/wallet/wallet_test.go index fd01074..7cf530b 100644 --- a/wallet/wallet_test.go +++ b/wallet/wallet_test.go @@ -32,10 +32,16 @@ func TestBtcAddressSerializer(t *testing.T) { mem: 1024, nIter: 5, } - rand.Read(kdfp.salt[:]) + if _, err := rand.Read(kdfp.salt[:]); err != nil { + t.Error(err.Error()) + return + } key := Key([]byte("banana"), kdfp) 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{}) if err != nil { t.Error(err.Error())