Skip to content

Commit 7e24f27

Browse files
committed
apollo_base_layer_tests: add logs for Anvil port number
1 parent f062408 commit 7e24f27

File tree

6 files changed

+9
-2
lines changed

6 files changed

+9
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/apollo_base_layer_tests/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ colored.workspace = true
1919
papyrus_base_layer = { workspace = true, features = ["testing"] }
2020
starknet_api.workspace = true
2121
tokio.workspace = true
22+
tracing.workspace = true
2223
url.workspace = true
2324

2425
[dev-dependencies]

crates/apollo_base_layer_tests/src/anvil_base_layer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use papyrus_base_layer::{
2828
use starknet_api::block::BlockHashAndNumber;
2929
use starknet_api::hash::StarkHash;
3030
use starknet_api::transaction::L1HandlerTransaction;
31+
use tracing::info;
3132
use url::Url;
3233

3334
/// Initialize an anvil instance under the default port and deploy the Starknet contract.
@@ -96,6 +97,7 @@ curl -L \
9697
_ => panic!("Failed to spawn Anvil: {}", error.to_string().red()),
9798
});
9899

100+
info!("Deploying Starknet contract to Anvil with port: {}", port);
99101
Starknet::deploy(anvil_client.clone()).await.unwrap();
100102

101103
let config = Self::config(Self::url_static(port));

crates/apollo_base_layer_tests/tests/anvil_starts_with_no_contract.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ use papyrus_base_layer::test_utils::{
1010
OTHER_ARBITRARY_ANVIL_L1_ACCOUNT_ADDRESS,
1111
};
1212
use papyrus_base_layer::BaseLayerContract;
13+
use tracing::info;
1314

1415
#[tokio::test]
1516
async fn anvil_starts_with_no_contract() {
1617
const NUM_L1_TRANSACTIONS: usize = 10;
1718
// TODO(GuyNir/Shahak): avoid this hard-coded port number, and align port usages throughout the
1819
// anvil instances.
20+
info!("Starting Anvil with port: 9999");
1921
let anvil = Anvil::new()
2022
.port(9999_u16)
2123
.try_spawn()

crates/apollo_integration_tests/src/flow_test_setup.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ impl FlowTestSetup {
123123
.try_into()
124124
.unwrap();
125125

126-
let anvil_base_layer = AnvilBaseLayer::new(None, None).await;
126+
let anvil_base_layer =
127+
AnvilBaseLayer::new(None, Some(available_ports.get_next_port())).await;
127128
let base_layer_url = anvil_base_layer.get_url().await.unwrap();
128129
let base_layer_config = anvil_base_layer.ethereum_base_layer.config.clone();
129130

crates/apollo_integration_tests/tests/l1_events_scraper_end_to_end.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use starknet_api::transaction::{L1HandlerTransaction, TransactionHasher, Transac
2222
#[tokio::test]
2323
async fn scraper_end_to_end() {
2424
// Setup.
25-
let mut base_layer = AnvilBaseLayer::new(None, None).await;
25+
let mut base_layer = AnvilBaseLayer::new(None, Some(8547)).await;
2626
let contract = &base_layer.ethereum_base_layer.contract;
2727
let mut l1_provider_client = MockL1ProviderClient::default();
2828

0 commit comments

Comments
 (0)