mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Cleanup
This commit is contained in:
parent
a9f6d8481b
commit
ece3639e5f
7 changed files with 35 additions and 28 deletions
|
@ -127,11 +127,11 @@ class PendingTradesDataModel implements Activatable, DataModel {
|
|||
}
|
||||
|
||||
void fiatPaymentStarted() {
|
||||
tradeManager.onFiatPaymentStarted(getTrade());
|
||||
((OffererTrade) getTrade()).onFiatPaymentStarted();
|
||||
}
|
||||
|
||||
void fiatPaymentReceived() {
|
||||
tradeManager.onFiatPaymentReceived(getTrade());
|
||||
((TakerTrade) getTrade()).onFiatPaymentReceived();
|
||||
}
|
||||
|
||||
void withdraw(String toAddress) {
|
||||
|
|
|
@ -143,7 +143,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
acceptedCountriesTextField.setText(model.getAcceptedCountries());
|
||||
acceptedLanguagesTextField.setText(model.getAcceptedLanguages());
|
||||
acceptedArbitratorsTextField.setText(model.getAcceptedArbitratorIds());
|
||||
|
||||
|
||||
showCheckAvailabilityScreen();
|
||||
}
|
||||
|
||||
|
|
|
@ -76,8 +76,8 @@ public class OffererTrade extends Trade implements Serializable {
|
|||
private OffererProcessState processState;
|
||||
private OffererLifeCycleState lifeCycleState;
|
||||
|
||||
transient private ObjectProperty<OffererProcessState> processStateProperty = new SimpleObjectProperty<>(processState);
|
||||
transient private ObjectProperty<OffererLifeCycleState> lifeCycleStateProperty = new SimpleObjectProperty<>(lifeCycleState);
|
||||
transient private ObjectProperty<OffererProcessState> processStateProperty = new SimpleObjectProperty<>();
|
||||
transient private ObjectProperty<OffererLifeCycleState> lifeCycleStateProperty = new SimpleObjectProperty<>();
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -79,8 +79,8 @@ public class TakerTrade extends Trade implements Serializable {
|
|||
private TakerProcessState processState;
|
||||
private TakerLifeCycleState lifeCycleState;
|
||||
|
||||
transient private ObjectProperty<TakerProcessState> processStateProperty = new SimpleObjectProperty<>(processState);
|
||||
transient private ObjectProperty<TakerLifeCycleState> lifeCycleStateProperty = new SimpleObjectProperty<>(lifeCycleState);
|
||||
transient private ObjectProperty<TakerProcessState> processStateProperty = new SimpleObjectProperty<>();
|
||||
transient private ObjectProperty<TakerLifeCycleState> lifeCycleStateProperty = new SimpleObjectProperty<>();
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -89,6 +89,7 @@ public class TakerTrade extends Trade implements Serializable {
|
|||
|
||||
public TakerTrade(Offer offer, Coin tradeAmount, Peer peer) {
|
||||
super(offer);
|
||||
|
||||
this.tradeAmount = tradeAmount;
|
||||
this.tradingPeer = peer;
|
||||
|
||||
|
|
|
@ -38,6 +38,10 @@ import javafx.beans.property.SimpleObjectProperty;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Holds all data which are relevant to the trade, but not those which are only needed in the trade process as shared data between tasks. Those data are
|
||||
* stored in the task model.
|
||||
*/
|
||||
abstract public class Trade implements Serializable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -128,10 +132,6 @@ abstract public class Trade implements Serializable {
|
|||
this.offererContractSignature = offererContractSignature;
|
||||
}
|
||||
|
||||
public Contract getContract() {
|
||||
return contract;
|
||||
}
|
||||
|
||||
public void setContractAsJson(String contractAsJson) {
|
||||
this.contractAsJson = contractAsJson;
|
||||
}
|
||||
|
@ -173,6 +173,10 @@ abstract public class Trade implements Serializable {
|
|||
return payoutTx;
|
||||
}
|
||||
|
||||
public Contract getContract() {
|
||||
return contract;
|
||||
}
|
||||
|
||||
public Coin getSecurityDeposit() {
|
||||
return offer.getSecurityDeposit();
|
||||
}
|
||||
|
@ -193,14 +197,6 @@ abstract public class Trade implements Serializable {
|
|||
return date;
|
||||
}
|
||||
|
||||
public ReadOnlyObjectProperty<Coin> tradeAmountProperty() {
|
||||
return tradeAmountProperty;
|
||||
}
|
||||
|
||||
public ReadOnlyObjectProperty<Fiat> tradeVolumeProperty() {
|
||||
return tradeVolumeProperty;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
@ -209,6 +205,14 @@ abstract public class Trade implements Serializable {
|
|||
return throwable;
|
||||
}
|
||||
|
||||
public ReadOnlyObjectProperty<Coin> tradeAmountProperty() {
|
||||
return tradeAmountProperty;
|
||||
}
|
||||
|
||||
public ReadOnlyObjectProperty<Fiat> tradeVolumeProperty() {
|
||||
return tradeVolumeProperty;
|
||||
}
|
||||
|
||||
public abstract ReadOnlyObjectProperty<? extends ProcessState> processStateProperty();
|
||||
|
||||
public abstract ReadOnlyObjectProperty<? extends LifeCycleState> lifeCycleStateProperty();
|
||||
|
@ -219,7 +223,6 @@ abstract public class Trade implements Serializable {
|
|||
|
||||
public abstract Peer getTradingPeer();
|
||||
|
||||
protected abstract void setConfidenceListener();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
@ -237,4 +240,12 @@ abstract public class Trade implements Serializable {
|
|||
", depthInBlocks=" + depthInBlocks +
|
||||
'}';
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Protected
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
protected abstract void setConfidenceListener();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -291,14 +291,6 @@ public class TradeManager {
|
|||
// Trade
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void onFiatPaymentStarted(Trade trade) {
|
||||
((OffererTrade) trade).onFiatPaymentStarted();
|
||||
}
|
||||
|
||||
public void onFiatPaymentReceived(Trade trade) {
|
||||
((TakerTrade) trade).onFiatPaymentReceived();
|
||||
}
|
||||
|
||||
public void requestWithdraw(String toAddress, Trade trade, ResultHandler resultHandler, FaultHandler faultHandler) {
|
||||
AddressEntry addressEntry = walletService.getAddressEntry(trade.getId());
|
||||
String fromAddress = addressEntry.getAddressString();
|
||||
|
|
|
@ -36,6 +36,9 @@ import java.io.Serializable;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Holds all data which are needed between tasks. All relevant data for the trade itself are stored in Trade.
|
||||
*/
|
||||
public class TakerAsSellerModel extends SharedTradeModel implements Serializable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
Loading…
Add table
Reference in a new issue