chore: DEFI-2304 remove deprecated ic-cdk imports in ic-cketh-minter#10290
Draft
gregorydemay wants to merge 1 commit into
Draft
chore: DEFI-2304 remove deprecated ic-cdk imports in ic-cketh-minter#10290gregorydemay wants to merge 1 commit into
gregorydemay wants to merge 1 commit into
Conversation
Migrate the ckETH minter off the deprecated `ic_cdk::api::management_canister::*`, `ic_cdk::api::call::RejectionCode`, `ic_cdk::caller`, `ic_cdk::id`, `ic_cdk::api::canister_balance128` and `ic_cdk::api::stable::stable_size` surfaces introduced in #6264, and drop the file-level `#![allow(deprecated)]` attributes. The internal `RejectionCode`-based `Reason::from_reject` helper is rewritten on top of the new `ic_cdk::call::CallFailed` / `SignCallError` enums while keeping the same `Reason` variants. `get_canister_status` now returns the modern `CanisterStatusResult`; `cketh_minter.did` is updated to mirror the new fields (matching the shape already adopted by the ckBTC minter). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the DEFI-2304 migration by removing usage of deprecated ic-cdk APIs in the ic-cketh-minter canister (and related test utilities), switching to the newer ic_cdk::management_canister::* surface and updated management-canister types.
Changes:
- Migrates management canister calls/types (HTTP outcalls, ECDSA, canister status) to
ic_cdk::management_canister::*and modern argument/result structs. - Replaces deprecated caller/self/balance/stable-memory APIs with their current equivalents.
- Updates
get_canister_statusreturn type and adjustscketh_minter.didto reflect the newer status response shape.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rs/ethereum/cketh/test_utils/src/mock.rs | Updates HTTP outcall response/transform types to the modern management-canister types. |
| rs/ethereum/cketh/minter/src/state/tests.rs | Updates ECDSA public key response type used in state-equivalence tests. |
| rs/ethereum/cketh/minter/src/state.rs | Migrates ECDSA public key fetch to modern args/result types and updated call signature. |
| rs/ethereum/cketh/minter/src/management.rs | Refactors rejection handling to CallFailed/SignCallError and updates sign_with_ecdsa call types. |
| rs/ethereum/cketh/minter/src/main.rs | Replaces deprecated ic-cdk APIs and modernizes get_canister_status implementation. |
| rs/ethereum/cketh/minter/cketh_minter.did | Updates the Candid interface for the new get_canister_status response fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+97
to
+98
| CallFailed::CallPerformFailed(_) => { | ||
| Self::InternalError("call_perform failed".to_string()) |
| custom_sections_size : nat; | ||
| canister_history_size : nat; | ||
| wasm_chunk_store_size : nat; | ||
| snapshots_size : nat; |
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
Continues DEFI-2304 — removing the
#![allow(deprecated)]attributes that were introduced in #6264 whenic-cdkwas upgraded to 0.18, by migrating the affected files off the deprecatedic_cdksurface.This PR handles
ic-cketh-minter:ic_cdk::api::management_canister::{main, ecdsa, http_request}→ic_cdk::management_canister::*+EcdsaPublicKeyArgs/EcdsaPublicKeyResult/SignWithEcdsaArgs/CanisterStatusArgs/CanisterStatusResultfromic_management_canister_types.ic_cdk::api::call::RejectionCode→ic_cdk::call::CallFailedandic_cdk::management_canister::SignCallError; the existingReason::from_rejectmapping is rewritten asfrom_call_failed/from_sign_call_errorwhile preserving the sameReasonvariants.ic_cdk::caller()/ic_cdk::id()→ic_cdk::api::msg_caller()/ic_cdk::api::canister_self().ic_cdk::api::canister_balance128()→ic_cdk::api::canister_cycle_balance().ic_cdk::api::stable::stable_size()→ic_cdk::stable::stable_size().get_canister_statusnow returns the modernCanisterStatusResult;cketh_minter.didis updated to mirror the new fields (the same shape already adopted by ckBTC minter in chore(XC): remove deprecation fromic-cdkinic-ckbtc-minter#6761).Follows the pattern set by #6755 (
ic-btc-checker) and #6761 (ic-ckbtc-minter). No behavior change.