From 1eeb47cef7c7cd0ae93299f168e27a1a5a2ee8c4 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 6 Mar 2019 22:38:40 -0500 Subject: [PATCH 1/3] Add removed deprecated payment methods again as it would break trade history We got some reports that the trade history was gone and it turned out the removal of the deprecated payment methods caused an exception when reading the persisted closed trades. So we have to keep that code to not break old db files. --- .../bisq/core/payment/CashAppAccount.java | 49 ++++++++ .../java/bisq/core/payment/OKPayAccount.java | 50 ++++++++ .../core/payment/PaymentAccountFactory.java | 9 ++ .../java/bisq/core/payment/VenmoAccount.java | 57 +++++++++ .../payload/CashAppAccountPayload.java | 107 +++++++++++++++++ .../payment/payload/OKPayAccountPayload.java | 106 ++++++++++++++++ .../core/payment/payload/PaymentMethod.java | 16 +++ .../payment/payload/VenmoAccountPayload.java | 113 ++++++++++++++++++ .../bisq/core/proto/CoreProtoResolver.java | 12 ++ .../resources/i18n/displayStrings.properties | 17 +++ 10 files changed, 536 insertions(+) create mode 100644 core/src/main/java/bisq/core/payment/CashAppAccount.java create mode 100644 core/src/main/java/bisq/core/payment/OKPayAccount.java create mode 100644 core/src/main/java/bisq/core/payment/VenmoAccount.java create mode 100644 core/src/main/java/bisq/core/payment/payload/CashAppAccountPayload.java create mode 100644 core/src/main/java/bisq/core/payment/payload/OKPayAccountPayload.java create mode 100644 core/src/main/java/bisq/core/payment/payload/VenmoAccountPayload.java diff --git a/core/src/main/java/bisq/core/payment/CashAppAccount.java b/core/src/main/java/bisq/core/payment/CashAppAccount.java new file mode 100644 index 00000000000..acd4f6b6a5d --- /dev/null +++ b/core/src/main/java/bisq/core/payment/CashAppAccount.java @@ -0,0 +1,49 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.payment; + +import bisq.core.locale.FiatCurrency; +import bisq.core.payment.payload.CashAppAccountPayload; +import bisq.core.payment.payload.PaymentAccountPayload; +import bisq.core.payment.payload.PaymentMethod; + +import lombok.EqualsAndHashCode; + +// Removed due too high chargeback risk +// Cannot be deleted as it would break old trade history entries +@Deprecated +@EqualsAndHashCode(callSuper = true) +public final class CashAppAccount extends PaymentAccount { + public CashAppAccount() { + super(PaymentMethod.CASH_APP); + setSingleTradeCurrency(new FiatCurrency("USD")); + } + + @Override + protected PaymentAccountPayload createPayload() { + return new CashAppAccountPayload(paymentMethod.getId(), id); + } + + public void setCashTag(String cashTag) { + ((CashAppAccountPayload) paymentAccountPayload).setCashTag(cashTag); + } + + public String getCashTag() { + return ((CashAppAccountPayload) paymentAccountPayload).getCashTag(); + } +} diff --git a/core/src/main/java/bisq/core/payment/OKPayAccount.java b/core/src/main/java/bisq/core/payment/OKPayAccount.java new file mode 100644 index 00000000000..24730181708 --- /dev/null +++ b/core/src/main/java/bisq/core/payment/OKPayAccount.java @@ -0,0 +1,50 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.payment; + +import bisq.core.locale.CurrencyUtil; +import bisq.core.payment.payload.OKPayAccountPayload; +import bisq.core.payment.payload.PaymentAccountPayload; +import bisq.core.payment.payload.PaymentMethod; + +import lombok.EqualsAndHashCode; + +// Cannot be deleted as it would break old trade history entries +@Deprecated +@EqualsAndHashCode(callSuper = true) +public final class OKPayAccount extends PaymentAccount { + public OKPayAccount() { + super(PaymentMethod.OK_PAY); + + // Incorrect call but we don't want to keep Deprecated code in CurrencyUtil if not needed... + tradeCurrencies.addAll(CurrencyUtil.getAllUpholdCurrencies()); + } + + @Override + protected PaymentAccountPayload createPayload() { + return new OKPayAccountPayload(paymentMethod.getId(), id); + } + + public void setAccountNr(String accountNr) { + ((OKPayAccountPayload) paymentAccountPayload).setAccountNr(accountNr); + } + + public String getAccountNr() { + return ((OKPayAccountPayload) paymentAccountPayload).getAccountNr(); + } +} diff --git a/core/src/main/java/bisq/core/payment/PaymentAccountFactory.java b/core/src/main/java/bisq/core/payment/PaymentAccountFactory.java index ed9462e25dc..044967cd7a6 100644 --- a/core/src/main/java/bisq/core/payment/PaymentAccountFactory.java +++ b/core/src/main/java/bisq/core/payment/PaymentAccountFactory.java @@ -76,6 +76,15 @@ public static PaymentAccount getPaymentAccount(PaymentMethod paymentMethod) { return new AdvancedCashAccount(); case PaymentMethod.BLOCK_CHAINS_INSTANT_ID: return new InstantCryptoCurrencyAccount(); + + // Cannot be deleted as it would break old trade history entries + case PaymentMethod.OK_PAY_ID: + return new OKPayAccount(); + case PaymentMethod.CASH_APP_ID: + return new CashAppAccount(); + case PaymentMethod.VENMO_ID: + return new VenmoAccount(); + default: throw new RuntimeException("Not supported PaymentMethod: " + paymentMethod); } diff --git a/core/src/main/java/bisq/core/payment/VenmoAccount.java b/core/src/main/java/bisq/core/payment/VenmoAccount.java new file mode 100644 index 00000000000..cd546601442 --- /dev/null +++ b/core/src/main/java/bisq/core/payment/VenmoAccount.java @@ -0,0 +1,57 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.payment; + +import bisq.core.locale.FiatCurrency; +import bisq.core.payment.payload.PaymentAccountPayload; +import bisq.core.payment.payload.PaymentMethod; +import bisq.core.payment.payload.VenmoAccountPayload; + +import lombok.EqualsAndHashCode; + +// Removed due too high chargeback risk +// Cannot be deleted as it would break old trade history entries +@Deprecated +@EqualsAndHashCode(callSuper = true) +public final class VenmoAccount extends PaymentAccount { + public VenmoAccount() { + super(PaymentMethod.VENMO); + setSingleTradeCurrency(new FiatCurrency("USD")); + } + + @Override + protected PaymentAccountPayload createPayload() { + return new VenmoAccountPayload(paymentMethod.getId(), id); + } + + public void setVenmoUserName(String venmoUserName) { + ((VenmoAccountPayload) paymentAccountPayload).setVenmoUserName(venmoUserName); + } + + public String getVenmoUserName() { + return ((VenmoAccountPayload) paymentAccountPayload).getVenmoUserName(); + } + + public void setHolderName(String holderName) { + ((VenmoAccountPayload) paymentAccountPayload).setHolderName(holderName); + } + + public String getHolderName() { + return ((VenmoAccountPayload) paymentAccountPayload).getHolderName(); + } +} diff --git a/core/src/main/java/bisq/core/payment/payload/CashAppAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/CashAppAccountPayload.java new file mode 100644 index 00000000000..3448a48489b --- /dev/null +++ b/core/src/main/java/bisq/core/payment/payload/CashAppAccountPayload.java @@ -0,0 +1,107 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.payment.payload; + +import bisq.core.locale.Res; + +import io.bisq.generated.protobuffer.PB; + +import com.google.protobuf.Message; + +import org.springframework.util.CollectionUtils; + +import java.nio.charset.Charset; + +import java.util.HashMap; +import java.util.Map; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.extern.slf4j.Slf4j; + +// Cannot be deleted as it would break old trade history entries +// Removed due too high chargeback risk +@Deprecated +@EqualsAndHashCode(callSuper = true) +@ToString +@Setter +@Getter +@Slf4j +public final class CashAppAccountPayload extends PaymentAccountPayload { + private String cashTag = ""; + + public CashAppAccountPayload(String paymentMethod, String id) { + super(paymentMethod, id); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // PROTO BUFFER + /////////////////////////////////////////////////////////////////////////////////////////// + + private CashAppAccountPayload(String paymentMethod, + String id, + String cashTag, + long maxTradePeriod, + Map excludeFromJsonDataMap) { + super(paymentMethod, + id, + maxTradePeriod, + excludeFromJsonDataMap); + + this.cashTag = cashTag; + } + + @Override + public Message toProtoMessage() { + return getPaymentAccountPayloadBuilder() + .setCashAppAccountPayload(PB.CashAppAccountPayload.newBuilder() + .setCashTag(cashTag)) + .build(); + } + + public static CashAppAccountPayload fromProto(PB.PaymentAccountPayload proto) { + return new CashAppAccountPayload(proto.getPaymentMethodId(), + proto.getId(), + proto.getCashAppAccountPayload().getCashTag(), + proto.getMaxTradePeriod(), + CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap())); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // API + /////////////////////////////////////////////////////////////////////////////////////////// + + @Override + public String getPaymentDetails() { + return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account") + " " + cashTag; + } + + @Override + public String getPaymentDetailsForTradePopup() { + return getPaymentDetails(); + } + + @Override + public byte[] getAgeWitnessInputData() { + return super.getAgeWitnessInputData(cashTag.getBytes(Charset.forName("UTF-8"))); + } +} diff --git a/core/src/main/java/bisq/core/payment/payload/OKPayAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/OKPayAccountPayload.java new file mode 100644 index 00000000000..4be25fb12a4 --- /dev/null +++ b/core/src/main/java/bisq/core/payment/payload/OKPayAccountPayload.java @@ -0,0 +1,106 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.payment.payload; + +import bisq.core.locale.Res; + +import io.bisq.generated.protobuffer.PB; + +import com.google.protobuf.Message; + +import org.springframework.util.CollectionUtils; + +import java.nio.charset.Charset; + +import java.util.HashMap; +import java.util.Map; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.extern.slf4j.Slf4j; + +// Cannot be deleted as it would break old trade history entries +@Deprecated +@EqualsAndHashCode(callSuper = true) +@ToString +@Setter +@Getter +@Slf4j +public final class OKPayAccountPayload extends PaymentAccountPayload { + private String accountNr = ""; + + public OKPayAccountPayload(String paymentMethod, String id) { + super(paymentMethod, id); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // PROTO BUFFER + /////////////////////////////////////////////////////////////////////////////////////////// + + private OKPayAccountPayload(String paymentMethod, + String id, + String accountNr, + long maxTradePeriod, + Map excludeFromJsonDataMap) { + super(paymentMethod, + id, + maxTradePeriod, + excludeFromJsonDataMap); + + this.accountNr = accountNr; + } + + @Override + public Message toProtoMessage() { + return getPaymentAccountPayloadBuilder() + .setOKPayAccountPayload(PB.OKPayAccountPayload.newBuilder() + .setAccountNr(accountNr)) + .build(); + } + + public static OKPayAccountPayload fromProto(PB.PaymentAccountPayload proto) { + return new OKPayAccountPayload(proto.getPaymentMethodId(), + proto.getId(), + proto.getOKPayAccountPayload().getAccountNr(), + proto.getMaxTradePeriod(), + CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap())); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // API + /////////////////////////////////////////////////////////////////////////////////////////// + + @Override + public String getPaymentDetails() { + return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.no") + " " + accountNr; + } + + @Override + public String getPaymentDetailsForTradePopup() { + return getPaymentDetails(); + } + + @Override + public byte[] getAgeWitnessInputData() { + return super.getAgeWitnessInputData(accountNr.getBytes(Charset.forName("UTF-8"))); + } +} diff --git a/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java b/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java index 6bfc2f5e69c..c8c44290cee 100644 --- a/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java +++ b/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java @@ -91,6 +91,14 @@ public final class PaymentMethod implements PersistablePayload, Comparable { public static final String ADVANCED_CASH_ID = "ADVANCED_CASH"; public static final String BLOCK_CHAINS_INSTANT_ID = "BLOCK_CHAINS_INSTANT"; + // Cannot be deleted as it would break old trade history entries + @Deprecated + public static final String OK_PAY_ID = "OK_PAY"; + @Deprecated + public static final String CASH_APP_ID = "CASH_APP"; // Removed due too high chargeback risk + @Deprecated + public static final String VENMO_ID = "VENMO"; // Removed due too high chargeback risk + public static PaymentMethod UPHOLD; public static PaymentMethod MONEY_BEAM; public static PaymentMethod POPMONEY; @@ -119,6 +127,14 @@ public final class PaymentMethod implements PersistablePayload, Comparable { public static PaymentMethod ADVANCED_CASH; public static PaymentMethod BLOCK_CHAINS_INSTANT; + // Cannot be deleted as it would break old trade history entries + @Deprecated + public static PaymentMethod OK_PAY; + @Deprecated + public static PaymentMethod CASH_APP; // Removed due too high chargeback risk + @Deprecated + public static PaymentMethod VENMO; // Removed due too high chargeback risk + // The limit and duration assignment must not be changed as that could break old offers (if amount would be higher // than new trade limit) and violate the maker expectation when he created the offer (duration). @Getter diff --git a/core/src/main/java/bisq/core/payment/payload/VenmoAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/VenmoAccountPayload.java new file mode 100644 index 00000000000..713851c1adb --- /dev/null +++ b/core/src/main/java/bisq/core/payment/payload/VenmoAccountPayload.java @@ -0,0 +1,113 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.core.payment.payload; + +import bisq.core.locale.Res; + +import io.bisq.generated.protobuffer.PB; + +import com.google.protobuf.Message; + +import org.springframework.util.CollectionUtils; + +import java.nio.charset.Charset; + +import java.util.HashMap; +import java.util.Map; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.extern.slf4j.Slf4j; + +// Cannot be deleted as it would break old trade history entries +// Removed due too high chargeback risk +@Deprecated +@EqualsAndHashCode(callSuper = true) +@ToString +@Setter +@Getter +@Slf4j +public final class VenmoAccountPayload extends PaymentAccountPayload { + private String venmoUserName = ""; + private String holderName = ""; + + public VenmoAccountPayload(String paymentMethod, String id) { + super(paymentMethod, id); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // PROTO BUFFER + /////////////////////////////////////////////////////////////////////////////////////////// + + private VenmoAccountPayload(String paymentMethod, + String id, + String venmoUserName, + String holderName, + long maxTradePeriod, + Map excludeFromJsonDataMap) { + super(paymentMethod, + id, + maxTradePeriod, + excludeFromJsonDataMap); + + this.venmoUserName = venmoUserName; + this.holderName = holderName; + } + + @Override + public Message toProtoMessage() { + return getPaymentAccountPayloadBuilder() + .setVenmoAccountPayload(PB.VenmoAccountPayload.newBuilder() + .setVenmoUserName(venmoUserName) + .setHolderName(holderName)) + .build(); + } + + public static VenmoAccountPayload fromProto(PB.PaymentAccountPayload proto) { + return new VenmoAccountPayload(proto.getPaymentMethodId(), + proto.getId(), + proto.getVenmoAccountPayload().getVenmoUserName(), + proto.getVenmoAccountPayload().getHolderName(), + proto.getMaxTradePeriod(), + CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap())); + } + + + /////////////////////////////////////////////////////////////////////////////////////////// + // API + /////////////////////////////////////////////////////////////////////////////////////////// + + @Override + public String getPaymentDetails() { + return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " + + Res.getWithCol("payment.venmo.venmoUserName") + " " + venmoUserName; + } + + @Override + public String getPaymentDetailsForTradePopup() { + return getPaymentDetails(); + } + + @Override + public byte[] getAgeWitnessInputData() { + return super.getAgeWitnessInputData(venmoUserName.getBytes(Charset.forName("UTF-8"))); + } +} diff --git a/core/src/main/java/bisq/core/proto/CoreProtoResolver.java b/core/src/main/java/bisq/core/proto/CoreProtoResolver.java index 69262e6b5c5..ebc101175e1 100644 --- a/core/src/main/java/bisq/core/proto/CoreProtoResolver.java +++ b/core/src/main/java/bisq/core/proto/CoreProtoResolver.java @@ -22,6 +22,7 @@ import bisq.core.payment.AccountAgeWitness; import bisq.core.payment.payload.AdvancedCashAccountPayload; import bisq.core.payment.payload.AliPayAccountPayload; +import bisq.core.payment.payload.CashAppAccountPayload; import bisq.core.payment.payload.CashDepositAccountPayload; import bisq.core.payment.payload.ChaseQuickPayAccountPayload; import bisq.core.payment.payload.ClearXchangeAccountPayload; @@ -34,6 +35,7 @@ import bisq.core.payment.payload.MoneyBeamAccountPayload; import bisq.core.payment.payload.MoneyGramAccountPayload; import bisq.core.payment.payload.NationalBankAccountPayload; +import bisq.core.payment.payload.OKPayAccountPayload; import bisq.core.payment.payload.PaymentAccountPayload; import bisq.core.payment.payload.PerfectMoneyAccountPayload; import bisq.core.payment.payload.PopmoneyAccountPayload; @@ -46,6 +48,7 @@ import bisq.core.payment.payload.SwishAccountPayload; import bisq.core.payment.payload.USPostalMoneyOrderAccountPayload; import bisq.core.payment.payload.UpholdAccountPayload; +import bisq.core.payment.payload.VenmoAccountPayload; import bisq.core.payment.payload.WeChatPayAccountPayload; import bisq.core.payment.payload.WesternUnionAccountPayload; import bisq.core.trade.statistics.TradeStatistics2; @@ -135,6 +138,15 @@ public PaymentAccountPayload fromProto(PB.PaymentAccountPayload proto) { return AdvancedCashAccountPayload.fromProto(proto); case INSTANT_CRYPTO_CURRENCY_ACCOUNT_PAYLOAD: return InstantCryptoCurrencyPayload.fromProto(proto); + + // Cannot be deleted as it would break old trade history entries + case O_K_PAY_ACCOUNT_PAYLOAD: + return OKPayAccountPayload.fromProto(proto); + case CASH_APP_ACCOUNT_PAYLOAD: + return CashAppAccountPayload.fromProto(proto); + case VENMO_ACCOUNT_PAYLOAD: + return VenmoAccountPayload.fromProto(proto); + default: throw new ProtobufferRuntimeException("Unknown proto message case(PB.PaymentAccountPayload). messageCase=" + messageCase); } diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 955f3208d2b..98f4fe65a8b 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -2591,6 +2591,15 @@ ADVANCED_CASH=Advanced Cash # suppress inspection "UnusedProperty" BLOCK_CHAINS_INSTANT=Altcoins Instant +# Deprecated: Cannot be deleted as it would break old trade history entries +# suppress inspection "UnusedProperty" +OK_PAY=OKPay +# suppress inspection "UnusedProperty" +CASH_APP=Cash App +# suppress inspection "UnusedProperty" +VENMO=Venmo + + # suppress inspection "UnusedProperty" UPHOLD_SHORT=Uphold # suppress inspection "UnusedProperty" @@ -2630,6 +2639,14 @@ ADVANCED_CASH_SHORT=Advanced Cash # suppress inspection "UnusedProperty" BLOCK_CHAINS_INSTANT_SHORT=Altcoins Instant +# Deprecated: Cannot be deleted as it would break old trade history entries +# suppress inspection "UnusedProperty" +OK_PAY_SHORT=OKPay +# suppress inspection "UnusedProperty" +CASH_APP_SHORT=Cash App +# suppress inspection "UnusedProperty" +VENMO_SHORT=Venmo + #################################################################### # Validation From 75f90e56babd6c01b8a1008a163438f7270cc257 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 6 Mar 2019 22:44:49 -0500 Subject: [PATCH 2/3] Add dummy instance for deprecated payment methods To show display string of payment method we need to create an instance --- .../main/java/bisq/core/payment/payload/PaymentMethod.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java b/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java index c8c44290cee..2751531304e 100644 --- a/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java +++ b/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java @@ -129,11 +129,11 @@ public final class PaymentMethod implements PersistablePayload, Comparable { // Cannot be deleted as it would break old trade history entries @Deprecated - public static PaymentMethod OK_PAY; + public static PaymentMethod OK_PAY = getDummyPaymentMethod(OK_PAY_ID); @Deprecated - public static PaymentMethod CASH_APP; // Removed due too high chargeback risk + public static PaymentMethod CASH_APP = getDummyPaymentMethod(CASH_APP_ID); // Removed due too high chargeback risk @Deprecated - public static PaymentMethod VENMO; // Removed due too high chargeback risk + public static PaymentMethod VENMO = getDummyPaymentMethod(VENMO_ID); // Removed due too high chargeback risk // The limit and duration assignment must not be changed as that could break old offers (if amount would be higher // than new trade limit) and violate the maker expectation when he created the offer (duration). From 13dfadddcbb8a23f7022ebb88212253491523343 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 6 Mar 2019 22:46:02 -0500 Subject: [PATCH 3/3] Change log level for log when msgThrottle is triggered --- p2p/src/main/java/bisq/network/p2p/network/Connection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/src/main/java/bisq/network/p2p/network/Connection.java b/p2p/src/main/java/bisq/network/p2p/network/Connection.java index ac2571de9fe..6ea6467512d 100644 --- a/p2p/src/main/java/bisq/network/p2p/network/Connection.java +++ b/p2p/src/main/java/bisq/network/p2p/network/Connection.java @@ -229,7 +229,7 @@ public void sendMessage(NetworkEnvelope networkEnvelope) { long now = System.currentTimeMillis(); long elapsed = now - lastSendTimeStamp; if (elapsed < sendMsgThrottleTrigger) { - log.warn("We got 2 sendMessage requests in less than {} ms. We set the thread to sleep " + + log.debug("We got 2 sendMessage requests in less than {} ms. We set the thread to sleep " + "for {} ms to avoid flooding our peer. lastSendTimeStamp={}, now={}, elapsed={}, networkEnvelope={}", sendMsgThrottleTrigger, sendMsgThrottleSleep, lastSendTimeStamp, now, elapsed, networkEnvelope.getClass().getSimpleName());