Skip to content

Commit 5ff80bf

Browse files
authored
Port long faucet chain test fixes to devnet (#2724)
* Add some tokens to the new chains (#2718) * Fix faucet timeout in long faucet chain test (#2721) * Add `forget_chain` method to wallet CLI wrapper Allow removing chains from the wallet in tests. * Forget irrelevant newly created chains in test The chains only serve to increase the Faucet chain's length in a way that simulates the Faucet from being executed for a long time, so they can be forgotten after they have been created.
1 parent 060eac9 commit 5ff80bf

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

linera-service/src/cli_wrappers/wallet.rs

+10
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,16 @@ impl ClientWrapper {
702702
Ok(())
703703
}
704704

705+
/// Runs `linera wallet forget-chain CHAIN_ID`.
706+
pub async fn forget_chain(&self, chain_id: ChainId) -> Result<()> {
707+
let mut command = self.command().await?;
708+
command
709+
.args(["wallet", "forget-chain"])
710+
.arg(chain_id.to_string());
711+
command.spawn_and_wait_for_stdout().await?;
712+
Ok(())
713+
}
714+
705715
pub async fn retry_pending_block(
706716
&self,
707717
chain_id: Option<ChainId>,

linera-service/tests/linera_net_tests.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2867,9 +2867,10 @@ async fn test_end_to_end_faucet_with_long_chains(config: impl LineraNetConfig) -
28672867

28682868
// Use the faucet directly to initialize many chains
28692869
for _ in 0..chain_count {
2870-
faucet_client
2871-
.open_chain(faucet_chain, None, Amount::ZERO)
2870+
let (_, new_chain_id) = faucet_client
2871+
.open_chain(faucet_chain, None, Amount::ONE)
28722872
.await?;
2873+
faucet_client.forget_chain(new_chain_id).await?;
28732874
}
28742875

28752876
let amount = Amount::ONE;

0 commit comments

Comments
 (0)