feat(ic-icrc1): add AuthorizedMint/AuthorizedBurn Operation variants#9642
Draft
bogwar wants to merge 2 commits intoicrc-122-1-typesfrom
Draft
feat(ic-icrc1): add AuthorizedMint/AuthorizedBurn Operation variants#9642bogwar wants to merge 2 commits intoicrc-122-1-typesfrom
bogwar wants to merge 2 commits intoicrc-122-1-typesfrom
Conversation
Contributor
There was a problem hiding this comment.
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/AuthorizedBurnvariants toic_icrc1::Operation. - Extend transaction flattening/CBOR (de)serialization with
reasonandbtype-based decoding for122mint/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>
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
AuthorizedMintandAuthorizedBurnvariants to theOperationenum for ICRC-122 block types (122mint/122burn)reasonfield toFlattenedTransactionfor CBOR round-trip serializationbtypeassignment infrom_transaction()Stacked on #9586.
Test plan
cargo clippyand existing test suites passing (no newOperationvariants are produced yet)🤖 Generated with Claude Code