mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 22:45:21 +01:00
Add option key for dev mode
This commit is contained in:
parent
aac493cc41
commit
b7064f9820
31 changed files with 73 additions and 42 deletions
|
@ -12,11 +12,18 @@ public class DevEnv {
|
|||
public static final String DEV_PRIVILEGE_PUB_KEY = "027a381b5333a56e1cc3d90d3a7d07f26509adf7029ed06fc997c656621f8da1ee";
|
||||
public static final String DEV_PRIVILEGE_PRIV_KEY = "6ac43ea1df2a290c1c8391736aa42e4339c5cb4f110ff0257a13b63211977b7a";
|
||||
|
||||
|
||||
// If set to true we ignore several UI behavior like confirmation popups as well dummy accounts are created and
|
||||
// offers are filled with default values. Intended to make dev testing faster.
|
||||
@SuppressWarnings("PointlessBooleanExpression")
|
||||
public static final boolean DEV_MODE = STRESS_TEST_MODE || false;
|
||||
private static boolean devMode = false;
|
||||
|
||||
public static boolean isDevMode() {
|
||||
return devMode;
|
||||
}
|
||||
|
||||
public static void setDevMode(boolean devMode) {
|
||||
DevEnv.devMode = devMode;
|
||||
}
|
||||
|
||||
public static final boolean DAO_PHASE2_ACTIVATED = false;
|
||||
public static final boolean DAO_TRADING_ACTIVATED = false;
|
||||
|
|
|
@ -103,7 +103,7 @@ public class Res {
|
|||
.replace("bitcoin", baseCurrencyNameLowerCase);
|
||||
} catch (MissingResourceException e) {
|
||||
log.warn("Missing resource for key: " + key);
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException("Missing resource for key: " + key);
|
||||
|
||||
return key;
|
||||
|
|
|
@ -9,4 +9,5 @@ public class AppOptionKeys {
|
|||
public static final String DUMP_STATISTICS = "dumpStatistics";
|
||||
public static final String IGNORE_DEV_MSG_KEY = "ignoreDevMsg";
|
||||
public static final String USE_DEV_PRIVILEGE_KEYS = "useDevPrivilegeKeys";
|
||||
public static final String USE_DEV_MODE = "useDevMode";
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ public class BisqEnvironment extends StandardEnvironment {
|
|||
@Getter
|
||||
protected List<String> bannedSeedNodes, bannedBtcNodes, bannedPriceRelayNodes;
|
||||
|
||||
protected final String btcNodes, seedNodes, ignoreDevMsg, useDevPrivilegeKeys, useTorForBtc, rpcUser, rpcPassword,
|
||||
protected final String btcNodes, seedNodes, ignoreDevMsg, useDevPrivilegeKeys, useDevMode, useTorForBtc, rpcUser, rpcPassword,
|
||||
rpcPort, rpcBlockNotificationPort, dumpBlockchainData, fullDaoNode,
|
||||
myAddress, banList, dumpStatistics, maxMemory, socks5ProxyBtcAddress,
|
||||
socks5ProxyHttpAddress, useAllProvidedNodes, numConnectionForBtc, regTestBsqGenesisTxId;
|
||||
|
@ -215,6 +215,9 @@ public class BisqEnvironment extends StandardEnvironment {
|
|||
useDevPrivilegeKeys = commandLineProperties.containsProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS) ?
|
||||
(String) commandLineProperties.getProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS) :
|
||||
"";
|
||||
useDevMode = commandLineProperties.containsProperty(AppOptionKeys.USE_DEV_MODE) ?
|
||||
(String) commandLineProperties.getProperty(AppOptionKeys.USE_DEV_MODE) :
|
||||
"";
|
||||
dumpStatistics = commandLineProperties.containsProperty(AppOptionKeys.DUMP_STATISTICS) ?
|
||||
(String) commandLineProperties.getProperty(AppOptionKeys.DUMP_STATISTICS) :
|
||||
"";
|
||||
|
@ -407,6 +410,7 @@ public class BisqEnvironment extends StandardEnvironment {
|
|||
setProperty(AppOptionKeys.APP_DATA_DIR_KEY, appDataDir);
|
||||
setProperty(AppOptionKeys.IGNORE_DEV_MSG_KEY, ignoreDevMsg);
|
||||
setProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS, useDevPrivilegeKeys);
|
||||
setProperty(AppOptionKeys.USE_DEV_MODE, useDevMode);
|
||||
setProperty(AppOptionKeys.DUMP_STATISTICS, dumpStatistics);
|
||||
setProperty(AppOptionKeys.APP_NAME_KEY, appName);
|
||||
setProperty(AppOptionKeys.MAX_MEMORY, maxMemory);
|
||||
|
|
|
@ -129,6 +129,10 @@ public abstract class BisqExecutable {
|
|||
"(This is for developers only!)", false))
|
||||
.withRequiredArg()
|
||||
.ofType(boolean.class);
|
||||
parser.accepts(AppOptionKeys.USE_DEV_MODE,
|
||||
description("Enables dev mode which is used for convenience for developer testing", false))
|
||||
.withRequiredArg()
|
||||
.ofType(boolean.class);
|
||||
parser.accepts(AppOptionKeys.DUMP_STATISTICS,
|
||||
description("If set to true the trade statistics are stored as json file in the data dir.", false))
|
||||
.withRequiredArg()
|
||||
|
|
|
@ -226,7 +226,7 @@ public class DaoPeriodService {
|
|||
return Phase.BREAK3;
|
||||
else {
|
||||
log.error("blocksInNewPhase is not covered by phase checks. blocksInNewPhase={}", blocksInNewPhase);
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException("blocksInNewPhase is not covered by phase checks. blocksInNewPhase=" + blocksInNewPhase);
|
||||
else
|
||||
return Phase.UNDEFINED;
|
||||
|
|
|
@ -293,7 +293,7 @@ public class RequestManager implements MessageListener, ConnectionListener, Peer
|
|||
// FIXME when a lot of blocks are created we get caught here. Seems to be a threading issue...
|
||||
log.warn("startBlockHeight must not be smaller than lastReceivedBlockHeight. That should never happen." +
|
||||
"startBlockHeight={},lastReceivedBlockHeight={}", startBlockHeight, lastReceivedBlockHeight);
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException("startBlockHeight must be larger than lastReceivedBlockHeight. startBlockHeight=" +
|
||||
startBlockHeight + " / lastReceivedBlockHeight=" + lastReceivedBlockHeight);
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ public class BsqParser {
|
|||
"txsWithInputsFromSameBlock=" + txsWithInputsFromSameBlock.toString() + "\n" +
|
||||
"txsWithoutInputsFromSameBlock=" + txsWithoutInputsFromSameBlock;
|
||||
log.warn(msg);
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -225,14 +225,14 @@ public class CompensationRequestManager implements PersistedDataHost, BsqBlockCh
|
|||
} else {
|
||||
final String msg = "removeCompensationRequest called for a CompensationRequest which is not ours.";
|
||||
log.warn(msg);
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException(msg);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
final String msg = "removeCompensationRequest called with a CompensationRequest which is outside of the CompensationRequest phase.";
|
||||
log.warn(msg);
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException(msg);
|
||||
return false;
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ public class CompensationRequestManager implements PersistedDataHost, BsqBlockCh
|
|||
} else {
|
||||
final String msg = "onRemoved called of a CompensationRequest which is outside of the CompensationRequest phase is invalid and we ignore it.";
|
||||
log.warn(msg);
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -209,7 +209,7 @@ public class BisqApp extends Application {
|
|||
persistedDataHosts.add(injector.getInstance(CompensationRequestManager.class));
|
||||
|
||||
// we apply at startup the reading of persisted data but don't want to get it triggered in the constructor
|
||||
persistedDataHosts.stream().forEach(e -> {
|
||||
persistedDataHosts.forEach(e -> {
|
||||
try {
|
||||
log.debug("call readPersisted at " + e.getClass().getSimpleName());
|
||||
e.readPersisted();
|
||||
|
@ -218,6 +218,9 @@ public class BisqApp extends Application {
|
|||
}
|
||||
});
|
||||
|
||||
boolean useDevMode = injector.getInstance(Key.get(Boolean.class, Names.named(AppOptionKeys.USE_DEV_MODE)));
|
||||
DevEnv.setDevMode(useDevMode);
|
||||
|
||||
Version.setBaseCryptoNetworkId(BisqEnvironment.getBaseCurrencyNetwork().ordinal());
|
||||
Version.printVersion();
|
||||
|
||||
|
@ -276,7 +279,7 @@ public class BisqApp extends Application {
|
|||
injector.getInstance(ManualPayoutTxWindow.class).show();
|
||||
else
|
||||
new Popup<>().warning(Res.get("popup.warning.walletNotInitialized")).show();
|
||||
} else if (DevEnv.DEV_MODE) {
|
||||
} else if (DevEnv.isDevMode()) {
|
||||
// dev ode only
|
||||
if (Utilities.isAltOrCtrlPressed(KeyCode.B, keyEvent)) {
|
||||
// BSQ empty wallet not public yet
|
||||
|
|
|
@ -90,6 +90,9 @@ public class BisqAppModule extends AppModule {
|
|||
Boolean useDevPrivilegeKeys = environment.getProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS, Boolean.class, false);
|
||||
bind(boolean.class).annotatedWith(Names.named(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS)).toInstance(useDevPrivilegeKeys);
|
||||
|
||||
Boolean useDevMode = environment.getProperty(AppOptionKeys.USE_DEV_MODE, Boolean.class, false);
|
||||
bind(boolean.class).annotatedWith(Names.named(AppOptionKeys.USE_DEV_MODE)).toInstance(useDevMode);
|
||||
|
||||
// ordering is used for shut down sequence
|
||||
install(tradeModule());
|
||||
install(encryptionServiceModule());
|
||||
|
|
|
@ -277,7 +277,7 @@ public class MainViewModel implements ViewModel {
|
|||
}
|
||||
|
||||
//noinspection ConstantConditions,ConstantConditions,PointlessBooleanExpression
|
||||
if (!preferences.isTacAccepted() && !DevEnv.DEV_MODE) {
|
||||
if (!preferences.isTacAccepted() && !DevEnv.isDevMode()) {
|
||||
UserThread.runAfter(() -> {
|
||||
tacWindow.onAction(() -> {
|
||||
preferences.setTacAccepted(true);
|
||||
|
@ -655,7 +655,7 @@ public class MainViewModel implements ViewModel {
|
|||
setupBtcNumPeersWatcher();
|
||||
setupP2PNumPeersWatcher();
|
||||
updateBalance();
|
||||
if (DevEnv.DEV_MODE) {
|
||||
if (DevEnv.isDevMode()) {
|
||||
preferences.setShowOwnOffersInOfferBook(true);
|
||||
setupDevDummyPaymentAccounts();
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ public class AccountView extends ActivatableView<TabPane, AccountViewModel> {
|
|||
|
||||
//noinspection UnusedAssignment
|
||||
String key = "accountPrivacyInfo";
|
||||
if (!DevEnv.DEV_MODE)
|
||||
if (!DevEnv.isDevMode())
|
||||
new Popup<>()
|
||||
.headLine(Res.get("account.info.headline"))
|
||||
.backgroundInfo(Res.get("account.info.msg"))
|
||||
|
|
|
@ -127,7 +127,7 @@ public class DisputesView extends ActivatableViewAndModel<TabPane, Activatable>
|
|||
|
||||
//noinspection UnusedAssignment
|
||||
String key = "supportInfo";
|
||||
if (!DevEnv.DEV_MODE)
|
||||
if (!DevEnv.isDevMode())
|
||||
//noinspection unchecked
|
||||
new Popup<>().backgroundInfo(Res.get("support.backgroundInfo"))
|
||||
.width(900)
|
||||
|
|
|
@ -166,7 +166,7 @@ public class DepositView extends ActivatableView<VBox, Void> {
|
|||
Tuple2<Label, InputTextField> amountTuple = addLabelInputTextField(gridPane, ++gridRow, Res.get("funds.deposit.amount"));
|
||||
amountLabel = amountTuple.first;
|
||||
amountTextField = amountTuple.second;
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
amountTextField.setText("10");
|
||||
|
||||
titledGroupBg.setVisible(false);
|
||||
|
|
|
@ -292,7 +292,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
|
|||
if (model.hasAcceptedArbitrators()) {
|
||||
Offer offer = model.createAndGetOffer();
|
||||
//noinspection PointlessBooleanExpression
|
||||
if (!DevEnv.DEV_MODE) {
|
||||
if (!DevEnv.isDevMode()) {
|
||||
offerDetailsWindow.onPlaceOffer(() ->
|
||||
model.onPlaceOffer(offer, offerDetailsWindow::hide))
|
||||
.show(offer);
|
||||
|
@ -364,7 +364,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
|
|||
balanceTextField.setTargetAmount(model.dataModel.totalToPayAsCoinProperty().get());
|
||||
|
||||
//noinspection PointlessBooleanExpression
|
||||
if (!DevEnv.DEV_MODE) {
|
||||
if (!DevEnv.isDevMode()) {
|
||||
String key = "securityDepositInfo";
|
||||
new Popup<>().backgroundInfo(Res.get("popup.info.securityDepositInfo"))
|
||||
.actionButtonText(Res.get("shared.faq"))
|
||||
|
@ -633,7 +633,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
|
|||
};
|
||||
|
||||
placeOfferCompletedListener = (o, oldValue, newValue) -> {
|
||||
if (DevEnv.DEV_MODE) {
|
||||
if (DevEnv.isDevMode()) {
|
||||
close();
|
||||
} else if (newValue) {
|
||||
// We need a bit of delay to avoid issues with fade out/fade in of 2 popups
|
||||
|
|
|
@ -198,7 +198,7 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
|||
|
||||
@Override
|
||||
protected void activate() {
|
||||
if (DevEnv.DEV_MODE) {
|
||||
if (DevEnv.isDevMode()) {
|
||||
UserThread.runAfter(() -> {
|
||||
switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) {
|
||||
case "BTC":
|
||||
|
|
|
@ -299,7 +299,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
public void onClose() {
|
||||
Coin balance = model.dataModel.getBalance().get();
|
||||
//noinspection ConstantConditions,ConstantConditions
|
||||
if (balance != null && balance.isPositive() && !model.takeOfferCompleted.get() && !DevEnv.DEV_MODE) {
|
||||
if (balance != null && balance.isPositive() && !model.takeOfferCompleted.get() && !DevEnv.isDevMode()) {
|
||||
model.dataModel.swapTradeToSavings();
|
||||
//noinspection unchecked
|
||||
new Popup<>().information(Res.get("takeOffer.alreadyFunded.movedFunds"))
|
||||
|
@ -328,7 +328,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
if (model.isReadyForTxBroadcast()) {
|
||||
if (model.dataModel.isTakerFeeValid()) {
|
||||
if (model.hasAcceptedArbitrators()) {
|
||||
if (!DevEnv.DEV_MODE) {
|
||||
if (!DevEnv.isDevMode()) {
|
||||
offerDetailsWindow.onTakeOffer(() ->
|
||||
model.onTakeOffer(() -> {
|
||||
offerDetailsWindow.hide();
|
||||
|
@ -380,7 +380,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
|
||||
balanceTextField.setTargetAmount(model.dataModel.getTotalToPayAsCoin().get());
|
||||
|
||||
if (!DevEnv.DEV_MODE) {
|
||||
if (!DevEnv.isDevMode()) {
|
||||
String key = "securityDepositInfo";
|
||||
new Popup<>().backgroundInfo(Res.get("popup.info.securityDepositInfo"))
|
||||
.actionButtonText(Res.get("shared.faq"))
|
||||
|
@ -559,7 +559,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
|
||||
showTransactionPublishedScreenSubscription = EasyBind.subscribe(model.showTransactionPublishedScreen, newValue -> {
|
||||
//noinspection ConstantConditions
|
||||
if (newValue && DevEnv.DEV_MODE) {
|
||||
if (newValue && DevEnv.isDevMode()) {
|
||||
close();
|
||||
} else //noinspection ConstantConditions,ConstantConditions
|
||||
if (newValue && model.getTrade() != null && !model.getTrade().hasFailed()) {
|
||||
|
|
|
@ -383,7 +383,7 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
|
|||
updateSpinnerInfo();
|
||||
} else {
|
||||
final String msg = "trade.getDepositTx() must not be null.";
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException(msg);
|
||||
log.error(msg);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public class SelectBaseCurrencyWindow extends Overlay<SelectBaseCurrencyWindow>
|
|||
comboBox.setPromptText(Res.get("shared.select"));
|
||||
List<BaseCurrencyNetwork> baseCurrencyNetworks = Arrays.asList(BaseCurrencyNetwork.values());
|
||||
// show ony mainnet in production version
|
||||
if (!DevEnv.DEV_MODE)
|
||||
if (!DevEnv.isDevMode())
|
||||
baseCurrencyNetworks = baseCurrencyNetworks.stream()
|
||||
.filter(e -> e.isMainnet())
|
||||
.collect(Collectors.toList());
|
||||
|
@ -98,7 +98,7 @@ public class SelectBaseCurrencyWindow extends Overlay<SelectBaseCurrencyWindow>
|
|||
comboBox.setConverter(new StringConverter<BaseCurrencyNetwork>() {
|
||||
@Override
|
||||
public String toString(BaseCurrencyNetwork baseCurrencyNetwork) {
|
||||
return DevEnv.DEV_MODE ? (baseCurrencyNetwork.getCurrencyName() + "_" + baseCurrencyNetwork.getNetwork()) :
|
||||
return DevEnv.isDevMode() ? (baseCurrencyNetwork.getCurrencyName() + "_" + baseCurrencyNetwork.getNetwork()) :
|
||||
baseCurrencyNetwork.getCurrencyName();
|
||||
}
|
||||
|
||||
|
|
|
@ -407,7 +407,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
|
|||
sellerState.set(UNDEFINED);
|
||||
buyerState.set(BuyerState.UNDEFINED);
|
||||
log.warn("unhandled processState " + tradeState);
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException("unhandled processState " + tradeState);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -280,7 +280,7 @@ public class BuyerStep2View extends TradeStepView {
|
|||
//noinspection UnusedAssignment
|
||||
String key = "confirmPaperReceiptSent";
|
||||
//noinspection ConstantConditions
|
||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||
if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
|
||||
Popup popup = new Popup<>();
|
||||
popup.headLine(Res.get("portfolio.pending.step2_buyer.paperReceipt.headline"))
|
||||
.feedback(Res.get("portfolio.pending.step2_buyer.paperReceipt.msg"))
|
||||
|
@ -296,7 +296,7 @@ public class BuyerStep2View extends TradeStepView {
|
|||
//noinspection UnusedAssignment
|
||||
//noinspection ConstantConditions
|
||||
String key = "westernUnionMTCNSent";
|
||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||
if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
|
||||
String email = ((WesternUnionAccountPayload) model.dataModel.getSellersPaymentAccountPayload()).getEmail();
|
||||
Popup popup = new Popup<>();
|
||||
popup.headLine(Res.get("portfolio.pending.step2_buyer.westernUnionMTCNInfo.headline"))
|
||||
|
@ -323,7 +323,7 @@ public class BuyerStep2View extends TradeStepView {
|
|||
//noinspection UnusedAssignment
|
||||
String key = "confirmPaymentStarted";
|
||||
//noinspection ConstantConditions
|
||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||
if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
|
||||
Popup popup = new Popup<>();
|
||||
popup.headLine(Res.get("portfolio.pending.step2_buyer.confirmStart.headline"))
|
||||
.confirmation(Res.get("portfolio.pending.step2_buyer.confirmStart.msg",
|
||||
|
@ -427,7 +427,7 @@ public class BuyerStep2View extends TradeStepView {
|
|||
//noinspection ConstantConditions,UnusedAssignment
|
||||
String key = "startPayment" + trade.getId();
|
||||
//noinspection ConstantConditions,ConstantConditions
|
||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||
if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
|
||||
DontShowAgainLookup.dontShowAgain(key, true);
|
||||
new Popup<>().headLine(Res.get("popup.attention.forTradeWithId", id))
|
||||
.attention(message)
|
||||
|
|
|
@ -162,7 +162,7 @@ public class BuyerStep4View extends TradeStepView {
|
|||
|
||||
String key = "tradeCompleted" + trade.getId();
|
||||
//noinspection ConstantConditions
|
||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||
if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
|
||||
DontShowAgainLookup.dontShowAgain(key, true);
|
||||
new Notification().headLine(Res.get("notification.tradeCompleted.headline"))
|
||||
.notification(Res.get("notification.tradeCompleted.msg"))
|
||||
|
@ -281,7 +281,7 @@ public class BuyerStep4View extends TradeStepView {
|
|||
|
||||
@SuppressWarnings("PointlessBooleanExpression")
|
||||
private void handleTradeCompleted() {
|
||||
if (!DevEnv.DEV_MODE) {
|
||||
if (!DevEnv.isDevMode()) {
|
||||
String key = "tradeCompleteWithdrawCompletedInfo";
|
||||
//noinspection unchecked
|
||||
new Popup<>().headLine(Res.get("portfolio.pending.step5_buyer.withdrawalCompleted.headline"))
|
||||
|
|
|
@ -254,7 +254,7 @@ public class SellerStep3View extends TradeStepView {
|
|||
//noinspection UnusedAssignment
|
||||
String key = "confirmPaymentReceived";
|
||||
//noinspection ConstantConditions
|
||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||
if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
|
||||
PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
|
||||
String message = Res.get("portfolio.pending.step3_seller.onPaymentReceived.part1", CurrencyUtil.getNameByCode(model.dataModel.getCurrencyCode()));
|
||||
if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload)) {
|
||||
|
@ -316,7 +316,7 @@ public class SellerStep3View extends TradeStepView {
|
|||
}
|
||||
}
|
||||
//noinspection ConstantConditions
|
||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||
if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
|
||||
DontShowAgainLookup.dontShowAgain(key, true);
|
||||
new Popup<>().headLine(Res.get("popup.attention.forTradeWithId", id))
|
||||
.attention(message)
|
||||
|
|
|
@ -168,7 +168,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Activatab
|
|||
selectBaseCurrencyNetworkComboBox.setConverter(new StringConverter<BaseCurrencyNetwork>() {
|
||||
@Override
|
||||
public String toString(BaseCurrencyNetwork baseCurrencyNetwork) {
|
||||
return DevEnv.DEV_MODE ? (baseCurrencyNetwork.getCurrencyName() + "_" + baseCurrencyNetwork.getNetwork()) :
|
||||
return DevEnv.isDevMode() ? (baseCurrencyNetwork.getCurrencyName() + "_" + baseCurrencyNetwork.getNetwork()) :
|
||||
baseCurrencyNetwork.getCurrencyName();
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Activatab
|
|||
List<BaseCurrencyNetwork> baseCurrencyNetworks = Arrays.asList(BaseCurrencyNetwork.values());
|
||||
|
||||
// show ony mainnet in production version
|
||||
if (!DevEnv.DEV_MODE)
|
||||
if (!DevEnv.isDevMode())
|
||||
baseCurrencyNetworks = baseCurrencyNetworks.stream()
|
||||
.filter(e -> e.isMainnet())
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.text.DecimalFormat;
|
|||
@Slf4j
|
||||
public class BsqFormatter extends BSFormatter {
|
||||
@SuppressWarnings("PointlessBooleanExpression")
|
||||
private static final boolean useBsqAddressFormat = true || !DevEnv.DEV_MODE;
|
||||
private static final boolean useBsqAddressFormat = true || !DevEnv.isDevMode();
|
||||
private final String prefix = "B";
|
||||
private final DecimalFormat amountFormat = new DecimalFormat("###,###,###.###");
|
||||
private final DecimalFormat marketCapFormat = new DecimalFormat("###,###,###");
|
||||
|
|
|
@ -110,7 +110,7 @@ public class GUIUtil {
|
|||
//noinspection UnusedAssignment
|
||||
String key = "miningFeeInfo";
|
||||
//noinspection ConstantConditions,ConstantConditions
|
||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key) && BisqEnvironment.getBaseCurrencyNetwork().isBitcoin()) {
|
||||
if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key) && BisqEnvironment.getBaseCurrencyNetwork().isBitcoin()) {
|
||||
new Popup<>().attention(Res.get("guiUtil.miningFeeInfo", String.valueOf(GUIUtil.feeService.getTxFeePerByte().value)))
|
||||
.onClose(runnable::run)
|
||||
.useIUnderstandButton()
|
||||
|
|
|
@ -86,6 +86,9 @@ class MonitorModule extends AppModule {
|
|||
Boolean useDevPrivilegeKeys = environment.getProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS, Boolean.class, false);
|
||||
bind(boolean.class).annotatedWith(Names.named(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS)).toInstance(useDevPrivilegeKeys);
|
||||
|
||||
Boolean useDevMode = environment.getProperty(AppOptionKeys.USE_DEV_MODE, Boolean.class, false);
|
||||
bind(boolean.class).annotatedWith(Names.named(AppOptionKeys.USE_DEV_MODE)).toInstance(useDevMode);
|
||||
|
||||
// ordering is used for shut down sequence
|
||||
install(tradeModule());
|
||||
install(encryptionServiceModule());
|
||||
|
|
|
@ -96,7 +96,7 @@ class MonitorRequestHandler implements MessageListener {
|
|||
log.warn("timeoutTimer was already set. That must not happen.");
|
||||
timeoutTimer.stop();
|
||||
|
||||
if (DevEnv.DEV_MODE)
|
||||
if (DevEnv.isDevMode())
|
||||
throw new RuntimeException("timeoutTimer was already set. That must not happen.");
|
||||
}
|
||||
timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions
|
||||
|
|
|
@ -82,6 +82,9 @@ class SeedNodeModule extends AppModule {
|
|||
Boolean useDevPrivilegeKeys = environment.getProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS, Boolean.class, false);
|
||||
bind(boolean.class).annotatedWith(Names.named(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS)).toInstance(useDevPrivilegeKeys);
|
||||
|
||||
Boolean useDevMode = environment.getProperty(AppOptionKeys.USE_DEV_MODE, Boolean.class, false);
|
||||
bind(boolean.class).annotatedWith(Names.named(AppOptionKeys.USE_DEV_MODE)).toInstance(useDevMode);
|
||||
|
||||
// ordering is used for shut down sequence
|
||||
install(tradeModule());
|
||||
install(encryptionServiceModule());
|
||||
|
|
|
@ -82,6 +82,9 @@ class StatisticsModule extends AppModule {
|
|||
Boolean useDevPrivilegeKeys = environment.getProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS, Boolean.class, false);
|
||||
bind(boolean.class).annotatedWith(Names.named(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS)).toInstance(useDevPrivilegeKeys);
|
||||
|
||||
Boolean useDevMode = environment.getProperty(AppOptionKeys.USE_DEV_MODE, Boolean.class, false);
|
||||
bind(boolean.class).annotatedWith(Names.named(AppOptionKeys.USE_DEV_MODE)).toInstance(useDevMode);
|
||||
|
||||
// ordering is used for shut down sequence
|
||||
install(tradeModule());
|
||||
install(encryptionServiceModule());
|
||||
|
|
Loading…
Add table
Reference in a new issue