HomePhabricator

[Cashtab] [pub key fetch from chronik p1] Get recipient public key from chronik…

Description

[Cashtab] [pub key fetch from chronik p1] Get recipient public key from chronik instead of bch-api

Summary:
T2730

This diff extracts the public key of the intended recipient of an encrypted cashtab message by using chronik instead of bch-api.

For review, this will be implemented as a stacked diff. In part 1, Cashtab is still getting the public key using bch-api and also with chronik, then comparing them.

In part 2 I will remove the bch-api call and the debug logging.

Unfortunately jest is not able to mock some of the more complex chronik calls, which required an optional param to be added to the sendXec function.

Test Plan:
Review unit test changes and npm test
npm start
Send a private msg to an address with outgoing txs. Confirm it succeeds. Confirm the pub key determined by chronik matches that determined by bch-api in the dev console.
Send a private msg to an address with no outgoing txs. Confirm the error msg '[chronik] Cannot send an encrypted message to a wallet with no outgoing transactions' appears.

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

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

Details

Provenance
bytesofmanAuthored on Oct 7 2022, 22:23
bytesofmanPushed on Oct 12 2022, 03:50
Reviewer
Restricted Project
Differential Revision
D12180: [Cashtab] [pub key fetch from chronik p1] Get recipient public key from chronik instead of bch-api
Parents
rABC570a423faa4a: [Cashtab] [Chronik] Airdrop block height retrieval
Branches
Unknown
Tags
Unknown