Skip to content

Commit 3fb8553

Browse files
Remove old replica compatibility code (#4079)
1 parent b04e931 commit 3fb8553

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/dfx/src/lib/diagnosis.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,24 +110,14 @@ fn local_replica_not_running(err: &AnyhowError) -> bool {
110110

111111
fn not_a_controller(err: &AgentError) -> bool {
112112
// Newer replicas include the error code in the reject response.
113-
if matches!(
113+
matches!(
114114
err,
115115
AgentError::UncertifiedReject(RejectResponse {
116116
reject_code: RejectCode::CanisterError,
117117
error_code: Some(error_code),
118118
..
119119
}) if error_code == error_code::CANISTER_INVALID_CONTROLLER
120-
) {
121-
return true;
122-
}
123-
124-
// Older replicas do not include the error code in the reject response.
125-
// replica gives HTTP403, message looks like "Only controllers of canister bkyz2-fmaaa-aaaaa-qaaaq-cai can call ic00 method canister_status"
126-
matches!(err, AgentError::HttpError(payload) if payload.status == 403
127-
&& matches!(
128-
std::str::from_utf8(payload.content.as_slice()),
129-
Ok("Only controllers of canister")
130-
))
120+
)
131121
}
132122

133123
fn wallet_method_not_found(err: &AgentError) -> bool {

0 commit comments

Comments
 (0)