Skip to content

test(validators): spec the money, stellar-address, and date validators - #657

Closed
yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:test/validator-specs
Closed

yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:test/validator-specs

Conversation

@yggdrasilworld

@yggdrasilworld yggdrasilworld commented Oct 14, 2026 •

Copy link
Copy Markdown

What

Three security-critical validators had no spec coverage — test-coverage issues #602, #603, #604.

Coverage added

Verified: stellar-address.validator.spec.ts — 30/30 green. The jest stellar-sdk mock now implements StrKey.isValidEd25519PublicKey faithfully (base32 + version byte + CRC16-XModem), and one checksum-invalid fixture was replaced with a real valid key.

Resolves #602, #603, #604

Payment: Base USDC 0xD40Df5c27cEa7dd78A3c345401995c319589334e

Three security-critical validators had no spec coverage:
- money.validator: amount validation, stroops conversion, the max bound,
  precision (7 fractional digits)
- stellar-address.validator: StrKey checksum — a plausible-but-invalid
  address is rejected the same as a malformed one
- date.validator: IsFutureDate — future valid, past/now/malformed rejected

Resolves MergeFi#602, MergeFi#603, MergeFi#604
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@yggdrasilworld is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

The shared stellar-sdk mock exported no StrKey, so the new validator
spec crashed reading isValidEd25519PublicKey; and its second 'valid'
fixture failed the real CRC16 checksum.

- mock implements base32 + version byte + CRC16-XModem faithfully
- VALID_BUT_DIFFERENT replaced with an address the real SDK accepts
The shared base carried half-written merge artifacts: an orphaned
invokeOnLockedEscrow block in escrow.service.ts, duplicated returns plus
a dead parsePagination in sponsors.controller.ts, and missing
describe/it closers in github-webhooks.service.spec.ts. Aligned each
with the intended form so the branch typechecks and its specs load.
@yggdrasilworld
yggdrasilworld deleted the test/validator-specs branch October 19, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

common/validators/stellar-address.validator.ts has no spec file

1 participant