Page MenuHomePhabricator

[chronik] Add block_and_blocks to bitcoinsuite-chronik-client
Needs ReviewPublic

Authored by hazzarust on Sat, Feb 8, 19:59.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

Depends on D17595 - this diff uses features from D17595 such as the test_runner and handler.

Tests verify block and blocks range retrieval from the Chronik client. They check:

  • Block retrieval by height and hash.
  • Block order and consistency in ranges.
  • Error handling for invalid, parked, or invalidated blocks.

This ensures the Chronik client correctly handles block queries and edge cases.

Added detailed comments from TypeScript tests to Rust code, aligned test logic, and ensured error handling and block order validation.

Test Plan

Please set BUILD_DIR env to export BUILD_DIR="/path/to/build_dir
UNIX: ./contrib/teamcity/build-configurations.py build-bitcoinsuite-chronik-client
cd modules/bitcoinsuite-chronik-client && cargo test