From 00acb04bc2b7e60ee806f2c8fb89b2355a4a66c3 Mon Sep 17 00:00:00 2001 From: lightsing Date: Wed, 27 Mar 2024 12:20:23 +0800 Subject: [PATCH] update geth-utils --- geth-utils/gethutil/trace.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/geth-utils/gethutil/trace.go b/geth-utils/gethutil/trace.go index f0cb76cffd..438bb9f97d 100644 --- a/geth-utils/gethutil/trace.go +++ b/geth-utils/gethutil/trace.go @@ -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. + // + StorageKeys []common.Hash `json:"storageKeys"` } `json:"access_list"` } @@ -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))