Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Dispute agents sign summary #4517

Closed
Closed
15 changes: 9 additions & 6 deletions core/src/main/resources/i18n/displayStrings.properties
Expand Up @@ -2459,12 +2459,15 @@ disputeSummaryWindow.reason.TRADE_ALREADY_SETTLED=Trade already settled
disputeSummaryWindow.summaryNotes=Summary notes
disputeSummaryWindow.addSummaryNotes=Add summary notes
disputeSummaryWindow.close.button=Close ticket
disputeSummaryWindow.close.msg=Ticket closed on {0}\n\n\
Summary:\n\
Payout amount for BTC buyer: {1}\n\
Payout amount for BTC seller: {2}\n\n\
Reason for dispute: {3}\n\n\
Summary notes:\n{4}
disputeSummaryWindow.close.msg=Ticket for trade {0} closed on {1}\n\
{2} node address: {3}\n\n\
Summary:\n\
Traded currency: {4}\n\
Trade amount: {5}\n\
Payout amount for BTC buyer: {6}\n\
Payout amount for BTC seller: {7}\n\n\
Reason for dispute: {8}\n\n\
Summary notes:\n{9}

disputeSummaryWindow.close.msgWithSigAndPubKey={0}{1}\
Signer node address: {2}\n\
Expand Down
Expand Up @@ -803,8 +803,33 @@ private void doClose(Button closeTicketButton) {
dispute.setIsClosed(true);
DisputeResult.Reason reason = disputeResult.getReason();

/* disputeSummaryWindow.close.msg=Ticket for trade {0} closed on {1}\n\n\
{2} node address: {3}\n\
Summary:\n\
Payout amount for BTC buyer: {4}\n\
Payout amount for BTC seller: {5}\n\n\
Reason for dispute: {6}\n\n\
Summary notes:\n{7}
.append("Currency: ")
.append(CurrencyUtil.getNameAndCode(contract.getOfferPayload().getCurrencyCode()))
.append("\n")
.append("Trade amount: ")
.append(contract.getTradeAmount().toFriendlyString())


*/
String role = isRefundAgent ? Res.get("shared.refundAgent") : Res.get("shared.mediator");
String agentNodeAddress = checkNotNull(disputeManager.getAgentNodeAddress(dispute)).getFullAddress();
Contract contract = dispute.getContract();
String currencyCode = contract.getOfferPayload().getCurrencyCode();
String amount = formatter.formatCoinWithCode(contract.getTradeAmount());
String textToSign = Res.get("disputeSummaryWindow.close.msg",
dispute.getShortTradeId(),
DisplayUtils.formatDateTime(disputeResult.getCloseDate()),
role,
agentNodeAddress,
currencyCode,
amount,
formatter.formatCoinWithCode(disputeResult.getBuyerPayoutAmount()),
formatter.formatCoinWithCode(disputeResult.getSellerPayoutAmount()),
Res.get("disputeSummaryWindow.reason." + reason.name()),
Expand Down