mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Update signed_data_test.go
This commit is contained in:
parent
28376aea78
commit
bd502d739c
1 changed files with 3 additions and 3 deletions
|
|
@ -219,7 +219,7 @@ func TestSignData(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if signature == nil || len(signature) != 65 {
|
||||
if len(signature) != 65 {
|
||||
t.Errorf("Expected 65 byte signature (got %d bytes)", len(signature))
|
||||
}
|
||||
// data/typed via SignTypeData
|
||||
|
|
@ -228,7 +228,7 @@ func TestSignData(t *testing.T) {
|
|||
var want []byte
|
||||
if signature, err = api.SignTypedData(context.Background(), a, typedData); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if signature == nil || len(signature) != 65 {
|
||||
} else if len(signature) != 65 {
|
||||
t.Errorf("Expected 65 byte signature (got %d bytes)", len(signature))
|
||||
} else {
|
||||
want = signature
|
||||
|
|
@ -241,7 +241,7 @@ func TestSignData(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
} else if signature, err = api.SignData(context.Background(), apitypes.DataTyped.Mime, a, hexutil.Encode(typedDataJson)); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if signature == nil || len(signature) != 65 {
|
||||
} else if len(signature) != 65 {
|
||||
t.Errorf("Expected 65 byte signature (got %d bytes)", len(signature))
|
||||
} else if have := signature; !bytes.Equal(have, want) {
|
||||
t.Fatalf("want %x, have %x", want, have)
|
||||
|
|
|
|||
Loading…
Reference in a new issue