Repository navigation
Conversation
…validation suites - Implement deadline validation for correct format, u64 bounds, and future dates (closes Stellar-split#1064) - Add amount validation for range bounds, 7-decimal precision, and boundary conditions (closes Stellar-split#1063) - Implement Stellar address validation for accounts, contracts, and muxed keys with CRC16 checksums (closes Stellar-split#1062) - Add signature validation for Ed25519 authenticity, multi-signature thresholds, and webhook HMACs (closes Stellar-split#1061) - Add typed validation error subclasses and type guards in errors module - Add comprehensive test suites covering all validators and edge cases
|
@terngunan Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This branch has not been deployed
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 this fixes
G,C,M), CRC16-XModem checksums, and explicit rejection of secret keys (S...).What changed
src/validators/deadlineValidator.ts):validateDeadline,validateDeadlineOrThrow,isFutureDeadline, andparseDeadline.bigint,number,Date, and ISO-8601/numeric date strings.referenceTime,minLeadSeconds, andmaxFutureSeconds.DeadlineValidatorclass for reusable configurations.src/validators/amountValidator.ts):validateAmount,validateAmountOrThrow,isValidAmount, andparseToStroops.1nto9_223_372_036_854_775_807n/ INT64_MAX) and boundary tests.STELLAR_MAX_DECIMALS = 7) and rejected scientific notation.min,max,allowZero,allowNegative,maxDecimals,unit).AmountValidatorclass for reusable configurations.src/validators/addressValidator.ts):validateAddress,validateAddressOrThrow,isStellarAddress,detectAddressType, andverifyAddressChecksum.G/C, 69 forM) and RFC 4648 Base32 character set ([A-Z2-7]).StrKey.S...).AddressValidatorclass withallowedTypesfiltering.src/validators/signatureValidator.ts):validateEd25519Signature,validateEd25519SignatureOrThrow,validateMultiSig,validateMultiSigOrThrow, andvalidateWebhookSignature.G...or 32-byte buffers).SignatureValidatorclass and format normalization helpers.src/errors.ts,src/validators/index.ts,src/index.ts):DeadlineValidationError,AmountValidationError,AddressValidationError, andSignatureValidationError(all extendingValidationError).isDeadlineValidationError,isAmountValidationError,isAddressValidationError, andisSignatureValidationError.@stellar-split/sdkandsrc/validators/index.ts.Testing
test/deadlineValidator.test.ts: 26 tests (all passed)test/amountValidator.test.ts: 24 tests (all passed)test/addressValidator.test.ts: 19 tests (all passed)test/signatureValidator.test.ts: 25 tests (all passed)test/sdkExports.test.ts: 4 tests (all passed)npm testverifying 110 baseline tests pass with zero regressions.Issues
closes #1064
closes #1063
closes #1062
closes #1061