[Chronik] Add /script/:type/:payload/confirmed-txs
Summary:
This endpoint returns all the confirmed txs of a script, in the order they appear in the blockchain.
This is useful if a wallet simply wants to download all the txs of the wallet. It can then store the last page it queried, and when re-syncing, it only needs to read pages from including after the current page.
While the original plan was to implement /script/:type/:payload/history directly, it is actually not a trivial implementation, so for simplicity, we start with this endpoint. It doesn't exist in the NNG Chronik version, but in discussions with Joey, it was clear that this is clearly a beneficial feature.
In the future, we might also add a ?after=<txid> feature (used instead of ?page=), to return txs starting after the given txid (in 'blockchain' order). This would allow wallets to query new txs by providing the last known txid.
Test Plan:
ninja check-crates && ninja && ./test/functional/test_runner.py chronik_script_confirmed_txs
You can also verify the txs capacity calculation by changing the log -> panic in group_history.rs, running the test plan again and it should work fine.
Reviewers: Fabien, #bitcoin_abc
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D13567