Skip to content

[LABS-495] Add condition drivers for magic conditions - #21390

Open
Quexington wants to merge 1 commit into
quex.common_puzzle_driversfrom
quex.magic_condition_drivers
Open

Quexington wants to merge 1 commit into
quex.common_puzzle_driversfrom
quex.magic_condition_drivers

Conversation

@Quexington

@Quexington Quexington commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Changes how CAT, NFT, and VC transactions assemble on-chain conditions; incorrect serialization would break mempool acceptance, though tests assert program equivalence with the old manual encoding.

Overview
Introduces typed Condition drivers so wallet spend construction no longer hand-builds UnknownCondition with raw CLVM opcodes and argument lists.

CAT: Adds TAILCondition in cat_utils and switches CAT/CR-CAT wallets, TAIL mint helpers, and related tests to use it with UnknownPuzzle / UnknownSolution for the -113 TAIL assertion on create-coin.

NFT: Adds UpdateMetadataCondition (-24 metadata updater) and TransferProgramCondition (-10 ownership transfer program). NFT wallet spends and create_ownership_layer_transfer_solution now emit these types; trade prices are modeled as a dict[bytes32, int] instead of nested lists.

VC: Adds MagicTPCondition for exigent-metadata-layer -10 conditions. VerifiedCredential helpers (magic_condition_for_new_proofs, standard_magic_condition, magic_condition_for_self_revoke) return this type directly instead of bare Programs wrapped in UnknownCondition.from_program.

Unit tests cover to_program / from_program roundtrips for the new drivers; lifecycle tests were updated to match.

Reviewed by Cursor Bugbot for commit c4144cb. Bugbot is set up for automated code reviews on this repo. Configure here.

@Quexington
Quexington requested a review from a team as a code owner September 10, 2026 22:03
@Quexington
Quexington deployed to windows-code-signing September 10, 2026 22:03 — with GitHub Actions Active
@Quexington Quexington added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor
File Coverage Missing Lines
chia/wallet/nft_wallet/nft_puzzle_utils.py 98.3% lines 345
chia/wallet/nft_wallet/nft_wallet.py 90.0% lines 820
Total Missing Coverage
191 lines 2 lines 98%

@coveralls-official

Copy link
Copy Markdown

Coverage Report for CI Build 34535459537

Warning

No base build found for commit a5989d6 on quex.common_puzzle_drivers.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 90.224%

Details

  • Patch coverage: 2 uncovered changes across 2 files (189 of 191 lines covered, 98.95%).

Uncovered Changes

File Changed Covered %
chia/wallet/nft_wallet/nft_puzzle_utils.py 60 59 98.33%
chia/wallet/nft_wallet/nft_wallet.py 10 9 90.0%
Total (16 files) 191 189 98.95%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 127077
Covered Lines: 117208
Line Coverage: 92.23%
Relevant Branches: 24942
Covered Branches: 19949
Branch Coverage: 79.98%
Branches in Coverage %: Yes
Coverage Strength: 1.84 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changed Required label for PR that categorizes merge commit message as "Changed" for changelog coverage-diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant