-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DDW-893] Implement wallet recovery phrase verification (#1565)
* [DDW-893] UI Init * [DDW-893] CHANGELOG * [DDW-893] UI progress * [DDW-893] UI - progress * [DDW-893] Wallet Settings page UI and logic * [DDW-893] Lint * [DDW-893] Dialogs - init * [DDW-893] Dialogs - containers and buttons * [DDW-893] Dialogs - basic styling * [DDW-893] Dialogs - basic styling * [DDW-893] Dialogs - intl * [DDW-893] Dialogs - translations manager * [DDW-893] Dialogs - update Storybook * [DDW-893] Dialogs - Change 'safetyAgreement' logic * [DDW-893] Styling adjustments * [DDW-893] Correct button naming * [DDW-893] Remove unused dummy data * [DDW-893] Change local wallet data logic location * [DDW-893] updates mnemonicsConfirmationDate * [DDW-893] Move wallet status logic * [DDW-893] Sidebar notification * [DDW-893] Integrate new API endpoint * [DDW-893] Wallets list notification * [DDW-893] Implement actions and store logic * [DDW-893] Flow errors * [DDW-893] Flow errors * [DDW-893] Translation manager * [DDW-893] Introduce Recovery Phrase Autocomplete * [DDW-893] Wallet Recovery Phrase validation and error messages * [DDW-893] Prevent closing when entering mnemonics * [DDW-893] Handles ElectronStore not available * [DDW-893] Fixes broken Storybook story * [DDW-893] Removes local data when deleting a wallet * [DDW-893] Update get wallet id and balance API endpoint * [DDW-893] Wallet nav notification * [DDW-893] Replace isVerifying component inner state with request isExecuting flag * [DDW-893] Styling adjustment * [DDW-893] Support portal link * [DDW-893] Adjustment * [DDW-893] Styling adjustments * [DDW-893] CSS Variables * [DDW-893] Correct time until * [DDW-893] Translation manager * [DDW-893] Update CHANGELOG * [DDW-893] Japanese translation * [DDW-893] Japanese translation * [DDW-893] Japanese translation * [DDW-893] Japanese translation * [DDW-893] Japanese translation * [DDW-893] Bg color for OK status * [DDW-893] Checkbox labels * [DDW-893] Keeps button verifying state after request is finished * [DDW-893] Removes dummy data from store * [DDW-893] Removes unused styling * [DDW-893] Fixes wrong dropdown positioning * [DDW-893] Wallet LocalStorage as a class * [DDW-893] Flow errors * [DDW-893] Refactory - init * [DDW-893] Adjustments * [DDW-893] Refactory - progress * [DDW-893] Refactory - progress * [DDW-893] Restores nav notification * [DDW-893] Updates wallet local after verifying * [DDW-893] Removes local data when deleting a wallet * [DDW-893] Reverts removing logs * [DDW-893] Removes unfinished test file * [DDW-893] E2E tests - WIP * [DDW-893] E2E tests - WIP * [DDW-893] Working E2E tests * [DDW-893] Improves E2E tests * [DDW-893] Translation manager * [DDW-893] Fixes wrong font variable introduced in [DDW-757] * [DDW-893] Automatic update message improvement * [DDW-893] Code improvements * [DDW-893] Fix broken E2E tests * [DDW-893] Bump cardano-sl revision * [DDW-893] Fix failing acceptance test * [DDW-893] Replace notification threshold from 150 to 183 days * [DDW-893] Better intl variable naming * [DDW-893] English proofreading changes * [DDW-893] Japanese translation
- Loading branch information
1 parent
f61a207
commit ab87929
Showing
69 changed files
with
2,864 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"url": "https://github.com/input-output-hk/cardano-sl", | ||
"rev": "51ad7c0503b1c52a75a6eb36096c407934136468", | ||
"date": "2019-08-10T03:35:47+00:00", | ||
"sha256": "0cqaxk3k8i5z4q4b5na0pcln9fblglmn7900vp1xdzmw75pp1rrz", | ||
"rev": "1a792d7cd0f0c93a0f0c28f66372bce3c3808dbd", | ||
"date": "2019-09-25T010:53:54+00:00", | ||
"sha256": "1vk71zn9bnkgkhgcyj59wzrp28crjwcd0lgnm013mhzpvxycgn61", | ||
"fetchSubmodules": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
features/tests/e2e/steps/wallet-recovery-phrase-verification-steps.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import { Given, When, Then } from 'cucumber'; | ||
import { expect } from 'chai'; | ||
import { navigateTo } from '../helpers/route-helpers'; | ||
import { | ||
waitUntilWaletNamesEqual, | ||
getNameOfActiveWalletInSidebar, | ||
} from '../helpers/wallets-helpers'; | ||
|
||
const SETTINGS_PAGE_STATUS_SELECTOR = '.WalletRecoveryPhrase_validationStatus'; | ||
const SETTINGS_PAGE_BUTTON_SELECTOR = `${SETTINGS_PAGE_STATUS_SELECTOR} .WalletRecoveryPhrase_validationStatusButton`; | ||
const DIALOG_SELECTOR = '.Dialog_dialogWrapper'; | ||
const DIALOG_CHECKBOX_SELECTOR = `${DIALOG_SELECTOR} .SimpleCheckbox_check`; | ||
const DIALOG_CONTINUE_BUTTON_SELECTOR = `${DIALOG_SELECTOR} .SimpleButton_root`; | ||
const DIALOG_SUCCESSFUL_SELECTOR = '.verification-successful'; | ||
const DIALOG_UNSUCCESSFUL_SELECTOR = '.verification-unsuccessful'; | ||
const DIALOG_VERIFY_AGAIN_BUTTON_SELECTOR = `${DIALOG_SELECTOR} button.attention`; | ||
const DIALOG_CLOSE_BUTTON_SELECTOR = `${DIALOG_SELECTOR} .DialogCloseButton_component`; | ||
const walletName = 'Wallet'; | ||
|
||
Given( | ||
'the last recovery phrase veryfication was done {int} days ago', | ||
async function(daysAgo) { | ||
await this.client.executeAsync((days, done) => { | ||
const { id } = daedalus.stores.wallets.active; | ||
const date = new Date(); | ||
date.setDate(date.getDate() - days); | ||
const recoveryPhraseVerificationDate = date.toISOString(); | ||
const { updateWalletLocalData } = daedalus.actions.wallets; | ||
updateWalletLocalData.once(done); | ||
updateWalletLocalData.trigger({ | ||
id, | ||
recoveryPhraseVerificationDate, | ||
}); | ||
}, daysAgo); | ||
} | ||
); | ||
|
||
Then( | ||
'I should see a {string} recovery phrase veryfication feature', | ||
async function(status) { | ||
const statusClassname = `${SETTINGS_PAGE_STATUS_SELECTOR}${status}`; | ||
return await this.client.waitForVisible(statusClassname); | ||
} | ||
); | ||
|
||
When(/^I click the recovery phrase veryfication button$/, function() { | ||
return this.waitAndClick(SETTINGS_PAGE_BUTTON_SELECTOR); | ||
}); | ||
|
||
When(/^I click the checkbox and Continue button$/, function() { | ||
this.waitAndClick(DIALOG_CHECKBOX_SELECTOR); | ||
return this.waitAndClick(DIALOG_CONTINUE_BUTTON_SELECTOR); | ||
}); | ||
|
||
When(/^I enter the recovery phrase mnemonics correctly$/, async function() { | ||
const recoveryPhrase = this.mnemonics[walletName].slice(); | ||
await this.client.executeAsync((recoveryPhrase, done) => { | ||
const { checkRecoveryPhrase } = daedalus.actions.walletBackup; | ||
checkRecoveryPhrase.once(done); | ||
checkRecoveryPhrase.trigger({ | ||
recoveryPhrase, | ||
}); | ||
}, recoveryPhrase); | ||
}); | ||
|
||
When(/^I enter the recovery phrase mnemonics incorrectly$/, async function() { | ||
const incorrectRecoveryPhrase = [...this.mnemonics[walletName]]; | ||
incorrectRecoveryPhrase[0] = 'wrong'; | ||
await this.client.executeAsync((recoveryPhrase, done) => { | ||
const { checkRecoveryPhrase } = daedalus.actions.walletBackup; | ||
checkRecoveryPhrase.once(done); | ||
checkRecoveryPhrase.trigger({ | ||
recoveryPhrase, | ||
}); | ||
}, incorrectRecoveryPhrase); | ||
}); | ||
|
||
When(/^I should see the confirmation dialog$/, async function() { | ||
return this.client.waitForVisible(DIALOG_SUCCESSFUL_SELECTOR); | ||
}); | ||
|
||
When(/^I should see the error dialog$/, async function() { | ||
return this.client.waitForVisible(DIALOG_UNSUCCESSFUL_SELECTOR); | ||
}); | ||
|
||
When(/^I should not see any dialog$/, async function() { | ||
return this.client.waitForVisible(DIALOG_SELECTOR, null, true); | ||
}); | ||
When(/^I click the Verify again button$/, async function() { | ||
return this.waitAndClick(DIALOG_VERIFY_AGAIN_BUTTON_SELECTOR); | ||
}); | ||
When(/^I click the close button$/, async function() { | ||
return this.waitAndClick(DIALOG_CLOSE_BUTTON_SELECTOR); | ||
}); |
32 changes: 32 additions & 0 deletions
32
features/wallet-settings-recovery-phrase-verification.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@e2e | ||
Feature: Wallet Settings - Recovery Phrase Verification | ||
|
||
Background: | ||
Given I have completed the basic setup | ||
And I have the following wallets: | ||
| name | | ||
| Wallet | | ||
|
||
Scenario: Recovery phrase correctly verified | ||
Given the last recovery phrase veryfication was done 400 days ago | ||
And I am on the "Wallet" wallet "settings" screen | ||
Then I should see a "Notification" recovery phrase veryfication feature | ||
When I click the recovery phrase veryfication button | ||
And I click the checkbox and Continue button | ||
And I enter the recovery phrase mnemonics correctly | ||
Then I should see the confirmation dialog | ||
When I click the checkbox and Continue button | ||
Then I should not see any dialog | ||
And I should see a "Ok" recovery phrase veryfication feature | ||
|
||
Scenario: Recovery phrase incorrectly verified | ||
Given the last recovery phrase veryfication was done 200 days ago | ||
And I am on the "Wallet" wallet "settings" screen | ||
Then I should see a "Warning" recovery phrase veryfication feature | ||
When I click the recovery phrase veryfication button | ||
And I click the checkbox and Continue button | ||
And I enter the recovery phrase mnemonics incorrectly | ||
Then I should see the error dialog | ||
When I click the close button | ||
Then I should not see any dialog | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.