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.
This commit is contained in:
Josh Rickmar 2014-04-11 15:18:43 -05:00
parent 00403c7839
commit 1b69fd63ff

View file

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