This commit is contained in:
Manfred Karrer 2015-03-14 09:43:10 +01:00
parent 871db17edf
commit 1b883cf386
62 changed files with 1125 additions and 575 deletions

View file

@ -188,12 +188,12 @@
<version>1.0.2</version> <version>1.0.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.vinumeris</groupId> <groupId>com.vinumeris</groupId>
<artifactId>updatefx</artifactId> <artifactId>updatefx</artifactId>
<version>1.2</version> <version>1.2</version>
</dependency> </dependency>
<!-- <!--
<dependency> <dependency>
<groupId>com.vinumeris</groupId> <groupId>com.vinumeris</groupId>

View file

@ -76,7 +76,7 @@ public class BitsquareAppMain extends BitsquareExecutable {
} }
BitsquareEnvironment bitsquareEnvironment = new BitsquareEnvironment(options); BitsquareEnvironment bitsquareEnvironment = new BitsquareEnvironment(options);
String updatesDirectory = bitsquareEnvironment.getProperty(BitsquareEnvironment.APP_DATA_DIR_KEY); String updatesDirectory = bitsquareEnvironment.getProperty(BitsquareEnvironment.APP_DATA_DIR_KEY);
// app dir need to be setup before UpdateFX bootstrap // app dir need to be setup before UpdateFX bootstrap
initAppDir(updatesDirectory); initAppDir(updatesDirectory);

View file

@ -53,7 +53,7 @@ public class UpdateProcess {
// Edit version for updateFX // Edit version for updateFX
private static final int BUILD_VERSION = 3; private static final int BUILD_VERSION = 3;
private static final List<ECPoint> UPDATE_SIGNING_KEYS = Crypto.decode("0296CFF54A8B1611499D4C1024E654140AFBB58C505FE4BB7C847B4F4A7C683DF6"); private static final List<ECPoint> UPDATE_SIGNING_KEYS = Crypto.decode("0296CFF54A8B1611499D4C1024E654140AFBB58C505FE4BB7C847B4F4A7C683DF6");
private static final String UPDATES_BASE_URL = "http://bitsquare.io/updateFX/"; private static final String UPDATES_BASE_URL = "http://bitsquare.io/updateFX/";
private static final int UPDATE_SIGNING_THRESHOLD = 1; private static final int UPDATE_SIGNING_THRESHOLD = 1;
@ -62,7 +62,7 @@ public class UpdateProcess {
public static int getBuildVersion() { public static int getBuildVersion() {
return BUILD_VERSION; return BUILD_VERSION;
} }
private Environment environment; private Environment environment;
public enum State { public enum State {
@ -107,7 +107,7 @@ public class UpdateProcess {
} }
}); });
timeoutTimer.start(); timeoutTimer.start();
String agent = environment.getProperty(BitsquareEnvironment.APP_NAME_KEY) + BUILD_VERSION; String agent = environment.getProperty(BitsquareEnvironment.APP_NAME_KEY) + BUILD_VERSION;
Path dataDirPath = new File(environment.getProperty(BitsquareEnvironment.APP_DATA_DIR_KEY)).toPath(); Path dataDirPath = new File(environment.getProperty(BitsquareEnvironment.APP_DATA_DIR_KEY)).toPath();
Updater updater = new Updater(UPDATES_BASE_URL, agent, BUILD_VERSION, dataDirPath, ROOT_CLASS_PATH, Updater updater = new Updater(UPDATES_BASE_URL, agent, BUILD_VERSION, dataDirPath, ROOT_CLASS_PATH,
@ -130,7 +130,7 @@ public class UpdateProcess {
updater.setOnSucceeded(event -> { updater.setOnSucceeded(event -> {
try { try {
UpdateSummary summary = updater.get(); UpdateSummary summary = updater.get();
log.info("summary " +summary.toString()); log.info("summary " + summary.toString());
if (summary.descriptions != null && summary.descriptions.size() > 0) { if (summary.descriptions != null && summary.descriptions.size() > 0) {
log.info("One liner: {}", summary.descriptions.get(0).getOneLiner()); log.info("One liner: {}", summary.descriptions.get(0).getOneLiner());
log.info("{}", summary.descriptions.get(0).getDescription()); log.info("{}", summary.descriptions.get(0).getDescription());

View file

@ -43,9 +43,9 @@ import org.slf4j.LoggerFactory;
public class TomP2PArbitratorMessageService implements ArbitratorMessageService { public class TomP2PArbitratorMessageService implements ArbitratorMessageService {
private static final Logger log = LoggerFactory.getLogger(TomP2PArbitratorMessageService.class); private static final Logger log = LoggerFactory.getLogger(TomP2PArbitratorMessageService.class);
private static final String ARBITRATORS_ROOT = "ArbitratorsRoot"; private static final String ARBITRATORS_ROOT = "ArbitratorsRoot";
private final TomP2PNode tomP2PNode; private final TomP2PNode tomP2PNode;
private final List<ArbitratorListener> arbitratorListeners = new ArrayList<>(); private final List<ArbitratorListener> arbitratorListeners = new ArrayList<>();
private Executor executor; private Executor executor;
@ -59,7 +59,7 @@ public class TomP2PArbitratorMessageService implements ArbitratorMessageService
this.tomP2PNode = tomP2PNode; this.tomP2PNode = tomP2PNode;
} }
public void setExecutor(Executor executor) { public void setExecutor(Executor executor) {
this.executor = executor; this.executor = executor;
} }

View file

@ -29,7 +29,7 @@ import javax.inject.Inject;
public class FeePolicy { public class FeePolicy {
public static final Coin TX_FEE = Transaction.REFERENCE_DEFAULT_MIN_TX_FEE; // dropped down to 0.00001 BTC public static final Coin TX_FEE = Transaction.REFERENCE_DEFAULT_MIN_TX_FEE; // dropped down to 0.00001 BTC
// TODO: Change REGISTRATION_FEE to 0.00001 (See https://github.com/bitsquare/bitsquare/issues/228) // TODO: Change REGISTRATION_FEE to 0.00001 (See https://github.com/bitsquare/bitsquare/issues/228)
public static final Coin REGISTRATION_FEE = TX_FEE.add(TX_FEE); public static final Coin REGISTRATION_FEE = TX_FEE.add(TX_FEE);

View file

@ -84,7 +84,7 @@ public class Navigation {
} }
currentPath = newPath; currentPath = newPath;
persistence.write(this, CURRENT_PATH_KEY, (List<? extends Serializable>)currentPath); persistence.write(this, CURRENT_PATH_KEY, (List<? extends Serializable>) currentPath);
listeners.stream().forEach((e) -> e.onNavigationRequested(currentPath)); listeners.stream().forEach((e) -> e.onNavigationRequested(currentPath));
} }

View file

@ -45,22 +45,22 @@ import javafx.scene.control.*;
* <p> * <p>
* ProgressIndicator sets focusTraversable to false. * ProgressIndicator sets focusTraversable to false.
* </p> * </p>
* <p> * <p/>
* <p> * <p/>
* This first example creates a ProgressIndicator with an indeterminate value : * This first example creates a ProgressIndicator with an indeterminate value :
* <pre><code> * <pre><code>
* import javafx.scene.control.ProgressIndicator; * import javafx.scene.control.ProgressIndicator;
* ProgressIndicator p1 = new ProgressIndicator(); * ProgressIndicator p1 = new ProgressIndicator();
* </code></pre> * </code></pre>
* <p> * <p/>
* <p> * <p/>
* This next example creates a ProgressIndicator which is 25% complete : * This next example creates a ProgressIndicator which is 25% complete :
* <pre><code> * <pre><code>
* import javafx.scene.control.ProgressIndicator; * import javafx.scene.control.ProgressIndicator;
* ProgressIndicator p2 = new ProgressIndicator(); * ProgressIndicator p2 = new ProgressIndicator();
* p2.setProgress(0.25F); * p2.setProgress(0.25F);
* </code></pre> * </code></pre>
* <p> * <p/>
* Implementation of ProgressIndicator According to JavaFX UI Control API Specification * Implementation of ProgressIndicator According to JavaFX UI Control API Specification
* *
* @since JavaFX 2.0 * @since JavaFX 2.0
@ -83,7 +83,7 @@ public class ConfidenceProgressIndicator extends Control {
**************************************************************************/ **************************************************************************/
/** /**
* Initialize the style class to 'progress-indicator'. * Initialize the style class to 'progress-indicator'.
* <p> * <p/>
* This is the selector class from which CSS can be used to style * This is the selector class from which CSS can be used to style
* this control. * this control.
*/ */

View file

@ -148,7 +148,7 @@ class MainViewModel implements ViewModel {
public void initBackend() { public void initBackend() {
Platform.runLater(() -> updateProcess.init()); Platform.runLater(() -> updateProcess.init());
setBitcoinNetworkSyncProgress(-1); setBitcoinNetworkSyncProgress(-1);
walletService.getDownloadProgress().subscribe( walletService.getDownloadProgress().subscribe(
percentage -> Platform.runLater(() -> { percentage -> Platform.runLater(() -> {

View file

@ -126,7 +126,6 @@ class IrcAccountViewModel extends ActivatableWithDataModel<IrcAccountDataModel>
} }
private InputValidator.ValidationResult validateInput() { private InputValidator.ValidationResult validateInput() {
InputValidator.ValidationResult result = nickNameValidator.validate(dataModel.nickName.get()); InputValidator.ValidationResult result = nickNameValidator.validate(dataModel.nickName.get());
if (dataModel.currency.get() == null) if (dataModel.currency.get() == null)

View file

@ -60,7 +60,7 @@
<Insets bottom="-15"/> <Insets bottom="-15"/>
</GridPane.margin> </GridPane.margin>
</Label> </Label>
<CheckBox fx:id="interceptBeforeCheckBox" onAction="#onCheckBoxChanged" GridPane.rowIndex="3" GridPane.columnIndex="1"> <CheckBox fx:id="interceptBeforeCheckBox" onAction="#onCheckBoxChanged" GridPane.rowIndex="3" GridPane.columnIndex="1">
<GridPane.margin> <GridPane.margin>
<Insets bottom="-15"/> <Insets bottom="-15"/>
</GridPane.margin> </GridPane.margin>

View file

@ -50,5 +50,4 @@ class PreferencesViewModel extends ActivatableWithDataModel<PreferencesDataModel
} }
} }

View file

@ -264,7 +264,6 @@ class CreateOfferDataModel implements Activatable, DataModel {
} }
private void updateBalance(@NotNull Coin balance) { private void updateBalance(@NotNull Coin balance) {
isWalletFunded.set(totalToPayAsCoin.get() != null && balance.compareTo(totalToPayAsCoin.get()) >= 0); isWalletFunded.set(totalToPayAsCoin.get() != null && balance.compareTo(totalToPayAsCoin.get()) >= 0);
} }

View file

@ -48,7 +48,7 @@ import org.slf4j.LoggerFactory;
/** /**
* Central point for formatting and input parsing. * Central point for formatting and input parsing.
* <p> * <p/>
* Note that we never use for text input values any coin or currency symbol or code. * Note that we never use for text input values any coin or currency symbol or code.
* BtcFormat does not support * BtcFormat does not support
*/ */

View file

@ -26,7 +26,7 @@ import javax.inject.Inject;
/** /**
* BtcValidator for validating BTC values. * BtcValidator for validating BTC values.
* <p> * <p/>
* That class implements just what we need for the moment. It is not intended as a general purpose library class. * That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/ */
public final class BtcAddressValidator extends InputValidator { public final class BtcAddressValidator extends InputValidator {

View file

@ -25,7 +25,7 @@ import java.math.BigDecimal;
/** /**
* BtcValidator for validating BTC values. * BtcValidator for validating BTC values.
* <p> * <p/>
* That class implements just what we need for the moment. It is not intended as a general purpose library class. * That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/ */
public final class BtcValidator extends NumberValidator { public final class BtcValidator extends NumberValidator {

View file

@ -25,7 +25,7 @@ import javax.inject.Inject;
/** /**
* FiatNumberValidator for validating fiat values. * FiatNumberValidator for validating fiat values.
* <p> * <p/>
* That class implements just what we need for the moment. It is not intended as a general purpose library class. * That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/ */
public final class FiatValidator extends NumberValidator { public final class FiatValidator extends NumberValidator {

View file

@ -21,7 +21,7 @@ import io.bitsquare.locale.BSResources;
/** /**
* Base class for other specialized validators. * Base class for other specialized validators.
* <p> * <p/>
* That class implements just what we need for the moment. It is not intended as a general purpose library class. * That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/ */
public class InputValidator { public class InputValidator {

View file

@ -24,7 +24,7 @@ import io.bitsquare.locale.BSResources;
* Localisation not supported at the moment * Localisation not supported at the moment
* The decimal mark can be either "." or ",". Thousand separators are not supported yet, * The decimal mark can be either "." or ",". Thousand separators are not supported yet,
* but might be added alter with Local support. * but might be added alter with Local support.
* <p> * <p/>
* That class implements just what we need for the moment. It is not intended as a general purpose library class. * That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/ */
public abstract class NumberValidator extends InputValidator { public abstract class NumberValidator extends InputValidator {

View file

@ -25,7 +25,7 @@ import java.math.BigDecimal;
/** /**
* BtcValidator for validating BTC values. * BtcValidator for validating BTC values.
* <p> * <p/>
* That class implements just what we need for the moment. It is not intended as a general purpose library class. * That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/ */
public final class OptionalBtcValidator extends NumberValidator { public final class OptionalBtcValidator extends NumberValidator {

View file

@ -25,7 +25,7 @@ import javax.inject.Inject;
/** /**
* FiatNumberValidator for validating fiat values. * FiatNumberValidator for validating fiat values.
* <p> * <p/>
* That class implements just what we need for the moment. It is not intended as a general purpose library class. * That class implements just what we need for the moment. It is not intended as a general purpose library class.
*/ */
public final class OptionalFiatValidator extends NumberValidator { public final class OptionalFiatValidator extends NumberValidator {

File diff suppressed because it is too large Load diff

View file

@ -22,7 +22,7 @@ import com.google.common.base.Objects;
public final class Node { public final class Node {
public static final String NAME_KEY = "node.name"; public static final String NAME_KEY = "node.name";
public static final String PORT_KEY = "node.port"; public static final String PORT_KEY = "node.port";
/** /**
* Default port is one <a * Default port is one <a
* href="https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?&page=103"> * href="https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?&page=103">

View file

@ -86,7 +86,7 @@ public class Offer implements Serializable {
// don't access directly as it might be null; use getStateProperty() which creates an object if not instantiated // don't access directly as it might be null; use getStateProperty() which creates an object if not instantiated
private transient ObjectProperty<State> stateProperty; private transient ObjectProperty<State> stateProperty;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Constructor // Constructor
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -255,7 +255,8 @@ public class Offer implements Serializable {
checkNotNull(getMinAmount(), "MinAmount is null"); checkNotNull(getMinAmount(), "MinAmount is null");
checkNotNull(getPrice(), "Price is null"); checkNotNull(getPrice(), "Price is null");
checkArgument(getMinAmount().compareTo(Restrictions.MIN_TRADE_AMOUNT) >= 0, "MinAmount is less then " + Restrictions.MIN_TRADE_AMOUNT.toFriendlyString()); checkArgument(getMinAmount().compareTo(Restrictions.MIN_TRADE_AMOUNT) >= 0, "MinAmount is less then " + Restrictions.MIN_TRADE_AMOUNT
.toFriendlyString());
checkArgument(getAmount().compareTo(Restrictions.MAX_TRADE_AMOUNT) <= 0, "Amount is larger then " + Restrictions.MAX_TRADE_AMOUNT.toFriendlyString()); checkArgument(getAmount().compareTo(Restrictions.MAX_TRADE_AMOUNT) <= 0, "Amount is larger then " + Restrictions.MAX_TRADE_AMOUNT.toFriendlyString());
checkArgument(getAmount().compareTo(getMinAmount()) >= 0, "MinAmount is larger then Amount"); checkArgument(getAmount().compareTo(getMinAmount()) >= 0, "MinAmount is larger then Amount");

View file

@ -29,7 +29,7 @@ import java.security.PublicKey;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
public interface TradeMessageService extends MessageBroker { public interface TradeMessageService extends MessageBroker {
void setExecutor(Executor executor); void setExecutor(Executor executor);
void sendMessage(Peer peer, Message message, SendMessageListener listener); void sendMessage(Peer peer, Message message, SendMessageListener listener);

View file

@ -41,7 +41,9 @@ public class AddOfferToRemoteOfferBook extends Task<PlaceOfferModel> {
(message, throwable) -> { (message, throwable) -> {
failed(throwable); failed(throwable);
}); });
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -37,7 +37,7 @@ public class CreateOfferFeeTx extends Task<PlaceOfferModel> {
protected void doRun() { protected void doRun() {
try { try {
Transaction transaction = model.getWalletService().createOfferFeeTx(model.getOffer().getId()); Transaction transaction = model.getWalletService().createOfferFeeTx(model.getOffer().getId());
// We assume there will be no tx malleability. We add a check later in case the published offer has a different hash. // We assume there will be no tx malleability. We add a check later in case the published offer has a different hash.
model.getOffer().setOfferFeePaymentTxID(transaction.getHashAsString()); model.getOffer().setOfferFeePaymentTxID(transaction.getHashAsString());
model.setTransaction(transaction); model.setTransaction(transaction);
@ -46,7 +46,9 @@ public class CreateOfferFeeTx extends Task<PlaceOfferModel> {
} catch (Throwable t) { } catch (Throwable t) {
failed(t); failed(t);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -40,7 +40,9 @@ public class ValidateOffer extends Task<PlaceOfferModel> {
} catch (Exception e) { } catch (Exception e) {
failed(e); failed(e);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -185,7 +185,7 @@ public class BuyerAsOffererProtocol {
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Massage dispatcher // Massage dispatcher
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
private void handleMessage(Message message, Peer peer) { private void handleMessage(Message message, Peer peer) {
log.trace("handleNewMessage: message = " + message.getClass().getSimpleName()); log.trace("handleNewMessage: message = " + message.getClass().getSimpleName());
if (message instanceof TradeMessage) { if (message instanceof TradeMessage) {

View file

@ -60,7 +60,9 @@ public class CreateDepositTx extends Task<BuyerAsOffererModel> {
} catch (InsufficientMoneyException e) { } catch (InsufficientMoneyException e) {
failed(e); failed(e);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -44,7 +44,7 @@ public class ProcessPayoutTxPublishedMessage extends Task<BuyerAsOffererModel> {
checkTradeId(model.getTrade().getId(), model.getTradeMessage()); checkTradeId(model.getTrade().getId(), model.getTradeMessage());
String payoutTxAsHex = nonEmptyStringOf(((PayoutTxPublishedMessage) model.getTradeMessage()).getPayoutTxAsHex()); String payoutTxAsHex = nonEmptyStringOf(((PayoutTxPublishedMessage) model.getTradeMessage()).getPayoutTxAsHex());
Transaction payoutTx = new Transaction(model.getWalletService().getWallet().getParams(), Utils.parseAsHexOrBase58(payoutTxAsHex)); Transaction payoutTx = new Transaction(model.getWalletService().getWallet().getParams(), Utils.parseAsHexOrBase58(payoutTxAsHex));
model.getTrade().setPayoutTx(payoutTx); model.getTrade().setPayoutTx(payoutTx);
model.getTrade().setState(Trade.State.PAYOUT_PUBLISHED); model.getTrade().setState(Trade.State.PAYOUT_PUBLISHED);
@ -52,7 +52,9 @@ public class ProcessPayoutTxPublishedMessage extends Task<BuyerAsOffererModel> {
} catch (Throwable t) { } catch (Throwable t) {
failed(t); failed(t);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -55,7 +55,9 @@ public class ProcessRequestOffererPublishDepositTxMessage extends Task<BuyerAsOf
} catch (Throwable t) { } catch (Throwable t) {
failed(t); failed(t);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -42,7 +42,9 @@ public class ProcessRequestTakeOfferMessage extends Task<BuyerAsOffererModel> {
} catch (Throwable t) { } catch (Throwable t) {
failed(t); failed(t);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -51,7 +51,9 @@ public class ProcessTakeOfferFeePayedMessage extends Task<BuyerAsOffererModel> {
} catch (Throwable t) { } catch (Throwable t) {
failed(t); failed(t);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -55,7 +55,9 @@ public class SendBankTransferInitedMessage extends Task<BuyerAsOffererModel> {
failed("Sending BankTransferInitedMessage failed."); failed("Sending BankTransferInitedMessage failed.");
} }
}); });
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -52,7 +52,9 @@ public class SendDepositTxIdToTaker extends Task<BuyerAsOffererModel> {
failed("Sending DepositTxPublishedMessage failed."); failed("Sending DepositTxPublishedMessage failed.");
} }
}); });
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -55,7 +55,9 @@ public class SendTakerDepositPaymentRequest extends Task<BuyerAsOffererModel> {
failed("RequestTakerDepositPaymentMessage did not arrive at peer"); failed("RequestTakerDepositPaymentMessage did not arrive at peer");
} }
}); });
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -44,17 +44,19 @@ public class SetupListenerForBlockChainConfirmation extends Task<BuyerAsOffererM
public void onConfidenceChanged(Transaction tx, ChangeReason reason) { public void onConfidenceChanged(Transaction tx, ChangeReason reason) {
log.trace("onConfidenceChanged " + tx.getConfidence()); log.trace("onConfidenceChanged " + tx.getConfidence());
if (reason == ChangeReason.TYPE && tx.getConfidence().getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING) { if (reason == ChangeReason.TYPE && tx.getConfidence().getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING) {
model.getTrade().setState(Trade.State.DEPOSIT_CONFIRMED); model.getTrade().setState(Trade.State.DEPOSIT_CONFIRMED);
//TODO not sure if that works //TODO not sure if that works
confidence.removeEventListener(this); confidence.removeEventListener(this);
} }
} }
}); });
complete(); complete();
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -66,7 +66,9 @@ public class SignAndPublishDepositTx extends Task<BuyerAsOffererModel> {
} catch (Exception e) { } catch (Exception e) {
failed(e); failed(e);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -61,8 +61,10 @@ public class SignPayoutTx extends Task<BuyerAsOffererModel> {
} catch (Exception e) { } catch (Exception e) {
failed(e); failed(e);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -56,7 +56,9 @@ public class VerifyAndSignContract extends Task<BuyerAsOffererModel> {
trade.setTakerContractSignature(signature); trade.setTakerContractSignature(signature);
complete(); complete();
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -38,9 +38,10 @@ public class VerifyTakeOfferFeePayment extends Task<BuyerAsOffererModel> {
/* if (numOfPeersSeenTx > 2) { /* if (numOfPeersSeenTx > 2) {
resultHandler.handleResult(); resultHandler.handleResult();
}*/ }*/
complete(); complete();
} }
@Override @Override
protected void rollBackOnFault() { protected void rollBackOnFault() {
} }

View file

@ -46,7 +46,9 @@ public class VerifyTakerAccount extends Task<BuyerAsOffererModel> {
else { else {
failed("Account registration validation for peer failed."); failed("Account registration validation for peer failed.");
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -190,7 +190,7 @@ public class SellerAsTakerProtocol {
); );
taskRunner.run(); taskRunner.run();
} }
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Massage dispatcher // Massage dispatcher

View file

@ -55,7 +55,9 @@ public class CreateAndSignContract extends Task<SellerAsTakerModel> {
trade.setTakerContractSignature(signature); trade.setTakerContractSignature(signature);
complete(); complete();
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -55,7 +55,9 @@ public class PayDeposit extends Task<SellerAsTakerModel> {
} catch (InsufficientMoneyException e) { } catch (InsufficientMoneyException e) {
failed(e); failed(e);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -39,7 +39,7 @@ public class ProcessBankTransferInitedMessage extends Task<SellerAsTakerModel> {
try { try {
checkTradeId(model.getTrade().getId(), model.getTradeMessage()); checkTradeId(model.getTrade().getId(), model.getTradeMessage());
BankTransferStartedMessage message = (BankTransferStartedMessage) model.getTradeMessage(); BankTransferStartedMessage message = (BankTransferStartedMessage) model.getTradeMessage();
model.setDepositTxAsHex(nonEmptyStringOf(message.getDepositTxAsHex())); model.setDepositTxAsHex(nonEmptyStringOf(message.getDepositTxAsHex()));
model.setOffererSignatureR(nonEmptyStringOf(message.getOffererSignatureR())); model.setOffererSignatureR(nonEmptyStringOf(message.getOffererSignatureR()));
model.setOffererSignatureS(nonEmptyStringOf(message.getOffererSignatureS())); model.setOffererSignatureS(nonEmptyStringOf(message.getOffererSignatureS()));
@ -52,7 +52,9 @@ public class ProcessBankTransferInitedMessage extends Task<SellerAsTakerModel> {
} catch (Throwable t) { } catch (Throwable t) {
failed(t); failed(t);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -38,7 +38,7 @@ public class ProcessDepositTxPublishedMessage extends Task<SellerAsTakerModel> {
protected void doRun() { protected void doRun() {
try { try {
checkTradeId(model.getTrade().getId(), model.getTradeMessage()); checkTradeId(model.getTrade().getId(), model.getTradeMessage());
DepositTxPublishedMessage message = (DepositTxPublishedMessage) model.getTradeMessage(); DepositTxPublishedMessage message = (DepositTxPublishedMessage) model.getTradeMessage();
model.setDepositTxAsHex(nonEmptyStringOf(message.getDepositTxAsHex())); model.setDepositTxAsHex(nonEmptyStringOf(message.getDepositTxAsHex()));
@ -46,7 +46,9 @@ public class ProcessDepositTxPublishedMessage extends Task<SellerAsTakerModel> {
} catch (Throwable t) { } catch (Throwable t) {
failed(t); failed(t);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -50,7 +50,9 @@ public class ProcessTakerDepositPaymentRequestMessage extends Task<SellerAsTaker
} catch (Throwable t) { } catch (Throwable t) {
failed(t); failed(t);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -48,7 +48,9 @@ public class SendPayoutTxToOfferer extends Task<SellerAsTakerModel> {
failed("Sending PayoutTxPublishedMessage failed."); failed("Sending PayoutTxPublishedMessage failed.");
} }
}); });
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -67,6 +67,7 @@ public class SendSignedTakerDepositTxAsHex extends Task<SellerAsTakerModel> {
} }
}); });
} }
@Override @Override
protected void rollBackOnFault() { protected void rollBackOnFault() {
} }

View file

@ -59,7 +59,7 @@ public class SignAndPublishPayoutTx extends Task<SellerAsTakerModel> {
model.setPayoutTx(transaction); model.setPayoutTx(transaction);
model.setPayoutTxAsHex(payoutTxAsHex); model.setPayoutTxAsHex(payoutTxAsHex);
model.getTrade().setState(Trade.State.PAYOUT_PUBLISHED); model.getTrade().setState(Trade.State.PAYOUT_PUBLISHED);
complete(); complete();
} }
@ -71,7 +71,9 @@ public class SignAndPublishPayoutTx extends Task<SellerAsTakerModel> {
} catch (AddressFormatException e) { } catch (AddressFormatException e) {
failed(e); failed(e);
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -42,7 +42,9 @@ public class TakerCommitDepositTx extends Task<SellerAsTakerModel> {
model.getTrade().setState(Trade.State.DEPOSIT_PUBLISHED); model.getTrade().setState(Trade.State.DEPOSIT_PUBLISHED);
complete(); complete();
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -39,7 +39,9 @@ public class VerifyOfferFeePayment extends Task<SellerAsTakerModel> {
resultHandler.handleResult(); resultHandler.handleResult();
}*/ }*/
complete(); complete();
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -44,7 +44,9 @@ public class VerifyOffererAccount extends Task<SellerAsTakerModel> {
else { else {
failed("Account registration validation for peer faultHandler.onFault."); failed("Account registration validation for peer faultHandler.onFault.");
} }
} @Override }
protected void rollBackOnFault() {
@Override
protected void rollBackOnFault() {
} }
} }

View file

@ -180,8 +180,8 @@ public class Utilities {
/** /**
* Empty and delete a folder (and subfolders). * Empty and delete a folder (and subfolders).
* @param folder *
* folder to empty * @param folder folder to empty
*/ */
public static void removeDirectory(final File folder) { public static void removeDirectory(final File folder) {
// check if folder file is a real folder // check if folder file is a real folder

View file

@ -20,7 +20,7 @@ package io.bitsquare.util.taskrunner;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class InterceptTaskException extends RuntimeException{ public class InterceptTaskException extends RuntimeException {
private static final Logger log = LoggerFactory.getLogger(InterceptTaskException.class); private static final Logger log = LoggerFactory.getLogger(InterceptTaskException.class);
public InterceptTaskException(String message) { public InterceptTaskException(String message) {

View file

@ -24,7 +24,7 @@ public interface Activatable {
void deactivate(); void deactivate();
Activatable NOOP_INSTANCE = new Activatable() {; Activatable NOOP_INSTANCE = new Activatable() {
@Override @Override
public void activate() { public void activate() {
} }

View file

@ -41,6 +41,6 @@ public class ViewPath extends ArrayList<Class<? extends View>> {
if (size() == 0) if (size() == 0)
return null; return null;
return get(size()-1); return get(size() - 1);
} }
} }

View file

@ -55,7 +55,7 @@ public class FxmlViewLoader implements ViewLoader {
final Class<? extends FxmlView.PathConvention> convention; final Class<? extends FxmlView.PathConvention> convention;
final Class<? extends FxmlView.PathConvention> defaultConvention = final Class<? extends FxmlView.PathConvention> defaultConvention =
(Class<? extends FxmlView.PathConvention>) getDefaultValue(FxmlView.class, "convention"); (Class<? extends FxmlView.PathConvention>) getDefaultValue(FxmlView.class, "convention");
final String specifiedLocation; final String specifiedLocation;
final String defaultLocation = (String) getDefaultValue(FxmlView.class, "location"); final String defaultLocation = (String) getDefaultValue(FxmlView.class, "location");

View file

@ -73,9 +73,9 @@ import static org.junit.Assert.*;
/** /**
* Test bootstrapping, DHT operations like put/get/add/remove and sendDirect in both LAN and WAN environment * Test bootstrapping, DHT operations like put/get/add/remove and sendDirect in both LAN and WAN environment
* Test scenarios in direct connection, auto port forwarding or relay mode. * Test scenarios in direct connection, auto port forwarding or relay mode.
* <p> * <p/>
* To start a bootstrap node code use the {@link io.bitsquare.app.bootstrap.BootstrapNode} class. * To start a bootstrap node code use the {@link io.bitsquare.app.bootstrap.BootstrapNode} class.
* <p> * <p/>
* To configure your test environment edit the static fields for id, IP and port. * To configure your test environment edit the static fields for id, IP and port.
* In the configure method and the connectionType you can define your test scenario. * In the configure method and the connectionType you can define your test scenario.
*/ */

View file

@ -120,15 +120,11 @@ public class UtilsDHT2 {
* Creates peers for testing. The first peer (peer[0]) will be used as the master. This means that shutting down * Creates peers for testing. The first peer (peer[0]) will be used as the master. This means that shutting down
* peer[0] will shut down all other peers * peer[0] will shut down all other peers
* *
* @param nrOfPeers * @param nrOfPeers The number of peers to create including the master
* The number of peers to create including the master * @param rnd The random object to create random peer IDs
* @param rnd * @param port The port where the master peer will listen to
* The random object to create random peer IDs
* @param port
* The port where the master peer will listen to
* @return All the peers, with the master peer at position 0 -> peer[0] * @return All the peers, with the master peer at position 0 -> peer[0]
* @throws Exception * @throws Exception If the creation of nodes fail.
* If the creation of nodes fail.
*/ */
public static PeerDHT[] createNodes(int nrOfPeers, Random rnd, int port, AutomaticFuture automaticFuture, public static PeerDHT[] createNodes(int nrOfPeers, Random rnd, int port, AutomaticFuture automaticFuture,
boolean maintenance) throws Exception { boolean maintenance) throws Exception {
@ -210,8 +206,7 @@ public class UtilsDHT2 {
* Perfect routing, where each neighbor has contacted each other. This means that for small number of peers, every * Perfect routing, where each neighbor has contacted each other. This means that for small number of peers, every
* peer knows every other peer. * peer knows every other peer.
* *
* @param peers * @param peers The peers taking part in the p2p network.
* The peers taking part in the p2p network.
*/ */
public static void perfectRouting(PeerDHT... peers) { public static void perfectRouting(PeerDHT... peers) {
for (int i = 0; i < peers.length; i++) { for (int i = 0; i < peers.length; i++) {

15
pom.xml
View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>io.bitsquare</groupId> <groupId>io.bitsquare</groupId>
@ -93,12 +94,12 @@
<artifactId>bitcoinj-core</artifactId> <artifactId>bitcoinj-core</artifactId>
<version>0.12.2</version> <version>0.12.2</version>
</dependency> </dependency>
<!-- <dependency> <!-- <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId> <artifactId>slf4j-jdk14</artifactId>
<version>1.7.7</version> <version>1.7.7</version>
</dependency>--> </dependency>-->
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>