Skip to content

Add tests for GET /block/:hash/txid/:index - #190

Closed
agoodminute wants to merge 2 commits into
Blockstream:new-indexfrom
agoodminute:improve-rest-tests
Closed

agoodminute wants to merge 2 commits into
Blockstream:new-indexfrom
agoodminute:improve-rest-tests

Conversation

@agoodminute

Copy link
Copy Markdown
Collaborator

New tests cover error handling for GET /block/:hash/txs/:start_index

  • Returns 400 when block hash format is invalid
  • Returns 404 when hash is valid but block does not exist

Why this was added:

  • To lock in correct API semantics (400 for bad input, 404 for missing resource)
  • To ensure missing blocks are not incorrectly returned as 400

@philippem

Copy link
Copy Markdown
Collaborator

Test failures are expected. Please add a fix to the underlying REST method as a second commit (then the tests will pass).

@agoodminute agoodminute closed this Mar 9, 2026
@agoodminute
agoodminute deleted the improve-rest-tests branch March 9, 2026 13:30
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