With dfx 0.11.2
when calling a a canister that takes a Nat
as an argument, we now have to specify the type of the number passed. E.g. this doesn’t work with the REPL
❯ dfx canister --network ic call xgktx-viaaa-aaaab-qadda-cai set '(7)'
dfx.json not found, using default.
Error: Failed update call.
Caused by: Failed update call.
The Replica returned an error: code 5, message: "Canister xgktx-viaaa-aaaab-qadda-cai trapped explicitly: IDL error: unexpected IDL type when parsing Nat"
but this does
❯ dfx canister --network ic call xgktx-viaaa-aaaab-qadda-cai set '(7 : nat)'
dfx.json not found, using default.
()
IIRC this never had to be specified previously if the method expected a plain Nat
. The README of the Counter example also specifies to just call dfx canister call counter set '(7)'
.