Skip to content

Commit

Permalink
Add test for failing to create canister without enough cycles.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-dfinity committed Nov 27, 2024
1 parent 490b4f4 commit b166f7f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions e2e/tests-dfx/cycles-ledger.bash
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,17 @@ current_time_nanoseconds() {

assert_command dfx deploy

# Test canister creation failure before topping up cycles.
cd ..
dfx_new canister_creation_failed

export DFX_DISABLE_AUTO_WALLET=1
assert_command_fail dfx canister create canister_creation_failed_backend --with-cycles 1T --identity alice
assert_contains "Insufficient cycles balance to create the canister."

## Back to top up cycles.
cd ../temporary

assert_command dfx canister call depositor deposit "(record {to = record{owner = principal \"$ALICE\";};cycles = 13_400_000_000_000;})" --identity cycle-giver
assert_command dfx canister call depositor deposit "(record {to = record{owner = principal \"$ALICE\"; subaccount = opt blob \"$ALICE_SUBACCT1_CANDID\"};cycles = 2_600_000_000_000;})" --identity cycle-giver

Expand Down

0 comments on commit b166f7f

Please sign in to comment.