Skip to content

Commit

Permalink
chore: removed is_eip1559 boolean flag (#5534)
Browse files Browse the repository at this point in the history
* chore: removed is_eip1559 flag

* chore: set eip1559 fields to "None" if not EIP1559 type
  • Loading branch information
andyrobert3 authored Aug 3, 2023
1 parent e05b9c7 commit 65b513d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions anvil/src/eth/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1907,7 +1906,6 @@ impl EthApi {
tx.pending_transaction.transaction.clone(),
None,
None,
true,
None,
);

Expand Down Expand Up @@ -2256,7 +2254,6 @@ impl EthApi {
tx,
Some(&block),
Some(info),
true,
Some(base_fee),
);
block_transactions.push(tx);
Expand Down
7 changes: 2 additions & 5 deletions anvil/src/eth/backend/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1982,7 +1982,6 @@ impl Backend {
tx,
Some(&block),
Some(info),
true,
block.header.base_fee_per_gas,
))
}
Expand Down Expand Up @@ -2018,7 +2017,6 @@ impl Backend {
tx,
Some(&block),
Some(info),
true,
block.header.base_fee_per_gas,
))
}
Expand Down Expand Up @@ -2245,7 +2243,6 @@ pub fn transaction_build(
eth_transaction: MaybeImpersonatedTransaction,
block: Option<&Block>,
info: Option<TransactionInfo>,
is_eip1559: bool,
base_fee: Option<U256>,
) -> Transaction {
let mut transaction: Transaction = eth_transaction.clone().into();
Expand All @@ -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;
Expand Down

0 comments on commit 65b513d

Please sign in to comment.