Skip to content

chore: DEFI-2304 remove deprecated ic-cdk imports in icp-ledger#10320

Draft
gregorydemay wants to merge 2 commits into
masterfrom
gdemay/DEFI-2304-icp-ledger
Draft

chore: DEFI-2304 remove deprecated ic-cdk imports in icp-ledger#10320
gregorydemay wants to merge 2 commits into
masterfrom
gdemay/DEFI-2304-icp-ledger

Conversation

@gregorydemay
Copy link
Copy Markdown
Contributor

@gregorydemay gregorydemay commented May 27, 2026

Summary

Extends DEFI-2304 — removing the file-level #![allow(deprecated)] attribute introduced in #6264.

This PR handles icp-ledger:

  • ic_cdk::api::call::{arg_data_raw, reply, reply_raw}ic_cdk::api::{msg_arg_data, msg_reply}.
  • ic_cdk::api::calleric_cdk::api::msg_caller.
  • ic_cdk::api::printic_cdk::api::debug_print.
  • ic_cdk::api::set_certified_dataic_cdk::api::certified_data_set.
  • ic_cdk::api::stable::StableReaderic_cdk::stable::StableReader.
  • ic_cdk::api::stable::stable_sizeic_cdk::stable::stable_size.

Imports use as aliases so the existing identifier-based call sites (caller(), arg_data_raw(), reply_raw(&res), print(...)) are preserved — that keeps the diff focused on the import line. The single fully qualified ic_cdk::api::call::reply((result,)) site is rewritten as reply_raw(Encode!(&result).unwrap()) to preserve the on-wire Candid output. No behavior change.

Follows the pattern set by #6755 (ic-btc-checker), #6761 (ic-ckbtc-minter), #10289, #10290, #10291, #10317, #10318 and #10319.

Migrate the ICP ledger canister off `ic_cdk::api::call::{arg_data_raw, reply, reply_raw}`,
`ic_cdk::api::{caller, print, set_certified_data, stable::StableReader, stable::stable_size}`
(all deprecated in #6264), and drop the file-level `#![allow(deprecated)]`. Imports use
`as` aliases so the existing identifier-based call sites are preserved, which keeps the
diff focused on the import line. The single `reply((result,))` site is rewritten as
`reply_raw(Encode!(&result).unwrap())` to preserve the on-wire Candid output.

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

Migrates the ICP ledger canister off deprecated ic-cdk APIs introduced under #![allow(deprecated)] in #6264, replacing them with their non-deprecated counterparts via as aliases to keep call sites unchanged.

Changes:

  • Replaces deprecated ic_cdk::api::{call::{arg_data_raw, reply_raw}, caller, print, set_certified_data} with msg_arg_data, msg_reply, msg_caller, debug_print, certified_data_set (aliased to old names).
  • Migrates ic_cdk::api::stable::{StableReader, stable_size} to ic_cdk::stable::*.
  • Rewrites the single Candid reply((result,)) site in get_nodes as reply_raw(Encode!(&result).unwrap()).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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