From c2f5adac9b2192454a45c037bdd2a42fd9981b39 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 26 Apr 2022 15:19:20 -0400 Subject: [PATCH] trigger price handled as string, same as price --- core/src/main/java/bisq/core/api/CoreApi.java | 4 ++-- .../java/bisq/core/api/CoreOffersService.java | 13 +++++++------ .../offer/placeoffer/tasks/ValidateOffer.java | 2 ++ .../src/main/java/bisq/core/util}/PriceUtil.java | 16 ++++++---------- .../core}/util/validation/AltcoinValidator.java | 2 +- .../util/validation/FiatPriceValidator.java | 2 +- .../core}/util/validation/MonetaryValidator.java | 3 +-- .../core}/util/validation/NumberValidator.java | 3 +-- .../notifications/MobileNotificationsView.java | 6 +++--- .../main/offer/MutableOfferViewModel.java | 9 ++++----- .../offer/createoffer/CreateOfferViewModel.java | 5 ++--- .../main/offer/offerbook/OfferBookViewModel.java | 2 +- .../closedtrades/ClosedTradesDataModel.java | 3 +-- .../duplicateoffer/DuplicateOfferViewModel.java | 5 ++--- .../portfolio/editoffer/EditOfferViewModel.java | 7 +++---- .../portfolio/openoffer/OpenOffersViewModel.java | 2 +- .../desktop/util/validation/BtcValidator.java | 2 +- .../util/validation/FiatVolumeValidator.java | 1 + .../validation/PercentageNumberValidator.java | 2 +- .../validation/SecurityDepositValidator.java | 2 +- .../createoffer/CreateOfferViewModelTest.java | 4 ++-- .../offer/offerbook/OfferBookViewModelTest.java | 3 +-- proto/src/main/proto/grpc.proto | 2 +- 23 files changed, 46 insertions(+), 54 deletions(-) rename {desktop/src/main/java/bisq/desktop/main => core/src/main/java/bisq/core/util}/PriceUtil.java (95%) rename {desktop/src/main/java/bisq/desktop => core/src/main/java/bisq/core}/util/validation/AltcoinValidator.java (96%) rename {desktop/src/main/java/bisq/desktop => core/src/main/java/bisq/core}/util/validation/FiatPriceValidator.java (96%) rename {desktop/src/main/java/bisq/desktop => core/src/main/java/bisq/core}/util/validation/MonetaryValidator.java (98%) rename {desktop/src/main/java/bisq/desktop => core/src/main/java/bisq/core}/util/validation/NumberValidator.java (95%) diff --git a/core/src/main/java/bisq/core/api/CoreApi.java b/core/src/main/java/bisq/core/api/CoreApi.java index c98d309e..5d77129f 100644 --- a/core/src/main/java/bisq/core/api/CoreApi.java +++ b/core/src/main/java/bisq/core/api/CoreApi.java @@ -432,7 +432,7 @@ public class CoreApi { long amountAsLong, long minAmountAsLong, double buyerSecurityDeposit, - long triggerPrice, + String triggerPriceAsString, String paymentAccountId, Consumer resultHandler, ErrorMessageHandler errorMessageHandler) { @@ -444,7 +444,7 @@ public class CoreApi { amountAsLong, minAmountAsLong, buyerSecurityDeposit, - triggerPrice, + triggerPriceAsString, paymentAccountId, resultHandler, errorMessageHandler); diff --git a/core/src/main/java/bisq/core/api/CoreOffersService.java b/core/src/main/java/bisq/core/api/CoreOffersService.java index acde4038..0aa87a46 100644 --- a/core/src/main/java/bisq/core/api/CoreOffersService.java +++ b/core/src/main/java/bisq/core/api/CoreOffersService.java @@ -30,7 +30,7 @@ import bisq.core.offer.OpenOffer; import bisq.core.offer.OpenOfferManager; import bisq.core.payment.PaymentAccount; import bisq.core.user.User; - +import bisq.core.util.PriceUtil; import bisq.common.crypto.KeyRing; import bisq.common.handlers.ErrorMessageHandler; import org.bitcoinj.core.Coin; @@ -176,7 +176,7 @@ class CoreOffersService { for (Offer offer : offers) { for (String keyImage : offer.getOfferPayload().getReserveTxKeyImages()) { if (!allKeyImages.add(keyImage)) { - log.warn("Key image {} belongs to another offer, removing offer {}", keyImage, offer.getId()); + log.warn("Key image {} belongs to another offer, removing offer {}", keyImage, offer.getId()); // TODO (woodser): this is list, not set, so not checking for duplicates unreservedOffers.add(offer); } } @@ -220,7 +220,7 @@ class CoreOffersService { long amountAsLong, long minAmountAsLong, double buyerSecurityDeposit, - long triggerPrice, + String triggerPriceAsString, String paymentAccountId, Consumer resultHandler, ErrorMessageHandler errorMessageHandler) { @@ -257,7 +257,7 @@ class CoreOffersService { //noinspection ConstantConditions placeOffer(offer, buyerSecurityDeposit, - triggerPrice, + triggerPriceAsString, useSavingsWallet, transaction -> resultHandler.accept(offer), errorMessageHandler); @@ -309,14 +309,15 @@ class CoreOffersService { private void placeOffer(Offer offer, double buyerSecurityDeposit, - long triggerPrice, + String triggerPriceAsString, boolean useSavingsWallet, Consumer resultHandler, ErrorMessageHandler errorMessageHandler) { + long triggerPriceAsLong = PriceUtil.getMarketPriceAsLong(triggerPriceAsString, offer.getCurrencyCode()); openOfferManager.placeOffer(offer, buyerSecurityDeposit, useSavingsWallet, - triggerPrice, + triggerPriceAsLong, resultHandler::accept, errorMessageHandler); } diff --git a/core/src/main/java/bisq/core/offer/placeoffer/tasks/ValidateOffer.java b/core/src/main/java/bisq/core/offer/placeoffer/tasks/ValidateOffer.java index 8e2f904d..678c9ddf 100644 --- a/core/src/main/java/bisq/core/offer/placeoffer/tasks/ValidateOffer.java +++ b/core/src/main/java/bisq/core/offer/placeoffer/tasks/ValidateOffer.java @@ -75,6 +75,8 @@ public class ValidateOffer extends Task { checkArgument(offer.getDate().getTime() > 0, "Date must not be 0. date=" + offer.getDate().toString()); + + System.out.println("OFFER PRICE: " + offer.getPrice()); checkNotNull(offer.getCurrencyCode(), "Currency is null"); checkNotNull(offer.getDirection(), "Direction is null"); diff --git a/desktop/src/main/java/bisq/desktop/main/PriceUtil.java b/core/src/main/java/bisq/core/util/PriceUtil.java similarity index 95% rename from desktop/src/main/java/bisq/desktop/main/PriceUtil.java rename to core/src/main/java/bisq/core/util/PriceUtil.java index c50fdd0c..b48c2fd6 100644 --- a/desktop/src/main/java/bisq/desktop/main/PriceUtil.java +++ b/core/src/main/java/bisq/core/util/PriceUtil.java @@ -15,11 +15,11 @@ * along with Haveno. If not, see . */ -package bisq.desktop.main; +package bisq.core.util; -import bisq.desktop.util.validation.AltcoinValidator; -import bisq.desktop.util.validation.FiatPriceValidator; -import bisq.desktop.util.validation.MonetaryValidator; +import bisq.core.util.validation.AltcoinValidator; +import bisq.core.util.validation.FiatPriceValidator; +import bisq.core.util.validation.MonetaryValidator; import bisq.core.locale.CurrencyUtil; import bisq.core.locale.Res; @@ -31,8 +31,6 @@ import bisq.core.provider.price.MarketPrice; import bisq.core.provider.price.PriceFeedService; import bisq.core.trade.statistics.TradeStatisticsManager; import bisq.core.user.Preferences; -import bisq.core.util.FormattingUtils; -import bisq.core.util.ParsingUtils; import bisq.core.util.validation.InputValidator; import bisq.common.util.MathUtils; @@ -41,14 +39,12 @@ import org.bitcoinj.utils.Fiat; import javax.inject.Inject; import javax.inject.Singleton; - +import lombok.extern.slf4j.Slf4j; import java.util.Optional; -import javax.annotation.Nullable; - -import static bisq.desktop.main.shared.ChatView.log; import static com.google.common.base.Preconditions.checkNotNull; +@Slf4j @Singleton public class PriceUtil { private final PriceFeedService priceFeedService; diff --git a/desktop/src/main/java/bisq/desktop/util/validation/AltcoinValidator.java b/core/src/main/java/bisq/core/util/validation/AltcoinValidator.java similarity index 96% rename from desktop/src/main/java/bisq/desktop/util/validation/AltcoinValidator.java rename to core/src/main/java/bisq/core/util/validation/AltcoinValidator.java index 6c173c82..890073f8 100644 --- a/desktop/src/main/java/bisq/desktop/util/validation/AltcoinValidator.java +++ b/core/src/main/java/bisq/core/util/validation/AltcoinValidator.java @@ -15,7 +15,7 @@ * along with Haveno. If not, see . */ -package bisq.desktop.util.validation; +package bisq.core.util.validation; import javax.inject.Inject; diff --git a/desktop/src/main/java/bisq/desktop/util/validation/FiatPriceValidator.java b/core/src/main/java/bisq/core/util/validation/FiatPriceValidator.java similarity index 96% rename from desktop/src/main/java/bisq/desktop/util/validation/FiatPriceValidator.java rename to core/src/main/java/bisq/core/util/validation/FiatPriceValidator.java index d75331d7..5986fae5 100644 --- a/desktop/src/main/java/bisq/desktop/util/validation/FiatPriceValidator.java +++ b/core/src/main/java/bisq/core/util/validation/FiatPriceValidator.java @@ -15,7 +15,7 @@ * along with Haveno. If not, see . */ -package bisq.desktop.util.validation; +package bisq.core.util.validation; import javax.inject.Inject; diff --git a/desktop/src/main/java/bisq/desktop/util/validation/MonetaryValidator.java b/core/src/main/java/bisq/core/util/validation/MonetaryValidator.java similarity index 98% rename from desktop/src/main/java/bisq/desktop/util/validation/MonetaryValidator.java rename to core/src/main/java/bisq/core/util/validation/MonetaryValidator.java index 468fa9d7..3513aa08 100644 --- a/desktop/src/main/java/bisq/desktop/util/validation/MonetaryValidator.java +++ b/core/src/main/java/bisq/core/util/validation/MonetaryValidator.java @@ -15,10 +15,9 @@ * along with Haveno. If not, see . */ -package bisq.desktop.util.validation; +package bisq.core.util.validation; import bisq.core.locale.Res; - import javax.inject.Inject; public abstract class MonetaryValidator extends NumberValidator { diff --git a/desktop/src/main/java/bisq/desktop/util/validation/NumberValidator.java b/core/src/main/java/bisq/core/util/validation/NumberValidator.java similarity index 95% rename from desktop/src/main/java/bisq/desktop/util/validation/NumberValidator.java rename to core/src/main/java/bisq/core/util/validation/NumberValidator.java index fe3a44f5..1afd94dc 100644 --- a/desktop/src/main/java/bisq/desktop/util/validation/NumberValidator.java +++ b/core/src/main/java/bisq/core/util/validation/NumberValidator.java @@ -15,11 +15,10 @@ * along with Haveno. If not, see . */ -package bisq.desktop.util.validation; +package bisq.core.util.validation; import bisq.core.locale.Res; import bisq.core.util.ParsingUtils; -import bisq.core.util.validation.InputValidator; /** * NumberValidator for validating basic number values. diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/notifications/MobileNotificationsView.java b/desktop/src/main/java/bisq/desktop/main/account/content/notifications/MobileNotificationsView.java index e8a86b55..595bd50a 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/notifications/MobileNotificationsView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/notifications/MobileNotificationsView.java @@ -21,13 +21,10 @@ import bisq.desktop.common.view.ActivatableView; import bisq.desktop.common.view.FxmlView; import bisq.desktop.components.InfoInputTextField; import bisq.desktop.components.InputTextField; -import bisq.desktop.main.PriceUtil; import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.util.FormBuilder; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; -import bisq.desktop.util.validation.AltcoinValidator; -import bisq.desktop.util.validation.FiatPriceValidator; import bisq.desktop.util.validation.PercentageNumberValidator; import bisq.core.locale.CurrencyUtil; @@ -48,6 +45,9 @@ import bisq.core.user.Preferences; import bisq.core.user.User; import bisq.core.util.FormattingUtils; import bisq.core.util.ParsingUtils; +import bisq.core.util.PriceUtil; +import bisq.core.util.validation.AltcoinValidator; +import bisq.core.util.validation.FiatPriceValidator; import bisq.core.util.validation.InputValidator; import bisq.common.UserThread; diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java index 026ed205..21b6409a 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java @@ -20,7 +20,6 @@ package bisq.desktop.main.offer; import bisq.desktop.Navigation; import bisq.desktop.common.model.ActivatableWithDataModel; import bisq.desktop.main.MainView; -import bisq.desktop.main.PriceUtil; import bisq.desktop.main.funds.FundsView; import bisq.desktop.main.funds.deposit.DepositView; import bisq.desktop.main.overlays.popups.Popup; @@ -28,11 +27,8 @@ import bisq.desktop.main.settings.SettingsView; import bisq.desktop.main.settings.preferences.PreferencesView; import bisq.desktop.util.DisplayUtils; import bisq.desktop.util.GUIUtil; -import bisq.desktop.util.validation.AltcoinValidator; import bisq.desktop.util.validation.BtcValidator; -import bisq.desktop.util.validation.FiatPriceValidator; import bisq.desktop.util.validation.FiatVolumeValidator; -import bisq.desktop.util.validation.MonetaryValidator; import bisq.desktop.util.validation.SecurityDepositValidator; import bisq.core.account.witness.AccountAgeWitnessService; @@ -55,11 +51,14 @@ import bisq.core.provider.price.PriceFeedService; import bisq.core.user.Preferences; import bisq.core.util.FormattingUtils; import bisq.core.util.ParsingUtils; +import bisq.core.util.PriceUtil; import bisq.core.util.VolumeUtil; import bisq.core.util.coin.CoinFormatter; import bisq.core.util.coin.CoinUtil; +import bisq.core.util.validation.AltcoinValidator; +import bisq.core.util.validation.FiatPriceValidator; import bisq.core.util.validation.InputValidator; - +import bisq.core.util.validation.MonetaryValidator; import bisq.common.Timer; import bisq.common.UserThread; import bisq.common.app.DevEnv; diff --git a/desktop/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java index 90bd3b67..9628d9b1 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java @@ -20,9 +20,7 @@ package bisq.desktop.main.offer.createoffer; import bisq.desktop.Navigation; import bisq.desktop.common.model.ViewModel; import bisq.desktop.main.offer.MutableOfferViewModel; -import bisq.desktop.util.validation.AltcoinValidator; import bisq.desktop.util.validation.BtcValidator; -import bisq.desktop.util.validation.FiatPriceValidator; import bisq.desktop.util.validation.FiatVolumeValidator; import bisq.desktop.util.validation.SecurityDepositValidator; @@ -32,7 +30,8 @@ import bisq.core.provider.price.PriceFeedService; import bisq.core.user.Preferences; import bisq.core.util.FormattingUtils; import bisq.core.util.coin.CoinFormatter; - +import bisq.core.util.validation.AltcoinValidator; +import bisq.core.util.validation.FiatPriceValidator; import com.google.inject.Inject; import javax.inject.Named; diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java index 4c209237..1fcdcb03 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java @@ -20,7 +20,6 @@ package bisq.desktop.main.offer.offerbook; import bisq.desktop.Navigation; import bisq.desktop.common.model.ActivatableViewModel; import bisq.desktop.main.MainView; -import bisq.desktop.main.PriceUtil; import bisq.desktop.main.settings.SettingsView; import bisq.desktop.main.settings.preferences.PreferencesView; import bisq.desktop.util.DisplayUtils; @@ -50,6 +49,7 @@ import bisq.core.trade.closed.ClosedTradableManager; import bisq.core.user.Preferences; import bisq.core.user.User; import bisq.core.util.FormattingUtils; +import bisq.core.util.PriceUtil; import bisq.core.util.coin.CoinFormatter; import bisq.network.p2p.NodeAddress; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesDataModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesDataModel.java index 8d2cd131..6e11e898 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesDataModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesDataModel.java @@ -18,8 +18,6 @@ package bisq.desktop.main.portfolio.closedtrades; import bisq.desktop.common.model.ActivatableDataModel; -import bisq.desktop.main.PriceUtil; - import bisq.core.monetary.Price; import bisq.core.monetary.Volume; import bisq.core.offer.Offer; @@ -32,6 +30,7 @@ import bisq.core.trade.Trade; import bisq.core.trade.closed.ClosedTradableManager; import bisq.core.trade.statistics.TradeStatisticsManager; import bisq.core.user.Preferences; +import bisq.core.util.PriceUtil; import bisq.core.util.VolumeUtil; import bisq.common.util.Tuple2; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/duplicateoffer/DuplicateOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/duplicateoffer/DuplicateOfferViewModel.java index b827aa24..bbbe5cf7 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/duplicateoffer/DuplicateOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/duplicateoffer/DuplicateOfferViewModel.java @@ -19,9 +19,7 @@ package bisq.desktop.main.portfolio.duplicateoffer; import bisq.desktop.Navigation; import bisq.desktop.main.offer.MutableOfferViewModel; -import bisq.desktop.util.validation.AltcoinValidator; import bisq.desktop.util.validation.BtcValidator; -import bisq.desktop.util.validation.FiatPriceValidator; import bisq.desktop.util.validation.FiatVolumeValidator; import bisq.desktop.util.validation.SecurityDepositValidator; @@ -33,7 +31,8 @@ import bisq.core.provider.price.PriceFeedService; import bisq.core.user.Preferences; import bisq.core.util.FormattingUtils; import bisq.core.util.coin.CoinFormatter; - +import bisq.core.util.validation.AltcoinValidator; +import bisq.core.util.validation.FiatPriceValidator; import com.google.inject.Inject; import javax.inject.Named; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferViewModel.java index e0229338..da0f6c8a 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferViewModel.java @@ -18,11 +18,8 @@ package bisq.desktop.main.portfolio.editoffer; import bisq.desktop.Navigation; -import bisq.desktop.main.PriceUtil; import bisq.desktop.main.offer.MutableOfferViewModel; -import bisq.desktop.util.validation.AltcoinValidator; import bisq.desktop.util.validation.BtcValidator; -import bisq.desktop.util.validation.FiatPriceValidator; import bisq.desktop.util.validation.FiatVolumeValidator; import bisq.desktop.util.validation.SecurityDepositValidator; @@ -32,8 +29,10 @@ import bisq.core.offer.OpenOffer; import bisq.core.provider.price.PriceFeedService; import bisq.core.user.Preferences; import bisq.core.util.FormattingUtils; +import bisq.core.util.PriceUtil; import bisq.core.util.coin.CoinFormatter; - +import bisq.core.util.validation.AltcoinValidator; +import bisq.core.util.validation.FiatPriceValidator; import bisq.common.handlers.ErrorMessageHandler; import bisq.common.handlers.ResultHandler; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersViewModel.java b/desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersViewModel.java index 5230541d..b76dd97b 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersViewModel.java @@ -19,7 +19,6 @@ package bisq.desktop.main.portfolio.openoffer; import bisq.desktop.common.model.ActivatableWithDataModel; import bisq.desktop.common.model.ViewModel; -import bisq.desktop.main.PriceUtil; import bisq.desktop.util.DisplayUtils; import bisq.desktop.util.GUIUtil; @@ -29,6 +28,7 @@ import bisq.core.monetary.Price; import bisq.core.offer.Offer; import bisq.core.offer.OpenOffer; import bisq.core.util.FormattingUtils; +import bisq.core.util.PriceUtil; import bisq.core.util.coin.CoinFormatter; import bisq.network.p2p.P2PService; 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 185adbdc..a73c7282 100644 --- a/desktop/src/main/java/bisq/desktop/util/validation/BtcValidator.java +++ b/desktop/src/main/java/bisq/desktop/util/validation/BtcValidator.java @@ -21,7 +21,7 @@ import bisq.core.btc.wallet.Restrictions; import bisq.core.locale.Res; import bisq.core.util.FormattingUtils; import bisq.core.util.coin.CoinFormatter; - +import bisq.core.util.validation.NumberValidator; import org.bitcoinj.core.Coin; import javax.inject.Inject; diff --git a/desktop/src/main/java/bisq/desktop/util/validation/FiatVolumeValidator.java b/desktop/src/main/java/bisq/desktop/util/validation/FiatVolumeValidator.java index 496cc800..35be39dd 100644 --- a/desktop/src/main/java/bisq/desktop/util/validation/FiatVolumeValidator.java +++ b/desktop/src/main/java/bisq/desktop/util/validation/FiatVolumeValidator.java @@ -17,6 +17,7 @@ package bisq.desktop.util.validation; +import bisq.core.util.validation.MonetaryValidator; import javax.inject.Inject; public class FiatVolumeValidator extends MonetaryValidator { diff --git a/desktop/src/main/java/bisq/desktop/util/validation/PercentageNumberValidator.java b/desktop/src/main/java/bisq/desktop/util/validation/PercentageNumberValidator.java index c7cea785..56f789fb 100644 --- a/desktop/src/main/java/bisq/desktop/util/validation/PercentageNumberValidator.java +++ b/desktop/src/main/java/bisq/desktop/util/validation/PercentageNumberValidator.java @@ -18,7 +18,7 @@ package bisq.desktop.util.validation; import bisq.core.locale.Res; - +import bisq.core.util.validation.NumberValidator; import lombok.Setter; import javax.annotation.Nullable; diff --git a/desktop/src/main/java/bisq/desktop/util/validation/SecurityDepositValidator.java b/desktop/src/main/java/bisq/desktop/util/validation/SecurityDepositValidator.java index 88e27fb7..c31ac130 100644 --- a/desktop/src/main/java/bisq/desktop/util/validation/SecurityDepositValidator.java +++ b/desktop/src/main/java/bisq/desktop/util/validation/SecurityDepositValidator.java @@ -22,7 +22,7 @@ import bisq.core.locale.Res; import bisq.core.payment.PaymentAccount; import bisq.core.util.FormattingUtils; import bisq.core.util.ParsingUtils; - +import bisq.core.util.validation.NumberValidator; import javax.inject.Inject; public class SecurityDepositValidator extends NumberValidator { diff --git a/desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java b/desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java index 860056ec..776131fb 100644 --- a/desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java +++ b/desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java @@ -17,9 +17,7 @@ package bisq.desktop.main.offer.createoffer; -import bisq.desktop.util.validation.AltcoinValidator; import bisq.desktop.util.validation.BtcValidator; -import bisq.desktop.util.validation.FiatPriceValidator; import bisq.desktop.util.validation.SecurityDepositValidator; import bisq.core.account.witness.AccountAgeWitnessService; @@ -42,6 +40,8 @@ import bisq.core.user.Preferences; import bisq.core.user.User; import bisq.core.util.coin.CoinFormatter; import bisq.core.util.coin.ImmutableCoinFormatter; +import bisq.core.util.validation.AltcoinValidator; +import bisq.core.util.validation.FiatPriceValidator; import bisq.core.util.validation.InputValidator; import bisq.common.config.Config; diff --git a/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java b/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java index b5fb22bc..0c6e9f11 100644 --- a/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java +++ b/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java @@ -17,8 +17,6 @@ package bisq.desktop.main.offer.offerbook; -import bisq.desktop.main.PriceUtil; - import bisq.core.locale.Country; import bisq.core.locale.CryptoCurrency; import bisq.core.locale.FiatCurrency; @@ -44,6 +42,7 @@ import bisq.core.payment.payload.SpecificBanksAccountPayload; import bisq.core.provider.price.MarketPrice; import bisq.core.provider.price.PriceFeedService; import bisq.core.trade.statistics.TradeStatisticsManager; +import bisq.core.util.PriceUtil; import bisq.core.util.coin.CoinFormatter; import bisq.core.util.coin.ImmutableCoinFormatter; diff --git a/proto/src/main/proto/grpc.proto b/proto/src/main/proto/grpc.proto index dd7aa806..5199fe6f 100644 --- a/proto/src/main/proto/grpc.proto +++ b/proto/src/main/proto/grpc.proto @@ -486,7 +486,7 @@ message CreateOfferRequest { uint64 amount = 6 [jstype = JS_STRING]; uint64 min_amount = 7 [jstype = JS_STRING]; double buyer_security_deposit = 8; - uint64 trigger_price = 9 [jstype = JS_STRING]; + string trigger_price = 9; string payment_account_id = 10; }