chore: DEFI-2304 remove deprecated ic-cdk imports in ic-sender-canister#10323
Draft
gregorydemay wants to merge 1 commit into
Draft
chore: DEFI-2304 remove deprecated ic-cdk imports in ic-sender-canister#10323gregorydemay wants to merge 1 commit into
gregorydemay wants to merge 1 commit into
Conversation
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>
Contributor
There was a problem hiding this comment.
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_raw128withCall::unbounded_wait(...).take_raw_args(...).with_cycles(...). - Introduces a local
RejectionCodeenum matching the previous public Candid shape. - Maps new
CallFailederrors back into the existingSendResulterror 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.
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
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).await→ic_cdk::call::Call::unbounded_wait(to, &method).take_raw_args(arg).with_cycles(payment).await+Response::into_bytesto recover the raw reply bytes.ic_cdk::api::call::RejectionCode→ a localRejectionCodeenum that mirrors the 7 variants previously exposed by the deprecated cdk type. The Candid interface declared insender.didis unchanged.CallFailederror is mapped back to(RejectionCode, String)so the publicSendError = (RejectionCode, String)type alias keeps the same wire shape.No behavior change.