Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
update geth-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsing committed Mar 27, 2024
1 parent 44145b7 commit 00acb04
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions geth-utils/gethutil/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ type Transaction struct {
GasTipCap *hexutil.Big `json:"gas_tip_cap"`
CallData hexutil.Bytes `json:"call_data"`
AccessList []struct {
Address common.Address `json:"address"`
StorageKeys []common.Hash `json:"storage_keys"`
Address common.Address `json:"address"`
// Must be `storageKeys`, since `camelCase` is specified in ethers-rs.
// <https://github.com/gakonst/ethers-rs/blob/88095ba47eb6a3507f0db1767353b387b27a6e98/ethers-core/src/types/transaction/eip2930.rs#L75>
StorageKeys []common.Hash `json:"storageKeys"`
} `json:"access_list"`
}

Expand Down Expand Up @@ -160,10 +162,14 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) {
blockGasLimit := toBigInt(config.Block.GasLimit).Uint64()
messages := make([]core.Message, len(config.Transactions))
for i, tx := range config.Transactions {
// If gas price is specified directly, the tx is treated as legacy type.
if tx.GasPrice != nil {
tx.GasFeeCap = tx.GasPrice
tx.GasTipCap = tx.GasPrice
// Set GasFeeCap and GasTipCap to GasPrice if not exist.
if tx.GasFeeCap == nil {
tx.GasFeeCap = tx.GasPrice
}
if tx.GasTipCap == nil {
tx.GasTipCap = tx.GasPrice
}
}

txAccessList := make(types.AccessList, len(tx.AccessList))
Expand Down

0 comments on commit 00acb04

Please sign in to comment.