test: harden scripts/:hash/redeemers and governance-purpose coverage - #107
Merged
Conversation
New preview fixtures, all pinned against live Blockfrost: - spend purpose: asc prefix of an active dex validator (attribution through input resolution), plus the second script the same five txs execute at a different redeemer index — a cross-attribution guard. - deep asc window (rows 781-800 of a 36k-row contended history): shifts if a backend wrongly counts phase-2-failed executions. - desc invariants on the retired golden script: desc equals reversed asc, derived from one shared row list, both pages. - governance purposes: a tx mixing spend and vote redeemers and a parameter-change proposal tx. Both pin the current API facts: vote and propose rows are served ahead of the published schema and carry an empty script_hash (db-sync does not attribute governance redeemers). The guardrails script itself therefore has no attributed rows on scripts/:hash/redeemers — pinned as []. The golden script's full 112-row history now lives in one const; the original fixture pins the first 100 rows of it unchanged.
The propose-redeemer tx (51f495aa…, a parameter-change proposal) and the guardrails script's empty scripts/:hash/redeemers answer, same facts as the preview fixtures: rows served ahead of the published schema, script_hash left empty by db-sync.
db-sync leaves vote and propose redeemers unattributed, so the current API returns script_hash ""; a ledger-attributing backend returns the real script (the voter credential, the guardrails script). The governance fixtures now accept exactly these two values per field, and the guardrails scripts/:hash/redeemers fixture accepts an empty page or propose-only rows. Any other value still fails. The four classic purposes stay strictly pinned — both backends agree there.
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
Eight new preview fixtures for the redeemer endpoints, all pinned against live Blockfrost (verified 20/20 with the internal runner). They close the coverage gaps that recent backend work surfaced: spend attribution, cross-script attribution, failed-tx exclusion, desc invariants, and the Conway governance purposes.
Fixtures
scripts/:hash/redeemers spend purpose…second script of the same txs…deep asc window…desc equals reversed asc+…desc last pagetxs/:hash/redeemers with a vote redeemerscript_hashis empty — db-sync does not attribute voter scripts.txs/:hash/redeemers with a propose redeemerscripts/:hash/redeemers guardrails script has no attributed rowsscript_hash, the constitution guardrails script (fa24fb30…) has no findable rows — pinned as[].Note on the three governance fixtures
They accept exactly the two values the two backend generations produce: db-sync-backed deployments return
script_hash: ""(governance redeemers are unattributed), ledger-attributing backends return the real script (a11f594d…voter credential,fa24fb30…guardrails). The guardrailsscripts/:hash/redeemersfixture accepts an empty page or propose-only rows. Any other value fails, and the classic four purposes stay strictly pinned. Verified green against live BF (preview and mainnet) and against a ledger-attributing backend (dolos, txpipe/dolos#1199) — the tolerance can be tightened to the attributed values once the db-sync behavior is retired.Refactor note
The existing golden fixture's inline rows were the first 100 of the script's 112 (the endpoint's default
countcap). The full history now lives in oneGOLDEN_SCRIPT_ROWSconst; the original fixture pinsslice(0, 100)of it, byte-identical behavior.🤖 Generated with Claude Code