From aa27d365acc305ea75ccd080b7a4f2fc06e5cb43 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Wed, 22 Jan 2025 17:58:19 +0800 Subject: [PATCH 1/2] Add an e2e test for canister_info. --- e2e/tests-dfx/wallet.bash | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e/tests-dfx/wallet.bash b/e2e/tests-dfx/wallet.bash index 89d53b77d3..44368ab8b8 100644 --- a/e2e/tests-dfx/wallet.bash +++ b/e2e/tests-dfx/wallet.bash @@ -154,6 +154,19 @@ teardown() { assert_command dfx canister call "${CHILD_ID}" wallet_balance '()' } +@test "forward canister_info call through wallet" { + dfx_new + install_asset identity + dfx_start + WALLET=$(dfx identity get-wallet) + assert_command dfx canister create --all --wallet default + assert_command dfx build + assert_command dfx canister install --all --wallet default + + assert_command dfx canister call aaaaa-aa canister_info --wallet default \ + "(record { canister_id= principal \"$(dfx canister id e2e_project_backend)\"; num_requested_changes= opt 20})" +} + @test "forward user call through wallet" { dfx_new install_asset identity From c2f778e0640fb5181974597675759dca64e12ee1 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Wed, 22 Jan 2025 19:52:31 +0800 Subject: [PATCH 2/2] Add more checks. --- e2e/tests-dfx/wallet.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/e2e/tests-dfx/wallet.bash b/e2e/tests-dfx/wallet.bash index 44368ab8b8..e1c869bf12 100644 --- a/e2e/tests-dfx/wallet.bash +++ b/e2e/tests-dfx/wallet.bash @@ -165,6 +165,9 @@ teardown() { assert_command dfx canister call aaaaa-aa canister_info --wallet default \ "(record { canister_id= principal \"$(dfx canister id e2e_project_backend)\"; num_requested_changes= opt 20})" + assert_contains "$WALLET" + assert_contains "$(dfx identity get-principal)" + assert_contains "3_862_312_591 = 2 : nat64;" } @test "forward user call through wallet" {