diff --git a/.gitignore b/.gitignore index 89362a333a..e733251672 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /bin .idea bitsquare.iml +.spvchain +.wallet diff --git a/pom.xml b/pom.xml index c878cf8081..24ffeb56ce 100644 --- a/pom.xml +++ b/pom.xml @@ -4,14 +4,21 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - bitsquare + io.bitsquare bitsquare - 0.1 + 0.01-SNAPSHOT BitSquare A P2P Fiat-Bitcoin Exchange https://www.bitsquare.io + + com.google + bitcoinj-parent + 0.12-SNAPSHOT + libs/bitcoinj/pom.xml + + Apache 2 @@ -24,6 +31,31 @@ https://github.com/bitsquare/bitsquare + + + sonatype-oss-snapshot + + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-oss-snapshot2 + + https://oss.sonatype.org/content/groups/public + + + + bitcoinj-release + + http://distribution.bitcoinj.googlecode.com/git/releases + + + + mvn-adamgent + http://mvn-adamgent.googlecode.com/svn/maven/release + Adam Gent Maven Repository + + + @@ -33,24 +65,27 @@ src/main/resources - org.apache.maven.plugins - maven-jar-plugin - 2.4 + maven-compiler-plugin + 3.1 - - - io.bitsquare.BitSquare - - + 1.8 + 1.8 + + + com.google + bitcoinj + 0.12-SNAPSHOT + + junit junit @@ -60,7 +95,7 @@ org.slf4j - slf4j-api + slf4j-jdk14 1.7.6 @@ -80,8 +115,14 @@ com.google.guava - guava-base - r03 + guava + 16.0.1 + + + + com.aquafx-project + aquafx + 0.1 @@ -97,6 +138,17 @@ 8.0.5 + + de.jensd + fontawesomefx + 8.0.0 + + + net.glxn + qrgen + 1.3 + + diff --git a/src/main/java/io/bitsquare/BitSquare.java b/src/main/java/io/bitsquare/BitSquare.java index 23130450e7..7fe0ea6838 100644 --- a/src/main/java/io/bitsquare/BitSquare.java +++ b/src/main/java/io/bitsquare/BitSquare.java @@ -1,12 +1,18 @@ package io.bitsquare; +import com.google.bitcoin.store.BlockStoreException; +import com.google.bitcoin.utils.BriefLogFormatter; +import com.google.bitcoin.utils.Threading; +import com.google.common.base.Throwables; import com.google.inject.Guice; import com.google.inject.Injector; +import io.bitsquare.btc.IWalletFacade; import io.bitsquare.di.BitSquareModule; import io.bitsquare.di.GuiceFXMLLoader; import io.bitsquare.setup.ISetup; import io.bitsquare.setup.MockSetup; import javafx.application.Application; +import javafx.application.Platform; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; @@ -18,6 +24,7 @@ import java.io.IOException; public class BitSquare extends Application { private static final Logger log = LoggerFactory.getLogger(BitSquare.class); + private IWalletFacade walletFacade; public static void main(String[] args) { @@ -25,27 +32,66 @@ public class BitSquare extends Application } @Override - public void start(Stage stage) + public void start(Stage stage) throws Exception { - Injector injector = Guice.createInjector(new BitSquareModule()); - ISetup setup = injector.getInstance(MockSetup.class); + // Show the crash dialog for any exceptions that we don't handle and that hit the main loop. + //GuiUtils.handleCrashesOnThisThread(); + try + { + init(stage); + } catch (Throwable t) + { + // Nicer message for the case where the block store file is locked. + if (Throwables.getRootCause(t) instanceof BlockStoreException) + { + //GuiUtils.informationalAlert("Already running", "This application is already running and cannot be started twice."); + } + else + { + throw t; + } + } + } + @Override + public void stop() throws Exception + { + walletFacade.terminateWallet(); + + super.stop(); + } + + private void init(Stage stage) throws IOException + { + // Make log output concise. + BriefLogFormatter.init(); + + // Tell bitcoinj to run event handlers on the JavaFX UI thread. This keeps things simple and means + // we cannot forget to switch threads when adding event handlers. Unfortunately, the DownloadListener + // we give to the app kit is currently an exception and runs on a library thread. It'll get fixed in + // a future version. + Threading.USER_THREAD = Platform::runLater; + + final Injector injector = Guice.createInjector(new BitSquareModule()); + walletFacade = injector.getInstance(IWalletFacade.class); + + final ISetup setup = injector.getInstance(MockSetup.class); setup.applyPersistedData(); stage.setTitle("BitSquare"); - GuiceFXMLLoader loader = new GuiceFXMLLoader(injector); - try - { - Parent mainView = loader.load(BitSquare.class.getResourceAsStream("/io/bitsquare/gui/MainView.fxml")); - Scene scene = new Scene(mainView, 800, 600); - scene.getStylesheets().setAll(getClass().getResource("/io/bitsquare/gui/global.css").toExternalForm()); - stage.setScene(scene); - stage.show(); - } catch (IOException e) - { - e.printStackTrace(); - } - } + // main view + final GuiceFXMLLoader loader = new GuiceFXMLLoader(injector); + final Parent mainView = loader.load(BitSquare.class.getResourceAsStream("/io/bitsquare/gui/MainView.fxml")); + final Scene scene = new Scene(mainView, 800, 600); + stage.setScene(scene); + // apply css + final String global = getClass().getResource("/io/bitsquare/gui/global.css").toExternalForm(); + // final String textValidation = getClass().getResource("/wallettemplate/utils/text-validation.css").toExternalForm(); + //scene.getStylesheets().setAll(global, textValidation); + scene.getStylesheets().setAll(global); + + stage.show(); + } } diff --git a/src/main/java/io/bitsquare/btc/IWalletFacade.java b/src/main/java/io/bitsquare/btc/IWalletFacade.java index 3981da16bb..3c36732e3d 100644 --- a/src/main/java/io/bitsquare/btc/IWalletFacade.java +++ b/src/main/java/io/bitsquare/btc/IWalletFacade.java @@ -1,9 +1,19 @@ package io.bitsquare.btc; +import com.google.bitcoin.core.PeerEventListener; + import java.math.BigInteger; public interface IWalletFacade { + public static final String MAIN_NET = "MAIN_NET"; + public static final String TEST_NET = "TEST_NET"; + public static final String REG_TEST_NET = "REG_TEST_NET"; + + void initWallet(PeerEventListener peerEventListener); + + void terminateWallet(); + BigInteger getBalance(); boolean pay(BigInteger satoshisToPay, String destinationAddress); diff --git a/src/main/java/io/bitsquare/btc/MockWalletFacade.java b/src/main/java/io/bitsquare/btc/MockWalletFacade.java deleted file mode 100644 index 3443a2bdbe..0000000000 --- a/src/main/java/io/bitsquare/btc/MockWalletFacade.java +++ /dev/null @@ -1,52 +0,0 @@ -package io.bitsquare.btc; - - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.math.BigInteger; -import java.util.UUID; - -/** - * Gateway to wallet - */ -public class MockWalletFacade implements IWalletFacade -{ - private static final Logger log = LoggerFactory.getLogger(MockWalletFacade.class); - - private BigInteger balance; - - public MockWalletFacade() - { - balance = new BigInteger("100000000"); - } - - @Override - public BigInteger getBalance() - { - return balance; - } - - @Override - public boolean pay(BigInteger satoshisToPay, String destinationAddress) - { - if (getBalance().subtract(satoshisToPay).longValue() > 0) - { - log.info("Pay " + satoshisToPay.toString() + " Satoshis to " + destinationAddress); - return true; - } - else - { - log.warn("Not enough funds in wallet for paying " + satoshisToPay.toString() + " Satoshis."); - return false; - } - - } - - @Override - public KeyPair createNewAddress() - { - //MOCK - return new KeyPair(UUID.randomUUID().toString(), UUID.randomUUID().toString()); - } -} diff --git a/src/main/java/io/bitsquare/btc/WalletFacade.java b/src/main/java/io/bitsquare/btc/WalletFacade.java new file mode 100644 index 0000000000..853b0f30ce --- /dev/null +++ b/src/main/java/io/bitsquare/btc/WalletFacade.java @@ -0,0 +1,97 @@ +package io.bitsquare.btc; + +import com.google.bitcoin.core.NetworkParameters; +import com.google.bitcoin.core.PeerEventListener; +import com.google.bitcoin.kits.WalletAppKit; +import com.google.bitcoin.params.MainNetParams; +import com.google.bitcoin.params.RegTestParams; +import com.google.inject.Inject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.math.BigInteger; +import java.util.UUID; + +public class WalletFacade implements IWalletFacade +{ + private static final Logger log = LoggerFactory.getLogger(WalletFacade.class); + private NetworkParameters networkParameters; + private WalletAppKit walletAppKit; + + private BigInteger balance; + + @Inject + public WalletFacade(NetworkParameters networkParameters, WalletAppKit walletAppKit) + { + this.networkParameters = networkParameters; + this.walletAppKit = walletAppKit; + + balance = new BigInteger("100000000"); + } + + public void initWallet(PeerEventListener peerEventListener) + { + if (networkParameters == RegTestParams.get()) + { + walletAppKit.connectToLocalHost(); // You should run a regtest mode bitcoind locally. + } + else if (networkParameters == MainNetParams.get()) + { + // Checkpoints are block headers that ship inside our app: for a new user, we pick the last header + // in the checkpoints file and then download the rest from the network. It makes things much faster. + // Checkpoint files are made using the BuildCheckpoints tool and usually we have to download the + // last months worth or more (takes a few seconds). + walletAppKit.setCheckpoints(getClass().getResourceAsStream("/wallet/checkpoints")); + } + + // Now configure and start the appkit. This will take a second or two - we could show a temporary splash screen + // or progress widget to keep the user engaged whilst we initialise, but we don't. + walletAppKit.setDownloadListener(peerEventListener) + .setBlockingStartup(false) + .setUserAgent("BitSquare", "1.0"); + walletAppKit.startAsync(); + walletAppKit.awaitRunning(); + // Don't make the user wait for confirmations for now, as the intention is they're sending it their own money! + walletAppKit.wallet().allowSpendingUnconfirmedTransactions(); + walletAppKit.peerGroup().setMaxConnections(11); + + log.info(walletAppKit.wallet().toString()); + } + + public void terminateWallet() + { + walletAppKit.stopAsync(); + walletAppKit.awaitTerminated(); + } + + + //MOCK... + @Override + public BigInteger getBalance() + { + return balance; + } + + @Override + public boolean pay(BigInteger satoshisToPay, String destinationAddress) + { + if (getBalance().subtract(satoshisToPay).longValue() > 0) + { + log.info("Pay " + satoshisToPay.toString() + " Satoshis to " + destinationAddress); + return true; + } + else + { + log.warn("Not enough funds in wallet for paying " + satoshisToPay.toString() + " Satoshis."); + return false; + } + + } + + @Override + public KeyPair createNewAddress() + { + //MOCK + return new KeyPair(UUID.randomUUID().toString(), UUID.randomUUID().toString()); + } +} diff --git a/src/main/java/io/bitsquare/di/BitSquareModule.java b/src/main/java/io/bitsquare/di/BitSquareModule.java index 4190481eb1..683689ffeb 100644 --- a/src/main/java/io/bitsquare/di/BitSquareModule.java +++ b/src/main/java/io/bitsquare/di/BitSquareModule.java @@ -1,10 +1,19 @@ package io.bitsquare.di; +import com.google.bitcoin.core.NetworkParameters; +import com.google.bitcoin.kits.WalletAppKit; +import com.google.bitcoin.params.MainNetParams; +import com.google.bitcoin.params.RegTestParams; +import com.google.bitcoin.params.TestNet3Params; import com.google.inject.AbstractModule; +import com.google.inject.Inject; +import com.google.inject.Provider; +import com.google.inject.name.Named; +import com.google.inject.name.Names; import io.bitsquare.btc.BlockChainFacade; import io.bitsquare.btc.IWalletFacade; -import io.bitsquare.btc.MockWalletFacade; +import io.bitsquare.btc.WalletFacade; import io.bitsquare.crypto.ICryptoFacade; import io.bitsquare.crypto.MockCryptoFacade; import io.bitsquare.msg.IMessageFacade; @@ -21,8 +30,12 @@ import io.bitsquare.trade.orderbook.MockOrderBook; import io.bitsquare.trade.orderbook.OrderBookFilter; import io.bitsquare.user.User; +import java.io.File; + public class BitSquareModule extends AbstractModule { + + @Override protected void configure() { @@ -35,10 +48,62 @@ public class BitSquareModule extends AbstractModule bind(OrderBookFilterSettings.class).asEagerSingleton(); bind(ICryptoFacade.class).to(MockCryptoFacade.class).asEagerSingleton(); - bind(IWalletFacade.class).to(MockWalletFacade.class).asEagerSingleton(); + bind(IWalletFacade.class).to(WalletFacade.class).asEagerSingleton(); bind(BlockChainFacade.class).asEagerSingleton(); bind(IMessageFacade.class).to(MessageFacade.class).asEagerSingleton(); bind(TradingFacade.class).asEagerSingleton(); + + bind(String.class).annotatedWith(Names.named("networkType")).toInstance(IWalletFacade.MAIN_NET); + bind(NetworkParameters.class).toProvider(NetworkParametersProvider.class).asEagerSingleton(); + bind(WalletAppKit.class).toProvider(WalletAppKitProvider.class).asEagerSingleton(); + } + + +} + +class WalletAppKitProvider implements Provider +{ + private NetworkParameters networkParameters; + + @Inject + public WalletAppKitProvider(NetworkParameters networkParameters) + { + this.networkParameters = networkParameters; + } + + public WalletAppKit get() + { + return new WalletAppKit(networkParameters, new File("."), "bitsquare"); + } +} + +class NetworkParametersProvider implements Provider +{ + private String networkType; + + @Inject + public NetworkParametersProvider(@Named("networkType") String networkType) + { + this.networkType = networkType; + } + + public NetworkParameters get() + { + NetworkParameters result = null; + + switch (networkType) + { + case IWalletFacade.MAIN_NET: + result = MainNetParams.get(); + break; + case IWalletFacade.TEST_NET: + result = TestNet3Params.get(); + break; + case IWalletFacade.REG_TEST_NET: + result = RegTestParams.get(); + break; + } + return result; } } \ No newline at end of file diff --git a/src/main/java/io/bitsquare/gui/MainController.java b/src/main/java/io/bitsquare/gui/MainController.java index 7125b4b684..ff373ad3bd 100644 --- a/src/main/java/io/bitsquare/gui/MainController.java +++ b/src/main/java/io/bitsquare/gui/MainController.java @@ -1,13 +1,18 @@ package io.bitsquare.gui; +import com.google.bitcoin.core.DownloadListener; import com.google.inject.Inject; import io.bitsquare.BitSquare; +import io.bitsquare.btc.IWalletFacade; import io.bitsquare.di.GuiceFXMLLoader; import io.bitsquare.gui.trade.TradeController; import io.bitsquare.gui.util.Icons; import io.bitsquare.settings.Settings; import io.bitsquare.trade.Direction; import io.bitsquare.trade.orderbook.OrderBookFilter; +import javafx.animation.FadeTransition; +import javafx.animation.Interpolator; +import javafx.application.Platform; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; @@ -15,61 +20,59 @@ import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Node; -import javafx.scene.control.ComboBox; -import javafx.scene.control.Label; -import javafx.scene.control.ToggleButton; -import javafx.scene.control.ToggleGroup; +import javafx.scene.control.*; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; +import javafx.util.Duration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.net.URL; import java.util.Currency; +import java.util.Date; import java.util.ResourceBundle; public class MainController implements Initializable, INavigationController { + private static final Logger log = LoggerFactory.getLogger(MainController.class); + private Settings settings; private OrderBookFilter orderBookFilter; + private IWalletFacade walletFacade; private IChildController childController; private ToggleGroup toggleGroup; private ToggleButton prevToggleButton; private Image prevToggleButtonIcon; + public ProgressBar networkSyncProgressBar; + public Label networkSyncInfoLabel; @FXML public Pane contentPane; - public HBox leftNavPane, rightNavPane; + public HBox leftNavPane, rightNavPane, footerContainer; @Inject - public MainController(Settings settings, OrderBookFilter orderBookFilter) + public MainController(Settings settings, OrderBookFilter orderBookFilter, IWalletFacade walletFacade) { this.settings = settings; this.orderBookFilter = orderBookFilter; + this.walletFacade = walletFacade; } @Override public void initialize(URL url, ResourceBundle rb) { - toggleGroup = new ToggleGroup(); + buildNavigation(); - ToggleButton homeButton = addNavButton(leftNavPane, "Overview", Icons.HOME, Icons.HOME, INavigationController.HOME); - ToggleButton buyButton = addNavButton(leftNavPane, "Buy BTC", Icons.NAV_BUY, Icons.NAV_BUY_ACTIVE, INavigationController.TRADE, Direction.BUY); - ToggleButton sellButton = addNavButton(leftNavPane, "Sell BTC", Icons.NAV_SELL, Icons.NAV_SELL_ACTIVE, INavigationController.TRADE, Direction.SELL); - addNavButton(leftNavPane, "Orders", Icons.ORDERS, Icons.ORDERS, INavigationController.ORDERS); - addNavButton(leftNavPane, "History", Icons.HISTORY, Icons.HISTORY, INavigationController.HISTORY); - addNavButton(leftNavPane, "Funds", Icons.FUNDS, Icons.FUNDS, INavigationController.FUNDS); - addNavButton(leftNavPane, "Message", Icons.MSG, Icons.MSG, INavigationController.MSG); - addCurrencyComboBox(); - addNavButton(rightNavPane, "Settings", Icons.SETTINGS, Icons.SETTINGS, INavigationController.SETTINGS); + buildFooter(); - - sellButton.fire(); - //homeButton.fire(); + walletFacade.initWallet(new ProgressBarUpdater()); } + @Override public IChildController navigateToView(String fxmlView, String title) { @@ -99,6 +102,34 @@ public class MainController implements Initializable, INavigationController return childController; } + private void buildNavigation() + { + toggleGroup = new ToggleGroup(); + + ToggleButton homeButton = addNavButton(leftNavPane, "Overview", Icons.HOME, Icons.HOME, INavigationController.HOME); + ToggleButton buyButton = addNavButton(leftNavPane, "Buy BTC", Icons.NAV_BUY, Icons.NAV_BUY_ACTIVE, INavigationController.TRADE, Direction.BUY); + ToggleButton sellButton = addNavButton(leftNavPane, "Sell BTC", Icons.NAV_SELL, Icons.NAV_SELL_ACTIVE, INavigationController.TRADE, Direction.SELL); + addNavButton(leftNavPane, "Orders", Icons.ORDERS, Icons.ORDERS, INavigationController.ORDERS); + addNavButton(leftNavPane, "History", Icons.HISTORY, Icons.HISTORY, INavigationController.HISTORY); + addNavButton(leftNavPane, "Funds", Icons.FUNDS, Icons.FUNDS, INavigationController.FUNDS); + addNavButton(leftNavPane, "Message", Icons.MSG, Icons.MSG, INavigationController.MSG); + addCurrencyComboBox(); + addNavButton(rightNavPane, "Settings", Icons.SETTINGS, Icons.SETTINGS, INavigationController.SETTINGS); + + sellButton.fire(); + //homeButton.fire(); + } + + private void buildFooter() + { + networkSyncInfoLabel = new Label(); + networkSyncInfoLabel.setText("Synchronize with network..."); + networkSyncProgressBar = new ProgressBar(); + networkSyncProgressBar.setPrefWidth(200); + networkSyncProgressBar.setProgress(-1); + footerContainer.getChildren().addAll(networkSyncProgressBar, networkSyncInfoLabel); + } + private ToggleButton addNavButton(Pane parent, String title, String iconId, String iconIdActivated, String navTarget) { return addNavButton(parent, title, iconId, iconIdActivated, navTarget, null); @@ -162,4 +193,40 @@ public class MainController implements Initializable, INavigationController holder.getChildren().add(currencyComboBox); rightNavPane.getChildren().add(holder); } + + private void setProgress(double percent) + { + networkSyncProgressBar.setProgress(percent / 100.0); + networkSyncInfoLabel.setText("Synchronize with network: " + (int) percent + "%"); + } + + private void doneDownload() + { + networkSyncInfoLabel.setText("Sync with network: Done"); + + FadeTransition fade = new FadeTransition(Duration.millis(700), footerContainer); + fade.setToValue(0.0); + fade.setCycleCount(1); + fade.setInterpolator(Interpolator.EASE_BOTH); + fade.play(); + fade.setOnFinished(e -> footerContainer.getChildren().clear()); + } + + private class ProgressBarUpdater extends DownloadListener + { + @Override + protected void progress(double percent, int blocksSoFar, Date date) + { + super.progress(percent, blocksSoFar, date); + Platform.runLater(() -> MainController.this.setProgress(percent)); + } + + @Override + protected void doneDownload() + { + super.doneDownload(); + Platform.runLater(MainController.this::doneDownload); + } + + } } \ No newline at end of file diff --git a/src/main/java/io/bitsquare/gui/MainView.fxml b/src/main/java/io/bitsquare/gui/MainView.fxml index f3b9269c29..7de5014ed5 100644 --- a/src/main/java/io/bitsquare/gui/MainView.fxml +++ b/src/main/java/io/bitsquare/gui/MainView.fxml @@ -8,7 +8,9 @@ - + diff --git a/src/main/java/io/bitsquare/gui/funds/FundsController.java b/src/main/java/io/bitsquare/gui/funds/FundsController.java index b061a88ad9..feab2b0c72 100644 --- a/src/main/java/io/bitsquare/gui/funds/FundsController.java +++ b/src/main/java/io/bitsquare/gui/funds/FundsController.java @@ -2,19 +2,25 @@ package io.bitsquare.gui.funds; import io.bitsquare.gui.IChildController; import io.bitsquare.gui.INavigationController; +import javafx.fxml.FXML; import javafx.fxml.Initializable; +import javafx.scene.layout.Pane; import java.net.URL; import java.util.ResourceBundle; + public class FundsController implements Initializable, IChildController { + private INavigationController navigationController; + @FXML + public Pane rootContainer; + @Override public void initialize(URL url, ResourceBundle rb) { - } @Override @@ -22,5 +28,6 @@ public class FundsController implements Initializable, IChildController { this.navigationController = navigationController; } + } diff --git a/src/main/java/io/bitsquare/gui/funds/FundsView.fxml b/src/main/java/io/bitsquare/gui/funds/FundsView.fxml index 9fcfeed4e1..3eda0873fd 100644 --- a/src/main/java/io/bitsquare/gui/funds/FundsView.fxml +++ b/src/main/java/io/bitsquare/gui/funds/FundsView.fxml @@ -1,6 +1,6 @@ + xmlns:fx="http://javafx.com/fxml" fx:id="rootContainer"> \ No newline at end of file diff --git a/src/main/java/io/bitsquare/gui/trade/tradeprocess/TradeProcessController.java b/src/main/java/io/bitsquare/gui/trade/tradeprocess/TradeProcessController.java index 0e0691cdc5..e5fddc2ade 100644 --- a/src/main/java/io/bitsquare/gui/trade/tradeprocess/TradeProcessController.java +++ b/src/main/java/io/bitsquare/gui/trade/tradeprocess/TradeProcessController.java @@ -199,7 +199,7 @@ public class TradeProcessController implements Initializable, IChildController private void onBankTransferInited() { infoLabel.setText("Bank transfer has been inited.\nCheck your bank account and continue when you have received the money.\n"); - nextButton.setText("Money received on Bank account"); + nextButton.setText("I have received the bank transfer"); nextButton.setOnAction(e -> releaseBTC()); vBox.getChildren().add(nextButton); } diff --git a/src/main/java/io/bitsquare/trade/TradingFacade.java b/src/main/java/io/bitsquare/trade/TradingFacade.java index 11ad75d20c..639344e020 100644 --- a/src/main/java/io/bitsquare/trade/TradingFacade.java +++ b/src/main/java/io/bitsquare/trade/TradingFacade.java @@ -2,8 +2,8 @@ package io.bitsquare.trade; import com.google.inject.Inject; import io.bitsquare.btc.BlockChainFacade; +import io.bitsquare.btc.IWalletFacade; import io.bitsquare.btc.KeyPair; -import io.bitsquare.btc.MockWalletFacade; import io.bitsquare.crypto.ICryptoFacade; import io.bitsquare.msg.IMessageFacade; import io.bitsquare.msg.Message; @@ -29,7 +29,7 @@ public class TradingFacade private User user; private IMessageFacade messageFacade; private BlockChainFacade blockChainFacade; - private MockWalletFacade walletFacade; + private IWalletFacade walletFacade; private ICryptoFacade cryptoFacade; private Settings settings; @@ -38,7 +38,7 @@ public class TradingFacade Settings settings, IMessageFacade messageFacade, BlockChainFacade blockChainFacade, - MockWalletFacade walletFacade, + IWalletFacade walletFacade, ICryptoFacade cryptoFacade) { this.user = user; diff --git a/src/main/java/io/bitsquare/trade/payment/process/PaymentProcess.java b/src/main/java/io/bitsquare/trade/payment/process/PaymentProcess.java index accf29fc3b..5181160ed6 100644 --- a/src/main/java/io/bitsquare/trade/payment/process/PaymentProcess.java +++ b/src/main/java/io/bitsquare/trade/payment/process/PaymentProcess.java @@ -2,7 +2,7 @@ package io.bitsquare.trade.payment.process; import com.google.inject.Inject; import io.bitsquare.btc.BlockChainFacade; -import io.bitsquare.btc.MockWalletFacade; +import io.bitsquare.btc.IWalletFacade; import io.bitsquare.msg.IMessageFacade; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,7 +26,7 @@ public class PaymentProcess protected String takerOutputPayment; protected String multiSigAddress; - private MockWalletFacade wallet; + private IWalletFacade wallet; public PaymentProcess() { @@ -39,7 +39,7 @@ public class PaymentProcess } @Inject - public void setWallet(MockWalletFacade wallet) + public void setWallet(IWalletFacade wallet) { this.wallet = wallet; } diff --git a/src/main/resources/wallet/checkpoints b/src/main/resources/wallet/checkpoints new file mode 100644 index 0000000000..bc1b2e5074 Binary files /dev/null and b/src/main/resources/wallet/checkpoints differ