feat(icrc1): add ICRC-123 block schemas and ICRC-153 endpoint types#9530
Draft
bogwar wants to merge 2 commits intoicrc-124-4-endpointsfrom
Draft
feat(icrc1): add ICRC-123 block schemas and ICRC-153 endpoint types#9530bogwar wants to merge 2 commits intoicrc-124-4-endpointsfrom
bogwar wants to merge 2 commits intoicrc-124-4-endpointsfrom
Conversation
Add type definitions for the ICRC-123/153 freeze/unfreeze feature: - ICRC-123 block schema validators (freeze/unfreeze account/principal) - ICRC-153 Candid types (args, errors, pagination request/response) - Transaction struct extended with freeze action fields - Fix downstream struct literals for new Transaction fields Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds ICRC-123/153 freeze/unfreeze support to the shared ledger types layer by introducing block schema validators, new Candid endpoint argument/error/listing types, and extending the ICRC-3 Transaction representation to carry freeze/unfreeze actions.
Changes:
- Added ICRC-123 schema validators (and unit tests) for 4 new freeze/unfreeze block types.
- Added ICRC-153 Candid types for freeze/unfreeze arguments, error enums, and frozen-entity list request/response types.
- Extended
icrc3::Transactionwith optional freeze/unfreeze fields and updated downstream struct literals to include the new fields.
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/sns/governance/token_valuation/src/tests.rs | Updates Transaction struct literals in tests to include new optional freeze/unfreeze fields. |
| rs/nervous_system/initial_supply/src/tests.rs | Updates Transaction struct literals in tests to include new optional freeze/unfreeze fields. |
| rs/ledger_suite/icrc1/src/endpoints.rs | Initializes new Transaction freeze/unfreeze fields to None when converting from blocks. |
| rs/ledger_suite/icrc1/index-ng/tests/tests.rs | Updates Transaction expectations to include new optional freeze/unfreeze fields. |
| packages/icrc-ledger-types/src/lib.rs | Exposes new icrc123 and icrc153 modules from the crate root. |
| packages/icrc-ledger-types/src/icrc3/transactions.rs | Adds ICRC-123 transaction kind constants, action structs, new Transaction fields, and constructors. |
| packages/icrc-ledger-types/src/icrc153/mod.rs | Introduces ICRC-153 Candid types for freeze/unfreeze args, errors, and list request/response types. |
| packages/icrc-ledger-types/src/icrc123/schema.rs | Adds schema validators + tests for ICRC-123 freeze/unfreeze block formats. |
| packages/icrc-ledger-types/src/icrc123/mod.rs | Adds module entrypoint for ICRC-123 schema module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ypes The Transaction struct in icrc-ledger-types now has freeze_account, unfreeze_account, freeze_principal, unfreeze_principal fields, so the .did files must include the corresponding Candid types to pass the check_candid_interface test. 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
123freezeaccount,123unfreezeaccount,123freezeprincipal,123unfreezeprincipal) with account-array and principal-blob target predicatesFreezeAccountArgs, etc.), error enums, and paginated list request/response typesTransactionstruct withfreeze_account,unfreeze_account,freeze_principal,unfreeze_principaloptional fields and constructorsTransactionfields (index-ng tests, nervous_system, sns)Stacked on #4321 (ICRC-124/154). First PR in the ICRC-123/153 freeze/unfreeze series.
Test plan
//packages/icrc-ledger-types:test— schema validator unit tests pass//rs/ledger_suite/icrc1:icrc1_unit_test— downstream compilation verifiedcargo clippyclean🤖 Generated with Claude Code