mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-18 06:45:56 -04:00
Reformat
This commit is contained in:
parent
871db17edf
commit
1b883cf386
12
core/pom.xml
12
core/pom.xml
@ -188,12 +188,12 @@
|
||||
<version>1.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.vinumeris</groupId>
|
||||
<artifactId>updatefx</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.vinumeris</groupId>
|
||||
<artifactId>updatefx</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>com.vinumeris</groupId>
|
||||
|
@ -76,7 +76,7 @@ public class BitsquareAppMain extends BitsquareExecutable {
|
||||
}
|
||||
BitsquareEnvironment bitsquareEnvironment = new BitsquareEnvironment(options);
|
||||
String updatesDirectory = bitsquareEnvironment.getProperty(BitsquareEnvironment.APP_DATA_DIR_KEY);
|
||||
|
||||
|
||||
// app dir need to be setup before UpdateFX bootstrap
|
||||
initAppDir(updatesDirectory);
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class UpdateProcess {
|
||||
|
||||
// Edit version for updateFX
|
||||
private static final int BUILD_VERSION = 3;
|
||||
|
||||
|
||||
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 int UPDATE_SIGNING_THRESHOLD = 1;
|
||||
@ -62,7 +62,7 @@ public class UpdateProcess {
|
||||
public static int getBuildVersion() {
|
||||
return BUILD_VERSION;
|
||||
}
|
||||
|
||||
|
||||
private Environment environment;
|
||||
|
||||
public enum State {
|
||||
@ -107,7 +107,7 @@ public class UpdateProcess {
|
||||
}
|
||||
});
|
||||
timeoutTimer.start();
|
||||
|
||||
|
||||
String agent = environment.getProperty(BitsquareEnvironment.APP_NAME_KEY) + BUILD_VERSION;
|
||||
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,
|
||||
@ -130,7 +130,7 @@ public class UpdateProcess {
|
||||
updater.setOnSucceeded(event -> {
|
||||
try {
|
||||
UpdateSummary summary = updater.get();
|
||||
log.info("summary " +summary.toString());
|
||||
log.info("summary " + summary.toString());
|
||||
if (summary.descriptions != null && summary.descriptions.size() > 0) {
|
||||
log.info("One liner: {}", summary.descriptions.get(0).getOneLiner());
|
||||
log.info("{}", summary.descriptions.get(0).getDescription());
|
||||
|
@ -43,9 +43,9 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TomP2PArbitratorMessageService implements ArbitratorMessageService {
|
||||
private static final Logger log = LoggerFactory.getLogger(TomP2PArbitratorMessageService.class);
|
||||
|
||||
|
||||
private static final String ARBITRATORS_ROOT = "ArbitratorsRoot";
|
||||
|
||||
|
||||
private final TomP2PNode tomP2PNode;
|
||||
private final List<ArbitratorListener> arbitratorListeners = new ArrayList<>();
|
||||
private Executor executor;
|
||||
@ -59,7 +59,7 @@ public class TomP2PArbitratorMessageService implements ArbitratorMessageService
|
||||
this.tomP2PNode = tomP2PNode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setExecutor(Executor executor) {
|
||||
this.executor = executor;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ import javax.inject.Inject;
|
||||
public class FeePolicy {
|
||||
|
||||
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)
|
||||
public static final Coin REGISTRATION_FEE = TX_FEE.add(TX_FEE);
|
||||
|
@ -84,7 +84,7 @@ public class Navigation {
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -45,22 +45,22 @@ import javafx.scene.control.*;
|
||||
* <p>
|
||||
* ProgressIndicator sets focusTraversable to false.
|
||||
* </p>
|
||||
* <p>
|
||||
* <p>
|
||||
* <p/>
|
||||
* <p/>
|
||||
* This first example creates a ProgressIndicator with an indeterminate value :
|
||||
* <pre><code>
|
||||
* import javafx.scene.control.ProgressIndicator;
|
||||
* ProgressIndicator p1 = new ProgressIndicator();
|
||||
* </code></pre>
|
||||
* <p>
|
||||
* <p>
|
||||
* <p/>
|
||||
* <p/>
|
||||
* This next example creates a ProgressIndicator which is 25% complete :
|
||||
* <pre><code>
|
||||
* import javafx.scene.control.ProgressIndicator;
|
||||
* ProgressIndicator p2 = new ProgressIndicator();
|
||||
* p2.setProgress(0.25F);
|
||||
* </code></pre>
|
||||
* <p>
|
||||
* <p/>
|
||||
* Implementation of ProgressIndicator According to JavaFX UI Control API Specification
|
||||
*
|
||||
* @since JavaFX 2.0
|
||||
@ -83,7 +83,7 @@ public class ConfidenceProgressIndicator extends Control {
|
||||
**************************************************************************/
|
||||
/**
|
||||
* Initialize the style class to 'progress-indicator'.
|
||||
* <p>
|
||||
* <p/>
|
||||
* This is the selector class from which CSS can be used to style
|
||||
* this control.
|
||||
*/
|
||||
|
@ -148,7 +148,7 @@ class MainViewModel implements ViewModel {
|
||||
|
||||
public void initBackend() {
|
||||
Platform.runLater(() -> updateProcess.init());
|
||||
|
||||
|
||||
setBitcoinNetworkSyncProgress(-1);
|
||||
walletService.getDownloadProgress().subscribe(
|
||||
percentage -> Platform.runLater(() -> {
|
||||
|
@ -126,7 +126,6 @@ class IrcAccountViewModel extends ActivatableWithDataModel<IrcAccountDataModel>
|
||||
}
|
||||
|
||||
|
||||
|
||||
private InputValidator.ValidationResult validateInput() {
|
||||
InputValidator.ValidationResult result = nickNameValidator.validate(dataModel.nickName.get());
|
||||
if (dataModel.currency.get() == null)
|
||||
|
@ -60,7 +60,7 @@
|
||||
<Insets bottom="-15"/>
|
||||
</GridPane.margin>
|
||||
</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>
|
||||
<Insets bottom="-15"/>
|
||||
</GridPane.margin>
|
||||
|
@ -50,5 +50,4 @@ class PreferencesViewModel extends ActivatableWithDataModel<PreferencesDataModel
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -264,7 +264,6 @@ class CreateOfferDataModel implements Activatable, DataModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void updateBalance(@NotNull Coin balance) {
|
||||
isWalletFunded.set(totalToPayAsCoin.get() != null && balance.compareTo(totalToPayAsCoin.get()) >= 0);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* BtcFormat does not support
|
||||
*/
|
||||
|
@ -26,7 +26,7 @@ import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public final class BtcAddressValidator extends InputValidator {
|
||||
|
@ -25,7 +25,7 @@ import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public final class BtcValidator extends NumberValidator {
|
||||
|
@ -25,7 +25,7 @@ import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public final class FiatValidator extends NumberValidator {
|
||||
|
@ -21,7 +21,7 @@ import io.bitsquare.locale.BSResources;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public class InputValidator {
|
||||
|
@ -24,7 +24,7 @@ import io.bitsquare.locale.BSResources;
|
||||
* Localisation not supported at the moment
|
||||
* The decimal mark can be either "." or ",". Thousand separators are not supported yet,
|
||||
* 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.
|
||||
*/
|
||||
public abstract class NumberValidator extends InputValidator {
|
||||
|
@ -25,7 +25,7 @@ import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public final class OptionalBtcValidator extends NumberValidator {
|
||||
|
@ -25,7 +25,7 @@ import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public final class OptionalFiatValidator extends NumberValidator {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@ import com.google.common.base.Objects;
|
||||
public final class Node {
|
||||
public static final String NAME_KEY = "node.name";
|
||||
public static final String PORT_KEY = "node.port";
|
||||
|
||||
|
||||
/**
|
||||
* Default port is one <a
|
||||
* href="https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?&page=103">
|
||||
|
@ -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
|
||||
private transient ObjectProperty<State> stateProperty;
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Constructor
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -255,7 +255,8 @@ public class Offer implements Serializable {
|
||||
checkNotNull(getMinAmount(), "MinAmount 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(getMinAmount()) >= 0, "MinAmount is larger then Amount");
|
||||
|
||||
|
@ -29,7 +29,7 @@ import java.security.PublicKey;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
public interface TradeMessageService extends MessageBroker {
|
||||
|
||||
|
||||
void setExecutor(Executor executor);
|
||||
|
||||
void sendMessage(Peer peer, Message message, SendMessageListener listener);
|
||||
|
@ -41,7 +41,9 @@ public class AddOfferToRemoteOfferBook extends Task<PlaceOfferModel> {
|
||||
(message, throwable) -> {
|
||||
failed(throwable);
|
||||
});
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class CreateOfferFeeTx extends Task<PlaceOfferModel> {
|
||||
protected void doRun() {
|
||||
try {
|
||||
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.
|
||||
model.getOffer().setOfferFeePaymentTxID(transaction.getHashAsString());
|
||||
model.setTransaction(transaction);
|
||||
@ -46,7 +46,9 @@ public class CreateOfferFeeTx extends Task<PlaceOfferModel> {
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,9 @@ public class ValidateOffer extends Task<PlaceOfferModel> {
|
||||
} catch (Exception e) {
|
||||
failed(e);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class BuyerAsOffererProtocol {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Massage dispatcher
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
private void handleMessage(Message message, Peer peer) {
|
||||
log.trace("handleNewMessage: message = " + message.getClass().getSimpleName());
|
||||
if (message instanceof TradeMessage) {
|
||||
|
@ -60,7 +60,9 @@ public class CreateDepositTx extends Task<BuyerAsOffererModel> {
|
||||
} catch (InsufficientMoneyException e) {
|
||||
failed(e);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ProcessPayoutTxPublishedMessage extends Task<BuyerAsOffererModel> {
|
||||
checkTradeId(model.getTrade().getId(), model.getTradeMessage());
|
||||
String payoutTxAsHex = nonEmptyStringOf(((PayoutTxPublishedMessage) model.getTradeMessage()).getPayoutTxAsHex());
|
||||
Transaction payoutTx = new Transaction(model.getWalletService().getWallet().getParams(), Utils.parseAsHexOrBase58(payoutTxAsHex));
|
||||
|
||||
|
||||
model.getTrade().setPayoutTx(payoutTx);
|
||||
model.getTrade().setState(Trade.State.PAYOUT_PUBLISHED);
|
||||
|
||||
@ -52,7 +52,9 @@ public class ProcessPayoutTxPublishedMessage extends Task<BuyerAsOffererModel> {
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
@ -55,7 +55,9 @@ public class ProcessRequestOffererPublishDepositTxMessage extends Task<BuyerAsOf
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
@ -42,7 +42,9 @@ public class ProcessRequestTakeOfferMessage extends Task<BuyerAsOffererModel> {
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
@ -51,7 +51,9 @@ public class ProcessTakeOfferFeePayedMessage extends Task<BuyerAsOffererModel> {
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
@ -55,7 +55,9 @@ public class SendBankTransferInitedMessage extends Task<BuyerAsOffererModel> {
|
||||
failed("Sending BankTransferInitedMessage failed.");
|
||||
}
|
||||
});
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,9 @@ public class SendDepositTxIdToTaker extends Task<BuyerAsOffererModel> {
|
||||
failed("Sending DepositTxPublishedMessage failed.");
|
||||
}
|
||||
});
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,9 @@ public class SendTakerDepositPaymentRequest extends Task<BuyerAsOffererModel> {
|
||||
failed("RequestTakerDepositPaymentMessage did not arrive at peer");
|
||||
}
|
||||
});
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -44,17 +44,19 @@ public class SetupListenerForBlockChainConfirmation extends Task<BuyerAsOffererM
|
||||
public void onConfidenceChanged(Transaction tx, ChangeReason reason) {
|
||||
log.trace("onConfidenceChanged " + tx.getConfidence());
|
||||
if (reason == ChangeReason.TYPE && tx.getConfidence().getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING) {
|
||||
|
||||
|
||||
model.getTrade().setState(Trade.State.DEPOSIT_CONFIRMED);
|
||||
|
||||
|
||||
//TODO not sure if that works
|
||||
confidence.removeEventListener(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
complete();
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,9 @@ public class SignAndPublishDepositTx extends Task<BuyerAsOffererModel> {
|
||||
} catch (Exception e) {
|
||||
failed(e);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -61,8 +61,10 @@ public class SignPayoutTx extends Task<BuyerAsOffererModel> {
|
||||
} catch (Exception e) {
|
||||
failed(e);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,9 @@ public class VerifyAndSignContract extends Task<BuyerAsOffererModel> {
|
||||
trade.setTakerContractSignature(signature);
|
||||
|
||||
complete();
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -38,9 +38,10 @@ public class VerifyTakeOfferFeePayment extends Task<BuyerAsOffererModel> {
|
||||
/* if (numOfPeersSeenTx > 2) {
|
||||
resultHandler.handleResult();
|
||||
}*/
|
||||
|
||||
|
||||
complete();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
@ -46,7 +46,9 @@ public class VerifyTakerAccount extends Task<BuyerAsOffererModel> {
|
||||
else {
|
||||
failed("Account registration validation for peer failed.");
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ public class SellerAsTakerProtocol {
|
||||
);
|
||||
taskRunner.run();
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Massage dispatcher
|
||||
|
@ -55,7 +55,9 @@ public class CreateAndSignContract extends Task<SellerAsTakerModel> {
|
||||
trade.setTakerContractSignature(signature);
|
||||
|
||||
complete();
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,9 @@ public class PayDeposit extends Task<SellerAsTakerModel> {
|
||||
} catch (InsufficientMoneyException e) {
|
||||
failed(e);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class ProcessBankTransferInitedMessage extends Task<SellerAsTakerModel> {
|
||||
try {
|
||||
checkTradeId(model.getTrade().getId(), model.getTradeMessage());
|
||||
BankTransferStartedMessage message = (BankTransferStartedMessage) model.getTradeMessage();
|
||||
|
||||
|
||||
model.setDepositTxAsHex(nonEmptyStringOf(message.getDepositTxAsHex()));
|
||||
model.setOffererSignatureR(nonEmptyStringOf(message.getOffererSignatureR()));
|
||||
model.setOffererSignatureS(nonEmptyStringOf(message.getOffererSignatureS()));
|
||||
@ -52,7 +52,9 @@ public class ProcessBankTransferInitedMessage extends Task<SellerAsTakerModel> {
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
@ -38,7 +38,7 @@ public class ProcessDepositTxPublishedMessage extends Task<SellerAsTakerModel> {
|
||||
protected void doRun() {
|
||||
try {
|
||||
checkTradeId(model.getTrade().getId(), model.getTradeMessage());
|
||||
|
||||
|
||||
DepositTxPublishedMessage message = (DepositTxPublishedMessage) model.getTradeMessage();
|
||||
model.setDepositTxAsHex(nonEmptyStringOf(message.getDepositTxAsHex()));
|
||||
|
||||
@ -46,7 +46,9 @@ public class ProcessDepositTxPublishedMessage extends Task<SellerAsTakerModel> {
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
@ -50,7 +50,9 @@ public class ProcessTakerDepositPaymentRequestMessage extends Task<SellerAsTaker
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
@ -48,7 +48,9 @@ public class SendPayoutTxToOfferer extends Task<SellerAsTakerModel> {
|
||||
failed("Sending PayoutTxPublishedMessage failed.");
|
||||
}
|
||||
});
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ public class SendSignedTakerDepositTxAsHex extends Task<SellerAsTakerModel> {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public class SignAndPublishPayoutTx extends Task<SellerAsTakerModel> {
|
||||
model.setPayoutTx(transaction);
|
||||
model.setPayoutTxAsHex(payoutTxAsHex);
|
||||
model.getTrade().setState(Trade.State.PAYOUT_PUBLISHED);
|
||||
|
||||
|
||||
complete();
|
||||
}
|
||||
|
||||
@ -71,7 +71,9 @@ public class SignAndPublishPayoutTx extends Task<SellerAsTakerModel> {
|
||||
} catch (AddressFormatException e) {
|
||||
failed(e);
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,9 @@ public class TakerCommitDepositTx extends Task<SellerAsTakerModel> {
|
||||
model.getTrade().setState(Trade.State.DEPOSIT_PUBLISHED);
|
||||
|
||||
complete();
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,9 @@ public class VerifyOfferFeePayment extends Task<SellerAsTakerModel> {
|
||||
resultHandler.handleResult();
|
||||
}*/
|
||||
complete();
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,9 @@ public class VerifyOffererAccount extends Task<SellerAsTakerModel> {
|
||||
else {
|
||||
failed("Account registration validation for peer faultHandler.onFault.");
|
||||
}
|
||||
} @Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void rollBackOnFault() {
|
||||
}
|
||||
}
|
||||
|
@ -180,8 +180,8 @@ public class Utilities {
|
||||
|
||||
/**
|
||||
* Empty and delete a folder (and subfolders).
|
||||
* @param folder
|
||||
* folder to empty
|
||||
*
|
||||
* @param folder folder to empty
|
||||
*/
|
||||
public static void removeDirectory(final File folder) {
|
||||
// check if folder file is a real folder
|
||||
|
@ -20,7 +20,7 @@ package io.bitsquare.util.taskrunner;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class InterceptTaskException extends RuntimeException{
|
||||
public class InterceptTaskException extends RuntimeException {
|
||||
private static final Logger log = LoggerFactory.getLogger(InterceptTaskException.class);
|
||||
|
||||
public InterceptTaskException(String message) {
|
||||
|
@ -24,7 +24,7 @@ public interface Activatable {
|
||||
void deactivate();
|
||||
|
||||
|
||||
Activatable NOOP_INSTANCE = new Activatable() {;
|
||||
Activatable NOOP_INSTANCE = new Activatable() {
|
||||
@Override
|
||||
public void activate() {
|
||||
}
|
||||
|
@ -41,6 +41,6 @@ public class ViewPath extends ArrayList<Class<? extends View>> {
|
||||
if (size() == 0)
|
||||
return null;
|
||||
|
||||
return get(size()-1);
|
||||
return get(size() - 1);
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class FxmlViewLoader implements ViewLoader {
|
||||
|
||||
final Class<? extends FxmlView.PathConvention> convention;
|
||||
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 defaultLocation = (String) getDefaultValue(FxmlView.class, "location");
|
||||
|
@ -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 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.
|
||||
* <p>
|
||||
* <p/>
|
||||
* 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.
|
||||
*/
|
||||
|
@ -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
|
||||
* peer[0] will shut down all other peers
|
||||
*
|
||||
* @param nrOfPeers
|
||||
* The number of peers to create including the master
|
||||
* @param rnd
|
||||
* The random object to create random peer IDs
|
||||
* @param port
|
||||
* The port where the master peer will listen to
|
||||
* @param nrOfPeers The number of peers to create including the master
|
||||
* @param rnd 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]
|
||||
* @throws Exception
|
||||
* If the creation of nodes fail.
|
||||
* @throws Exception If the creation of nodes fail.
|
||||
*/
|
||||
public static PeerDHT[] createNodes(int nrOfPeers, Random rnd, int port, AutomaticFuture automaticFuture,
|
||||
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
|
||||
* peer knows every other peer.
|
||||
*
|
||||
* @param peers
|
||||
* The peers taking part in the p2p network.
|
||||
* @param peers The peers taking part in the p2p network.
|
||||
*/
|
||||
public static void perfectRouting(PeerDHT... peers) {
|
||||
for (int i = 0; i < peers.length; i++) {
|
||||
|
15
pom.xml
15
pom.xml
@ -1,5 +1,6 @@
|
||||
<?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>
|
||||
|
||||
<groupId>io.bitsquare</groupId>
|
||||
@ -93,12 +94,12 @@
|
||||
<artifactId>bitcoinj-core</artifactId>
|
||||
<version>0.12.2</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-jdk14</artifactId>
|
||||
<version>1.7.7</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-jdk14</artifactId>
|
||||
<version>1.7.7</version>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
|
Loading…
x
Reference in New Issue
Block a user