[bisq-network/bisq] Misc dao improvements (#2556)
Manfred Karrer
notifications at github.com
Thu Mar 21 05:39:28 UTC 2019
ManfredKarrer 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;
Yes that is not correct. Was a bit too lazy... Basically there is no use case for setting one to 0 and the other not. But should handle it correclty... The whole validation code could need more love...
--
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#discussion_r267629835
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190320/e578ae83/attachment.html>
More information about the bisq-github
mailing list