Skip to content

Create a mock of the BtcIndexerRpc #151

@Rcc999

Description

@Rcc999

packages/btcindexer is a Typescript Cloudflare worker in the workers monorepo. It exposes Cloudflare worker RPC BtcIndexerRpc class exported in the index.ts.

We want to have a mocked version of that class - create a stateless in-memory mock of the BtcIndexerRpc, to run enable easy local development without relaying on all external services that the btcindexer is using.
Maybe we can use Typescript mixins, to have a common base class for the mock and mock tests?

Ideally, we have it in the same worker, and have a runtime argument (eg bun run dev --mock) to select the RPC class to use.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions