From e8e926ee06a2e74a1ca33d4d133b4942e8d447b1 Mon Sep 17 00:00:00 2001 From: evalir Date: Mon, 11 Dec 2023 10:34:02 -0400 Subject: [PATCH] feat: enable anvil ipc tests (#6570) --- crates/anvil/tests/it/ipc.rs | 10 ++++++---- crates/anvil/tests/it/main.rs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/anvil/tests/it/ipc.rs b/crates/anvil/tests/it/ipc.rs index b25bbba5249f..7324389646ed 100644 --- a/crates/anvil/tests/it/ipc.rs +++ b/crates/anvil/tests/it/ipc.rs @@ -1,7 +1,9 @@ //! IPC tests +use alloy_providers::provider::TempProvider; use anvil::{spawn, NodeConfig}; -use ethers::{core::rand, prelude::Middleware, types::U256}; +use alloy_primitives::U256; +use ethers::{core::rand, prelude::Middleware}; use futures::StreamExt; pub fn rand_ipc_endpoint() -> String { @@ -22,19 +24,19 @@ async fn can_get_block_number_ipc() { let (api, handle) = spawn(ipc_config()).await; let block_num = api.block_number().unwrap(); - assert_eq!(block_num, U256::zero()); + assert_eq!(block_num, U256::ZERO); let provider = handle.ipc_provider().unwrap(); let num = provider.get_block_number().await.unwrap(); - assert_eq!(num, block_num.as_u64().into()); + assert_eq!(num, block_num.to::()); } #[tokio::test(flavor = "multi_thread")] async fn test_sub_new_heads_ipc() { let (api, handle) = spawn(ipc_config()).await; - let provider = handle.ipc_provider().unwrap(); + let provider = handle.ethers_ipc_provider().unwrap(); let blocks = provider.subscribe_blocks().await.unwrap(); diff --git a/crates/anvil/tests/it/main.rs b/crates/anvil/tests/it/main.rs index 153d664245c1..668fc5b79c9d 100644 --- a/crates/anvil/tests/it/main.rs +++ b/crates/anvil/tests/it/main.rs @@ -7,7 +7,7 @@ mod ganache; mod gas; mod genesis; mod geth; -// mod ipc; +mod ipc; mod logs; mod optimism; mod proof;