sdk icon indicating copy to clipboard operation
sdk copied to clipboard

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

Open fxgst opened this issue 1 year ago • 3 comments

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:

  • [x] The title of this PR complies with Conventional Commits.
  • [x] I have edited the CHANGELOG accordingly.
  • [x] I have made corresponding changes to the documentation.

fxgst avatar May 15 '24 18:05 fxgst

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

adamspofford-dfinity avatar May 15 '24 18:05 adamspofford-dfinity

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"?

mraszyk avatar May 15 '24 19:05 mraszyk

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

adamspofford-dfinity avatar May 15 '24 19:05 adamspofford-dfinity