diff --git a/src/dfx/src/lib/diagnosis.rs b/src/dfx/src/lib/diagnosis.rs index 86e387fe06..b346341cf7 100644 --- a/src/dfx/src/lib/diagnosis.rs +++ b/src/dfx/src/lib/diagnosis.rs @@ -1,6 +1,5 @@ use crate::lib::cycles_ledger_types::create_canister::CreateCanisterError; use crate::lib::error_code; -use crate::lib::ledger_types::TransferError as ICPTransferError; use anyhow::Error as AnyhowError; use dfx_core::error::root_key::FetchRootKeyError; use dfx_core::network::provider::get_network_context; @@ -81,12 +80,6 @@ pub fn diagnose(err: &AnyhowError) -> Diagnosis { } } - if let Some(transfer_error) = err.downcast_ref::() { - if insufficient_icp(transfer_error) { - return diagnose_insufficient_icp(); - } - } - NULL_DIAGNOSIS } @@ -302,19 +295,3 @@ fn diagnose_insufficient_cycles() -> Diagnosis { ); (Some(explanation.to_string()), Some(suggestion)) } - -fn insufficient_icp(err: &ICPTransferError) -> bool { - matches!(err, ICPTransferError::InsufficientFunds { balance: _ }) -} - -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 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())) -}