mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-05 21:24:19 -04:00
fix error loading interac e-transfer offers
This commit is contained in:
parent
da9cf540e6
commit
100b2136a7
2 changed files with 5 additions and 4 deletions
|
@ -23,6 +23,7 @@ import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.offer.Offer;
|
import haveno.core.offer.Offer;
|
||||||
import haveno.core.offer.OfferDirection;
|
import haveno.core.offer.OfferDirection;
|
||||||
import haveno.core.offer.placeoffer.PlaceOfferModel;
|
import haveno.core.offer.placeoffer.PlaceOfferModel;
|
||||||
|
import haveno.core.payment.PaymentAccount;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
import haveno.core.trade.messages.TradeMessage;
|
import haveno.core.trade.messages.TradeMessage;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
|
@ -96,6 +97,9 @@ public class ValidateOffer extends Task<PlaceOfferModel> {
|
||||||
/*checkArgument(offer.getMinAmount().compareTo(ProposalConsensus.getMinTradeAmount()) >= 0,
|
/*checkArgument(offer.getMinAmount().compareTo(ProposalConsensus.getMinTradeAmount()) >= 0,
|
||||||
"MinAmount is less than " + ProposalConsensus.getMinTradeAmount().toFriendlyString());*/
|
"MinAmount is less than " + ProposalConsensus.getMinTradeAmount().toFriendlyString());*/
|
||||||
|
|
||||||
|
PaymentAccount paymentAccount = user.getPaymentAccount(offer.getMakerPaymentAccountId());
|
||||||
|
checkArgument(paymentAccount != null, "Payment account is null. makerPaymentAccountId=" + offer.getMakerPaymentAccountId());
|
||||||
|
|
||||||
long maxAmount = accountAgeWitnessService.getMyTradeLimit(user.getPaymentAccount(offer.getMakerPaymentAccountId()), offer.getCurrencyCode(), offer.getDirection(), offer.hasBuyerAsTakerWithoutDeposit());
|
long maxAmount = accountAgeWitnessService.getMyTradeLimit(user.getPaymentAccount(offer.getMakerPaymentAccountId()), offer.getCurrencyCode(), offer.getDirection(), offer.hasBuyerAsTakerWithoutDeposit());
|
||||||
checkArgument(offer.getAmount().longValueExact() <= maxAmount,
|
checkArgument(offer.getAmount().longValueExact() <= maxAmount,
|
||||||
"Amount is larger than " + HavenoUtils.atomicUnitsToXmr(maxAmount) + " XMR");
|
"Amount is larger than " + HavenoUtils.atomicUnitsToXmr(maxAmount) + " XMR");
|
||||||
|
|
|
@ -36,8 +36,6 @@ public final class InteracETransferAccount extends PaymentAccount {
|
||||||
|
|
||||||
public static final List<TradeCurrency> SUPPORTED_CURRENCIES = List.of(new TraditionalCurrency("CAD"));
|
public static final List<TradeCurrency> SUPPORTED_CURRENCIES = List.of(new TraditionalCurrency("CAD"));
|
||||||
|
|
||||||
private final InteracETransferValidator interacETransferValidator;
|
|
||||||
|
|
||||||
private static final List<PaymentAccountFormField.FieldId> INPUT_FIELD_IDS = List.of(
|
private static final List<PaymentAccountFormField.FieldId> INPUT_FIELD_IDS = List.of(
|
||||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||||
PaymentAccountFormField.FieldId.EMAIL_OR_MOBILE_NR,
|
PaymentAccountFormField.FieldId.EMAIL_OR_MOBILE_NR,
|
||||||
|
@ -50,8 +48,6 @@ public final class InteracETransferAccount extends PaymentAccount {
|
||||||
public InteracETransferAccount() {
|
public InteracETransferAccount() {
|
||||||
super(PaymentMethod.INTERAC_E_TRANSFER);
|
super(PaymentMethod.INTERAC_E_TRANSFER);
|
||||||
setSingleTradeCurrency(SUPPORTED_CURRENCIES.get(0));
|
setSingleTradeCurrency(SUPPORTED_CURRENCIES.get(0));
|
||||||
this.interacETransferValidator = HavenoUtils.corePaymentAccountService.interacETransferValidator;
|
|
||||||
if (interacETransferValidator == null) throw new IllegalArgumentException("InteracETransferValidator cannot be null");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -102,6 +98,7 @@ public final class InteracETransferAccount extends PaymentAccount {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void validateFormField(PaymentAccountForm form, PaymentAccountFormField.FieldId fieldId, String value) {
|
public void validateFormField(PaymentAccountForm form, PaymentAccountFormField.FieldId fieldId, String value) {
|
||||||
|
InteracETransferValidator interacETransferValidator = HavenoUtils.corePaymentAccountService.interacETransferValidator;
|
||||||
switch (fieldId) {
|
switch (fieldId) {
|
||||||
case QUESTION:
|
case QUESTION:
|
||||||
processValidationResult(interacETransferValidator.questionValidator.validate(value));
|
processValidationResult(interacETransferValidator.questionValidator.validate(value));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue