Skip to content

Commit

Permalink
Port long faucet chain test fixes to devnet (#2724)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
jvff authored Oct 27, 2024
1 parent 060eac9 commit 5ff80bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions linera-service/src/cli_wrappers/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,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<ChainId>,
Expand Down
5 changes: 3 additions & 2 deletions linera-service/tests/linera_net_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
.open_chain(faucet_chain, None, Amount::ZERO)
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;
Expand Down

0 comments on commit 5ff80bf

Please sign in to comment.