Page MenuHomePhabricator

[ecash-coinselect] Add chronikMock
AbandonedPublic

Authored by emack on Aug 28 2023, 12:50.

Details

Reviewers
bytesofman
Fabien
Group Reviewers
Restricted Project
Summary

Adds a basic chronikMock to support mocking of script().utxos() API calls in D14417. This chronikMock has been stripped back to the bare essentials for script and utxo endpoints.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chronikMock
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24871
Build 49330: Build Diffecash-coinselect
Build 49329: arc lint + arc unit

Event Timeline

emack requested review of this revision.Aug 28 2023, 12:50

Note: the corresponding unit tests for this mock will be added to D14417 as that diff introduces chronik utxo api calls to the library. This mock is separated out into its own diff to minimize the size of D14417.

Since

  1. we are now using chronik mocks (that are all substantially identical to each other, plus or minus some features that are not used) across a number of apps in the monorepo
  2. Other mods to chronik-client higher priority than this unit testing support tool as part of that npm module

Let's get a bridge solution.

Please

  1. Create a mock-chronik-client directory in apps and populate it with the most extensive version of mocked chronik client we have (currently exists in alias-server, examples, and ecash-herald)
  2. Change the imports in existing repos to point to this new common monorepo mock-chronik-client
This revision now requires changes to proceed.Aug 28 2023, 23:30