diff --git a/geth-utils/gethutil/trace.go b/geth-utils/gethutil/trace.go index 438bb9f97d..d48e46666c 100644 --- a/geth-utils/gethutil/trace.go +++ b/geth-utils/gethutil/trace.go @@ -99,21 +99,20 @@ type Account struct { } type Transaction struct { - From common.Address `json:"from"` - To *common.Address `json:"to"` - Nonce hexutil.Uint64 `json:"nonce"` - Value *hexutil.Big `json:"value"` - GasLimit hexutil.Uint64 `json:"gas_limit"` - GasPrice *hexutil.Big `json:"gas_price"` - GasFeeCap *hexutil.Big `json:"gas_fee_cap"` - GasTipCap *hexutil.Big `json:"gas_tip_cap"` - CallData hexutil.Bytes `json:"call_data"` - AccessList []struct { - Address common.Address `json:"address"` - // Must be `storageKeys`, since `camelCase` is specified in ethers-rs. - // - StorageKeys []common.Hash `json:"storageKeys"` - } `json:"access_list"` + From common.Address `json:"from"` + To *common.Address `json:"to"` + Nonce hexutil.Uint64 `json:"nonce"` + Value *hexutil.Big `json:"value"` + GasLimit hexutil.Uint64 `json:"gas_limit"` + GasPrice *hexutil.Big `json:"gas_price"` + GasFeeCap *hexutil.Big `json:"gas_fee_cap"` + GasTipCap *hexutil.Big `json:"gas_tip_cap"` + CallData hexutil.Bytes `json:"call_data"` + AccessList types.AccessList `json:"access_list"` + Type string `json:"tx_type"` + V int64 `json:"v"` + R *hexutil.Big `json:"r"` + S *hexutil.Big `json:"s"` } type TraceConfig struct { diff --git a/mock/src/transaction.rs b/mock/src/transaction.rs index 1184d418d4..e960181b82 100644 --- a/mock/src/transaction.rs +++ b/mock/src/transaction.rs @@ -133,8 +133,8 @@ pub struct MockTransaction { pub s: Option, pub transaction_type: U64, pub access_list: AccessList, - pub max_priority_fee_per_gas: Word, - pub max_fee_per_gas: Word, + pub max_priority_fee_per_gas: Option, + pub max_fee_per_gas: Option, pub chain_id: Word, pub invalid: bool, } @@ -158,8 +158,8 @@ impl Default for MockTransaction { s: None, transaction_type: U64::zero(), access_list: AccessList::default(), - max_priority_fee_per_gas: Word::zero(), - max_fee_per_gas: Word::zero(), + max_priority_fee_per_gas: None, + max_fee_per_gas: None, chain_id: *MOCK_CHAIN_ID, invalid: false, } @@ -185,8 +185,8 @@ impl From for Transaction { s: mock.s.unwrap_or_default(), transaction_type: Some(mock.transaction_type), access_list: Some(mock.access_list), - max_priority_fee_per_gas: Some(mock.max_priority_fee_per_gas), - max_fee_per_gas: Some(mock.max_fee_per_gas), + max_priority_fee_per_gas: mock.max_priority_fee_per_gas, + max_fee_per_gas: mock.max_fee_per_gas, chain_id: Some(mock.chain_id), other: OtherFields::default(), } @@ -289,13 +289,13 @@ impl MockTransaction { /// Set max_priority_fee_per_gas field for the MockTransaction. pub fn max_priority_fee_per_gas(&mut self, max_priority_fee_per_gas: Word) -> &mut Self { - self.max_priority_fee_per_gas = max_priority_fee_per_gas; + self.max_priority_fee_per_gas = Some(max_priority_fee_per_gas); self } /// Set max_fee_per_gas field for the MockTransaction. pub fn max_fee_per_gas(&mut self, max_fee_per_gas: Word) -> &mut Self { - self.max_fee_per_gas = max_fee_per_gas; + self.max_fee_per_gas = Some(max_fee_per_gas); self }