From 9b5aaa6d92b6676f713beca50ea06ca8eeb4128b Mon Sep 17 00:00:00 2001 From: Omar Abdulla Date: Tue, 14 Oct 2025 21:24:02 +0300 Subject: [PATCH] Remove unneeded test --- .../src/node_implementations/substrate.rs | 4 ++ .../src/node_implementations/zombienet.rs | 52 ------------------- 2 files changed, 4 insertions(+), 52 deletions(-) diff --git a/crates/node/src/node_implementations/substrate.rs b/crates/node/src/node_implementations/substrate.rs index 88c3905..8617823 100644 --- a/crates/node/src/node_implementations/substrate.rs +++ b/crates/node/src/node_implementations/substrate.rs @@ -318,6 +318,7 @@ impl SubstrateNode { export_chainspec_command: &str, wallet: &EthereumWallet, ) -> anyhow::Result { + trace!("Exporting the chainspec"); let output = Command::new(node_path) .arg(export_chainspec_command) .arg("--chain") @@ -326,6 +327,7 @@ impl SubstrateNode { .output() .context("Failed to export the chain-spec")?; + trace!("Waiting for chainspec export"); if !output.status.success() { anyhow::bail!( "Substrate-node export-chain-spec failed: {}", @@ -333,6 +335,7 @@ impl SubstrateNode { ); } + trace!("Obtained chainspec"); let content = String::from_utf8(output.stdout) .context("Failed to decode Substrate export-chain-spec output as UTF-8")?; let mut chainspec_json = serde_json::from_str::(&content) @@ -343,6 +346,7 @@ impl SubstrateNode { .as_array_mut() .expect("Can't fail"); + trace!("Adding addresses to chainspec"); for address in NetworkWallet::::signer_addresses(wallet) { let substrate_address = Self::eth_to_substrate_address(&address); let balance = INITIAL_BALANCE; diff --git a/crates/node/src/node_implementations/zombienet.rs b/crates/node/src/node_implementations/zombienet.rs index 7a2225e..0803e63 100644 --- a/crates/node/src/node_implementations/zombienet.rs +++ b/crates/node/src/node_implementations/zombienet.rs @@ -865,58 +865,6 @@ mod tests { .expect("Failed to get the receipt for the transfer"); } - #[tokio::test] - async fn test_init_generates_chainspec_with_balances() { - let genesis_content = r#" - { - "alloc": { - "90F8bf6A479f320ead074411a4B0e7944Ea8c9C1": { - "balance": "1000000000000000000" - }, - "Ab8483F64d9C6d1EcF9b849Ae677dD3315835cb2": { - "balance": "2000000000000000000" - } - } - } - "#; - - let context = test_config(); - let mut node = ZombienetNode::new( - context.polkadot_parachain_configuration.path.clone(), - &context, - ); - - // Call `init()` - node.init(serde_json::from_str(genesis_content).unwrap()) - .expect("init failed"); - - // Check that the patched chainspec file was generated - let final_chainspec_path = node - .base_directory - .join(ZombienetNode::CHAIN_SPEC_JSON_FILE); - assert!(final_chainspec_path.exists(), "Chainspec file should exist"); - - let contents = - std::fs::read_to_string(&final_chainspec_path).expect("Failed to read chainspec"); - - // Validate that the Polkadot addresses derived from the Ethereum addresses are in the file - let first_eth_addr = ZombienetNode::eth_to_polkadot_address( - &"90F8bf6A479f320ead074411a4B0e7944Ea8c9C1".parse().unwrap(), - ); - let second_eth_addr = ZombienetNode::eth_to_polkadot_address( - &"Ab8483F64d9C6d1EcF9b849Ae677dD3315835cb2".parse().unwrap(), - ); - - assert!( - contents.contains(&first_eth_addr), - "Chainspec should contain Polkadot address for first Ethereum account" - ); - assert!( - contents.contains(&second_eth_addr), - "Chainspec should contain Polkadot address for second Ethereum account" - ); - } - #[test] fn print_eth_to_polkadot_mappings() { let eth_addresses = vec![