From 1b69fd63ff7c6266474cbfb53eae4a77fc22f49a Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Fri, 11 Apr 2014 15:18:43 -0500 Subject: [PATCH] Fix a test. Calling Bytes() on a big.Int strips any leading padding zeros. This change fixes the test to always pad the byte slice for a private key to a length of 32. --- wallet/wallet_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wallet/wallet_test.go b/wallet/wallet_test.go index 11fbce6..f3b6863 100644 --- a/wallet/wallet_test.go +++ b/wallet/wallet_test.go @@ -756,7 +756,7 @@ func TestImportPrivateKey(t *testing.T) { // import priv key importHeight := int32(50) importedAt := &BlockStamp{Height: importHeight} - address, err := w.ImportPrivateKey(pk.D.Bytes(), false, importedAt) + address, err := w.ImportPrivateKey(pad(32, pk.D.Bytes()), false, importedAt) if err != nil { t.Error("importing private key: " + err.Error()) return