Page MenuHomePhabricator

[chronik-client] Add support and tests for blocks method
AbandonedPublic

Authored by bytesofman on Jan 20 2024, 00:20.

Details

Reviewers
PiRK
Fabien
Group Reviewers
Restricted Project
Summary

Add support and unit tests for blocks() method

Depends on D15210

Test Plan

CI builds successfully, ref test plan in D14915 to test locally

Event Timeline

This revision is now accepted and ready to land.Jan 22 2024, 10:24
Fabien requested changes to this revision.Jan 22 2024, 10:48
Fabien added a subscriber: Fabien.

You're missing a test for end height > start height

modules/chronik-client/README.md
90

See related comment in D15210

modules/chronik-client/src/ChronikClientNode.ts
52

layout

modules/chronik-client/test/integration/block_and_blocks.ts
48

See related comment in D15210

118

Please check the height (and prevhash if possible) in a loop to make sure you're getting contiguous blocks and the expected range, this test would pass if given heights 200, 150 and 42.

131

See relevant comment from D15210

This revision now requires changes to proceed.Jan 22 2024, 10:48
bytesofman marked 5 inline comments as done.

Update tests, add test for bad startHeight/endHeight, test ordering of blocks

Failed tests logs:

====== /block and /blocks: "before each" hook for "gives us the block after parking the last block and throws expected error attempting to get parked block"./block and /blocks "before each" hook for "gives us the block after parking the last block and throws expected error attempting to get parked block" ======
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/work/modules/chronik-client/test/integration/block_and_blocks.ts)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

Each failure log is accessible here:
/block and /blocks: "before each" hook for "gives us the block after parking the last block and throws expected error attempting to get parked block"./block and /blocks "before each" hook for "gives us the block after parking the last block and throws expected error attempting to get parked block"

Fabien requested changes to this revision.Jan 23 2024, 08:26

This now conflicts with D15210

This revision now requires changes to proceed.Jan 23 2024, 08:26

the dep stack was messed up during a rebase, not able to reconstruct.

Will have it all in D15210