Skip to content

Commit

Permalink
fix: handle unset tx type
Browse files Browse the repository at this point in the history
  • Loading branch information
petscheit committed Apr 26, 2024
1 parent 3dcc33c commit 1323c0e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tx_receipt_trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/tx_trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1323c0e

Please sign in to comment.