accounts/keystore, crypto: enforce 256 bit keys on import

This commit is contained in:
Péter Szilágyi
2017-05-23 14:58:03 +03:00
parent 3556962053
commit aa73420207
10 changed files with 32 additions and 31 deletions

View File

@ -96,7 +96,10 @@ func TestConfigWriteRead(t *testing.T) {
}
defer os.RemoveAll(tmp)
prvkey := crypto.ToECDSA(common.Hex2Bytes(hexprvkey))
prvkey, err := crypto.HexToECDSA(hexprvkey)
if err != nil {
t.Fatalf("failed to load private key: %v", err)
}
orig, err := NewConfig(tmp, common.Address{}, prvkey, 323)
if err != nil {
t.Fatalf("expected no error, got %v", err)