mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-05-31 04:24:39 -04:00
Add check at offerer for trade price
This commit is contained in:
parent
261a037020
commit
461aa9bd7f
8 changed files with 50 additions and 17 deletions
|
@ -76,7 +76,7 @@ import static io.bitsquare.app.BitsquareEnvironment.APP_NAME_KEY;
|
|||
public class BitsquareApp extends Application {
|
||||
private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class);
|
||||
|
||||
public static final boolean DEV_MODE = false;
|
||||
public static final boolean DEV_MODE = true;
|
||||
public static final boolean IS_RELEASE_VERSION = !DEV_MODE && true;
|
||||
|
||||
private static Environment env;
|
||||
|
|
|
@ -497,7 +497,11 @@ public class MainViewModel implements ViewModel {
|
|||
setupBtcNumPeersWatcher();
|
||||
setupP2PNumPeersWatcher();
|
||||
updateBalance();
|
||||
setupDevDummyPaymentAccount();
|
||||
if (BitsquareApp.DEV_MODE) {
|
||||
preferences.setShowOwnOffersInOfferBook(true);
|
||||
if (user.getPaymentAccounts().isEmpty())
|
||||
setupDevDummyPaymentAccount();
|
||||
}
|
||||
setupMarketPriceFeed();
|
||||
swapPendingOfferFundingEntries();
|
||||
fillPriceFeedComboBoxItems();
|
||||
|
@ -713,7 +717,7 @@ public class MainViewModel implements ViewModel {
|
|||
marketPriceBinding.subscribe((observable, oldValue, newValue) -> {
|
||||
if (newValue != null && !newValue.equals(oldValue)) {
|
||||
setMarketPriceInItems();
|
||||
|
||||
|
||||
String code = preferences.getUseStickyMarketPrice() ?
|
||||
preferences.getPreferredTradeCurrency().getCode() :
|
||||
priceFeed.currencyCodeProperty().get();
|
||||
|
@ -896,12 +900,10 @@ public class MainViewModel implements ViewModel {
|
|||
}
|
||||
|
||||
private void setupDevDummyPaymentAccount() {
|
||||
if (BitsquareApp.DEV_MODE && user.getPaymentAccounts().isEmpty()) {
|
||||
OKPayAccount okPayAccount = new OKPayAccount();
|
||||
okPayAccount.setAccountNr("dummy");
|
||||
okPayAccount.setAccountName("OKPay dummy");
|
||||
okPayAccount.setSelectedTradeCurrency(CurrencyUtil.getDefaultTradeCurrency());
|
||||
user.addPaymentAccount(okPayAccount);
|
||||
}
|
||||
OKPayAccount okPayAccount = new OKPayAccount();
|
||||
okPayAccount.setAccountNr("dummy");
|
||||
okPayAccount.setAccountName("OKPay dummy");
|
||||
okPayAccount.setSelectedTradeCurrency(CurrencyUtil.getDefaultTradeCurrency());
|
||||
user.addPaymentAccount(okPayAccount);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,6 +140,8 @@ class CreateOfferDataModel extends ActivatableDataModel {
|
|||
networkFeeAsCoin = FeePolicy.getFixedTxFeeForTrades();
|
||||
securityDepositAsCoin = FeePolicy.getSecurityDeposit();
|
||||
|
||||
usePercentageBasedPrice.set(preferences.getUsePercentageBasedPrice());
|
||||
|
||||
balanceListener = new BalanceListener(getAddressEntry().getAddress()) {
|
||||
@Override
|
||||
public void onBalanceChanged(Coin balance, Transaction tx) {
|
||||
|
@ -282,9 +284,6 @@ class CreateOfferDataModel extends ActivatableDataModel {
|
|||
String countryCode = paymentAccount instanceof CountryBasedPaymentAccount ? ((CountryBasedPaymentAccount) paymentAccount).getCountry().code : null;
|
||||
|
||||
checkNotNull(p2PService.getAddress(), "Address must not be null");
|
||||
log.error("fiatPrice " + fiatPrice);
|
||||
log.error("percentageBasedPrice " + percentageBasedPrice);
|
||||
log.error("usePercentageBasedPrice " + usePercentageBasedPrice.get());
|
||||
return new Offer(offerId,
|
||||
p2PService.getAddress(),
|
||||
keyRing.getPubKeyRing(),
|
||||
|
@ -389,6 +388,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
|
|||
|
||||
public void setUsePercentageBasedPrice(boolean usePercentageBasedPrice) {
|
||||
this.usePercentageBasedPrice.set(usePercentageBasedPrice);
|
||||
preferences.setUsePercentageBasedPrice(usePercentageBasedPrice);
|
||||
}
|
||||
|
||||
/*boolean isFeeFromFundingTxSufficient() {
|
||||
|
|
|
@ -989,7 +989,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
|
|||
VBox priceAsPercentageInputBox = priceAsPercentageInputBoxTuple.second;
|
||||
|
||||
priceAsPercentageTextField.setPromptText("Enter % value");
|
||||
priceAsPercentageLabel.setText("% dist.");
|
||||
priceAsPercentageLabel.setText("%");
|
||||
priceAsPercentageLabel.setStyle("-fx-alignment: center;");
|
||||
|
||||
Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = getValueCurrencyBox(BSResources.get("createOffer.amount.prompt"));
|
||||
|
|
|
@ -855,7 +855,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
priceAsPercentageInputBox = priceAsPercentageInputBoxTuple.second;
|
||||
|
||||
priceAsPercentageTextField.setPromptText("Enter % value");
|
||||
priceAsPercentageLabel.setText("% dist.");
|
||||
priceAsPercentageLabel.setText("%");
|
||||
priceAsPercentageLabel.setStyle("-fx-alignment: center;");
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue