fix(test): repair trix test expect/balance phase + modernize utxorpc utxo parsing#123
Merged
Merged
Conversation
…hell
The `trix test` expect phase never worked against the released cshell — it
errored with `CShell failed to get wallet utxos` and, on that error path,
leaked the Dolos devnet daemon. Four layered bugs:
1. `@`-prefix not stripped: the expect path passed the literal `@bob`
placeholder to `cshell wallet utxos`, but wallets are named `bob`. The tx
path already strips it (`replace_placeholder_args`); the expect path now
mirrors that via a small, unit-tested `wallet_name` helper.
2. Wrong cshell store: expect queried `devnet.home` (the *dolos* store), which
holds neither the wallets nor the provider. It now queries
`wallet.target_dir` — the same cshell home the invoke path submits against.
3. Missing provider: `cshell wallet utxos <NAME> <PROVIDER>` falls back to the
*default* provider when the positional is omitted, but the generated
cshell.toml marks its sole provider `is_default = false`. Expect now passes
the provider name explicitly (same as invoke), fixing "Wallet and provider
not found".
4. Stale utxo deserialization: cshell emits utxorpc `AnyUtxoData` via pbjson
(camelCase, base64 bytes, oneofs flattened to `cardano`, `BigInt` coin as
`{ "int": "..." }`), but the `UTxO` struct expected a flat hex shape and
failed with `missing field tx`. Replaced with wire structs matching cshell's
actual output, decoded into a flat view. Deserializing into trix's own
`utxorpc` types won't work — its pinned spec models `coin` as plain `uint64`,
not the BigInt cshell now emits.
Also: tear the devnet down unconditionally so a failed/early-exiting test never
leaves a daemon running, and surface cshell's stderr in the utxos error.
Verified end-to-end against the installed beta channel via the umbrella DX e2e
harness: `trix test` on the default scaffold now prints `Test Passed`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump `utxorpc` 0.12 → 0.13 (matching cshell / spec 0.18) and deserialize the
`wallet utxos` output straight into `utxorpc::spec::query::AnyUtxoData` instead
of the hand-rolled wire structs the previous commit introduced. pbjson handles
the camelCase / base64 / oneof / BigInt-coin shaping, so the six `Wire*` structs,
the `decode_b64` helper, and the direct `base64` dependency all go away.
The earlier commit couldn't do this: trix's pinned spec (0.17) modeled cardano
`coin` as a plain `uint64`, which won't parse cshell's BigInt-shaped
`{ "int": "..." }`. Spec 0.18 models it as `BigInt`, matching cshell's output.
The bump is otherwise transparent — the only other utxorpc consumer
(`devnet/copy.rs`) compiles unchanged.
The flat `UTxO` view the `expect` checks read is preserved; it's now built by
`flatten_utxo` walking the typed `AnyUtxoData` (parsed_state → Cardano → coin /
assets / datum), with a shared `bigint_to_string` for lovelace and asset
quantities. Re-verified end-to-end against installed beta: `trix test` still
prints `Test Passed`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
trix test expect/balance phase against shipped cshelltrix test expect/balance phase + modernize utxorpc utxo parsing
scarmuega
added a commit
to tx3-lang/toolchain
that referenced
this pull request
Jun 16, 2026
The expect path's stale utxo deserialization (bug 4) is fixed by bumping trix's `utxorpc` 0.12 → 0.13 (spec 0.18) and deserializing into `AnyUtxoData` directly, not by hand-rolled wire structs. Update the plan + README findings to match the landed approach (tx3-lang/trix#123, second commit). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
scarmuega
added a commit
to tx3-lang/toolchain
that referenced
this pull request
Jun 16, 2026
A README describes how the harness works, not which bugs it has surfaced, so remove the "Findings" section and generalize the Hermeticity note (the daemon reap is described as harness behavior, not a specific trix bug). The DX e2e findings plan was fulfilled by the trix expect/balance fix (tx3-lang/trix#123), so delete it rather than annotate it DONE. The one genuinely open item it held — the feature-dense lowering latency — moves to a lean, forward-looking plan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
scarmuega
added a commit
to tx3-lang/toolchain
that referenced
this pull request
Jun 16, 2026
A README describes how the harness works, not which bugs it has surfaced, so remove the "Findings" section and generalize the Hermeticity note (the daemon reap is described as harness behavior, not a specific trix bug). The DX e2e findings plan was fulfilled by the trix expect/balance fix (tx3-lang/trix#123), so delete it rather than annotate it DONE. The one genuinely open item it held — the feature-dense lowering latency — moves to a lean, forward-looking plan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
scarmuega
added a commit
to tx3-lang/toolchain
that referenced
this pull request
Jun 16, 2026
Point trix at main (0e9d854), which includes the `trix test` expect/balance repair + utxorpc modernization (tx3-lang/trix#123). Not yet released, so the journey 01 xfail stays until the fix ships in a channel manifest. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
scarmuega
added a commit
to tx3-lang/toolchain
that referenced
this pull request
Jun 16, 2026
Drop the xfail bracket from 04-devnet-roundtrip — the round-trip is now a strict `run_cmd ... trix test` + `assert_output_contains "Test Passed"`. On released channels (which still carry the bug) the journey now *fails* instead of being tolerated, so the broken state is a real, visible CI failure on the beta job rather than a green xfail. It goes green automatically once the trix fix (tx3-lang/trix#123) ships to a channel. Verified both directions: fails (exit 1) on the released beta binaries; passes strictly against trix main (the fix). Docs + skill updated to say "fails", not "xfail". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
scarmuega
added a commit
to tx3-lang/toolchain
that referenced
this pull request
Jun 16, 2026
The roadmap predated 03-lang-edge / 04-devnet-roundtrip, so its planned `03-codegen-consume` / `04-registry` collided with real journeys, it linked the now-deleted findings plan, and it placed the round-trip in 01 (now 04). - Drop fixed `NN-` prefixes from planned journeys — they're themes, numbered at authoring time (next free: 05) — so the roadmap stops colliding with real journeys. - Fix references: round-trip machinery lives in 04-devnet-roundtrip; the trix test fix is merged (tx3-lang/trix#123) but unreleased; each journey ships its own README (no journey table to update); drop the dead findings-plan link. Co-Authored-By: Claude Opus 4.8 <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.
What
trix testresolves and submits the scaffolded transfers fine, but its expect/balance phase never worked against the released cshell — it errored withCShell failed to get wallet utxosand, on that error path, leaked the Dolos devnet daemon. Reproduces on both stable (trix 0.25.1) and beta (0.26.0), with cshell 0.14 / utxorpc 0.13.It turned out to be four layered bugs, each only visible once the prior is fixed:
@-prefix not stripped — the expect path passed the literal@bobplaceholder tocshell wallet utxos, but wallets are namedbob. The tx path already strips it (replace_placeholder_args); the expect path now mirrors that via a small, unit-testedwallet_namehelper.devnet.home(the dolos store), which holds neither the wallets nor the provider. It now querieswallet.target_dir— the same cshell home the invoke path submits against.cshell wallet utxos <NAME> <PROVIDER>falls back to the default provider when the positional is omitted, but the generatedcshell.tomlmarks its sole provideris_default = false. Expect now passes the provider name explicitly (same as invoke), fixingWallet and provider not found.AnyUtxoDatavia pbjson (camelCase keys,bytesas base64, theparsed_stateoneof flattened tocardano,BigIntcoin as{ "int": "..." }), but theUTxOstruct expected a flat hex shape and failed withmissing field tx.Also: tear the devnet down unconditionally so a failed/early-exiting test never leaves a daemon running, and surface cshell's stderr in the utxos error.
Two commits
fix(test): …— fixes bugs 1–3 + the daemon leak, and (bug 4) replaces the staleUTxOdeserializer. This commit couldn't reuse trix's own utxorpc types: the pinned spec (0.17) modeled cardanocoinas plainuint64, which won't parse cshell's BigInt-shaped coin — so it landed a self-contained wire deserializer.refactor(test): deserialize cshell utxos via utxorpc AnyUtxoData— bumpsutxorpc0.12 → 0.13 (matching cshell, spec 0.18, which modelscoinasBigInt) and deserializes straight intoutxorpc::spec::query::AnyUtxoData. pbjson handles the camelCase / base64 / oneof / BigInt shaping, so the hand-rolled wire structs, the base64 decode helper, and the directbase64dep all go away (net −63 lines). The bump is otherwise transparent — the only other utxorpc consumer,devnet/copy.rs, compiles unchanged.Testing
@-strip; full lib suite (55) green; clippy clean.e2e/, journey01-basic-init) after both commits:trix teston the default scaffold printsTest Passed, and no Dolos daemon survives the run.Surfaced by the umbrella DX e2e harness (tx3-lang/toolchain
e2e/), which had this round-trip bracketed as anxfailon exactly this signature.🤖 Generated with Claude Code