[bisq-network/bisq] Misc dao improvements (#2556)
Devin Bileck
notifications at github.com
Wed Mar 20 23:32:31 UTC 2019
devinbileck commented on this pull request.
> + *
+ * @param currentValue Current value
+ * @param newValue New value
+ * @param min Decrease of param value limited to current value / maxDecrease. If 0 we don't apply the check and any change is possible
+ * @param max Increase of param value limited to current value * maxIncrease. If 0 we don't apply the check and any change is possible
+ * @return Validation result
+ */
+ @VisibleForTesting
+ static Result getChangeValidationResult(double currentValue, double newValue, double min, double max) {
+ checkArgument(min >= 0, "Min must be >= 0");
+ checkArgument(max >= 0, "Max must be >= 0");
+ if (currentValue == newValue)
+ return Result.SAME;
+
+ if (max == 0)
+ return Result.OK;
Are you assuming that if max is zero, then so is min? If max is zero but min is non-zero (not sure if there is a use case for that) and the change is <1, then it wont validate min.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/2556#pullrequestreview-217031434
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190320/5d38490c/attachment.html>
More information about the bisq-github
mailing list