replace trade.getBuyerSecurityDeposit() w/ getBuyer().getSecurityDeposit()

This commit is contained in:
woodser 2023-10-28 10:31:37 -04:00
parent 7592d8fbca
commit 8f8d653871
4 changed files with 13 additions and 23 deletions

View file

@ -212,8 +212,8 @@ public class CoreDisputesService {
public void applyPayoutAmountsToDisputeResult(DisputePayout payout, Dispute dispute, DisputeResult disputeResult, long customWinnerAmount) {
Contract contract = dispute.getContract();
Trade trade = tradeManager.getTrade(dispute.getTradeId());
BigInteger buyerSecurityDeposit = trade.getBuyerSecurityDeposit();
BigInteger sellerSecurityDeposit = trade.getSellerSecurityDeposit();
BigInteger buyerSecurityDeposit = trade.getBuyer().getSecurityDeposit();
BigInteger sellerSecurityDeposit = trade.getSeller().getSecurityDeposit();
BigInteger tradeAmount = contract.getTradeAmount();
if (payout == DisputePayout.BUYER_GETS_TRADE_AMOUNT) {
disputeResult.setBuyerPayoutAmount(tradeAmount.add(buyerSecurityDeposit));

View file

@ -159,8 +159,8 @@ public class TradeInfo implements Payload {
.withTakerDepositTxId(trade.getTaker().getDepositTxHash())
.withPayoutTxId(trade.getPayoutTxId())
.withAmount(trade.getAmount().longValueExact())
.withBuyerSecurityDeposit(trade.getBuyerSecurityDeposit() == null ? -1 : trade.getBuyerSecurityDeposit().longValueExact())
.withSellerSecurityDeposit(trade.getSellerSecurityDeposit() == null ? -1 : trade.getSellerSecurityDeposit().longValueExact())
.withBuyerSecurityDeposit(trade.getBuyer().getSecurityDeposit() == null ? -1 : trade.getBuyer().getSecurityDeposit().longValueExact())
.withSellerSecurityDeposit(trade.getSeller().getSecurityDeposit() == null ? -1 : trade.getSeller().getSecurityDeposit().longValueExact())
.withPrice(toPreciseTradePrice.apply(trade))
.withVolume(toRoundedVolume.apply(trade))
.withArbitratorNodeAddress(toArbitratorNodeAddress.apply(trade))

View file

@ -1105,7 +1105,7 @@ public abstract class Trade implements Tradable, Model {
// by mediators and we keep the confirm disabled to avoid that the seller can complete the trade
// without the penalty.
long payoutAmountFromMediation = processModel.getSellerPayoutAmountFromMediation();
long normalPayoutAmount = getSellerSecurityDeposit().longValueExact();
long normalPayoutAmount = getSeller().getSecurityDeposit().longValueExact();
return payoutAmountFromMediation < normalPayoutAmount;
}
@ -1637,16 +1637,6 @@ public abstract class Trade implements Tradable, Model {
return BigInteger.valueOf(totalTxFee);
}
public BigInteger getBuyerSecurityDeposit() {
if (getBuyer().getDepositTxHash() == null) return null;
return getBuyer().getSecurityDeposit();
}
public BigInteger getSellerSecurityDeposit() {
if (getSeller().getDepositTxHash() == null) return null;
return getSeller().getSecurityDeposit();
}
@Nullable
public MoneroTx getPayoutTx() {
if (payoutTx == null) {