Skip to content

chore(motoko): migrate @sdk examples to mo:core 2.4.0#1330

Merged
marc0olo merged 7 commits intomasterfrom
chore/mo-core-2.4.0-sdk
Apr 20, 2026
Merged

chore(motoko): migrate @sdk examples to mo:core 2.4.0#1330
marc0olo merged 7 commits intomasterfrom
chore/mo-core-2.4.0-sdk

Conversation

@marc0olo
Copy link
Copy Markdown
Member

@marc0olo marc0olo commented Apr 20, 2026

Summary

Migrates 5 @dfinity/sdk-owned Motoko examples from mo:base to mo:core 2.4.0.

  • canister_factory: bump moc/core in mops.toml (already used mo:core/Principal)
  • query_stats: swap 3 mo:base imports to mo:core; create new mops.toml
  • pub-sub: create mops.toml; replace mo:base/List (functional linked list) with mo:core/ArrayList.push/List.toArrayconcat/vals
  • ic-pos: create mops.toml; migrate Triemo:core/Map (drops merchantKey helper), BufferArray (for ephemeral log), ExperimentalCycles.addawait (with cycles = N)
  • icrc2-swap: create mops.toml; migrate TrieMapmo:core/Map, remove preupgrade/postupgrade system hooks (Map is stable by default in persistent actor)

- canister_factory: bump moc/core in mops.toml (already used mo:core)
- query_stats: swap 3 mo:base imports to mo:core
- pub-sub: create mops.toml; replace mo:base/List with mo:core/Array
- ic-pos: create mops.toml; migrate Trie→mo:core/Map, Buffer→Array,
  ExperimentalCycles→await-with-cycles
- icrc2-swap: create mops.toml; migrate TrieMap→mo:core/Map, remove
  preupgrade/postupgrade (Map is stable by default)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo requested a review from a team as a code owner April 20, 2026 13:02
marc0olo and others added 5 commits April 20, 2026 15:10
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- pub-sub: add explicit `: async ()` return types (M0242)
- icrc2-swap: remove unused `msg` binding in deposit/swap (M0240);
  consolidate double Nat subtraction into single deduction var (M0155)
`: async ()` caused a type error in sub/Main.mo which calls
Publisher.subscribe without await. The correct M0242 fix is explicit
oneway annotation since fire-and-forget is intentional here.
[compiler] warnings = "error" is a mops-only setting not read by dfx in
CI. [moc] args = ["-W", "M0236", ...] passes flags directly to moc and
is effective in both mops check and dfx builds.
@marc0olo marc0olo requested review from a team as code owners April 20, 2026 15:04
These examples require @dfinity/languages approval and will be handled
in a separate PR.
@marc0olo marc0olo merged commit 229c6e7 into master Apr 20, 2026
16 checks passed
@marc0olo marc0olo deleted the chore/mo-core-2.4.0-sdk branch April 20, 2026 15:36
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.

2 participants