From 0406a0fdca734d12f046e51f29d97f07108fa153 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Wed, 21 Feb 2024 10:34:59 +0100 Subject: [PATCH] Palango/cleanups (#2261) * Rename `distributeFees` to `creditFees` This caused some confusion in the past, so let's make the naming closer to the names in the smart contracts. * Fix typo --- core/state_transition.go | 8 ++++---- internal/ethapi/transaction_args.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 5c37c0daa8..a10a58102b 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -514,7 +514,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { st.refundGas(params.RefundQuotientEIP3529) } - err = st.distributeTxFees() + err = st.creditTxFees() if err != nil { return nil, err } @@ -525,8 +525,8 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { }, nil } -// distributeTxFees calculates the amounts and recipients of transaction fees and credits the accounts. -func (st *StateTransition) distributeTxFees() error { +// creditTxFees calculates the amounts and recipients of transaction fees and credits the accounts. +func (st *StateTransition) creditTxFees() error { // Run only primary evm.Call() with tracer if st.evm.GetDebug() { st.evm.SetDebug(false) @@ -569,7 +569,7 @@ func (st *StateTransition) distributeTxFees() error { baseTxFee = new(big.Int) } - log.Trace("distributeTxFees", "from", from, "refund", refund, "feeCurrency", st.msg.FeeCurrency(), + log.Trace("creditTxFees", "from", from, "refund", refund, "feeCurrency", st.msg.FeeCurrency(), "gatewayFeeRecipient", *gatewayFeeRecipient, "gatewayFee", st.msg.GatewayFee(), "coinbaseFeeRecipient", st.evm.Context.Coinbase, "coinbaseFee", tipTxFee, "feeHandler", feeHandlerAddress, "communityFundFee", baseTxFee) diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 5bf8f01003..a01e4c1978 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -235,7 +235,7 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int) (t gasPrice = args.GasPrice.ToInt() gasFeeCap, gasTipCap = gasPrice, gasPrice } else { - // User specified 1559 gas feilds (or none), use those + // User specified 1559 gas fields (or none), use those gasFeeCap = new(big.Int) if args.MaxFeePerGas != nil { gasFeeCap = args.MaxFeePerGas.ToInt()