Skip to content

Commit

Permalink
show canister_info after snapshot operations
Browse files Browse the repository at this point in the history
  • Loading branch information
lwshang committed Aug 7, 2024
1 parent 65d039b commit 8ad7549
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion e2e-tests/canisters/management_caller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ mod snapshot {
use ic_cdk::api::management_canister::main::*;

#[update]
async fn execute_snapshot_methods() {
async fn execute_snapshot_methods() -> CanisterInfoResponse {
let arg = CreateCanisterArgument::default();
let canister_id = create_canister(arg, 2_000_000_000_000u128)
.await
Expand Down Expand Up @@ -157,6 +157,12 @@ mod snapshot {
snapshot_id: snapshot1.id.clone(),
};
assert!(delete_canister_snapshot(arg).await.is_ok());

let arg = CanisterInfoRequest {
canister_id,
num_requested_changes: None,
};
canister_info(arg).await.unwrap().0
}
}

Expand Down
6 changes: 4 additions & 2 deletions e2e-tests/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,10 @@ fn test_snapshot() {
let canister_id = pic.create_canister();
pic.add_cycles(canister_id, 300_000_000_000_000_000_000_000_000u128);
pic.install_canister(canister_id, wasm, vec![], None);
let () = call_candid(&pic, canister_id, "execute_snapshot_methods", ())
.expect("Error calling execute_snapshot_methods");
let canister_info_response: (CanisterInfoResponse,) =
call_candid(&pic, canister_id, "execute_snapshot_methods", ())
.expect("Error calling execute_snapshot_methods");
println!("{canister_info_response:?}");
}

#[test]
Expand Down

0 comments on commit 8ad7549

Please sign in to comment.