use of bisq.core.arbitration.Dispute in project bisq-desktop by bisq-network.
the class DisputeSummaryWindow method addButtons.
private void addButtons(Contract contract) {
Tuple2<Button, Button> tuple = add2ButtonsAfterGroup(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.close.button"), Res.get("shared.cancel"));
Button closeTicketButton = tuple.first;
closeTicketButton.disableProperty().bind(Bindings.createBooleanBinding(() -> tradeAmountToggleGroup.getSelectedToggle() == null || summaryNotesTextArea.getText() == null || summaryNotesTextArea.getText().length() == 0 || !isPayoutAmountValid(), tradeAmountToggleGroup.selectedToggleProperty(), summaryNotesTextArea.textProperty(), buyerPayoutAmountInputTextField.textProperty(), sellerPayoutAmountInputTextField.textProperty()));
Button cancelButton = tuple.second;
final Dispute finalPeersDispute = peersDisputeOptional.get();
closeTicketButton.setOnAction(e -> {
if (dispute.getDepositTxSerialized() != null) {
try {
AddressEntry arbitratorAddressEntry = walletService.getOrCreateAddressEntry(AddressEntry.Context.ARBITRATOR);
disputeResult.setArbitratorPubKey(walletService.getOrCreateAddressEntry(AddressEntry.Context.ARBITRATOR).getPubKey());
/* byte[] depositTxSerialized,
Coin buyerPayoutAmount,
Coin sellerPayoutAmount,
Coin arbitratorPayoutAmount,
String buyerAddressString,
String sellerAddressString,
AddressEntry arbitratorAddressEntry,
byte[] buyerPubKey,
byte[] sellerPubKey,
byte[] arbitratorPubKey)
*/
byte[] arbitratorSignature = tradeWalletService.arbitratorSignsDisputedPayoutTx(dispute.getDepositTxSerialized(), disputeResult.getBuyerPayoutAmount(), disputeResult.getSellerPayoutAmount(), contract.getBuyerPayoutAddressString(), contract.getSellerPayoutAddressString(), arbitratorAddressEntry.getKeyPair(), contract.getBuyerMultiSigPubKey(), contract.getSellerMultiSigPubKey(), arbitratorAddressEntry.getPubKey());
disputeResult.setArbitratorSignature(arbitratorSignature);
closeTicketButton.disableProperty().unbind();
dispute.setDisputeResult(disputeResult);
disputeResult.setLoserPublisher(isLoserPublisherCheckBox.isSelected());
disputeResult.setCloseDate(new Date());
String text = Res.get("disputeSummaryWindow.close.msg", formatter.formatDateTime(disputeResult.getCloseDate()), role, formatter.booleanToYesNo(disputeResult.tamperProofEvidenceProperty().get()), role, formatter.booleanToYesNo(disputeResult.idVerificationProperty().get()), role, formatter.booleanToYesNo(disputeResult.screenCastProperty().get()), formatter.formatCoinWithCode(disputeResult.getBuyerPayoutAmount()), formatter.formatCoinWithCode(disputeResult.getSellerPayoutAmount()), disputeResult.summaryNotesProperty().get());
dispute.setIsClosed(true);
disputeManager.sendDisputeResultMessage(disputeResult, dispute, text);
if (!finalPeersDispute.isClosed())
UserThread.runAfter(() -> new Popup<>().attention(Res.get("disputeSummaryWindow.close.closePeer")).show(), Transitions.DEFAULT_DURATION, TimeUnit.MILLISECONDS);
hide();
finalizeDisputeHandlerOptional.ifPresent(Runnable::run);
} catch (AddressFormatException | TransactionVerificationException e2) {
e2.printStackTrace();
}
} else {
log.warn("dispute.getDepositTxSerialized is null");
}
});
cancelButton.setOnAction(e -> {
dispute.setDisputeResult(disputeResult);
hide();
});
}
Aggregations