chore: migrate rust/inter-canister-calls to icp-cli#1420
Open
marc0olo wants to merge 7 commits into
Open
Conversation
8d577d1 to
bbef37c
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e to 1.0.1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bbef37c to
146a833
Compare
…from icp.yaml environment_variables is not a valid canister-level field. PUBLIC_CANISTER_ID:counter is automatically injected by the @dfinity/rust recipe for all sibling canisters. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e README - caller: replace removed ic_cdk::management_canister with ic-cdk-management-canister = "0.1.1" (DepositCyclesArgs); send_cycles target stays as Principal parameter since the canister ID is provided by the caller, not hardcoded - caller + counter: add export_candid!() required by @dfinity/rust recipe's candid-extractor step - Both crates: edition 2021 → 2024; add cdylib comment - README: add Node.js v18+, Rust with wasm32-unknown-unknown prerequisites Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… icp canister id Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uce send amount On repeated runs the caller exhausts its cycles; top up with 1t before the test and reduce the amount sent from 1t to 100b so the test is idempotent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ptions - Fetch COUNTER_ID once at the top instead of 7 times - Move setup (reset + top-up) to the top before all tests - Fix Test 8 description: "retries until success" was misleading since a healthy local canister never fails; now says "no retries needed" - Use 99 for stubborn_set to distinguish it from earlier set values Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Migrates the rust/inter-canister-calls example from dfx to icp-cli, aligning it with the repository’s modern example structure and CI approach while keeping the two-canister (“counter” + “caller”) setup.
Changes:
- Replaced
dfx.json/Makefile-based workflow withicp.yaml+test.shand a new GitHub Actions workflow using theicp-dev-env-rust:1.0.1container. - Restructured the Rust workspace and canister sources (
src/*→ top-levelcaller/andcounter/crates), updated dependencies (includingic-cdk 0.20) and addedexport_candid!(). - Updated README to document
icp-cli-based local deploy/test steps and current security best-practices link.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/inter-canister-calls/test.sh | Adds an icp-cli-based integration test script covering the example’s endpoints. |
| rust/inter-canister-calls/rust-toolchain.toml | Ensures the wasm target is available for builds. |
| rust/inter-canister-calls/README.md | Updates instructions from dfx/ICP Ninja to icp-cli deploy + test flow. |
| rust/inter-canister-calls/icp.yaml | Introduces icp-cli project definition for counter and caller canisters. |
| rust/inter-canister-calls/Cargo.toml | Updates workspace members to the new crate layout. |
| rust/inter-canister-calls/Cargo.lock | Refreshes lockfile for updated dependencies/tooling. |
| rust/inter-canister-calls/counter/src/lib.rs | Reintroduces the counter canister code in the new crate location and exports Candid. |
| rust/inter-canister-calls/counter/Cargo.toml | Defines the new counter canister crate manifest. |
| rust/inter-canister-calls/caller/src/lib.rs | Updates inter-canister calling logic to ic-cdk 0.20 and management-canister crate usage; exports Candid. |
| rust/inter-canister-calls/caller/Cargo.toml | Defines the new caller canister crate manifest and adds ic-cdk-management-canister. |
| rust/inter-canister-calls/dfx.json | Removes legacy dfx project configuration. |
| rust/inter-canister-calls/Makefile | Removes dfx-driven Makefile test runner. |
| rust/inter-canister-calls/BUILD.md | Removes ICP Ninja/dfx-oriented build instructions. |
| rust/inter-canister-calls/.devcontainer/devcontainer.json | Removes per-example devcontainer configuration. |
| rust/inter-canister-calls/src/counter/src/lib.rs | Deletes old counter source location after restructure. |
| rust/inter-canister-calls/src/counter/counter.did | Removes committed .did from the prior dfx layout. |
| rust/inter-canister-calls/src/counter/Cargo.toml | Deletes old counter crate manifest from the prior layout. |
| rust/inter-canister-calls/src/caller/Cargo.toml | Deletes old caller crate manifest from the prior layout. |
| rust/inter-canister-calls/src/caller/caller.did | Removes committed .did from the prior dfx layout. |
| .github/workflows/rust-inter-canister-calls.yaml | Removes the legacy dfx-based CI workflow. |
| .github/workflows/inter-canister-calls.yml | Adds new container-based CI workflow using icp-cli. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
raymondk
approved these changes
Jul 5, 2026
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
dfx.jsonwithicp.yamlusing@dfinity/rust@v3.3.0for bothcounterandcallercanisterssrc/caller/→caller/,src/counter/→counter/; update workspaceCargo.tomlic-cdkto0.20; addic-cdk-management-canister = "0.1.1"tocaller(replaces removedic_cdk::management_canistermodule); addic_cdk::export_candid!()to both canisters; update edition to"2024"rust-toolchain.tomlwithwasm32-unknown-unknowntargetMakefilewithtest.sh: 9 tests covering all endpoints (call_get_and_set,set_then_get,call_increment,call_get,stubborn_set,send_cycles) with setup (counter reset + caller top-up) before each runinter-canister-calls.yml(icp-dev-env-rust:1.0.1); remove legacyrust-inter-canister-calls.yamlwasm32-unknown-unknownprerequisitesdfx.json,BUILD.md,.devcontainer/, oldsrc/tree, old.didfiles,MakefileTest plan
icp network start -d && icp deploy && bash test.shpasses — all 9 tests green includingsend_cyclesafter top-upinter-canister-callspasses on push🤖 Generated with Claude Code