Skip to content

Commit

Permalink
make helper more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Weigelt committed Jan 21, 2025
1 parent d4c2a81 commit d5f5f39
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions rs/tests/execution/general_execution_tests/nns_shielding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,20 @@ fn setup_ucan_and_try_mint128(node: IcNodeSnapshot) -> (AgentError, u128, u128,
let agent = node.build_default_agent();
let effective_canister_id = node.get_last_canister_id_in_allocation_ranges();
block_on(async move {
let canister_id =
let mut canister_id =
UniversalCanister::new_with_cycles(&agent, effective_canister_id, *INITIAL_CYCLES)
.await
.unwrap()
.canister_id();
// Check that 'canister_id' is not 'CYCLES_MINTING_CANISTER_ID'.
assert_ne!(canister_id, CYCLES_MINTING_CANISTER_ID.into());
// Make sure that 'canister_id' is not 'CYCLES_MINTING_CANISTER_ID'.
if canister_id == CYCLES_MINTING_CANISTER_ID.into() {
let effective_canister_id = node.get_last_canister_id_in_allocation_ranges();
canister_id =
UniversalCanister::new_with_cycles(&agent, effective_canister_id, *INITIAL_CYCLES)
.await
.unwrap()
.canister_id();
}
let before_balance = get_balance(&canister_id, &agent).await;
let res = agent
.update(&canister_id, "update")
Expand Down

0 comments on commit d5f5f39

Please sign in to comment.