diff --git a/linera-service/src/cli_wrappers/wallet.rs b/linera-service/src/cli_wrappers/wallet.rs index f877eff45c0..1beddf84792 100644 --- a/linera-service/src/cli_wrappers/wallet.rs +++ b/linera-service/src/cli_wrappers/wallet.rs @@ -709,6 +709,16 @@ impl ClientWrapper { Ok(()) } + /// Runs `linera wallet forget-chain CHAIN_ID`. + pub async fn forget_chain(&self, chain_id: ChainId) -> Result<()> { + let mut command = self.command().await?; + command + .args(["wallet", "forget-chain"]) + .arg(chain_id.to_string()); + command.spawn_and_wait_for_stdout().await?; + Ok(()) + } + pub async fn retry_pending_block( &self, chain_id: Option, diff --git a/linera-service/tests/linera_net_tests.rs b/linera-service/tests/linera_net_tests.rs index 44660aa90ca..69ace1ae1e7 100644 --- a/linera-service/tests/linera_net_tests.rs +++ b/linera-service/tests/linera_net_tests.rs @@ -2867,9 +2867,10 @@ async fn test_end_to_end_faucet_with_long_chains(config: impl LineraNetConfig) - // Use the faucet directly to initialize many chains for _ in 0..chain_count { - faucet_client + let (_, new_chain_id) = faucet_client .open_chain(faucet_chain, None, Amount::ONE) .await?; + faucet_client.forget_chain(new_chain_id).await?; } let amount = Amount::ONE;