From 3fb85531a33fc56c07666a140353735d432eb8a6 Mon Sep 17 00:00:00 2001 From: Adam Spofford <93943719+adamspofford-dfinity@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:35:02 -0800 Subject: [PATCH] Remove old replica compatibility code (#4079) --- src/dfx/src/lib/diagnosis.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/dfx/src/lib/diagnosis.rs b/src/dfx/src/lib/diagnosis.rs index ee122da3f1..344841dee3 100644 --- a/src/dfx/src/lib/diagnosis.rs +++ b/src/dfx/src/lib/diagnosis.rs @@ -110,24 +110,14 @@ fn local_replica_not_running(err: &AnyhowError) -> bool { fn not_a_controller(err: &AgentError) -> bool { // Newer replicas include the error code in the reject response. - if matches!( + matches!( err, AgentError::UncertifiedReject(RejectResponse { reject_code: RejectCode::CanisterError, error_code: Some(error_code), .. }) if error_code == error_code::CANISTER_INVALID_CONTROLLER - ) { - return true; - } - - // Older replicas do not include the error code in the reject response. - // replica gives HTTP403, message looks like "Only controllers of canister bkyz2-fmaaa-aaaaa-qaaaq-cai can call ic00 method canister_status" - matches!(err, AgentError::HttpError(payload) if payload.status == 403 - && matches!( - std::str::from_utf8(payload.content.as_slice()), - Ok("Only controllers of canister") - )) + ) } fn wallet_method_not_found(err: &AgentError) -> bool {