From bcd9790781b1d7979a56a28f852b0d041e9e659f Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Fri, 8 Mar 2024 16:07:26 +0100 Subject: [PATCH] internal/ethapi, signer/core/apitypes: updates to tests --- internal/ethapi/api_test.go | 7 ++----- signer/core/apitypes/types_test.go | 8 ++++++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index 3f69f86144..bc6bf37a29 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -1037,11 +1037,8 @@ func TestSignBlobTransaction(t *testing.T) { } _, err = api.SignTransaction(context.Background(), argsFromTransaction(res.Tx, b.acc.Address)) - if err == nil { - t.Fatalf("should fail on blob transaction") - } - if !errors.Is(err, errBlobTxNotSupported) { - t.Errorf("error mismatch. Have: %v, want: %v", err, errBlobTxNotSupported) + if err != nil { + t.Fatalf("should not fail on blob transaction") } } diff --git a/signer/core/apitypes/types_test.go b/signer/core/apitypes/types_test.go index 761b2ef5af..daffdefc2a 100644 --- a/signer/core/apitypes/types_test.go +++ b/signer/core/apitypes/types_test.go @@ -72,10 +72,14 @@ func TestTxArgs(t *testing.T) { if err := json.Unmarshal(tc.data, &txArgs); err != nil { t.Fatal(err) } - if have := txArgs.ToTransaction().Type(); have != tc.wantType { + tx, err := txArgs.ToTransaction() + if err != nil { + t.Fatal(err) + } + if have := tx.Type(); have != tc.wantType { t.Errorf("test %d, have type %d, want type %d", i, have, tc.wantType) } - if have := txArgs.ToTransaction().Hash(); have != tc.want { + if have := tx.Hash(); have != tc.want { t.Errorf("test %d: have %v, want %v", i, have, tc.want) } d2, err := json.Marshal(txArgs)