Skip to content

Add comprehensive unit tests for Stellar memo format validation utility #449

Description

@Cjay-Cyber-2

Description

Add dedicated unit tests for the shared Stellar memo format validation utility to ensure memos adhere strictly to the MP:<code> structure required by the settlement engine.

Context & Requirements

Stellar transactions rely on standardized memos to link on-chain payments to specific expenses (MP:<code>). While validation functions exist, test coverage for edge cases (such as missing prefixes, invalid code lengths, or unexpected characters) needs reinforcement.

Acceptance Criteria

  • Add a test file src/utils/__tests__/memo.test.ts (or equivalent test directory).
  • Test valid memos (MP:AB123) and invalid memos (empty string, missing MP: prefix, lowercase letters, special characters).
  • Ensure 100% pass rate when running Vitest.

Implementation Guidance

  • Likely files to touch: src/utils/ (locate existing memo helper), new test file.
  • Use Vitest assertions matching the project's testing setup.

Testing & Validation

  • Execute npm test and verify that the new memo validation test suite runs and passes cleanly.

Submission Guidelines

  • Open a Pull Request referencing Closes #<issue-number>.
  • Adhere to TypeScript strict rules and existing codebase formatting standards.

Wave complexity: Trivial

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions