From e5321f63a958a697aa68488a3882f019473adba7 Mon Sep 17 00:00:00 2001 From: Benjamin Maggi Date: Fri, 26 Oct 2018 09:27:42 +0200 Subject: [PATCH 1/8] :seedling: display address --- i18n/locales/en/common.json | 1 - src/components/transactions/transactionType.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/i18n/locales/en/common.json b/i18n/locales/en/common.json index f574eb4b10..f4ae1ba1ef 100644 --- a/i18n/locales/en/common.json +++ b/i18n/locales/en/common.json @@ -7,7 +7,6 @@ "Academy": "Academy", "Access extra features": "Access extra features", "Account Info": "Account Info", - "Account initialization": "Account initialization", "Active": "Active", "Activity": "Activity", "Add a Lisk ID": "Add a Lisk ID", diff --git a/src/components/transactions/transactionType.js b/src/components/transactions/transactionType.js index f45a24870c..e9bc6b8464 100644 --- a/src/components/transactions/transactionType.js +++ b/src/components/transactions/transactionType.js @@ -7,7 +7,7 @@ const TransactionType = (props) => { let type; switch (props.type) { case 0: - type = props.senderId === props.recipientId ? t('Account initialization') : false; + type = false; break; case 1: type = t('Second passphrase registration'); From 6a806411b738c54cff85206be20c8a53754d2003 Mon Sep 17 00:00:00 2001 From: Benjamin Maggi Date: Fri, 26 Oct 2018 15:33:07 +0200 Subject: [PATCH 2/8] :nail_care: remove unessesary case --- src/components/transactions/transactionType.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/transactions/transactionType.js b/src/components/transactions/transactionType.js index e9bc6b8464..087ccd74a4 100644 --- a/src/components/transactions/transactionType.js +++ b/src/components/transactions/transactionType.js @@ -6,9 +6,6 @@ const TransactionType = (props) => { const { t } = props; let type; switch (props.type) { - case 0: - type = false; - break; case 1: type = t('Second passphrase registration'); break; From 84e1cdb2d30c547240a7e07c425a3c0a340fc6a5 Mon Sep 17 00:00:00 2001 From: Benjamin Maggi Date: Mon, 29 Oct 2018 10:46:02 +0100 Subject: [PATCH 3/8] :bug: set reference when accountInit --- i18n/locales/en/common.json | 1 + src/components/sendReadable/send.js | 3 ++- test/integration/wallet.test.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/i18n/locales/en/common.json b/i18n/locales/en/common.json index f4ae1ba1ef..f574eb4b10 100644 --- a/i18n/locales/en/common.json +++ b/i18n/locales/en/common.json @@ -7,6 +7,7 @@ "Academy": "Academy", "Access extra features": "Access extra features", "Account Info": "Account Info", + "Account initialization": "Account initialization", "Active": "Active", "Activity": "Activity", "Add a Lisk ID": "Add a Lisk ID", diff --git a/src/components/sendReadable/send.js b/src/components/sendReadable/send.js index a8d0416274..ddddec0cb8 100644 --- a/src/components/sendReadable/send.js +++ b/src/components/sendReadable/send.js @@ -79,13 +79,14 @@ class SendReadable extends React.Component { send(event) { event.preventDefault(); this.setState({ loading: true }); + const isAccountInit = this.props.accountInit && (this.props.account.address === this.state.recipient.value); this.props.sent({ account: this.props.account, recipientId: this.state.recipient.value, amount: this.state.amount.value, passphrase: this.props.passphrase.value, secondPassphrase: this.props.secondPassphrase.value, - data: this.props.reference, + data: isAccountInit ? this.props.t('Account initialization') : this.props.reference, }); } diff --git a/test/integration/wallet.test.js b/test/integration/wallet.test.js index 77e36520f6..f642f1af5f 100644 --- a/test/integration/wallet.test.js +++ b/test/integration/wallet.test.js @@ -200,7 +200,7 @@ describe('@integration: Wallet', () => { match.defined, match.defined, null, - undefined, + 'Account initialization', ).returnsPromise().resolves({ data: [] }); }); From 7935f689ec893b854a223bc76496e11b8c356630 Mon Sep 17 00:00:00 2001 From: Benjamin Maggi Date: Mon, 29 Oct 2018 11:23:32 +0100 Subject: [PATCH 4/8] :nail_care: fix line exceeding max lenght --- src/components/sendReadable/send.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/sendReadable/send.js b/src/components/sendReadable/send.js index ddddec0cb8..57dfce5c24 100644 --- a/src/components/sendReadable/send.js +++ b/src/components/sendReadable/send.js @@ -79,7 +79,8 @@ class SendReadable extends React.Component { send(event) { event.preventDefault(); this.setState({ loading: true }); - const isAccountInit = this.props.accountInit && (this.props.account.address === this.state.recipient.value); + const isAccountInit = this.props.accountInit && + (this.props.account.address === this.state.recipient.value); this.props.sent({ account: this.props.account, recipientId: this.state.recipient.value, From b6794ae45bfec46f23b5f78e9add102259aa4d63 Mon Sep 17 00:00:00 2001 From: Benjamin Maggi Date: Mon, 29 Oct 2018 12:30:55 +0100 Subject: [PATCH 5/8] :recycle: remove uneccesary variable --- src/components/sendReadable/send.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/sendReadable/send.js b/src/components/sendReadable/send.js index 57dfce5c24..b91a3d751f 100644 --- a/src/components/sendReadable/send.js +++ b/src/components/sendReadable/send.js @@ -79,15 +79,13 @@ class SendReadable extends React.Component { send(event) { event.preventDefault(); this.setState({ loading: true }); - const isAccountInit = this.props.accountInit && - (this.props.account.address === this.state.recipient.value); this.props.sent({ account: this.props.account, recipientId: this.state.recipient.value, amount: this.state.amount.value, passphrase: this.props.passphrase.value, secondPassphrase: this.props.secondPassphrase.value, - data: isAccountInit ? this.props.t('Account initialization') : this.props.reference, + data: this.props.accountInit ? this.props.t('Account initialization') : this.props.reference, }); } From 57a0c9fcca8408b3f881277b077cfb1140321bb3 Mon Sep 17 00:00:00 2001 From: Benjamin Maggi Date: Mon, 29 Oct 2018 13:19:20 +0100 Subject: [PATCH 6/8] :white_check_mark: change initialization message selector --- test/cypress/e2e/transfer.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/e2e/transfer.spec.js b/test/cypress/e2e/transfer.spec.js index 449acaacdb..de62cca7d8 100644 --- a/test/cypress/e2e/transfer.spec.js +++ b/test/cypress/e2e/transfer.spec.js @@ -136,7 +136,7 @@ describe('Transfer', () => { cy.get(ss.amountInput).click().type(randomAmount); cy.get(ss.nextButton).click(); cy.get(ss.sendButton).click(); - cy.get(ss.transactionRow).eq(0).find(ss.transactionAddress).should('have.text', msg.accountInitializatoinAddress); + cy.get(ss.transactionRow).eq(0).find(ss.transactionReference).should('have.text', msg.accountInitializatoinAddress); }); it('Launch protocol link prefills recipient, amount and reference', () => { From 96e2322057c7de915b58444e094ae42c7bed65e6 Mon Sep 17 00:00:00 2001 From: Benjamin Maggi Date: Mon, 29 Oct 2018 13:42:38 +0100 Subject: [PATCH 7/8] :white_check_mark: show self address --- test/cypress/e2e/transfer.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/e2e/transfer.spec.js b/test/cypress/e2e/transfer.spec.js index de62cca7d8..ed1a62de0a 100644 --- a/test/cypress/e2e/transfer.spec.js +++ b/test/cypress/e2e/transfer.spec.js @@ -136,7 +136,7 @@ describe('Transfer', () => { cy.get(ss.amountInput).click().type(randomAmount); cy.get(ss.nextButton).click(); cy.get(ss.sendButton).click(); - cy.get(ss.transactionRow).eq(0).find(ss.transactionReference).should('have.text', msg.accountInitializatoinAddress); + cy.get(ss.transactionRow).eq(0).find(ss.transactionAddress).should('have.text', accounts.genesis.address); }); it('Launch protocol link prefills recipient, amount and reference', () => { From 8463eb1f3645de5caf98f126b5fabd28df705ed5 Mon Sep 17 00:00:00 2001 From: andreiklimenok Date: Mon, 29 Oct 2018 15:44:10 +0100 Subject: [PATCH 8/8] :white_check_mark: remove transfer to myself test, add assertions to account init test --- test/cypress/e2e/transfer.spec.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/test/cypress/e2e/transfer.spec.js b/test/cypress/e2e/transfer.spec.js index ed1a62de0a..d790cfb516 100644 --- a/test/cypress/e2e/transfer.spec.js +++ b/test/cypress/e2e/transfer.spec.js @@ -129,16 +129,6 @@ describe('Transfer', () => { cy.get('@tx').find(ss.transactionAddress).should('have.text', randomAddress); }); - it('Transfer to myself appears as account initialization', () => { - cy.autologin(accounts.genesis.passphrase, networks.devnet.node); - cy.visit(urls.wallet); - cy.get(ss.recipientInput).type(accounts.genesis.address); - cy.get(ss.amountInput).click().type(randomAmount); - cy.get(ss.nextButton).click(); - cy.get(ss.sendButton).click(); - cy.get(ss.transactionRow).eq(0).find(ss.transactionAddress).should('have.text', accounts.genesis.address); - }); - it('Launch protocol link prefills recipient, amount and reference', () => { cy.autologin(accounts.genesis.passphrase, networks.devnet.node); cy.visit('/wallet?recipient=4995063339468361088L&amount=5&reference=test'); @@ -172,5 +162,8 @@ describe('Transfer', () => { cy.wait(txConfirmationTimeout); cy.reload(); cy.get(ss.accountInitializationMsg).should('not.exist'); + cy.get(ss.transactionRow).eq(0).as('tx'); + cy.get('@tx').find(ss.transactionAddress).should('have.text', accounts['without initialization'].address); + cy.get('@tx').find(ss.transactionReference).should('have.text', 'Account initialization'); }); });