HomePhabricator

[Cashtab] Mock getPubKey for unit tests

Description

[Cashtab] Mock getPubKey for unit tests

Summary: Unit tests that called BCH.encryption.getPubKey(address) were actually performing an API call. This call has been mocked in key unit tests. Unit tests that were testing address validation for this endpoint have been removed, as mocking the error messages and comparing such mocks to an error message is not useful.

Test Plan:

  1. On the master branch, run npm test. Push a to run all the tests. When they are complete, push a again to run them again. You should see all tests succeed on the first pass, then fail on the second or third pass.
  2. Checkout this diff. Do the same test. Note that they continue to pass without too many requests error, as requests have been removed.

Reviewers: emack, #bitcoin_abc

Reviewed By: emack, #bitcoin_abc

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

Details

Provenance
Joey King <joseph.roy.king@gmail.com>Authored on Feb 7 2022, 21:33
bytesofmanPushed on Feb 8 2022, 13:48
Reviewer
Restricted Project
Differential Revision
D11008: [Cashtab] Mock getPubKey for unit tests
Parents
rABCb602a1a79807: style: rename hSocket to sock
Branches
Unknown
Tags
Unknown

Event Timeline