diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d7168c4f6..4b9bffcec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # UNRELEASED +### feat: Updated handling of missing values in state tree certificates + +The `Unknown` lookup of a path in a certificate results in an `AgentError` (the IC returns `Absent` for non-existing paths). + ### fix: dfx deploy urls printed for asset canisters ### chore: --emulator parameter is deprecated and will be discontinued soon diff --git a/src/dfx/src/lib/state_tree/canister_info.rs b/src/dfx/src/lib/state_tree/canister_info.rs index 7b01527bb9..f84b49c737 100644 --- a/src/dfx/src/lib/state_tree/canister_info.rs +++ b/src/dfx/src/lib/state_tree/canister_info.rs @@ -12,7 +12,7 @@ pub async fn read_state_tree_canister_controllers( .read_state_canister_info(canister_id, "controllers") .await { - Err(AgentError::LookupPathUnknown(_) | AgentError::LookupPathAbsent(_)) => { + Err(AgentError::LookupPathAbsent(_)) => { return Ok(None); } r => r.with_context(|| format!("Failed to read controllers of canister {canister_id}."))?, @@ -57,10 +57,7 @@ pub async fn read_state_tree_canister_module_hash( .await { Ok(blob) => Some(blob), - // If the canister is empty, this path does not exist. - // The replica doesn't support negative lookups, therefore if the canister - // is empty, the replica will return lookup_path([], Pruned _) = Unknown - Err(AgentError::LookupPathUnknown(_)) | Err(AgentError::LookupPathAbsent(_)) => None, + Err(AgentError::LookupPathAbsent(_)) => None, Err(x) => bail!(x), };