Skip to content

chore: DEFI-2304 remove deprecated ic-cdk imports in ic-sender-canister#10323

Draft
gregorydemay wants to merge 1 commit into
masterfrom
gdemay/DEFI-2304-sender-canister
Draft

chore: DEFI-2304 remove deprecated ic-cdk imports in ic-sender-canister#10323
gregorydemay wants to merge 1 commit into
masterfrom
gdemay/DEFI-2304-sender-canister

Conversation

@gregorydemay
Copy link
Copy Markdown
Contributor

@gregorydemay gregorydemay commented May 27, 2026

Summary

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

This PR handles ic-sender-canister:

  • ic_cdk::api::call::call_raw128(to, &method, arg, payment).awaitic_cdk::call::Call::unbounded_wait(to, &method).take_raw_args(arg).with_cycles(payment).await + Response::into_bytes to recover the raw reply bytes.
  • ic_cdk::api::call::RejectionCode → a local RejectionCode enum that mirrors the 7 variants previously exposed by the deprecated cdk type. The Candid interface declared in sender.did is unchanged.
  • The new CallFailed error is mapped back to (RejectionCode, String) so the public SendError = (RejectionCode, String) type alias keeps the same wire shape.

No behavior change.

Migrate the sender canister off `ic_cdk::api::call::{RejectionCode, call_raw128}`
(both deprecated in #6264), and drop the file-level `#![allow(deprecated)]`.

`call_raw128(to, &method, arg, payment)` is rewritten on top of the
`ic_cdk::call::Call::unbounded_wait(...).take_raw_args(arg).with_cycles(payment)`
builder, with `Response::into_bytes` extracting the raw reply. The new
`CallFailed` error is mapped back to `(RejectionCode, String)` so the canister's
Candid interface is unchanged: `RejectionCode` becomes a local enum that
mirrors the 7 variants previously exposed by `ic_cdk::api::call::RejectionCode`.

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 removes deprecated ic-cdk call API usage from the ic-sender-canister test utility while preserving its existing Candid wire interface.

Changes:

  • Replaces call_raw128 with Call::unbounded_wait(...).take_raw_args(...).with_cycles(...).
  • Introduces a local RejectionCode enum matching the previous public Candid shape.
  • Maps new CallFailed errors back into the existing SendResult error type.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
rs/rosetta-api/icp/test_utils/sender_canister/src/main.rs Updates raw inter-canister call execution to the non-deprecated ic_cdk::call::Call API and maps failures to the existing result type.
rs/rosetta-api/icp/test_utils/sender_canister/src/lib.rs Replaces the deprecated imported rejection code type with a local Candid-compatible enum and raw-code mapping.

💡 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