From 1eacf6bfba62ed26eb0ec87d52bd930d73b96556 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Wed, 27 Nov 2024 16:03:52 +0800 Subject: [PATCH] Improve the diagnosis message. --- CHANGELOG.md | 7 ++++++- src/dfx/src/lib/diagnosis.rs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4663b6734..da1d97aba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/dfx/src/lib/diagnosis.rs b/src/dfx/src/lib/diagnosis.rs index 947bd8aaf2..47119c9878 100644 --- a/src/dfx/src/lib/diagnosis.rs +++ b/src/dfx/src/lib/diagnosis.rs @@ -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())) }