Skip to content

feat(icrc1): add ICRC-123 block schemas and ICRC-153 endpoint types#9530

Draft
bogwar wants to merge 2 commits intoicrc-124-4-endpointsfrom
icrc-123-1-types
Draft

feat(icrc1): add ICRC-123 block schemas and ICRC-153 endpoint types#9530
bogwar wants to merge 2 commits intoicrc-124-4-endpointsfrom
icrc-123-1-types

Conversation

@bogwar
Copy link
Contributor

@bogwar bogwar commented Mar 20, 2026

Summary

  • Add ICRC-123 block schema validators for 4 freeze/unfreeze block types (123freezeaccount, 123unfreezeaccount, 123freezeprincipal, 123unfreezeprincipal) with account-array and principal-blob target predicates
  • Add ICRC-153 Candid types: args (FreezeAccountArgs, etc.), error enums, and paginated list request/response types
  • Extend Transaction struct with freeze_account, unfreeze_account, freeze_principal, unfreeze_principal optional fields and constructors
  • Fix downstream struct literals for new Transaction fields (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 verified
  • cargo clippy clean

🤖 Generated with Claude Code

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>
Copy link
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 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::Transaction with 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>
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.

2 participants