Repository navigation
Conversation
…ting Refract-Protocol#572: stellar-address.pipe.ts passed the raw @PARAM() value straight to the length/StrKey checks, so a value with leading/trailing whitespace (e.g. from a copy-paste) failed length validation even though the address itself was valid. Trim before validating; StrKey.isValidEd25519PublicKey already rejects any remaining internal whitespace on its own, since space is not part of the base32 charset it decodes, so no separate internal-whitespace check was needed. The error messages already name the field ("address"). Closes Refract-Protocol#572 Refract-Protocol#573, Refract-Protocol#571, Refract-Protocol#570 are not changed in this commit: investigated each against the real current code and found the described bug does not exist. Refract-Protocol#573: src/common/pagination.ts and list-claims.dto.ts use keyset-cursor pagination with a 1-based `page` field already validated by `@Min(1)` - there is no `Math.floor(offset / limit)` page computation anywhere in the codebase (grepped for it). ListClaimsDto itself has no callers. Refract-Protocol#571: coverage-limits.validator.ts already rejects a coverageAmount of 0 (and any negative value) via its existing `coverageAmount < limits.minCoverageAmount` check, since minCoverageAmount is hardcoded to 100 for every coverage type - 0 can never satisfy `>= 100`. Same for durationDays against minDurationDays=1. Refract-Protocol#570: both real fixed-decimal parsers in this codebase (src/common/fixed-point.ts's parseFixed and src/oracle/oracle-encoding.ts's parseFixedDecimal) use the regex `/^-?\d+(\.\d+)?$/`, which already requires at least one digit before any decimal point - "." and "-.5" already throw today. Note this regex also currently rejects a bare trailing-dot input like "5." (no digits after the dot), which the issue explicitly says must keep working; no test pins this down for either parser (no test file exists for fixed-point.ts), so I did not touch it rather than guess at an untested edge case while the issue's core premise (lone "." silently becoming 0) does not reproduce.
|
@thelux134 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 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.
#572: stellar-address.pipe.ts passed the raw @PARAM() value straight to the length/StrKey checks, so a value with leading/trailing whitespace (e.g. from a copy-paste) failed length validation even though the address itself was valid. Trim before validating; StrKey.isValidEd25519PublicKey already rejects any remaining internal whitespace on its own, since space is not part of the base32 charset it decodes, so no separate internal-whitespace check was needed. The error messages already name the field ("address"). Closes #572
#573, #571, #570 are not changed in this commit: investigated each against the real current code and found the described bug does not exist.
#573: src/common/pagination.ts and list-claims.dto.ts use keyset-cursor pagination with a 1-based
pagefield already validated by@Min(1)- there is noMath.floor(offset / limit)page computation anywhere in the codebase (grepped for it). ListClaimsDto itself has no callers.#571: coverage-limits.validator.ts already rejects a coverageAmount of 0 (and any negative value) via its existing
coverageAmount < limits.minCoverageAmountcheck, since minCoverageAmount is hardcoded to 100 for every coverage type - 0 can never satisfy>= 100. Same for durationDays against minDurationDays=1.#570: both real fixed-decimal parsers in this codebase (src/common/fixed-point.ts's parseFixed and
src/oracle/oracle-encoding.ts's parseFixedDecimal) use the regex
/^-?\d+(\.\d+)?$/, which already requires at least one digit before any decimal point - "." and "-.5" already throw today. Note this regex also currently rejects a bare trailing-dot input like "5." (no digits after the dot), which the issue explicitly says must keep working; no test pins this down for either parser (no test file exists for fixed-point.ts), so I did not touch it rather than guess at an untested edge case while the issue's core premise (lone "." silently becoming 0) does not reproduce.Summary