From 1323c0e53481a4ccace3bd575a65486a0324c03a Mon Sep 17 00:00:00 2001 From: petscheit Date: Fri, 26 Apr 2024 12:41:45 +0200 Subject: [PATCH] fix: handle unset tx type --- src/tx.rs | 1 + src/tx_receipt_trie.rs | 2 +- src/tx_trie.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tx.rs b/src/tx.rs index 496a738..6390659 100644 --- a/src/tx.rs +++ b/src/tx.rs @@ -299,6 +299,7 @@ impl RpcTx { Some(tx_type) if tx_type == &U64::from(1) => Ok(TxType::Eip2930), Some(tx_type) if tx_type == &U64::from(2) => Ok(TxType::Eip1559), Some(tx_type) if tx_type == &U64::from(3) => Ok(TxType::Eip4844), + None => Ok(TxType::Legacy), _ => Err(Error::InvalidTxVersion), } } diff --git a/src/tx_receipt_trie.rs b/src/tx_receipt_trie.rs index f55a6a5..d3b7f98 100644 --- a/src/tx_receipt_trie.rs +++ b/src/tx_receipt_trie.rs @@ -161,7 +161,7 @@ mod tests { use alloy_primitives::hex; use alloy_primitives::B256; - const MAINNET_RPC_URL: &str = "https://mainnet.infura.io/v3/da91aac0e91048b3bf3be813262d43a6"; + const MAINNET_RPC_URL: &str = "https://mainnet.infura.io/v3/720000a7936b45c79d0868f70478e2e9"; // Test cases // Byzantium: 4370000 diff --git a/src/tx_trie.rs b/src/tx_trie.rs index a73e29c..51f680c 100644 --- a/src/tx_trie.rs +++ b/src/tx_trie.rs @@ -155,7 +155,7 @@ mod tests { use alloy_primitives::hex; use alloy_primitives::B256; - const MAINNET_RPC_URL: &str = "https://mainnet.infura.io/v3/da91aac0e91048b3bf3be813262d43a6"; + const MAINNET_RPC_URL: &str = "https://mainnet.infura.io/v3/720000a7936b45c79d0868f70478e2e9"; // Test cases // Frontier: 46147