Skip to content

chore: DEFI-2304 remove deprecated ic-cdk imports in ic-icp-index#10319

Draft
gregorydemay wants to merge 1 commit into
masterfrom
gdemay/DEFI-2304-icp-index
Draft

chore: DEFI-2304 remove deprecated ic-cdk imports in ic-icp-index#10319
gregorydemay wants to merge 1 commit into
masterfrom
gdemay/DEFI-2304-icp-index

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 ic-icp-index:

  • ic_cdk::api::calleric_cdk::api::msg_caller.
  • ic_cdk::api::canister_balance128ic_cdk::api::canister_cycle_balance.
  • ic_cdk::api::stable::stable_sizeic_cdk::stable::stable_size.
  • Inter-canister calls go through the modern ic_cdk::call::Call::unbounded_wait(...).with_arg(...).await?.candid()? builder instead of the deprecated tuple-based ic_cdk::call(canister_id, method, (req,)) / (T,) shape.

The internal State::last_wait_time field is itself separately deprecated (tracked by DEFI-1144); its single construction site keeps a narrowly scoped #[allow(deprecated)] so this PR stays focused on the DEFI-2304 surface.

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

Migrate the ICP index canister off `ic_cdk::api::caller`,
`ic_cdk::api::call::call`, `ic_cdk::api::canister_balance128` and
`ic_cdk::api::stable::stable_size` (all deprecated in #6264), and drop the
file-level `#![allow(deprecated)]`. The inter-canister calls now use the
`ic_cdk::call::Call::unbounded_wait(...).with_arg(...).await?.candid()?`
builder (returning `Response::candid` rather than the deprecated `(T,)`
tuple shape). The internal `State::last_wait_time` field (tracked separately
by DEFI-1144) keeps a narrowly-scoped `#[allow(deprecated)]` on its only
construction site.

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 ic-icp-index off deprecated ic-cdk 0.18 APIs and removes the file-level #![allow(deprecated)], replacing caller, balance, stable-size, and tuple-style inter-canister call APIs with their modern equivalents.

Changes:

  • Replace caller/canister_balance128/api::stable::stable_size with msg_caller/canister_cycle_balance/stable::stable_size.
  • Rewrite ledger and archive calls using the Call::unbounded_wait(...).with_arg(...).await?.candid()? builder.
  • Narrowly scope the remaining deprecation to State::default() via #[allow(deprecated)] for the last_wait_time field.

💡 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