When creating and deploying a canister; the deployer is the wallet’s canister of the default identity.
But when I do
dfx --identity id_alice canister call icpTopuper setCanisters "(vec { principal \"$(dfx canister id exampleCanister1)\"; principal \"$(dfx canister id exampleCanister2)\"; principal \"$(dfx canister id exampleCanister3)\"; principal \"$(dfx canister id exampleCanisterBad)\"; })"
It says unauthorized as the call is received default Principal (and not the default's wallet Principal)
I tried to do a delegate call but it seems I need to pass the serialized vec… Any idea on how to achieve this?
cf. wallet_call
// Call Forwarding
wallet_call: (record {
canister: principal; // $(dfx canister id icpTopuper)
method_name: text; // `setCanisters`
args: blob; // `"(vec { principal \"$(dfx canister id exampleCanister1)\"; principal \"$(dfx canister id exampleCanister2)\"; principal \"$(dfx canister id exampleCanister3)\"; principal \"$(dfx canister id exampleCanisterBad)\"; })"`
cycles: nat64; // 0
}) -> (record { return: blob });
This is the only way to call a canister as the identity’s wallet canister Principal? Seems… complicated . It seems like a rather essential thing to do easily, now that the deployer of a canister is the wallet canister of the default identity.
From the 0.6.26 release notes:
Only the default wallet canister principal can perform canister management tasks
The introduction of the cycles wallet canister changes the default principal used to perform key canister management tasks, such as registering a new canister identifier and deploying a new canister on the Internet Computer. This change introduces some inconsistencies in the identity used to perform certain tasks and can result in potential access control issues.
You should note that none of the tutorials have been updated to reflect this specific change in behavior yet and the current version of the Add access control with identities tutorial is known to be invalid for this release. If you want to experiment with access control using the Add access control with identities tutorial, you should install the DFINITY Canister SDK version 0.6.23 (or older).
It would be nice if the release notes gave a hint at what to do, rather than just advise you to downgrade to 0.6.23.
This is the only way to call a canister as the identity’s wallet canister Principal?
This is the only way as of the 0.6.26 hotfix release. The next release (for internal release on Tuesday) will have better support for call proxy though wallet.