dfinity / cycles-wallet

DFINITY Cycles Wallet
Apache License 2.0
55 stars 30 forks source link

feat: a wallet calling itself can access custodial methods #61

Closed p-shahi closed 3 years ago

p-shahi commented 3 years ago
➜  custom git:(master) ✗ dfx canister call rwlgt-iiaaa-aaaaa-aaaaa-cai wallet_call '(record { canister = principal "rwlgt-iiaaa-aaaaa-aaaaa-cai"; method_name = "get_controllers";  args = blob "DIDL\00\00"; cycles = (0:nat64)})'
The Replica returned an error: code 5, message: "Canister rwlgt-iiaaa-aaaaa-aaaaa-cai trapped explicitly: An error happened during the call: 5: IC0503: Canister rwlgt-iiaaa-aaaaa-aaaaa-cai trapped explicitly: Attempted to call forward on self. This is not allowed. Call this method via an different custodian."

➜  custom git:(master) ✗ dfx canister --no-wallet call rwlgt-iiaaa-aaaaa-aaaaa-cai wallet_call '(record { canister = principal "rwlgt-iiaaa-aaaaa-aaaaa-cai"; method_name = "get_controllers";  args = blob "DIDL\00\00"; cycles = (0:nat64)})'
(
  record {
    153_986_224 = blob "DIDL\01mh\01\00\01\01\1d\07\af'\0c;[\ff\cd\7f\0a\a5&]i\ed\c6\af\d3\d5\cf\8d\9e\cfx\ca\1f\a1\91\02";
  },
)

➜  custom git:(master) ✗ dfx canister call rwlgt-iiaaa-aaaaa-aaaaa-cai wallet_balance '()'
(record { 3_573_748_184 = 100_000_000_000_000 })