Skip to content

Commit

Permalink
fix some panics
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita committed Oct 3, 2024
1 parent bc15b4f commit f85a2fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions crates/statetest-types/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ impl TransactionParts {
let mut tx_type = TransactionType::Legacy;

// if it has access list it is EIP-2930 tx
if self.access_lists.get(access_list_index).is_some() {
tx_type = TransactionType::Eip2930;
if let Some(access_list) = self.access_lists.get(access_list_index) {
if access_list.is_some() {
tx_type = TransactionType::Eip2930;
}
}

// If there is max_fee it is EIP-1559 tx
Expand Down
2 changes: 1 addition & 1 deletion crates/wiring/src/default/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl LegacyTx for TxEnv {
}

fn gas_price(&self) -> u128 {
self.gas_price.to()
self.gas_price.try_into().unwrap_or(u128::MAX)
}
}

Expand Down

0 comments on commit f85a2fc

Please sign in to comment.