Skip to content

Commit

Permalink
fix: testing anvil with another port
Browse files Browse the repository at this point in the history
  • Loading branch information
mohiiit committed Sep 17, 2024
1 parent 7090462 commit eedccf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions crates/client/eth/src/l1_gas_price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ mod eth_client_gas_price_worker_test {

const L1_BLOCK_NUMBER: u64 = 20395662;
const FORK_URL: &str = "https://ethereum-rpc.publicnode.com";
const ANOTHER_ANVIL_PORT: u16 = 8546;

#[serial]
#[tokio::test]
async fn gas_price_worker_when_infinite_loop_true_works() {
let anvil = Anvil::new()
.fork(FORK_URL)
.fork_block_number(L1_BLOCK_NUMBER)
.port(ANOTHER_ANVIL_PORT)
.try_spawn()
.expect("issue while forking for the anvil");
let eth_client = create_ethereum_client(Some(anvil.endpoint().as_str()));
Expand Down Expand Up @@ -149,6 +151,7 @@ mod eth_client_gas_price_worker_test {
let anvil = Anvil::new()
.fork(FORK_URL)
.fork_block_number(L1_BLOCK_NUMBER)
.port(ANOTHER_ANVIL_PORT)
.try_spawn()
.expect("issue while forking for the anvil");
let eth_client = create_ethereum_client(Some(anvil.endpoint().as_str()));
Expand Down Expand Up @@ -233,6 +236,7 @@ mod eth_client_gas_price_worker_test {
let anvil = Anvil::new()
.fork(FORK_URL)
.fork_block_number(L1_BLOCK_NUMBER)
.port(ANOTHER_ANVIL_PORT)
.try_spawn()
.expect("issue while forking for the anvil");
let eth_client = create_ethereum_client(Some(anvil.endpoint().as_str()));
Expand Down
1 change: 0 additions & 1 deletion crates/tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
mod rpc;

use anyhow::bail;
use rstest::rstest;
use starknet_providers::Provider;
use starknet_providers::{jsonrpc::HttpTransport, JsonRpcClient, Url};
use std::ops::Range;
Expand Down

0 comments on commit eedccf6

Please sign in to comment.