Cleanups, improve loggings

This commit is contained in:
Manfred Karrer 2016-02-01 19:21:04 +01:00
parent bee9d2c610
commit 406bcd31ef
34 changed files with 290 additions and 283 deletions

View file

@ -146,14 +146,14 @@ public final class Arbitrator implements PubKeyProtectedExpirablePayload {
@Override
public String toString() {
return "Arbitrator{" +
"arbitratorAddress=" + arbitratorNodeAddress +
", languageCodes=" + languageCodes +
", btcAddress='" + btcAddress + '\'' +
", registrationDate=" + registrationDate +
", btcPubKey.hashCode()=" + Arrays.toString(btcPubKey).hashCode() +
", pubKeyRing.hashCode()=" + pubKeyRing.hashCode() +
", registrationSignature.hashCode()='" + registrationSignature.hashCode() + '\'' +
", registrationPubKey.hashCode()=" + Arrays.toString(registrationPubKey).hashCode() +
"\n\tarbitratorAddress=" + arbitratorNodeAddress +
"\n\tlanguageCodes=" + languageCodes +
"\n\tbtcAddress='" + btcAddress + '\'' +
"\n\tregistrationDate=" + registrationDate +
"\n\tbtcPubKey.hashCode()=" + Arrays.toString(btcPubKey).hashCode() +
"\n\tpubKeyRing.hashCode()=" + pubKeyRing.hashCode() +
"\n\tregistrationSignature.hashCode()='" + registrationSignature.hashCode() + '\'' +
"\n\tregistrationPubKey.hashCode()=" + Arrays.toString(registrationPubKey).hashCode() +
'}';
}
}

View file

@ -159,29 +159,6 @@ public class Contract implements Serializable {
return sellerNodeAddress;
}
@Override
public String toString() {
return "Contract{" +
"offer=" + offer +
", tradeAmount=" + tradeAmount +
", takeOfferFeeTxID='" + takeOfferFeeTxID + '\'' +
", arbitratorAddress=" + arbitratorNodeAddress +
", isBuyerOffererAndSellerTaker=" + isBuyerOffererAndSellerTaker +
", offererAccountId='" + offererAccountId + '\'' +
", takerAccountId='" + takerAccountId + '\'' +
", offererPaymentAccountContractData=" + offererPaymentAccountContractData +
", takerPaymentAccountContractData=" + takerPaymentAccountContractData +
", offererPubKeyRing=" + offererPubKeyRing +
", takerPubKeyRing=" + takerPubKeyRing +
", buyerAddress=" + buyerNodeAddress +
", sellerAddress=" + sellerNodeAddress +
", offererPayoutAddressString='" + offererPayoutAddressString + '\'' +
", takerPayoutAddressString='" + takerPayoutAddressString + '\'' +
", offererBtcPubKey=" + Arrays.toString(offererBtcPubKey) +
", takerBtcPubKey=" + Arrays.toString(takerBtcPubKey) +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
@ -243,4 +220,26 @@ public class Contract implements Serializable {
return result;
}
@Override
public String toString() {
return "Contract{" +
"\n\toffer=" + offer +
"\n\ttradeAmount=" + tradeAmount +
"\n\ttakeOfferFeeTxID='" + takeOfferFeeTxID + '\'' +
"\n\tarbitratorAddress=" + arbitratorNodeAddress +
"\n\tisBuyerOffererAndSellerTaker=" + isBuyerOffererAndSellerTaker +
"\n\toffererAccountId='" + offererAccountId + '\'' +
"\n\ttakerAccountId='" + takerAccountId + '\'' +
"\n\toffererPaymentAccountContractData=" + offererPaymentAccountContractData +
"\n\ttakerPaymentAccountContractData=" + takerPaymentAccountContractData +
"\n\toffererPubKeyRing=" + offererPubKeyRing +
"\n\ttakerPubKeyRing=" + takerPubKeyRing +
"\n\tbuyerAddress=" + buyerNodeAddress +
"\n\tsellerAddress=" + sellerNodeAddress +
"\n\toffererPayoutAddressString='" + offererPayoutAddressString + '\'' +
"\n\ttakerPayoutAddressString='" + takerPayoutAddressString + '\'' +
"\n\toffererBtcPubKey=" + Arrays.toString(offererBtcPubKey) +
"\n\ttakerBtcPubKey=" + Arrays.toString(takerBtcPubKey) +
'}';
}
}

View file

@ -137,7 +137,7 @@ abstract public class Trade implements Tradable, Model, Serializable {
///////////////////////////////////////////////////////////////////////////////////////////
// Transient/Immutable
transient private ObjectProperty<State> processStateProperty;
transient private ObjectProperty<State> stateProperty;
transient private ObjectProperty<DisputeState> disputeStateProperty;
transient private ObjectProperty<TradePeriodState> tradePeriodStateProperty;
// Trades are saved in the TradeList
@ -242,7 +242,7 @@ abstract public class Trade implements Tradable, Model, Serializable {
}
protected void initStateProperties() {
processStateProperty = new SimpleObjectProperty<>(state);
stateProperty = new SimpleObjectProperty<>(state);
disputeStateProperty = new SimpleObjectProperty<>(disputeState);
tradePeriodStateProperty = new SimpleObjectProperty<>(tradePeriodState);
}
@ -300,7 +300,7 @@ abstract public class Trade implements Tradable, Model, Serializable {
public void setState(State state) {
this.state = state;
processStateProperty.set(state);
stateProperty.set(state);
persist();
persist();
}
@ -385,7 +385,7 @@ abstract public class Trade implements Tradable, Model, Serializable {
public ReadOnlyObjectProperty<? extends State> stateProperty() {
return processStateProperty;
return stateProperty;
}
public ReadOnlyObjectProperty<Coin> tradeAmountProperty() {
@ -609,25 +609,31 @@ abstract public class Trade implements Tradable, Model, Serializable {
@Override
public String toString() {
return "Trade{" +
"tradeAmount=" + tradeAmount +
", tradingPeer=" + tradingPeerNodeAddress +
", tradeAmountProperty=" + tradeAmountProperty +
", tradeVolumeProperty=" + tradeVolumeProperty +
", processStateProperty=" + processStateProperty +
", storage=" + storage +
", tradeProtocol=" + tradeProtocol +
", offer=" + offer +
", date=" + takeOfferDate +
", processModel=" + processModel +
", processState=" + state +
", messageWithPubKey=" + decryptedMsgWithPubKey +
", depositTx=" + depositTx +
/* ", contract=" + contract +
", contractAsJson='" + contractAsJson + '\'' +*/
/* ", sellerContractSignature='" + sellerContractSignature + '\'' +
", buyerContractSignature='" + buyerContractSignature + '\'' +*/
", payoutTx=" + payoutTx +
", errorMessage='" + errorMessage + '\'' +
"\n\ttradeAmount=" + tradeAmount +
"\n\ttradingPeerNodeAddress=" + tradingPeerNodeAddress +
"\n\ttradeVolume=" + tradeVolumeProperty.get() +
"\n\toffer=" + offer +
"\n\tprocessModel=" + processModel +
"\n\tdecryptedMsgWithPubKey=" + decryptedMsgWithPubKey +
"\n\ttakeOfferDate=" + takeOfferDate +
"\n\tstate=" + state +
"\n\tdisputeState=" + disputeState +
"\n\ttradePeriodState=" + tradePeriodState +
"\n\tdepositTx=" + depositTx +
"\n\tcontract=" + contract +
/* "\n\tcontractAsJson='" + contractAsJson + '\'' +*/
/* "\n\tcontractHash=" + Arrays.toString(contractHash) +*/
"\n\ttakerContractSignature.hashCode()='" + takerContractSignature.hashCode() + '\'' +
"\n\toffererContractSignature.hashCode()='" + offererContractSignature.hashCode() + '\'' +
"\n\tpayoutTx=" + payoutTx +
"\n\tlockTimeAsBlockHeight=" + lockTimeAsBlockHeight +
"\n\topenDisputeTimeAsBlockHeight=" + openDisputeTimeAsBlockHeight +
"\n\tcheckPaymentTimeAsBlockHeight=" + checkPaymentTimeAsBlockHeight +
"\n\tarbitratorNodeAddress=" + arbitratorNodeAddress +
"\n\ttakerPaymentAccountId='" + takerPaymentAccountId + '\'' +
"\n\thalfTradePeriodReachedWarningDisplayed=" + halfTradePeriodReachedWarningDisplayed +
"\n\ttradePeriodOverWarningDisplayed=" + tradePeriodOverWarningDisplayed +
"\n\terrorMessage='" + errorMessage + '\'' +
'}';
}
}

View file

@ -395,27 +395,27 @@ public final class Offer implements PubKeyProtectedExpirablePayload {
@Override
public String toString() {
return "Offer{" +
"id='" + id + '\'' +
", direction=" + direction +
", currencyCode='" + currencyCode + '\'' +
", date=" + date +
", fiatPrice=" + fiatPrice +
", amount=" + amount +
", minAmount=" + minAmount +
", offererAddress=" + offererNodeAddress +
", pubKeyRing=" + pubKeyRing +
", paymentMethodName='" + paymentMethodName + '\'' +
", paymentMethodCountryCode='" + paymentMethodCountryCode + '\'' +
", offererPaymentAccountId='" + offererPaymentAccountId + '\'' +
", acceptedCountryCodes=" + acceptedCountryCodes +
", arbitratorAddresses=" + arbitratorNodeAddresses +
", offerFeePaymentTxID='" + offerFeePaymentTxID + '\'' +
", state=" + state +
", stateProperty=" + stateProperty +
", availabilityProtocol=" + availabilityProtocol +
", errorMessageProperty=" + errorMessageProperty +
", TAC_OFFERER=" + TAC_OFFERER +
", TAC_TAKER=" + TAC_TAKER +
"\n\tid='" + id + '\'' +
"\n\tdirection=" + direction +
"\n\tcurrencyCode='" + currencyCode + '\'' +
"\n\tdate=" + date +
"\n\tfiatPrice=" + fiatPrice +
"\n\tamount=" + amount +
"\n\tminAmount=" + minAmount +
"\n\toffererAddress=" + offererNodeAddress +
"\n\tpubKeyRing=" + pubKeyRing +
"\n\tpaymentMethodName='" + paymentMethodName + '\'' +
"\n\tpaymentMethodCountryCode='" + paymentMethodCountryCode + '\'' +
"\n\toffererPaymentAccountId='" + offererPaymentAccountId + '\'' +
"\n\tacceptedCountryCodes=" + acceptedCountryCodes +
"\n\tarbitratorAddresses=" + arbitratorNodeAddresses +
"\n\tofferFeePaymentTxID='" + offerFeePaymentTxID + '\'' +
"\n\tstate=" + state +
"\n\tstateProperty=" + stateProperty +
"\n\tavailabilityProtocol=" + availabilityProtocol +
"\n\terrorMessageProperty=" + errorMessageProperty +
"\n\tTAC_OFFERER=" + TAC_OFFERER +
"\n\tTAC_TAKER=" + TAC_TAKER +
'}';
}

View file

@ -110,6 +110,16 @@ public class OpenOffer implements Tradable, Serializable {
timeoutTimer = null;
}
}
@Override
public String toString() {
return "OpenOffer{" +
"\n\ttimeoutTimer=" + timeoutTimer +
"\n\toffer=" + offer +
"\n\tstate=" + state +
"\n\tstorage=" + storage +
'}';
}
}