Documentation/example review 260223#300
Open
Crypto2099 wants to merge 2 commits intotx3-lang:mainfrom
Open
Conversation
- Create _test_harness in examples folder that allows for quick iteration of all examples to ensure all examples pass `trix check` validation with latest version. The only exception/expected error here is `semantic_errors.tx3` which is intentionally broken. - Move the non-functional, aspirational examples to an aspirational directory with a README explaining their nature. These are prone to causing confusion if left in the main examples folder. - Updates to several existing scripts to bring them inline with the latest version of Trix/Tx3 and make sure they pass validation.
- Update lang_tour, reference_script, and introduce new policy_variants examples to document and fill gaps left by current examples
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
trix checkTest harness (
examples/_test_harness/)A simple shell script that iterates every
.tx3file in the examples directory, copies it into a minimal trix project, and runstrix check. This makes it easy to verify that all examples stay valid as the language evolves. The only expected failure issemantic_errors.tx3, which is intentionally broken.Aspirational examples (
examples/aspirational/)Moved
jpg.tx3,levvy.tx3,levvy.simple.tx3,plutus_addresses.tx3,spans.tx3, andsplash.tx3into anaspirational/subdirectory with a README. These files use syntax or features that don't yet compile and were causing confusion when mixed in with working examples.Example fixes
swap_static.tx3— minor fix to pass current validationtransfer_nft.tx3— updated to work with latest language versionNew and updated examples filling grammar coverage gaps
Boolliteral (true/false)lang_tour.tx3field6: BooltoMyRecord, usedtruein datum constructorAddressprimitive typelang_tour.tx3field_e: Addressto env block!lang_tour.tx3!field_cin locals blocklang_tour.tx3quantity + -1in datum fieldoutput?lang_tour.tx3output? optional_changeblockcardano::publishwithdatumreference_script.tx3datum:field to existing publish blockpolicy_variants.tx3policy_variants.tx3AnyAsset(PolicyName, ...)resolving to hashpolicy_variants.tx3policy_variants.tx3cardano::native_witnessattached to native script policy mintpolicy_variants.tx3referenceblock supplying plutus script from on-chain UTxOTest results
28 passing, 1 expected failure (
semantic_errors.tx3) — all new and modified files validated.Notes
During this audit we identified several
policyobject limitations that are tracked separately:MyPolicy.script) is not supportedassetdefinitions can't reference policy names or env varshashpasstrix checkbut panic attrix build🤖 Generated with Claude Code