Skip to content

Add unit tests for the Stellar memo validator accepting only text memos within the 28-byte limit #751

Description

@Chucks1093

Summary

Stellar text memos are limited to 28 bytes. The memo validator used before transaction submission should reject memos that exceed the byte limit, are empty, or contain non-UTF-8 characters, and accept valid memos at the boundary.

Scope

  • Test a memo of exactly 28 ASCII characters passes validation
  • Test a memo of 29 ASCII characters fails with memo_too_long
  • Test a memo of 28 UTF-8 multi-byte characters that exceed 28 bytes fails with memo_too_long
  • Test an empty string memo fails with memo_empty
  • Test a valid short memo passes unchanged

Acceptance Criteria

  • 28-byte memo passes
  • 29-byte memo fails with memo_too_long
  • Multi-byte characters counted by byte length, not character count
  • Empty memo fails with memo_empty
  • Valid short memo passes unchanged

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions