Skip to content

chore: migrate motoko/icrc2-swap to icp-cli#1386

Draft
marc0olo wants to merge 1 commit into
masterfrom
chore/migrate-icrc2-swap-to-icp-cli
Draft

chore: migrate motoko/icrc2-swap to icp-cli#1386
marc0olo wants to merge 1 commit into
masterfrom
chore/migrate-icrc2-swap-to-icp-cli

Conversation

@marc0olo

Copy link
Copy Markdown
Member

Summary

  • Replaces dfx.json with icp.yaml using @dfinity/motoko@v5.0.0 recipe for the swap backend and pre-built build steps for the two ICRC-1/ICRC-2 token ledger canisters (token_a, token_b) from the ledger-suite-icrc-2026-03-09 release
  • Moves Motoko sources from src/swap/ to backend/ (renamed main.moapp.mo)
  • Updates mops.toml to moc = "1.9.0", core = "2.5.0", adds --default-persistent-actors flag
  • Adds Makefile with deploy target (multi-step: token ledgers first, then swap backend with dynamic init args using token canister IDs) and test target with 5 canister call tests
  • Adds icrc2-swap.yml CI workflow using icp-dev-env-motoko:0.3.2, replacing the old dfx-based workflow
  • Removes JS/Jest test suite, test/deploy.sh, prettier config, and all dfx artifacts
  • Updates README.md to use icp-cli deploy instructions

Notes

The deployment requires a custom make deploy step (rather than plain icp deploy) because the swap backend is an actor class whose init args (token_a and token_b canister principals) are only known after deploying the token ledger canisters. The CI workflow calls make deploy && make test.

Test plan

  • icp network start -d && make deploy && make test passes locally
  • CI workflow runs successfully on PR
  • mops check passes with no errors

🤖 Generated with Claude Code

Replace dfx.json with icp.yaml, migrate Motoko sources from src/swap/ to
backend/, add icp-dev-env-motoko:0.3.2 CI workflow, update mops.toml to
moc 1.9.0 / core 2.5.0 with --default-persistent-actors. Remove JS/Jest
test suite, old deploy.sh, and prettier config; add Makefile with deploy
and test targets that handle the multi-step deployment (token_a, token_b
ICRC-1 ledger canisters via pre-built WASM, then backend swap canister
with dynamic init args containing the token canister IDs).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant