trade history casts trade to get security deposit when available

This commit is contained in:
woodser 2023-11-02 11:31:37 -04:00
parent 8a89be1636
commit 4cc2d7d112

View File

@ -85,13 +85,19 @@ public class ClosedTradableFormatter {
}
public String getBuyerSecurityDepositAsString(Tradable tradable) {
Trade trade = castToTrade(tradable);
return HavenoUtils.formatXmr(trade.getBuyerSecurityDepositBeforeMiningFee());
if (tradable instanceof Trade) {
Trade trade = castToTrade(tradable);
return HavenoUtils.formatXmr(trade.getBuyerSecurityDepositBeforeMiningFee());
}
return HavenoUtils.formatXmr(tradable.getOffer().getMaxBuyerSecurityDeposit());
}
public String getSellerSecurityDepositAsString(Tradable tradable) {
Trade trade = castToTrade(tradable);
return HavenoUtils.formatXmr(trade.getSellerSecurityDepositBeforeMiningFee());
if (tradable instanceof Trade) {
Trade trade = castToTrade(tradable);
return HavenoUtils.formatXmr(trade.getSellerSecurityDepositBeforeMiningFee());
}
return HavenoUtils.formatXmr(tradable.getOffer().getMaxSellerSecurityDeposit());
}
public String getTradeFeeAsString(Tradable tradable, boolean appendCode) {