Skip to content

test(metadata): cover desc order within a block for label txs - #142

Merged
vladimirvolek merged 1 commit into
mainfrom
feat/metadata-order
Nov 6, 2026
Merged

vladimirvolek merged 1 commit into
mainfrom
feat/metadata-order

Conversation

@michalrus

@michalrus michalrus commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Related:

Add Mainnet, Preprod, and Preview fixtures for:

  • /metadata/txs/labels/{label}
  • /metadata/txs/labels/{label}/cbor

Each one uses a label whose two newest txs are in the same block.

With order=desc, count=2 must list the later tx of the block first, and count=1&page=2 must return the earlier one. The existing fixtures never put a label on two txs of one block, so a server that reversed only the block order still passed them.

Add Mainnet, Preprod, and Preview fixtures for:
- `/metadata/txs/labels/{label}`
- `/metadata/txs/labels/{label}/cbor`

Each one uses a label whose two newest txs are in the same block.

With `order=desc`, `count=2` must list the later tx of the block first,
and `count=1&page=2` must return the earlier one. The existing fixtures
never put a label on two txs of one block, so a server that reversed
only the block order still passed them.
@michalrus
michalrus requested review from slowbackspace and vladimirvolek and a balanced review from Copilot November 6, 2026 12:21
@michalrus michalrus self-assigned this Nov 6, 2026
@michalrus michalrus added the enhancement New feature or request label Nov 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The regression depends on external chain data, with no independent repository evidence that each network’s selected hashes are the label’s two newest transactions sharing the stated block and transaction indices.

No open issues 🎉

What changed in this PR

Adds regression fixtures for descending transaction order within a single block across Mainnet, Preprod, and Preview. These cover a gap where reversing only block order could pass existing metadata tests.

Changes:

  • Adds 12 fixtures covering the JSON and CBOR label endpoints across all three networks.
  • Verifies that order=desc&count=2 returns the later transaction first.
  • Verifies that order=desc&count=1&page=2 returns the earlier transaction.
File Description
src/​fixtures/​preview/​metadata/​txs-labels-label.ts Adds Preview JSON ordering and pagination fixtures.
src/​fixtures/​preview/​metadata/​txs-labels-label-cbor.ts Adds Preview CBOR ordering and pagination fixtures.
src/​fixtures/​preprod/​metadata/​txs-labels-label.ts Adds Preprod JSON ordering and pagination fixtures.
src/​fixtures/​preprod/​metadata/​txs-labels-label-cbor.ts Adds Preprod CBOR ordering and pagination fixtures.
src/​fixtures/​mainnet/​metadata/​txs-labels-label.ts Adds Mainnet JSON ordering and pagination fixtures.
src/​fixtures/​mainnet/​metadata/​txs-labels-label-cbor.ts Adds Mainnet CBOR ordering and pagination fixtures.

Review effort: Balanced

@vladimirvolek
vladimirvolek merged commit f13dde7 into main Nov 6, 2026
3 checks passed
@michalrus
michalrus deleted the feat/metadata-order branch November 6, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants