diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index 7a40643823..52bbc8b47a 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -850,6 +850,17 @@ func TestEstimateGas(t *testing.T) { }, want: 46000, }, + // Should retrieve the code of 0xef0001 || accounts[0].addr and return an invalid opcode error. + { + blockNumber: rpc.LatestBlockNumber, + call: TransactionArgs{ + From: &accounts[0].addr, + To: &accounts[0].addr, + Value: (*hexutil.Big)(big.NewInt(0)), + AuthorizationList: []types.SetCodeAuthorization{setCodeAuthorization}, + }, + expectErr: errors.New("invalid opcode: opcode 0xef not defined"), + }, // SetCodeTx with empty authorization list should fail. { blockNumber: rpc.LatestBlockNumber, @@ -881,7 +892,7 @@ func TestEstimateGas(t *testing.T) { continue } if !errors.Is(err, tc.expectErr) { - if !reflect.DeepEqual(err, tc.expectErr) { + if err.Error() != tc.expectErr.Error() { t.Errorf("test %d: error mismatch, want %v, have %v", i, tc.expectErr, err) } }