diff --git a/crates/pevm/tests/mainnet.rs b/crates/pevm/tests/mainnet.rs index 41b3dba8..6208232d 100644 --- a/crates/pevm/tests/mainnet.rs +++ b/crates/pevm/tests/mainnet.rs @@ -1,20 +1,19 @@ #![allow(unused_crate_dependencies)] -use alloy_provider::{Provider, ProviderBuilder}; -use alloy_rpc_types::{BlockId, BlockTransactionsKind}; -use reqwest::Url; - -use pevm::chain::{PevmChain, PevmEthereum}; +use pevm::chain::PevmEthereum; pub mod common; #[tokio::test(flavor = "multi_thread")] #[cfg(feature = "rpc-storage")] async fn mainnet_blocks_from_rpc() { + use alloy_provider::{Provider, ProviderBuilder}; + use pevm::chain::PevmChain; + let rpc_url = match std::env::var("ETHEREUM_RPC_URL") { // The empty check is for GitHub Actions where the variable is set with an empty string when unset!? Ok(value) if !value.is_empty() => value.parse().unwrap(), - _ => Url::parse("https://eth.public-rpc.com").unwrap(), + _ => reqwest::Url::parse("https://eth.public-rpc.com").unwrap(), }; // First block under 50 transactions of each EVM-spec-changing fork @@ -35,14 +34,20 @@ async fn mainnet_blocks_from_rpc() { ] { let provider = ProviderBuilder::new().on_http(rpc_url.clone()); let block = provider - .get_block(BlockId::number(block_number), BlockTransactionsKind::Full) + .get_block( + alloy_rpc_types::BlockId::number(block_number), + alloy_rpc_types::BlockTransactionsKind::Full, + ) .await .unwrap() .unwrap(); let chain = PevmEthereum::mainnet(); let spec_id = chain.get_block_spec(&block.header).unwrap(); - let rpc_storage = - pevm::RpcStorage::new(provider, spec_id, BlockId::number(block_number - 1)); + let rpc_storage = pevm::RpcStorage::new( + provider, + spec_id, + alloy_rpc_types::BlockId::number(block_number - 1), + ); common::test_execute_alloy(&rpc_storage, &chain, block, true); } }