HomePhabricator

[herald] Add price info to sent tg msgs

Description

[herald] Add price info to sent tg msgs

Summary:
T2972

Depends on D13642

Add price info to messages sent by ecash-herald

A slight refactor was required to the getCoingeckoPrices function. We need coingecko's exact API response for unit test mocks. So, I return it.

Another option would be to separate getCoingeckoPrices into two functions. This was considered but dismissed as it is useful to get all the info from using your config.priceApi param.

Test Plan:
npm test
npm run sendTestTgMsgs and msgs are sent by test bot with properly formatted price info

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
bytesofmanAuthored on Apr 8 2023, 17:51
bytesofmanPushed on Apr 12 2023, 14:26
Reviewer
Restricted Project
Differential Revision
D13643: [herald] Add price info to sent tg msgs
Parents
rABC5e3c04ec7238: [herald] New formatPrice function to prep prices for tg msgs
Branches
Unknown
Tags
Unknown