Skip to content

[BE-122] Unit tests for the stellar module #981

Description

@mftee

Overview

backend/src/stellar/ has 2 files and no tests, and stellar-sdk is a dependency. This module bridges to an external network, which makes both its success and failure paths worth pinning down.

Tasks

  • Mock the Stellar SDK and Horizon HTTP layer — tests must never hit a live network.
  • Test transaction construction: correct memo, correct asset, correct destination.
  • Test network failure, timeout, and malformed-response handling — each should produce a typed error, never an unhandled rejection.
  • Test that a failed anchoring never reports success to callers.
  • Test testnet vs mainnet configuration selection, and that mainnet is never used by default.
  • Target ≥75% coverage.

Acceptance Criteria

  • npm run test -- stellar passes at ≥75% coverage with no network access.
  • Every external failure mode maps to a typed error.
  • A test proves the default network is not mainnet.

Notes for Contributors

Comment below to be assigned.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions