From 497158ad13082467a3a3a8145775a45360818af4 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Thu, 7 Apr 2022 21:13:24 +0200 Subject: [PATCH] Fix rebase errors with master --- .../bisq/core/payment/PaymentAccountUtil.java | 61 +++++++++---------- .../offerbook/BsqOfferBookViewModel.java | 7 ++- .../offerbook/BtcOfferBookViewModel.java | 4 +- .../offerbook/OtherOfferBookViewModel.java | 4 +- .../TopAltcoinOfferBookViewModel.java | 4 +- .../offerbook/OfferBookViewModelTest.java | 22 +++---- 6 files changed, 55 insertions(+), 47 deletions(-) diff --git a/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java b/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java index 0d6456a08d..363aea0a0b 100644 --- a/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java +++ b/core/src/main/java/bisq/core/payment/PaymentAccountUtil.java @@ -19,7 +19,6 @@ package bisq.core.payment; import bisq.core.account.witness.AccountAgeWitnessService; import bisq.core.locale.Country; -import bisq.core.locale.CurrencyUtil; import bisq.core.locale.TradeCurrency; import bisq.core.offer.Offer; import bisq.core.payment.payload.PaymentAccountPayload; @@ -141,54 +140,54 @@ public class PaymentAccountUtil { case STRIKE_ID: return getAllStrikeCurrencies(); case TIKKIE_ID: - return CurrencyUtil.getAllTikkieIdCurrencies(); + return getAllTikkieIdCurrencies(); case ALI_PAY_ID: - return CurrencyUtil.getAllAliPayAccountCurrencies(); + return getAllAliPayAccountCurrencies(); case NEQUI_ID: - return CurrencyUtil.getAllNequiCurrencies(); + return getAllNequiCurrencies(); case IMPS_ID: case NEFT_ID: case PAYTM_ID: case RTGS_ID: case UPI_ID: - return CurrencyUtil.getAllIfscBankCurrencies(); + return getAllIfscBankCurrencies(); case BIZUM_ID: - return CurrencyUtil.getAllBizumCurrencies(); + return getAllBizumCurrencies(); case MONEY_BEAM_ID: - return CurrencyUtil.getAllMoneyBeamCurrencies(); + return getAllMoneyBeamCurrencies(); case PIX_ID: - return CurrencyUtil.getAllPixCurrencies(); + return getAllPixCurrencies(); case SATISPAY_ID: - return CurrencyUtil.getAllSatispayCurrencies(); + return getAllSatispayCurrencies(); case CHASE_QUICK_PAY_ID: - return CurrencyUtil.getAllChaseQuickPayCurrencies(); + return getAllChaseQuickPayCurrencies(); case US_POSTAL_MONEY_ORDER_ID: - return CurrencyUtil.getAllUSPostalMoneyOrderCurrencies(); + return getAllUSPostalMoneyOrderCurrencies(); case VENMO_ID: - return CurrencyUtil.getAllVenmoCurrencies(); + return getAllVenmoCurrencies(); case JAPAN_BANK_ID: - return CurrencyUtil.getAllJapanBankCurrencies(); + return getAllJapanBankCurrencies(); case WECHAT_PAY_ID: - return CurrencyUtil.getAllWeChatPayCurrencies(); + return getAllWeChatPayCurrencies(); case CLEAR_X_CHANGE_ID: - return CurrencyUtil.getAllClearXchangeCurrencies(); + return getAllClearXchangeCurrencies(); case AUSTRALIA_PAYID_ID: - return CurrencyUtil.getAllAustraliaPayidCurrencies(); + return getAllAustraliaPayidCurrencies(); case PERFECT_MONEY_ID: - return CurrencyUtil.getAllPerfectMoneyCurrencies(); + return getAllPerfectMoneyCurrencies(); case HAL_CASH_ID: - return CurrencyUtil.getAllHalCashCurrencies(); + return getAllHalCashCurrencies(); case SWISH_ID: - return CurrencyUtil.getAllSwishCurrencies(); + return getAllSwishCurrencies(); case CASH_APP_ID: - return CurrencyUtil.getAllCashAppCurrencies(); + return getAllCashAppCurrencies(); case POPMONEY_ID: - return CurrencyUtil.getAllPopmoneyCurrencies(); + return getAllPopmoneyCurrencies(); case PROMPT_PAY_ID: - return CurrencyUtil.getAllPromptPayCurrencies(); + return getAllPromptPayCurrencies(); case SEPA_ID: case SEPA_INSTANT_ID: - return CurrencyUtil.getAllSEPACurrencies(); + return getAllSEPACurrencies(); case CASH_BY_MAIL_ID: case F2F_ID: case NATIONAL_BANK_ID: @@ -196,21 +195,21 @@ public class PaymentAccountUtil { case SPECIFIC_BANKS_ID: case CASH_DEPOSIT_ID: case WESTERN_UNION_ID: - return CurrencyUtil.getAllFiatCurrencies(); + return getAllFiatCurrencies(); case FASTER_PAYMENTS_ID: - return CurrencyUtil.getAllFasterPaymentCurrencies(); + return getAllFasterPaymentCurrencies(); case DOMESTIC_WIRE_TRANSFER_ID: - return CurrencyUtil.getAllDomesticWireTransferCurrencies(); + return getAllDomesticWireTransferCurrencies(); case ACH_TRANSFER_ID: - return CurrencyUtil.getAllACHTransferCurrencies(); + return getAllACHTransferCurrencies(); case CELPAY_ID: - return CurrencyUtil.getAllCelPayCurrencies(); + return getAllCelPayCurrencies(); case MONESE_ID: - return CurrencyUtil.getAllMoneseCurrencies(); + return getAllMoneseCurrencies(); case TRANSFERWISE_USD_ID: - return CurrencyUtil.getAllTransferwiseUSDCurrencies(); + return getAllTransferwiseUSDCurrencies(); case VERSE_ID: - return CurrencyUtil.getAllVerseCurrencies(); + return getAllVerseCurrencies(); default: return Collections.emptyList(); } diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/BsqOfferBookViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/BsqOfferBookViewModel.java index d430b1fafb..44706bdb8e 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/BsqOfferBookViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/BsqOfferBookViewModel.java @@ -32,6 +32,7 @@ import bisq.core.offer.OpenOfferManager; import bisq.core.payment.payload.PaymentMethod; import bisq.core.provider.price.PriceFeedService; import bisq.core.trade.ClosedTradableManager; +import bisq.core.trade.bsq_swap.BsqSwapTradeManager; import bisq.core.user.Preferences; import bisq.core.user.User; import bisq.core.util.FormattingUtils; @@ -65,14 +66,16 @@ public class BsqOfferBookViewModel extends OfferBookViewModel { P2PService p2PService, PriceFeedService priceFeedService, ClosedTradableManager closedTradableManager, + BsqSwapTradeManager bsqSwapTradeManager, AccountAgeWitnessService accountAgeWitnessService, Navigation navigation, PriceUtil priceUtil, OfferFilterService offerFilterService, @Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter, BsqFormatter bsqFormatter, - BsqWalletService bsqWalletService, CoreApi coreApi) { - super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi); + BsqWalletService bsqWalletService, + CoreApi coreApi) { + super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, bsqSwapTradeManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi); } @Override diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/BtcOfferBookViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/BtcOfferBookViewModel.java index 969137feb2..1e18554272 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/BtcOfferBookViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/BtcOfferBookViewModel.java @@ -36,6 +36,7 @@ import bisq.core.payment.PaymentAccountUtil; import bisq.core.payment.payload.PaymentMethod; import bisq.core.provider.price.PriceFeedService; import bisq.core.trade.ClosedTradableManager; +import bisq.core.trade.bsq_swap.BsqSwapTradeManager; import bisq.core.user.Preferences; import bisq.core.user.User; import bisq.core.util.FormattingUtils; @@ -66,6 +67,7 @@ public class BtcOfferBookViewModel extends OfferBookViewModel { P2PService p2PService, PriceFeedService priceFeedService, ClosedTradableManager closedTradableManager, + BsqSwapTradeManager bsqSwapTradeManager, AccountAgeWitnessService accountAgeWitnessService, Navigation navigation, PriceUtil priceUtil, @@ -73,7 +75,7 @@ public class BtcOfferBookViewModel extends OfferBookViewModel { @Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter, BsqFormatter bsqFormatter, BsqWalletService bsqWalletService, CoreApi coreApi) { - super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi); + super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, bsqSwapTradeManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi); } @Override diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OtherOfferBookViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OtherOfferBookViewModel.java index 72fb9b4108..26c6347632 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OtherOfferBookViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OtherOfferBookViewModel.java @@ -34,6 +34,7 @@ import bisq.core.offer.OpenOfferManager; import bisq.core.payment.payload.PaymentMethod; import bisq.core.provider.price.PriceFeedService; import bisq.core.trade.ClosedTradableManager; +import bisq.core.trade.bsq_swap.BsqSwapTradeManager; import bisq.core.user.Preferences; import bisq.core.user.User; import bisq.core.util.FormattingUtils; @@ -68,6 +69,7 @@ public class OtherOfferBookViewModel extends OfferBookViewModel { P2PService p2PService, PriceFeedService priceFeedService, ClosedTradableManager closedTradableManager, + BsqSwapTradeManager bsqSwapTradeManager, AccountAgeWitnessService accountAgeWitnessService, Navigation navigation, PriceUtil priceUtil, @@ -75,7 +77,7 @@ public class OtherOfferBookViewModel extends OfferBookViewModel { @Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter, BsqFormatter bsqFormatter, BsqWalletService bsqWalletService, CoreApi coreApi) { - super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi); + super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, bsqSwapTradeManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi); } @Override diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/TopAltcoinOfferBookViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/TopAltcoinOfferBookViewModel.java index 956e5d90b3..e3392c057b 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/TopAltcoinOfferBookViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/TopAltcoinOfferBookViewModel.java @@ -32,6 +32,7 @@ import bisq.core.offer.OpenOfferManager; import bisq.core.payment.payload.PaymentMethod; import bisq.core.provider.price.PriceFeedService; import bisq.core.trade.ClosedTradableManager; +import bisq.core.trade.bsq_swap.BsqSwapTradeManager; import bisq.core.user.Preferences; import bisq.core.user.User; import bisq.core.util.FormattingUtils; @@ -64,6 +65,7 @@ public class TopAltcoinOfferBookViewModel extends OfferBookViewModel { P2PService p2PService, PriceFeedService priceFeedService, ClosedTradableManager closedTradableManager, + BsqSwapTradeManager bsqSwapTradeManager, AccountAgeWitnessService accountAgeWitnessService, Navigation navigation, PriceUtil priceUtil, @@ -72,7 +74,7 @@ public class TopAltcoinOfferBookViewModel extends OfferBookViewModel { BsqFormatter bsqFormatter, BsqWalletService bsqWalletService, CoreApi coreApi) { - super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi); + super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, bsqSwapTradeManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi); } @Override 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 01288ca0f2..0a70c5acd1 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 @@ -239,7 +239,7 @@ public class OfferBookViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookViewModel model = new BtcOfferBookViewModel(null, null, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); assertEquals(0, model.maxPlacesForAmount.intValue()); } @@ -253,7 +253,7 @@ public class OfferBookViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); model.activate(); assertEquals(6, model.maxPlacesForAmount.intValue()); @@ -271,7 +271,7 @@ public class OfferBookViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); model.activate(); assertEquals(15, model.maxPlacesForAmount.intValue()); @@ -290,7 +290,7 @@ public class OfferBookViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookViewModel model = new BtcOfferBookViewModel(null, null, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); assertEquals(0, model.maxPlacesForVolume.intValue()); } @@ -304,7 +304,7 @@ public class OfferBookViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); model.activate(); assertEquals(5, model.maxPlacesForVolume.intValue()); @@ -322,7 +322,7 @@ public class OfferBookViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); model.activate(); assertEquals(9, model.maxPlacesForVolume.intValue()); @@ -341,7 +341,7 @@ public class OfferBookViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookViewModel model = new BtcOfferBookViewModel(null, null, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); assertEquals(0, model.maxPlacesForPrice.intValue()); } @@ -355,7 +355,7 @@ public class OfferBookViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); model.activate(); assertEquals(7, model.maxPlacesForPrice.intValue()); @@ -373,7 +373,7 @@ public class OfferBookViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookViewModel model = new BtcOfferBookViewModel(null, null, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); assertEquals(0, model.maxPlacesForMarketPriceMargin.intValue()); } @@ -408,7 +408,7 @@ public class OfferBookViewModelTest { offerBookListItems.addAll(item1, item2); final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, priceFeedService, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); model.activate(); assertEquals(8, model.maxPlacesForMarketPriceMargin.intValue()); //" (1.97%)" @@ -429,7 +429,7 @@ public class OfferBookViewModelTest { when(priceFeedService.getMarketPrice(anyString())).thenReturn(new MarketPrice("USD", 12684.0450, Instant.now().getEpochSecond(), true)); final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null, - null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); + null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null); final OfferBookListItem item = make(btcBuyItem.but( with(useMarketBasedPrice, true),