Add eht dummy account

This commit is contained in:
Manfred Karrer 2016-04-17 20:49:38 +02:00
parent b889e9dc14
commit b6f368c1ec
3 changed files with 12 additions and 5 deletions

View file

@ -76,7 +76,7 @@ import static io.bitsquare.app.BitsquareEnvironment.APP_NAME_KEY;
public class BitsquareApp extends Application { public class BitsquareApp extends Application {
private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class); private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class);
public static final boolean DEV_MODE = true; public static final boolean DEV_MODE = false;
public static final boolean IS_RELEASE_VERSION = !DEV_MODE && true; public static final boolean IS_RELEASE_VERSION = !DEV_MODE && true;
private static Environment env; private static Environment env;

View file

@ -56,6 +56,7 @@ import io.bitsquare.p2p.network.CloseConnectionReason;
import io.bitsquare.p2p.network.Connection; import io.bitsquare.p2p.network.Connection;
import io.bitsquare.p2p.network.ConnectionListener; import io.bitsquare.p2p.network.ConnectionListener;
import io.bitsquare.p2p.peers.keepalive.messages.Ping; import io.bitsquare.p2p.peers.keepalive.messages.Ping;
import io.bitsquare.payment.CryptoCurrencyAccount;
import io.bitsquare.payment.OKPayAccount; import io.bitsquare.payment.OKPayAccount;
import io.bitsquare.trade.Trade; import io.bitsquare.trade.Trade;
import io.bitsquare.trade.TradeManager; import io.bitsquare.trade.TradeManager;
@ -500,7 +501,7 @@ public class MainViewModel implements ViewModel {
if (BitsquareApp.DEV_MODE) { if (BitsquareApp.DEV_MODE) {
preferences.setShowOwnOffersInOfferBook(true); preferences.setShowOwnOffersInOfferBook(true);
if (user.getPaymentAccounts().isEmpty()) if (user.getPaymentAccounts().isEmpty())
setupDevDummyPaymentAccount(); setupDevDummyPaymentAccounts();
} }
setupMarketPriceFeed(); setupMarketPriceFeed();
swapPendingOfferFundingEntries(); swapPendingOfferFundingEntries();
@ -899,11 +900,17 @@ public class MainViewModel implements ViewModel {
showPendingTradesNotification.set(numPendingTrades > 0); showPendingTradesNotification.set(numPendingTrades > 0);
} }
private void setupDevDummyPaymentAccount() { private void setupDevDummyPaymentAccounts() {
OKPayAccount okPayAccount = new OKPayAccount(); OKPayAccount okPayAccount = new OKPayAccount();
okPayAccount.setAccountNr("dummy"); okPayAccount.setAccountNr("dummy_" + new Random().nextInt(100));
okPayAccount.setAccountName("OKPay dummy"); okPayAccount.setAccountName("OKPay dummy");
okPayAccount.setSelectedTradeCurrency(CurrencyUtil.getDefaultTradeCurrency()); okPayAccount.setSelectedTradeCurrency(CurrencyUtil.getDefaultTradeCurrency());
user.addPaymentAccount(okPayAccount); user.addPaymentAccount(okPayAccount);
CryptoCurrencyAccount cryptoCurrencyAccount = new CryptoCurrencyAccount();
cryptoCurrencyAccount.setAccountName("ETH dummy");
cryptoCurrencyAccount.setAddress("0x" + new Random().nextInt(1000000));
cryptoCurrencyAccount.setSingleTradeCurrency(CurrencyUtil.getCryptoCurrency("ETH").get());
user.addPaymentAccount(cryptoCurrencyAccount);
} }
} }