HomePhabricator

[ecash-herald] Use saved mocks if available

Description

[ecash-herald] Use saved mocks if available

Summary:
Testing of ecash-herald is complicated by API calls used in the npm run generateMocks script. We aren't really interested in these changing API call results (e.g. the utxo set of tested addresses, crypto prices). Some API calls will never change so we shouldn't be making them all the time (blockDetails).

This diff checks blocks.js for saved mocks for a specific blockhash. If they exist, these saved mocks are used instead of live API calls. If they do not exist, live API calls are used.

Test Plan: npm run generateMocks true and blocks.js does not change

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

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

Details

Provenance
bytesofmanAuthored on Jul 7 2023, 17:35
bytesofmanPushed on Jul 10 2023, 16:21
Reviewer
Restricted Project
Differential Revision
D14230: [ecash-herald] Use saved mocks if available
Parents
rABC8bc99e8ea904: [electrum] update links in the documentation
Branches
Unknown
Tags
Unknown