Skip to content

fix: align tx evaluate fixtures with Conway-only platform behavior#65

Merged
vladimirvolek merged 2 commits intomainfrom
tx-evaluation-rebased
Apr 13, 2026
Merged

fix: align tx evaluate fixtures with Conway-only platform behavior#65
vladimirvolek merged 2 commits intomainfrom
tx-evaluation-rebased

Conversation

@ginnun
Copy link
Copy Markdown
Contributor

@ginnun ginnun commented Apr 6, 2026

Fixture Changes for Conway-only Deserialization

Background

blockfrost-platform uses pallas decoding and testgen-hs with cardano-ledger's Conway decoder both. Both decodes only conway.

Rust's pallas produces different error strings than Haskell's cardano-ledger for the same invalid CBOR input.

The test CBOR in txs-evaluate-utxos contains an empty required_signers field (CBOR key 14 = 0x80). Conway's fieldGuarded validation rejects empty sets that are present rather than omitted. Ogmios avoids this via Babbage fallback, so the transaction never reaches evaluation. Platform behavior depends on which decoder is in use.

Below brief explanation of what tests did change:

Preview (src/fixtures/preview/utils/)

txs-evaluate.ts

fails (client fault) to submit on ill-formed tx

  • Old: exact string match '...DeserialiseFailure 0 "expected tag".'
  • New: stringContaining('...CBOR failed with error:')
  • Reason: Pallas (Rust) and cardano-ledger (Haskell) produce different error suffixes for the same malformed CBOR. We now match only the shared prefix.

txs-evaluate-utxos.ts

error Unknown transaction input (missing from UTxO set)

  • Old: static response object asserting a single jsonwsp/response with nested EvaluationFailure.ScriptFailures
  • New: customExpect function that handles two possible outcomes:
    • jsonwsp/response path: asserts exact error string including tx input hash via .toBe('Unknown transaction input (missing from UTxO set): 7d67...eb6b#0')
    • jsonwsp/fault path: asserts response.fault.string contains 'Required Signer Hashes'
  • Reason: Conway's fieldGuarded rejects the empty required_signers set before evaluation, returning a jsonwsp/fault. Ogmios decodes via Babbage and reaches evaluation, returning a jsonwsp/response. The test now accepts both paths depending on the platform's decoder.

Preprod (src/fixtures/preprod/utils/)

txs-evaluate.ts

Same change as preview txs-evaluate.ts.

txs-evaluate-utxos.ts

Same change as preview txs-evaluate-utxos.ts.

Copy link
Copy Markdown
Member

@michalrus michalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But won’t this break other places that blockfrost-tests are used in? 👀

@vladimirvolek
Copy link
Copy Markdown
Member

But won’t this break other places that blockfrost-tests are used in? 👀

https://github.com/blockfrost/blockfrost-tests-internal/actions/runs/24073289428

@ginnun ginnun force-pushed the tx-evaluation-rebased branch from 567e24a to b48c0c1 Compare April 7, 2026 13:41
@ginnun
Copy link
Copy Markdown
Contributor Author

ginnun commented Apr 7, 2026

Yes, it will break of course.
I am trying to mimic the existing behaviour of ogmios + our Blockfrost API.
There are cases that it's too much hack to mimic, so I am considering loosening the tests (like partially matching error strings) or accepting two different responses. I will update here once done with it. @vladimirvolek @michalrus

@ginnun ginnun marked this pull request as draft April 7, 2026 13:51
@ginnun ginnun force-pushed the tx-evaluation-rebased branch from b48c0c1 to b7b4253 Compare April 8, 2026 11:50
@ginnun ginnun self-assigned this Apr 10, 2026
@ginnun ginnun marked this pull request as ready for review April 10, 2026 16:41
@vladimirvolek vladimirvolek merged commit c1251d9 into main Apr 13, 2026
2 checks passed
@michalrus michalrus deleted the tx-evaluation-rebased branch April 13, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants