Skip to content

Commit

Permalink
Palango/cleanups (#2261)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
palango authored Feb 21, 2024
1 parent 97a1b09 commit 0406a0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/transaction_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0406a0f

Please sign in to comment.