HomePhabricator

[alias-server] Add function to get only unprocessed txs from chronik tx history

Description

[alias-server] Add function to get only unprocessed txs from chronik tx history

Summary:
T2966

Depends on D13329

Add new getUnprocessedTxHistory function using previously introduced processedBlockheight and processedTxCount parameters.

Most of the time, getting the most recent page of chronik tx history will be enough. However there is a complicated edge case when more than 25 txs need to be fetched.

Test Plan:
node index.js, register new aliases and send non alias txs to alias registration address, see that unprocessed txs are picked up when the next block is found and logged

Review new unit tests and npm test
Change config.txHistoryPageSize to some value > 11 and npm test again. Tests still pass.
(Note that 2 unit tests are hardcoded to not require additional pages of data based on available mocks data of 11 unconfirmed and then confirmed txs).

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Differential Revision: https://reviews.bitcoinabc.org/D13333

Details

Provenance
bytesofmanAuthored on Mar 14 2023, 14:28
bytesofmanPushed on Mar 16 2023, 03:42
Reviewer
Restricted Project
Differential Revision
D13333: [alias-server] Add function to get only unprocessed txs from chronik tx history
Parents
rABC6f42bd9c87c9: [alias-server] get count of txs that server has processed
Branches
Unknown
Tags
Unknown