From be2a71b9b50198628355941f8d9046dcb0281f34 Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 23 May 2021 09:38:40 -0400 Subject: [PATCH] increase trade limits by factor of 10 popup warning displays effective trade limit --- core/src/main/java/bisq/core/offer/OfferRestrictions.java | 2 +- .../java/bisq/core/payment/payload/PaymentMethod.java | 8 ++++---- .../bisq/desktop/main/offer/MutableOfferViewModel.java | 6 +++++- .../java/bisq/desktop/util/validation/BtcValidator.java | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/bisq/core/offer/OfferRestrictions.java b/core/src/main/java/bisq/core/offer/OfferRestrictions.java index 85931a9f..0f157f5c 100644 --- a/core/src/main/java/bisq/core/offer/OfferRestrictions.java +++ b/core/src/main/java/bisq/core/offer/OfferRestrictions.java @@ -36,7 +36,7 @@ public class OfferRestrictions { return new Date().after(REQUIRE_UPDATE_DATE); } - public static Coin TOLERATED_SMALL_TRADE_AMOUNT = Coin.parseCoin("0.1"); + public static Coin TOLERATED_SMALL_TRADE_AMOUNT = Coin.parseCoin("1.0"); static boolean hasOfferMandatoryCapability(Offer offer, Capability mandatoryCapability) { Map extraDataMap = offer.getOfferPayload().getExtraDataMap(); diff --git a/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java b/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java index 61977327..83646761 100644 --- a/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java +++ b/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java @@ -60,10 +60,10 @@ public final class PaymentMethod implements PersistablePayload, Comparable ext } else if (amount.get() != null && btcValidator.getMaxTradeLimit() != null && btcValidator.getMaxTradeLimit().value == OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value) { amount.set(btcFormatter.formatCoin(btcValidator.getMaxTradeLimit())); new Popup().information(Res.get("popup.warning.tradeLimitDueAccountAgeRestriction.buyer", - btcFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT), + btcFormatter.formatCoinWithCode(getEffectiveLimit()), Res.get("offerbook.warning.newVersionAnnouncement"))) .width(900) .show(); @@ -746,6 +746,10 @@ public abstract class MutableOfferViewModel ext } } + private Coin getEffectiveLimit() { + return btcValidator.getMaxValue() == null ? btcValidator.getMaxTradeLimit() : btcValidator.getMaxValue(); + } + public void onFocusOutMinAmountTextField(boolean oldValue, boolean newValue) { if (oldValue && !newValue) { InputValidator.ValidationResult result = isBtcInputValid(minAmount.get()); diff --git a/desktop/src/main/java/bisq/desktop/util/validation/BtcValidator.java b/desktop/src/main/java/bisq/desktop/util/validation/BtcValidator.java index b204dbd0..5ac499d0 100644 --- a/desktop/src/main/java/bisq/desktop/util/validation/BtcValidator.java +++ b/desktop/src/main/java/bisq/desktop/util/validation/BtcValidator.java @@ -44,6 +44,7 @@ public class BtcValidator extends NumberValidator { @Nullable @Setter + @Getter protected Coin maxValue; @Nullable