Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix length check text on manual payout tool #5223

Merged
merged 1 commit into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3624,6 +3624,7 @@ validation.inputTooSmall=Input has to be larger than {0}
validation.inputToBeAtLeast=Input has to be at least {0}
validation.amountBelowDust=An amount below the dust limit of {0} satoshi is not allowed.
validation.length=Length must be between {0} and {1}
validation.fixedLength=Length must be {0}
validation.pattern=Input must be of format: {0}
validation.noHexString=The input is not in HEX format.
validation.advancedCash.invalidFormat=Must be a valid email or wallet id of format: X000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ public ValidationResult validate(String input) {
ValidationResult result = new ValidationResult(true);
int length = (input == null) ? 0 : input.length();

if (this.minLength == this.maxLength) {
if (length != this.minLength)
result = new ValidationResult(false, Res.get("validation.fixedLength", this.minLength));
} else
if (length < this.minLength || length > this.maxLength)
result = new ValidationResult(false, Res.get("validation.length", this.minLength, this.maxLength));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@ public void validate() throws Exception {
assertFalse(validator2.validate(null).isValid); // too short
assertFalse(validator2.validate("123456789").isValid); // too long
}

}