Skip to content

feat(ic-icrc1): add AuthorizedMint/AuthorizedBurn Operation variants#9642

Draft
bogwar wants to merge 2 commits intoicrc-122-1-typesfrom
icrc-122-2-core
Draft

feat(ic-icrc1): add AuthorizedMint/AuthorizedBurn Operation variants#9642
bogwar wants to merge 2 commits intoicrc-122-1-typesfrom
icrc-122-2-core

Conversation

@bogwar
Copy link
Copy Markdown
Contributor

@bogwar bogwar commented Mar 28, 2026

Summary

  • Adds AuthorizedMint and AuthorizedBurn variants to the Operation enum for ICRC-122 block types (122mint/122burn)
  • Adds reason field to FlattenedTransaction for CBOR round-trip serialization
  • Adds btype-based deserialization and btype assignment in from_transaction()
  • Stubs all exhaustive match sites with panics (index-ng, rosetta, test utilities, endpoints) — real implementations in subsequent PRs

Stacked on #9586.

Test plan

  • No new runtime behavior — all new code paths are behind panics until endpoints are added in a later PR
  • Verified by cargo clippy and existing test suites passing (no new Operation variants are produced yet)

🤖 Generated with Claude Code

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

Adds scaffolding to support ICRC-122 privileged mint/burn block types by extending the ICRC-1 ledger transaction model and CBOR encoding/decoding, while explicitly stubbing downstream consumers (Rosetta, index-ng, test utilities) until follow-up PRs implement full support.

Changes:

  • Add AuthorizedMint / AuthorizedBurn variants to ic_icrc1::Operation.
  • Extend transaction flattening/CBOR (de)serialization with reason and btype-based decoding for 122mint / 122burn.
  • Add explicit panic stubs at exhaustive match sites across Rosetta, index-ng, and test utilities.

Reviewed changes

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

Show a summary per file
File Description
rs/ledger_suite/icrc1/src/lib.rs Adds new Operation variants, adds reason to flattened tx, and adds btype-based tx decoding + btype assignment in from_transaction().
rs/ledger_suite/icrc1/src/endpoints.rs Stubs endpoint conversion for new operation variants with a panic.
rs/ledger_suite/icrc1/index-ng/src/main.rs Stubs indexing logic for new variants with panics.
rs/rosetta-api/icrc1/src/common/storage/types.rs Stubs Rosetta storage model conversion for new variants with a panic.
rs/rosetta-api/icrc1/src/construction_api/services.rs Updates Rosetta construction API tests to explicitly panic on new variants.
rs/rosetta-api/icrc1/tests/system_tests.rs Updates Rosetta system test matching to explicitly panic on new variants.
rs/rosetta-api/icrc1/tests/multitoken_system_tests.rs Same as above for multitoken system tests.
rs/ledger_suite/test_utils/in_memory_ledger/src/lib.rs Stubs in-memory ledger block consumer for new variants with a panic.
rs/ledger_suite/icrc1/test_utils/src/lib.rs Adjusts generators and utilities to compile with the new variants (panic stubs / exclusions).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add ICRC-122 block type support to the core Operation enum with CBOR
encoding/decoding via FlattenedTransaction. Exhaustive match sites
across index-ng, rosetta, and test utilities are stubbed with panics
— real implementations will follow in subsequent PRs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

3 participants