Skip to content

Commit

Permalink
replace unsafe unwraps
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroXbrock committed Apr 9, 2024
1 parent fd5e745 commit b55702e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/anvil/src/eth/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2218,8 +2218,6 @@ impl EthApi {
.collect(),
),
};
// TODO: simplify this...
// see `self.validate_tx`
let sig = tx
.signature
.map(|sig| {
Expand All @@ -2229,8 +2227,7 @@ impl EthApi {
alloy_primitives::Parity::Eip155(sig.v.to::<u64>()),
)
})
.unwrap()
.unwrap();
.ok_or(BlockchainError::FailedToDecodeSignedTransaction)??;
Ok(match tx.transaction_type {
None => TypedTransaction::Legacy(Signed::new_unchecked(to_legacy(tx), sig, tx.hash)),
Some(n) => match n.to::<u64>() {
Expand Down

0 comments on commit b55702e

Please sign in to comment.