Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sesi200 committed Dec 7, 2023
1 parent d377f6e commit 2cfe147
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
5 changes: 0 additions & 5 deletions e2e/tests-dfx/create.bash
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,3 @@ teardown() {
assert_command dfx wallet upgrade --identity alice
assert_command dfx canister create --all --controller alice --controller bob --identity alice
}

@test "canister-create on mainnet without wallet does not propagate the 404" {
assert_command_fail dfx deploy --network ic --no-wallet
assert_match 'dfx ledger create-canister'
}
10 changes: 5 additions & 5 deletions e2e/tests-dfx/cycles-ledger.bash
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ current_time_nanoseconds() {


assert_command dfx canister call cycles-depositor deposit "(record {to = record{owner = principal \"$ALICE\";};cycles = 1_700_400_200_150;})" --identity cycle-giver
assert_eq "(record { balance = 1_700_400_200_150 : nat; txid = 0 : nat })"
assert_eq "(record { balance = 1_700_400_200_150 : nat; block_index = 0 : nat })"

assert_command dfx canister call cycles-depositor deposit "(record {to = record{owner = principal \"$ALICE\"; subaccount = opt blob \"$ALICE_SUBACCT1_CANDID\"};cycles = 3_750_000_000_000;})" --identity cycle-giver
assert_eq "(record { balance = 3_750_000_000_000 : nat; txid = 1 : nat })"
assert_eq "(record { balance = 3_750_000_000_000 : nat; block_index = 1 : nat })"

assert_command dfx canister call cycles-depositor deposit "(record {to = record{owner = principal \"$ALICE\"; subaccount = opt blob \"$ALICE_SUBACCT2_CANDID\"};cycles = 760_500_000_000;})" --identity cycle-giver
assert_eq "(record { balance = 760_500_000_000 : nat; txid = 2 : nat })"
assert_eq "(record { balance = 760_500_000_000 : nat; block_index = 2 : nat })"

assert_command dfx canister call cycles-depositor deposit "(record {to = record{owner = principal \"$BOB\";};cycles = 2_900_000_000_000;})" --identity cycle-giver
assert_eq "(record { balance = 2_900_000_000_000 : nat; txid = 3 : nat })"
assert_eq "(record { balance = 2_900_000_000_000 : nat; block_index = 3 : nat })"


assert_command dfx cycles balance --cycles-ledger-canister-id "$(dfx canister id cycles-ledger)" --precise --identity alice
Expand Down Expand Up @@ -390,7 +390,7 @@ current_time_nanoseconds() {


assert_command dfx canister call cycles-depositor deposit "(record {to = record{owner = principal \"$ALICE\";};cycles = 500_000_000;})" --identity cycle-giver
assert_eq "(record { balance = 500_000_000 : nat; txid = 0 : nat })"
assert_eq "(record { balance = 500_000_000 : nat; block_index = 0 : nat })"

assert_command dfx canister status cycles-depositor
assert_contains "Balance: 9_999_500_000_000 Cycles"
Expand Down
12 changes: 0 additions & 12 deletions e2e/tests-dfx/error_diagnosis.bash
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,3 @@ teardown() {
assert_match "not part of the controllers" # this is part of the error explanation
assert_match "'dfx canister update-settings --add-controller <controller principal to add> <canister id/name or --all> \(--network ic\)'" # this is part of the solution
}

@test "Instruct user to set a wallet" {
dfx_new hello
install_asset greet
assert_command dfx identity new alice --storage-mode plaintext
assert_command dfx identity use alice

# this will fail because no wallet is configured for alice on network ic
assert_command_fail dfx deploy --network ic
assert_match "requires a configured wallet" # this is part of the error explanation
assert_match "'dfx identity set-wallet <wallet id> --network <network name>'" # this is part of the solution
}

0 comments on commit 2cfe147

Please sign in to comment.