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:
parent
00403c7839
commit
1b69fd63ff
1 changed files with 1 additions and 1 deletions
|
@ -756,7 +756,7 @@ func TestImportPrivateKey(t *testing.T) {
|
||||||
// import priv key
|
// import priv key
|
||||||
importHeight := int32(50)
|
importHeight := int32(50)
|
||||||
importedAt := &BlockStamp{Height: importHeight}
|
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 {
|
if err != nil {
|
||||||
t.Error("importing private key: " + err.Error())
|
t.Error("importing private key: " + err.Error())
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue