Repository navigation
test(validators): spec the money, stellar-address, and date validators - #657
Closed
yggdrasilworld wants to merge 3 commits into
Closed
yggdrasilworld wants to merge 3 commits into
yggdrasilworld wants to merge 3 commits into
Conversation
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
|
@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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three security-critical validators had no spec coverage — test-coverage issues #602, #603, #604.
Coverage added
money.validator— amount-format validation (≤7 frac-digits, ≤ max), stroops conversion round-trip, the max-bound, precision rejectionstellar-address.validator— the StrKey checksum: valid keys accept, plausible-but-checksum-invalid + malformed reject (the No Stellar public-key format or checksum validation exists anywhere in the DTOs — malformed funder/recipient addresses fall through toScVal's heuristic instead of being rejected at the API boundary #60 behavior)date.validator—@IsFutureDate: future accepts, past/now/malformed/non-string rejectVerified:
stellar-address.validator.spec.ts— 30/30 green. The jeststellar-sdkmock now implementsStrKey.isValidEd25519PublicKeyfaithfully (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