From d82bb03d9862ba49692067f1ea501f3af5aedd96 Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Thu, 10 Apr 2025 00:38:40 +0800 Subject: [PATCH] remove 0xef0001 || accounts[0].addr unit test --- core/vm/errors.go | 5 ----- internal/ethapi/api_test.go | 11 ----------- 2 files changed, 16 deletions(-) diff --git a/core/vm/errors.go b/core/vm/errors.go index b4ffd15e45..e33c9fcb85 100644 --- a/core/vm/errors.go +++ b/core/vm/errors.go @@ -81,11 +81,6 @@ type ErrInvalidOpCode struct { func (e *ErrInvalidOpCode) Error() string { return fmt.Sprintf("invalid opcode: %s", e.opcode) } -// NewErrInvalidOpCode is only used in tests to generate an exact ErrInvalidOpCode error. -func NewErrInvalidOpCode(opcode OpCode) *ErrInvalidOpCode { - return &ErrInvalidOpCode{opcode: opcode} -} - // rpcError is the same interface as the one defined in rpc/errors.go // but we do not want to depend on rpc package here so we redefine it. // diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index 702b2b150f..7a40643823 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -850,17 +850,6 @@ 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: vm.NewErrInvalidOpCode(0xef), - }, // SetCodeTx with empty authorization list should fail. { blockNumber: rpc.LatestBlockNumber,