feat(ic-icrc1): add ICRC-122/152 AuthorizedMint/AuthorizedBurn support for index-ng#9411
Draft
bogwar wants to merge 7 commits intoicrc-122-1-typesfrom
Draft
feat(ic-icrc1): add ICRC-122/152 AuthorizedMint/AuthorizedBurn support for index-ng#9411bogwar wants to merge 7 commits intoicrc-122-1-typesfrom
bogwar wants to merge 7 commits intoicrc-122-1-typesfrom
Conversation
…urn support Add Operation variants for AuthorizedMint and AuthorizedBurn with CBOR codec support (btype 122mint/122burn, op 152mint/152burn). Add BlockBuilder methods for creating test blocks. Implement balance tracking in index-ng (credit for mint, debit for burn) with tests verifying correct behavior via the ICRC-3 test ledger. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Handle the new ICRC-122 Operation variants in exhaustive matches within the Rosetta API test files and construction API services to fix CI compilation errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…transactions The `From<Block> for Transaction` conversion previously hit `unreachable!()` for ICRC-122 operations, causing the index canister to trap when returning AuthorizedMint/AuthorizedBurn transactions through the `get_account_transactions` API. - Add `AuthorizedMint` and `AuthorizedBurn` structs to `icrc_ledger_types::icrc3::transactions` - Add `authorized_mint`/`authorized_burn` fields to the flat `Transaction` type - Implement the Block→Transaction conversion for both variants - Update the index-ng Candid interface (.did) - Add `test_get_account_transactions_authorized_mint_and_burn` to verify transactions are returned correctly - Extend `assert_tx_eq` to compare the new transaction types Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n struct literals Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ort lint Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tructs These are transaction-level fields, not operation-specific. The enclosing Transaction already carries timestamp, and memo/created_at_time are not part of the ICRC-122 operation definition. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Transaction type is shared across the ledger, archive, and index-ng canisters. All three .did files must include the new fields. 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 toOperation<Tokens>with CBOR codec (btype122mint/122burn, op152mint/152burn)AuthorizedMint/AuthorizedBurnstructs to the flatTransactiontype inicrc_ledger_typesand implement theBlock → Transactionconversion (previously hitunreachable!()).did) for index-ng, archive, and ledger to include the new transaction typesBlockBuilder::authorized_mint()andauthorized_burn()for creating ICRC-122 test blocks via the ICRC-3 test ledgerDepends on #9393.
Test plan
test_authorized_mint_credits_account: adds an authorized mint block via the ICRC-3 test ledger, syncs the index, and verifies the recipient's balance is correctly creditedtest_authorized_burn_debits_account: mints tokens then adds an authorized burn block, verifies the account balance reflects the debittest_authorized_mint_and_burn_sequence: exercises a mixed sequence (two authorized mints to different accounts, one authorized burn) and verifies both final balances are correcttest_get_account_transactions_authorized_mint_and_burn: adds an authorized mint and burn, then queriesget_account_transactionsand verifies the API returns both transactions with correct fields (to/from,amount,caller,reason) and the correct balance🤖 Generated with Claude Code