Add dev flags (STRESS_TEST_MODE)

This commit is contained in:
Manfred Karrer 2016-05-25 13:30:00 +02:00
parent 0488ef4668
commit be3fc1998f
5 changed files with 31 additions and 18 deletions

View file

@ -18,6 +18,7 @@
package io.bitsquare.gui.main.offer.createoffer;
import com.google.inject.Inject;
import io.bitsquare.app.DevFlags;
import io.bitsquare.arbitration.Arbitrator;
import io.bitsquare.btc.AddressEntry;
import io.bitsquare.btc.FeePolicy;
@ -460,7 +461,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
log.debug("missingCoin " + missingCoin.get().toFriendlyString());
isWalletFunded.set(isBalanceSufficient(balance.get()));
if (totalToPayAsCoin.get() != null && isWalletFunded.get() && walletFundedNotification == null) {
if (totalToPayAsCoin.get() != null && isWalletFunded.get() && walletFundedNotification == null && !DevFlags.DEV_MODE) {
walletFundedNotification = new Notification()
.headLine("Trading wallet update")
.notification("Your trading wallet is sufficiently funded.\n" +

View file

@ -195,6 +195,9 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
onPaymentAccountsComboBoxSelected();
balanceTextField.setTargetAmount(model.dataModel.totalToPayAsCoin.get());
if (DevFlags.DEV_MODE)
UserThread.runAfter(() -> onShowPayFundsScreen(), 200, TimeUnit.MILLISECONDS);
}
@Override
@ -266,10 +269,14 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
if (model.isBootstrapped()) {
if (model.hasAcceptedArbitrators()) {
Offer offer = model.createAndGetOffer();
offerDetailsWindow.onPlaceOffer(() ->
model.onPlaceOffer(offer, () ->
offerDetailsWindow.hide()))
.show(offer);
if (!DevFlags.DEV_MODE)
offerDetailsWindow.onPlaceOffer(() ->
model.onPlaceOffer(offer, () ->
offerDetailsWindow.hide()))
.show(offer);
else
model.onPlaceOffer(offer, () -> {
});
} else {
new Popup().warning("You have no arbitrator selected.\n" +
"You need to select at least one arbitrator.")
@ -613,7 +620,6 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
placeOfferCompletedListener = (o, oldValue, newValue) -> {
if (DevFlags.DEV_MODE) {
close();
navigation.navigateTo(MainView.class, PortfolioView.class, OpenOffersView.class);
} else if (newValue) {
// We need a bit of delay to avoid issues with fade out/fade in of 2 popups
String key = "createOfferSuccessInfo";

View file

@ -275,12 +275,16 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
private void onTakeOffer() {
if (model.hasAcceptedArbitrators()) {
offerDetailsWindow.onTakeOffer(() ->
model.onTakeOffer(() -> {
offerDetailsWindow.hide();
offerDetailsWindowDisplayed = false;
})
).show(model.getOffer(), model.dataModel.amountAsCoin.get(), model.dataModel.tradePrice);
if (!DevFlags.DEV_MODE)
offerDetailsWindow.onTakeOffer(() ->
model.onTakeOffer(() -> {
offerDetailsWindow.hide();
offerDetailsWindowDisplayed = false;
})
).show(model.getOffer(), model.dataModel.amountAsCoin.get(), model.dataModel.tradePrice);
else
model.onTakeOffer(() -> {
});
offerDetailsWindowDisplayed = true;
} else {
new Popup().warning("You have no arbitrator selected.\n" +

View file

@ -17,6 +17,7 @@
package io.bitsquare.gui.util;
import io.bitsquare.app.DevFlags;
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.user.Preferences;
import javafx.geometry.Orientation;
@ -40,7 +41,7 @@ public class GUIUtil {
public static void showFeeInfoBeforeExecute(Runnable runnable) {
String key = "miningFeeInfo";
if (Preferences.INSTANCE.showAgain(key)) {
if (!DevFlags.DEV_MODE && Preferences.INSTANCE.showAgain(key)) {
new Popup<>().information("Please be sure that the mining fee used at your external wallet is " +
"sufficiently high so that the funding transaction will be added to the blockchain.\n" +
"Otherwise the trade transactions cannot be confirmed and a trade would end up in a dispute.\n\n" +