HomePhabricator

[herald] Simplify price api to add specific urls to mocks

Description

[herald] Simplify price api to add specific urls to mocks

Summary:
Price API is designed to support any possible crypto. Cool feature that we never use.

I'm looking to add another API request to handleBlockConnected to show peerName for avalanche staking rewards. However, all the unit tests have been lazily designed with just a single mock axios that does not specify a URL.

In order to specify the URL, need to have a simple way of getting it from config, so that if we do change the config and list of currencies, we don't need to change this hardcoded mock everywhere.

So, simplify to the point of making the URL extraction a one-liner. Then update the axios mocks to reference this URL.

Test Plan: npm test

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
bytesofmanAuthored on Nov 22 2023, 02:27
bytesofmanPushed on Nov 23 2023, 11:35
Reviewer
Restricted Project
Differential Revision
D14835: [herald] Simplify price api to add specific urls to mocks
Parents
rABCffb653302c0b: [chronik-client] Implement keepAlive to preserve longlived connections
Branches
Unknown
Tags
Unknown