Skip to content

test(sep24): fortify SEP-24 state machine with integration tests #25

Description

@enny791

Summary

The SEP-24 (Hosted Deposit and Withdrawal) flow involves a highly complex state machine. Transactions transition through various states (incomplete, pending_user_transfer_start, completed) based on external triggers and Horizon network events. Currently, our unit tests only cover isolated functions, leaving us vulnerable to integration bugs between the network listener and the database.

We must build a comprehensive end-to-end integration suite for SEP-24. This suite needs to mock Horizon network responses, simulate the interactive web flow, and assert that the database state mutates exactly as defined by the Stellar ecosystem specifications. Fee calculation edge-cases must also be rigorously asserted.

Acceptance Criteria

  • Write end-to-end tests covering the entire deposit and withdrawal lifecycle.
  • Mock the Stellar Horizon server to simulate incoming network payments.
  • Assert exact database state transitions at every step of the flow.
  • Ensure 100% test coverage on the fee calculation utility.

Tech Stack

TypeScript (Node.js 24), Jest, supertest.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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