From 65b513de27ef23f4b4c4574e7f40f739a8fd9edb Mon Sep 17 00:00:00 2001 From: Matthew Alexander Date: Thu, 3 Aug 2023 22:41:41 +0800 Subject: [PATCH] chore: removed `is_eip1559` boolean flag (#5534) * chore: removed is_eip1559 flag * chore: set eip1559 fields to "None" if not EIP1559 type --- anvil/src/eth/api.rs | 3 --- anvil/src/eth/backend/mem/mod.rs | 7 ++----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/anvil/src/eth/api.rs b/anvil/src/eth/api.rs index be95b7c2f..4cab9194c 100644 --- a/anvil/src/eth/api.rs +++ b/anvil/src/eth/api.rs @@ -981,7 +981,6 @@ impl EthApi { pending.transaction, None, None, - true, Some(self.backend.base_fee()), ); // we set the from field here explicitly to the set sender of the pending transaction, @@ -1907,7 +1906,6 @@ impl EthApi { tx.pending_transaction.transaction.clone(), None, None, - true, None, ); @@ -2256,7 +2254,6 @@ impl EthApi { tx, Some(&block), Some(info), - true, Some(base_fee), ); block_transactions.push(tx); diff --git a/anvil/src/eth/backend/mem/mod.rs b/anvil/src/eth/backend/mem/mod.rs index d453a75ca..575a4da76 100644 --- a/anvil/src/eth/backend/mem/mod.rs +++ b/anvil/src/eth/backend/mem/mod.rs @@ -1364,7 +1364,7 @@ impl Backend { let info = storage.transactions.get(&hash)?.info.clone(); let tx = block.transactions.get(info.transaction_index as usize)?.clone(); - let tx = transaction_build(Some(hash), tx, Some(block), Some(info), true, base_fee); + let tx = transaction_build(Some(hash), tx, Some(block), Some(info), base_fee); transactions.push(tx); } Some(transactions) @@ -1982,7 +1982,6 @@ impl Backend { tx, Some(&block), Some(info), - true, block.header.base_fee_per_gas, )) } @@ -2018,7 +2017,6 @@ impl Backend { tx, Some(&block), Some(info), - true, block.header.base_fee_per_gas, )) } @@ -2245,7 +2243,6 @@ pub fn transaction_build( eth_transaction: MaybeImpersonatedTransaction, block: Option<&Block>, info: Option, - is_eip1559: bool, base_fee: Option, ) -> Transaction { let mut transaction: Transaction = eth_transaction.clone().into(); @@ -2264,7 +2261,7 @@ pub fn transaction_build( base_fee.checked_add(max_priority_fee_per_gas).unwrap_or_else(U256::max_value), ); } - } else if !is_eip1559 { + } else { transaction.max_fee_per_gas = None; transaction.max_priority_fee_per_gas = None; transaction.transaction_type = None;