Skip to content

chore: DEFI-2304 remove deprecated ic-cdk imports in ic-cketh-minter#10290

Draft
gregorydemay wants to merge 1 commit into
masterfrom
gdemay/DEFI-2304-cketh-minter
Draft

chore: DEFI-2304 remove deprecated ic-cdk imports in ic-cketh-minter#10290
gregorydemay wants to merge 1 commit into
masterfrom
gdemay/DEFI-2304-cketh-minter

Conversation

@gregorydemay
Copy link
Copy Markdown
Contributor

@gregorydemay gregorydemay commented May 22, 2026

Summary

Continues DEFI-2304 — removing the #![allow(deprecated)] attributes that were introduced in #6264 when ic-cdk was upgraded to 0.18, by migrating the affected files off the deprecated ic_cdk surface.

This PR handles ic-cketh-minter:

  • ic_cdk::api::management_canister::{main, ecdsa, http_request}ic_cdk::management_canister::* + EcdsaPublicKeyArgs / EcdsaPublicKeyResult / SignWithEcdsaArgs / CanisterStatusArgs / CanisterStatusResult from ic_management_canister_types.
  • ic_cdk::api::call::RejectionCodeic_cdk::call::CallFailed and ic_cdk::management_canister::SignCallError; the existing Reason::from_reject mapping is rewritten as from_call_failed / from_sign_call_error while preserving the same Reason variants.
  • 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_status now returns the modern CanisterStatusResult; cketh_minter.did is updated to mirror the new fields (the same shape already adopted by ckBTC minter in chore(XC): remove deprecation from ic-cdk in ic-ckbtc-minter #6761).

Follows the pattern set by #6755 (ic-btc-checker) and #6761 (ic-ckbtc-minter). No behavior change.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_status return type and adjusts cketh_minter.did to 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants