dfinity / sdk

IC SDK: a Software Development Kit for creating and managing canister smart contracts on the ICP blockchain.
https://internetcomputer.org/developers
Apache License 2.0
170 stars 82 forks source link

fix: Ledger create canister with `--next-to` transferring funds too early #3760

Closed fxgst closed 3 months ago

fxgst commented 3 months ago

Description

When creating a canister with dfx ledger create-canister --next-to on a canister that does not exist (e.g., aaaa-aa), then the funds are first transferred away from the users account, but the call then fails to create the new canister, and the funds are not returned to the user's account.

Fixes # (issue)

How Has This Been Tested?

Steps to reproduce: dfx ledger --ic create-canister --amount 0.01 --next-to aaaaa-aa $(dfx identity get-principal --ic)

Checklist:

adamspofford-dfinity commented 3 months ago

Can you add a test-case to ledger.bash?

mraszyk commented 3 months ago

and the funds are not returned to the user's account.

they should be if notify_create is called - is there a way to trigger that with dfx "manually"?

adamspofford-dfinity commented 3 months ago

@mraszyk Yes, with dfx ledger notify create-canister.