refactor: add proxy dispatch module and use ic-management-canister-types#482
Merged
refactor: add proxy dispatch module and use ic-management-canister-types#482
Conversation
Move the proxy-or-direct update call dispatch into a shared `operations::call::update_or_proxy_call` function, replacing the duplicated proxy handling in `commands/canister/call.rs` and `operations/create.rs`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename operations/call.rs to operations/proxy.rs. Rename functions to update_or_proxy_raw and update_or_proxy. Add a higher-level update_or_proxy that accepts ArgumentEncoder/ArgumentDecoder for typed Candid encoding/decoding. Refactor create_proxy to use the typed helper with ic-management-canister-types (CreateCanisterArgs, CanisterIdRecord). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…canister-types Remove the `management_canister` module from `icp-canister-interfaces` and use `CanisterSettings`, `CreateCanisterArgs`, `CanisterIdRecord`, and `LogVisibility` from the `ic-management-canister-types` crate instead. This eliminates duplicated type definitions and ensures consistency with the upstream IC interface types. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
viviveevee
approved these changes
Apr 2, 2026
…yDef directly The local LogVisibility enum was a 1:1 mirror of ic_management_canister_types::LogVisibility. Replace it with LogVisibilityDef as the Settings field type and convert directly to the IC management type, removing ~50 lines of boilerplate. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
operations::proxymodule withupdate_or_proxy_rawandupdate_or_proxyhelpers that centralize the logic for dispatching canister update calls either directly or through a proxy canister. This replaces duplicated proxy-routing code incanister callandcanister create.MgmtCreateCanisterArgs,MgmtCreateCanisterResponse,CanisterSettingsArg,LogVisibility) inicp-canister-interfaceswith the upstreamic-management-canister-typescrate, removing themanagement_canistermodule entirely.LogVisibilityenum that mirroredic_management_canister_types::LogVisibility.Settings::log_visibilitynow usesLogVisibilityDefdirectly and converts straight to the IC management type, removing ~50 lines of boilerplate.Test plan
cargo test)cargo clippyandcargo fmtclean🤖 Generated with Claude Code