mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Fix length check text on manual payout tool
This commit is contained in:
parent
314e6ce314
commit
6edb318236
@ -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
|
||||
|
@ -21,6 +21,10 @@ public class LengthValidator extends InputValidator {
|
||||
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));
|
||||
|
||||
|
@ -69,5 +69,4 @@ public class LengthValidatorTest {
|
||||
assertFalse(validator2.validate(null).isValid); // too short
|
||||
assertFalse(validator2.validate("123456789").isValid); // too long
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user