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

Commit 00acb04

Browse files
committed
update geth-utils
1 parent 44145b7 commit 00acb04

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

geth-utils/gethutil/trace.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ type Transaction struct {
109109
GasTipCap *hexutil.Big `json:"gas_tip_cap"`
110110
CallData hexutil.Bytes `json:"call_data"`
111111
AccessList []struct {
112-
Address common.Address `json:"address"`
113-
StorageKeys []common.Hash `json:"storage_keys"`
112+
Address common.Address `json:"address"`
113+
// Must be `storageKeys`, since `camelCase` is specified in ethers-rs.
114+
// <https://github.com/gakonst/ethers-rs/blob/88095ba47eb6a3507f0db1767353b387b27a6e98/ethers-core/src/types/transaction/eip2930.rs#L75>
115+
StorageKeys []common.Hash `json:"storageKeys"`
114116
} `json:"access_list"`
115117
}
116118

@@ -160,10 +162,14 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) {
160162
blockGasLimit := toBigInt(config.Block.GasLimit).Uint64()
161163
messages := make([]core.Message, len(config.Transactions))
162164
for i, tx := range config.Transactions {
163-
// If gas price is specified directly, the tx is treated as legacy type.
164165
if tx.GasPrice != nil {
165-
tx.GasFeeCap = tx.GasPrice
166-
tx.GasTipCap = tx.GasPrice
166+
// Set GasFeeCap and GasTipCap to GasPrice if not exist.
167+
if tx.GasFeeCap == nil {
168+
tx.GasFeeCap = tx.GasPrice
169+
}
170+
if tx.GasTipCap == nil {
171+
tx.GasTipCap = tx.GasPrice
172+
}
167173
}
168174

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

0 commit comments

Comments
 (0)