mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Updates to 'Edit Offer' to allow for change of market and payment method
Display the trading account group on edit offer screen which allows the market and payment method to be chosen. When applying the edits to the new offer payload, merge in appropriate fields that describe the market & payment method: - base and counter currency codes - payment method and account - country code, accepted country codes - bankid and accepted bankIds Fixes #4720
This commit is contained in:
parent
50ab4283b2
commit
f73aaae3c7
@ -286,7 +286,7 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
|
||||
// UI actions
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Offer createAndGetOffer() {
|
||||
protected Offer createAndGetOffer() {
|
||||
return createOfferService.createAndGetOffer(offerId,
|
||||
direction,
|
||||
tradeCurrencyCode.get(),
|
||||
|
@ -179,28 +179,32 @@ class EditOfferDataModel extends MutableOfferDataModel {
|
||||
}
|
||||
|
||||
public void onPublishOffer(ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) {
|
||||
// editedPayload is a merge of the original offerPayload and newOfferPayload
|
||||
// fields which are editable are merged in from newOfferPayload (such as payment account details)
|
||||
// fields which cannot change (most importantly BTC amount) are sourced from the original offerPayload
|
||||
final OfferPayload offerPayload = openOffer.getOffer().getOfferPayload();
|
||||
final OfferPayload newOfferPayload = createAndGetOffer().getOfferPayload();
|
||||
final OfferPayload editedPayload = new OfferPayload(offerPayload.getId(),
|
||||
offerPayload.getDate(),
|
||||
offerPayload.getOwnerNodeAddress(),
|
||||
offerPayload.getPubKeyRing(),
|
||||
offerPayload.getDirection(),
|
||||
getPrice().get().getValue(),
|
||||
getMarketPriceMargin(),
|
||||
isUseMarketBasedPriceValue(),
|
||||
getAmount().get().getValue(),
|
||||
getMinAmount().get().getValue(),
|
||||
offerPayload.getBaseCurrencyCode(),
|
||||
offerPayload.getCounterCurrencyCode(),
|
||||
newOfferPayload.getPrice(),
|
||||
newOfferPayload.getMarketPriceMargin(),
|
||||
newOfferPayload.isUseMarketBasedPrice(),
|
||||
offerPayload.getAmount(),
|
||||
offerPayload.getMinAmount(),
|
||||
newOfferPayload.getBaseCurrencyCode(),
|
||||
newOfferPayload.getCounterCurrencyCode(),
|
||||
offerPayload.getArbitratorNodeAddresses(),
|
||||
offerPayload.getMediatorNodeAddresses(),
|
||||
offerPayload.getPaymentMethodId(),
|
||||
offerPayload.getMakerPaymentAccountId(),
|
||||
newOfferPayload.getPaymentMethodId(),
|
||||
newOfferPayload.getMakerPaymentAccountId(),
|
||||
offerPayload.getOfferFeePaymentTxId(),
|
||||
offerPayload.getCountryCode(),
|
||||
offerPayload.getAcceptedCountryCodes(),
|
||||
offerPayload.getBankId(),
|
||||
offerPayload.getAcceptedBankIds(),
|
||||
newOfferPayload.getCountryCode(),
|
||||
newOfferPayload.getAcceptedCountryCodes(),
|
||||
newOfferPayload.getBankId(),
|
||||
newOfferPayload.getAcceptedBankIds(),
|
||||
offerPayload.getVersionNr(),
|
||||
offerPayload.getBlockHeightAtOfferCreation(),
|
||||
offerPayload.getTxFee(),
|
||||
|
@ -119,7 +119,6 @@ public class EditOfferView extends MutableOfferView<EditOfferViewModel> {
|
||||
|
||||
// To force re-validation of payment account validation
|
||||
onPaymentAccountsComboBoxSelected();
|
||||
hidePaymentGroup();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user