📋 Description
lib/validation/percentages.ts exports validatePercentages (must sum to 100, non-negative) and validateStellarAddress (regex ^G[A-Z0-9]{55}$). There is an existing property test file at tests/property/validation-properties.test.ts and a test:property script, but coverage of these two functions' invariants and adversarial inputs is incomplete.
Why this matters: these validators sit on the money path (allocation gating, recipient acceptance). A weak charset/length check on the address regex can accept malformed keys; a float-tolerance bug on percentages can let a non-100 split through.
🎯 Requirements & Context
Functional requirements
Context & constraints
- Use the existing property-test harness style in the repo.
- This is test-only; if a real validation gap is found, document it in the PR rather than silently changing behavior.
🛠️ Suggested Execution
git checkout -b test/validation-property-suite
- Extend the property suite, add adversarial address cases, document regex-vs-checksum discrepancy.
npm run lint
npm run test:property
npm run test:coverage
- Edge cases: sum = 99.999/100.001 (tolerance), all-zero, negative, 56 chars but bad checksum (regex passes — flag it).
Example commit message
test(validation): property-based coverage for percentages + address
Extends the property suite with generated percentage tuples and
adversarial Stellar address inputs; documents regex-vs-checksum gap.
✅ Acceptance Criteria & Guidelines
| Requirement |
Target |
| Property cases for both validators |
Required |
| Adversarial address inputs covered |
Required |
| Validation coverage |
≥ 95% branches |
| Regex-vs-checksum discrepancy documented |
Required |
| Lint clean, property suite green |
Required |
| Timeframe |
96 hours from assignment |
💬 Community & Support
Join the RemitWise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment to claim before starting. 🚀
📋 Description
lib/validation/percentages.tsexportsvalidatePercentages(must sum to 100, non-negative) andvalidateStellarAddress(regex^G[A-Z0-9]{55}$). There is an existing property test file attests/property/validation-properties.test.tsand atest:propertyscript, but coverage of these two functions' invariants and adversarial inputs is incomplete.🎯 Requirements & Context
Functional requirements
tests/property/validation-properties.test.ts(run vianpm run test:property) with generated cases forvalidatePercentages: random 4-tuples, asserting it accepts iff sum≈100 and all non-negative.validateStellarAddress: wrong prefix, wrong length (55/57), lowercase, illegal characters, empty/non-string.StrKeychecksum used inRecipientAddressInput, and document the intended source of truth.Context & constraints
🛠️ Suggested Execution
Example commit message
✅ Acceptance Criteria & Guidelines
💬 Community & Support
Join the RemitWise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment to claim before starting. 🚀