diff --git a/core/eip2780_test.go b/core/eip2780_test.go index 976876300d..26b6b174be 100644 --- a/core/eip2780_test.go +++ b/core/eip2780_test.go @@ -199,8 +199,8 @@ func TestEIP2780InsufficientGasForCallCharge(t *testing.T) { fresh := common.HexToAddress("0xbeef000000000000000000000000000000000003") sdb := mkState(senderAlloc(nil)) _, _, err := applyMsg(t, sdb, callTx(0, fresh, 1, 21_000, nil)) - if !errors.Is(err, ErrEIP2780CallCharge) { - t.Fatalf("expected ErrEIP2780CallCharge, got %v", err) + if !errors.Is(err, ErrEIP2780CallRecipientCharge) { + t.Fatalf("expected ErrEIP2780CallRecipientCharge, got %v", err) } if sdb.Exist(fresh) { t.Fatal("recipient should not be created when the call charge cannot be paid") diff --git a/core/error.go b/core/error.go index 70785fe77e..4b5bf5471b 100644 --- a/core/error.go +++ b/core/error.go @@ -81,9 +81,9 @@ var ( // than required for the data floor cost. ErrFloorDataGas = errors.New("insufficient gas for floor data gas cost") - // ErrEIP2780CallCharge is returned if the transaction doesn't have sufficient - // gas to cover the cost of EIP-2780 call charge. - ErrEIP2780CallCharge = errors.New("insufficient gas for EIP-2780 call charge") + // ErrEIP2780CallRecipientCharge is returned if the transaction doesn't have + // sufficient gas to cover the cost of EIP-2780 call charge. + ErrEIP2780CallRecipientCharge = errors.New("insufficient gas for EIP-2780 call recipient charge") // ErrTxTypeNotSupported is returned if a transaction is not supported in the // current network configuration. diff --git a/core/state_transition.go b/core/state_transition.go index fe8203d5ff..6386b74af2 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -748,7 +748,7 @@ func (st *stateTransition) execute() (*ExecutionResult, error) { } // EIP-2780: charge the transaction's top-level recipient costs. if rules.IsAmsterdam && !st.chargeCallRecipientEIP2780(value) { - return nil, fmt.Errorf("%w: address %v", ErrEIP2780CallCharge, msg.To.Hex()) + return nil, fmt.Errorf("%w: address %v", ErrEIP2780CallRecipientCharge, msg.To.Hex()) } // Execute the transaction's call. ret, result, vmerr = st.evm.Call(msg.From, st.to(), msg.Data, st.gasRemaining.ForwardAll(), value)