[bisq-network/bisq] Add support for user name for Revolut accounts (#4453)

sqrrm notifications at github.com
Mon Aug 31 13:34:11 UTC 2020


@sqrrm commented on this pull request.

I have tested this and it keeps the sign status.

Would be good if someone with revolut knowledge acked before merge.

> @@ -17,10 +17,13 @@
 
 package bisq.desktop.util.validation;
 
-public final class RevolutValidator extends PhoneNumberValidator {
+public final class RevolutValidator extends LengthValidator {

I would like someone with knowledge of this requirement to weigh in before merging.

> +    @Override
+    public void show() {
+        if (headLine == null)
+            headLine = Res.get("payment.revolut.addUserNameInfo.headLine");
+
+        width = 868;
+        createGridPane();
+        addHeadLine();
+        addContent();
+        addButtons();
+        applyStyles();
+        display();
+    }
+
+    private void addContent() {
+        addLabel(gridPane, ++rowIndex, Res.get("payment.account.revolut.addUserNameInfo", Res.get("payment.revolut.info"), revolutAccount.getAccountName()));

Keeping lines shorter helps the reviewer. and it would also be in accordance with our style guide.

> +        // it has been the case before
+        String input = this.accountId == null ? "" : this.accountId;
+        return super.getAgeWitnessInputData(input.getBytes(StandardCharsets.UTF_8));
+    }
+
+    public void setUserName(@Nullable String userName) {
+        this.userName = userName;
+        // We only set accountId to userName for new accounts. Existing accounts have accountId set with email
+        // or phone nr. and we keep that to not break account signing.
+        if (accountId == null) {
+            accountId = userName;
+        }
+    }
+
+    public String getUserName() {
+        return userName != null ? userName : accountId;

Is this safe now that accountId can be null as well?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4453#pullrequestreview-478506367
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200831/146ba187/attachment.html>


More information about the bisq-github mailing list