From b55702e81791fa50ce90d50b94d219ef8acfa2e2 Mon Sep 17 00:00:00 2001 From: zeroXbrock <2791467+zeroXbrock@users.noreply.github.com> Date: Mon, 8 Apr 2024 21:34:36 -0700 Subject: [PATCH] replace unsafe unwraps --- crates/anvil/src/eth/api.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/anvil/src/eth/api.rs b/crates/anvil/src/eth/api.rs index 97926bb64e43..fefcee3c642e 100644 --- a/crates/anvil/src/eth/api.rs +++ b/crates/anvil/src/eth/api.rs @@ -2218,8 +2218,6 @@ impl EthApi { .collect(), ), }; - // TODO: simplify this... - // see `self.validate_tx` let sig = tx .signature .map(|sig| { @@ -2229,8 +2227,7 @@ impl EthApi { alloy_primitives::Parity::Eip155(sig.v.to::()), ) }) - .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::() {