Skip to content

Add mock/stub for Stellar RPC client #241

Description

@AbelOsaretin

What

No reusable mock exists for the Stellar RPC client. Each test file would need to create its own mocks.

Why

A shared mock ensures consistent behavior across tests and reduces boilerplate.

Scope

  • Create a mock Stellar RPC server class
  • Implement getAccount, sendTransaction, getTransaction, simulateTransaction, prepareTransaction
  • Support configurable responses and errors
  • Export for use in all test files

Acceptance Criteria

  • Mock class: MockRpcServer or similar
  • Methods return configurable responses
  • Methods throw configurable errors
  • Easy to set up per-test scenarios

Technical Context

  • src/lib/stellar.ts:15-18rpcServer singleton
  • Methods used: getAccount, sendTransaction, getTransaction, simulateTransaction, prepareTransaction
  • Could use jest.mock() or a manual mock class

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programmediumFunctionality impaired but workaround exists, edge case, partial feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions