Skip to content

Commit

Permalink
Fix length check text on manual payout tool
Browse files Browse the repository at this point in the history
  • Loading branch information
BtcContributor committed Feb 23, 2021
1 parent 314e6ce commit 6edb318
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
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
}

}

0 comments on commit 6edb318

Please sign in to comment.