Skip to content

Commit

Permalink
Improve the diagnosis message.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-dfinity committed Nov 27, 2024
1 parent 71fc2cc commit 1eacf6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ Error explanation:
Insufficient ICP balance to finish the transfer transaction.
How to resolve the error:
Please top up your ICP balance.
Please run 'dfx ledger account-id' to get the address for receiving ICP tokens.
Please run 'dfx ledger account-id' to get your account address for receiving ICP from centralized exchanges.
(Example: a9e20b8d042cb7b73144de94e9091e8f2620dfc1e617cbfaa19d624322451b9d)
Please run 'dfx identity get-principal' to get your principal for receiving ICP from ICP wallets and decentralized exchanges.
(Exmaple: treln-6wg26-lak4v-sh7p6-qm7hn-ohcjl-ut3os-lemuf-ypxvr-zcamm-gae)
```

# 0.24.3
Expand Down
7 changes: 6 additions & 1 deletion src/dfx/src/lib/diagnosis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ fn insufficient_icp(err: &ICPTransferError) -> bool {
fn diagnose_insufficient_icp() -> Diagnosis {
let explanation = "Insufficient ICP balance to finish the transfer transaction.";
let suggestion = "Please top up your ICP balance.
Please run 'dfx ledger account-id' to get the address for receiving ICP tokens.";
Please run 'dfx ledger account-id' to get your account address for receiving ICP from centralized exchanges.
(Example: a9e20b8d042cb7b73144de94e9091e8f2620dfc1e617cbfaa19d624322451b9d)
Please run 'dfx identity get-principal' to get your principal for receiving ICP from ICP wallets and decentralized exchanges.
(Exmaple: treln-6wg26-lak4v-sh7p6-qm7hn-ohcjl-ut3os-lemuf-ypxvr-zcamm-gae)";
(Some(explanation.to_string()), Some(suggestion.to_string()))
}

0 comments on commit 1eacf6b

Please sign in to comment.