Skip to content

Mock Stellar RPC for VaultModule unit tests #18

Description

@Code-Paragon

Problem

The VaultModule is currently untested. To prevent tests from attempting real testnet network requests, the Stellar RPC must be mocked to test deposit and withdraw logic safely.

Expected behavior

A new test file verifies that VaultModule.deposit properly formats stroop conversion, builds the transaction, and returns a mock transaction hash using Jest mocks on rpc.Server.

Files to update

  • tests/vault.test.ts (update/expand)

Project relevance

Allows developers to confidently refactor the core financial logic of the SDK without worrying about network latency or live testnet token balances during testing.

Acceptance criteria

  • Feature works as described
  • Tests are added or updated where needed
  • Documentation is updated where needed
  • client.rpcServer.sendTransaction is successfully mocked to return a static { hash: "mock_hash" } payload
  • No TypeScript, lint, test, or build errors

Metadata

Metadata

Assignees

No one assigned

    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