Skip to content

Commit

Permalink
Fixed review comments by updating the wordings.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-dfinity committed Nov 5, 2024
1 parent 86dbb01 commit a2fe0a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Allow setting permissions lists in init arguments just like in upgrade arguments
- Module hash: f45db224b40fac516c877e3108dc809d4b22fa42d05ee8dfa5002536a3a3daed
- Bump agent-js to fix error code

### chore!: improve `dfx cycles balance` messages.
### chore!: improve the messages for the subcommands of `dfx cycles`.

If users run `dfx cycles balance` without running the `--ic` flag, show below messages to indicate what to do next.
If users run subcommands of `dfx cycles` without the `--ic` flag, show below messages to indicate what to do next.
```
Error explanation:
Cycles ledger with canister ID 'um5iw-rqaaa-aaaaq-qaaba-cai' cannot be found.
Cycles ledger with canister ID 'um5iw-rqaaa-aaaaq-qaaba-cai' is not installed.
How to resolve the error:
Run the command with '--ic' flag if you want to access the cycles ledger on the mainnet.
Run the command with '--ic' flag if you want to manage the cycles on the mainnet.
```

# 0.24.2
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests-dfx/cycles-ledger.bash
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ current_time_nanoseconds() {
assert_eq "2.900 TC (trillion cycles)."
}

@test "balance without cycles ledger failed as expected" {
@test "balance without cycles ledger fails as expected" {
dfx_start

assert_command_fail dfx cycles balance
assert_contains "Cycles ledger with canister ID 'um5iw-rqaaa-aaaaq-qaaba-cai' cannot be found."
assert_contains "Cycles ledger with canister ID 'um5iw-rqaaa-aaaaq-qaaba-cai' is not installed."
}

@test "transfer" {
Expand Down
4 changes: 2 additions & 2 deletions src/dfx/src/lib/diagnosis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ fn cycles_ledger_not_found(err: &AnyhowError) -> bool {

fn diagnose_cycles_ledger_not_found() -> Diagnosis {
let explanation =
"Cycles ledger with canister ID 'um5iw-rqaaa-aaaaq-qaaba-cai' cannot be found.";
"Cycles ledger with canister ID 'um5iw-rqaaa-aaaaq-qaaba-cai' is not installed.";
let suggestion =
"Run the command with '--ic' flag if you want to access the cycles ledger on the mainnet.";
"Run the command with '--ic' flag if you want to manage the cycles on the mainnet.";

(Some(explanation.to_string()), Some(suggestion.to_string()))
}

0 comments on commit a2fe0a0

Please sign in to comment.