From 595c968f2d41e965db4989735a28499a481956be Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Sun, 30 Aug 2020 16:44:45 -0500 Subject: [PATCH] Various small cleanups... --- .../autoconf/xmr/XmrTransferProofService.java | 2 +- .../bisq/core/user/AutoConfirmSettings.java | 5 ++++ .../main/java/bisq/core/user/Preferences.java | 6 ++--- .../bisq/core/user/PreferencesPayload.java | 2 +- .../resources/i18n/displayStrings.properties | 13 +++++----- .../overlays/windows/TradeDetailsWindow.java | 6 ++--- .../steps/seller/SellerStep3View.java | 2 +- proto/src/main/proto/pb.proto | 24 +++++++++---------- 8 files changed, 33 insertions(+), 27 deletions(-) diff --git a/core/src/main/java/bisq/core/trade/autoconf/xmr/XmrTransferProofService.java b/core/src/main/java/bisq/core/trade/autoconf/xmr/XmrTransferProofService.java index f6841d211a..e713a11631 100644 --- a/core/src/main/java/bisq/core/trade/autoconf/xmr/XmrTransferProofService.java +++ b/core/src/main/java/bisq/core/trade/autoconf/xmr/XmrTransferProofService.java @@ -32,7 +32,7 @@ import lombok.extern.slf4j.Slf4j; import javax.annotation.Nullable; /** - * Manages the XMR transfers proof requests for multiple trades. + * Manages the XMR transfers proof requests for multiple trades and multiple services. */ @Slf4j class XmrTransferProofService { diff --git a/core/src/main/java/bisq/core/user/AutoConfirmSettings.java b/core/src/main/java/bisq/core/user/AutoConfirmSettings.java index b2420c4771..e83acb7c6d 100644 --- a/core/src/main/java/bisq/core/user/AutoConfirmSettings.java +++ b/core/src/main/java/bisq/core/user/AutoConfirmSettings.java @@ -43,6 +43,11 @@ public final class AutoConfirmSettings implements PersistablePayload { this.currencyCode = currencyCode; } + + /////////////////////////////////////////////////////////////////////////////////////////// + // PROTO BUFFER + /////////////////////////////////////////////////////////////////////////////////////////// + @Override public Message toProtoMessage() { return protobuf.AutoConfirmSettings.newBuilder() diff --git a/core/src/main/java/bisq/core/user/Preferences.java b/core/src/main/java/bisq/core/user/Preferences.java index 8cab825896..584e051e7d 100644 --- a/core/src/main/java/bisq/core/user/Preferences.java +++ b/core/src/main/java/bisq/core/user/Preferences.java @@ -128,9 +128,9 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid // list of XMR proof providers : this list will be used if no preference has been set public static final List getDefaultXmrProofProviders() { if (DevEnv.isDevMode()) { - return new ArrayList<>(Arrays.asList( - "78.47.61.90:8081")); + return new ArrayList<>(Arrays.asList("78.47.61.90:8081")); } else { + // TODO we need at least 2 for relase return new ArrayList<>(Arrays.asList( "monero3bec7m26vx6si6qo7q7imlaoz45ot5m2b5z2ppgoooo6jx2rqd.onion")); } @@ -410,7 +410,7 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid persist(); } - // AutoConfirmSettings is currently only used for one coin: XMR. Although it could + // AutoConfirmSettings is currently only used for XMR. Although it could // potentially in the future be used for others too. In the interest of flexibility // we store it as a list in the proto definition, but in practical terms the // application is not coded to handle more than one entry. For now this API diff --git a/core/src/main/java/bisq/core/user/PreferencesPayload.java b/core/src/main/java/bisq/core/user/PreferencesPayload.java index 9894612f7b..fbf97ea575 100644 --- a/core/src/main/java/bisq/core/user/PreferencesPayload.java +++ b/core/src/main/java/bisq/core/user/PreferencesPayload.java @@ -127,7 +127,7 @@ public final class PreferencesPayload implements UserThreadMappedPersistableEnve private int blockNotifyPort; private boolean tacAcceptedV120; - // Added after 1.3.7 + // Added at 1.3.8 private List autoConfirmSettingsList = new ArrayList<>(); diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 3678fcd0d6..c20bd80783 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -572,7 +572,7 @@ portfolio.pending.step3_seller.autoConfirmStatus=Auto-confirm status portfolio.pending.autoConfirmTxNotFound=Transaction not found portfolio.pending.autoConfirmPending=Pending portfolio.pending.autoConfirmDisabled=Disabled -portfolio.pending.autoConfirmSuccess=Auto-Confirmed +portfolio.pending.autoConfirmSuccess=Auto-confirmed portfolio.pending.step5.completed=Completed portfolio.pending.step1.info=Deposit transaction has been published.\n{0} need to wait for at least one blockchain confirmation before starting the payment. @@ -643,8 +643,9 @@ portfolio.pending.step2_buyer.confirmStart.msg=Did you initiate the {0} payment portfolio.pending.step2_buyer.confirmStart.yes=Yes, I have started the payment portfolio.pending.step2_buyer.confirmStart.warningTitle=You have not provided proof of payment portfolio.pending.step2_buyer.confirmStart.warning=You have not entered the transaction ID and the transaction key.\n\n\ - By not providing this data the peer cannot use the auto confirm feature to release the BTC as soon the XMR has been received.\n\ - Beside that, Bisq requires that the sender of the XMR transaction is able to provide this information to the mediator or arbitrator in case of a dispute. + By not providing this data the peer cannot use the auto-confirm feature to release the BTC as soon the XMR has been received.\n\ + Beside that, Bisq requires that the sender of the XMR transaction is able to provide this information to the mediator or arbitrator in case of a dispute.\n\ + See more details on the Bisq wiki: https://bisq.wiki/Trading_Monero#Auto-confirming_trades portfolio.pending.step2_buyer.confirmStart.warningButton=Ignore and continue anyway portfolio.pending.step2_seller.waitPayment.headline=Wait for payment portfolio.pending.step2_seller.f2fInfo.headline=Buyer's contact information @@ -1069,7 +1070,7 @@ setting.preferences.avoidStandbyMode=Avoid standby mode setting.preferences.autoConfirmXMR=XMR auto-confirm setting.preferences.autoConfirmEnabled=Enabled setting.preferences.autoConfirmRequiredConfirmations=Required confirmations -setting.preferences.autoConfirmMaxTradeSize=Max trade size (BTC) +setting.preferences.autoConfirmMaxTradeSize=Max. trade amount (BTC) setting.preferences.autoConfirmServiceAddresses=Service addresses setting.preferences.deviationToLarge=Values higher than {0}% are not allowed. setting.preferences.txFee=Withdrawal transaction fee (satoshis/byte) @@ -1349,7 +1350,7 @@ https://bisq.wiki/Trading_Monero#Proving_payments\n\n\ Failure to provide the required transaction data will result in losing disputes.\n\n\ Also note that Bisq now offers automatic confirming for XMR transactions to make trades quicker, \ but you need to enable it in Settings.\n\n\ -See the wiki for more about the auto-confirm feature:\n\ +See the wiki for more information about the auto-confirm feature:\n\ https://bisq.wiki/Trading_Monero#Auto-confirming_trades # suppress inspection "TrailingSpacesInProperty" account.altcoin.popup.msr.msg=Trading MSR on Bisq requires that you understand and fulfill \ @@ -2450,7 +2451,7 @@ filterWindow.priceRelayNode=Filtered price relay nodes (comma sep. onion address filterWindow.btcNode=Filtered Bitcoin nodes (comma sep. addresses + port) filterWindow.preventPublicBtcNetwork=Prevent usage of public Bitcoin network filterWindow.disableDao=Disable DAO -filterWindow.disableAutoConf=Disable auto-confirmation (altcoins) +filterWindow.disableAutoConf=Disable auto-confirm filterWindow.disableDaoBelowVersion=Min. version required for DAO filterWindow.disableTradeBelowVersion=Min. version required for trading filterWindow.add=Add filter diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java index 9e7d6a2cea..ecf34d3109 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java @@ -158,11 +158,11 @@ public class TradeDetailsWindow extends Overlay { DisplayUtils.formatVolumeWithCode(trade.getTradeVolume())); addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.tradePrice"), FormattingUtils.formatPrice(trade.getTradePrice())); - String methodText = Res.get(offer.getPaymentMethod().getId()); + String paymentMethodText = Res.get(offer.getPaymentMethod().getId()); if (trade.getAutoConfirmResult().isSuccessState()) { - methodText += " (" + trade.getAutoConfirmResult().getTextStatus() + ")"; + paymentMethodText += " (" + trade.getAutoConfirmResult().getTextStatus() + ")"; } - addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.paymentMethod"), methodText); + addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.paymentMethod"), paymentMethodText); // second group rows = 6; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java index 81e017d666..777d7f0f82 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java @@ -225,7 +225,7 @@ public class SellerStep3View extends TradeStepView { GridPane.setRowSpan(titledGroupBg, 4); } - if (isBlockChain && trade.getOffer().getCurrencyCode().equalsIgnoreCase("XMR")) { + if (isBlockChain && trade.getOffer().getCurrencyCode().equals("XMR")) { autoConfirmStatusField = addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("portfolio.pending.step3_seller.autoConfirmStatus"), "", Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE).second; diff --git a/proto/src/main/proto/pb.proto b/proto/src/main/proto/pb.proto index 10a27fd375..7a3e231bee 100644 --- a/proto/src/main/proto/pb.proto +++ b/proto/src/main/proto/pb.proto @@ -1396,10 +1396,6 @@ message Trade { AutoConfirmResult auto_confirm_result = 38; } -message AutoConfirmResult { - string stateName = 1; -} - message BuyerAsMakerTrade { Trade trade = 1; } @@ -1561,6 +1557,14 @@ message PreferencesPayload { repeated AutoConfirmSettings auto_confirm_settings = 56; } +message AutoConfirmSettings { + bool enabled = 1; + int32 required_confirmations = 2; + int64 trade_limit = 3; + repeated string service_addresses = 4; + string currency_code = 5; +} + /////////////////////////////////////////////////////////////////////////////////////////// // UserPayload /////////////////////////////////////////////////////////////////////////////////////////// @@ -1583,6 +1587,10 @@ message UserPayload { RefundAgent registered_refund_agent = 15; } +message AutoConfirmResult { + string stateName = 1; +} + /////////////////////////////////////////////////////////////////////////////////////////// // DAO /////////////////////////////////////////////////////////////////////////////////////////// @@ -2042,14 +2050,6 @@ message TradeCurrency { } } -message AutoConfirmSettings { - bool enabled = 1; - int32 required_confirmations = 2; - int64 trade_limit = 3; - repeated string service_addresses = 4; - string currency_code = 5; -} - message CryptoCurrency { bool is_asset = 1; }