Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify seed phrase #664

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Verify seed phrase #664

merged 1 commit into from
Oct 10, 2023

Conversation

ademar111190
Copy link
Collaborator

Fixes: #647

How to test

Flow 1 (new wallets)

  • Clean install c-breez
  • Start a new wallet (Let's breez! option)
  • You should see a warning icon at the top right
  • This warning should trigger the verify seed phrase flow

Flow 2 (restored wallets)

  • Clean install c-breez
  • Restore a wallet (Restore from backup option)
  • You should not see a warning icon at the top right
  • (We consider the phrase verified as you just restored it)

@ademar111190 ademar111190 requested a review from a team October 9, 2023 13:52
@ademar111190 ademar111190 self-assigned this Oct 9, 2023
@@ -162,7 +162,10 @@ class InitialWalkthroughPageState extends State<InitialWalkthroughPage>

final themeProvider = ThemeProvider.controllerOf(context);
try {
await accountBloc.connect(mnemonic: mnemonic ?? bip39.generateMnemonic(strength: 128));
await accountBloc.connect(
mnemonic: mnemonic ?? bip39.generateMnemonic(strength: 128),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about pass null in the mnemonics in restore case and then we don't need the restored flag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Account bloc uses the null case already: https://github.com/breez/c-breez/pull/664/files#diff-5dbe6ee35eb95a61a99689c83031840c5e21fc8f6a0f24b8b42ecbc2a87ab16bR54 when it is null, it doesn't change the current state of the validation status.
So, in order to use null instead of the boolean flag, I need to change how the bloc is started, from if (!state.initial) connect(); to something like if (!state.initial) init(); and adding this init method.
Let me know if you prefer this way Roei.

@ademar111190 ademar111190 merged commit d4e9e5f into main Oct 10, 2023
1 check failed
@ademar111190 ademar111190 deleted the aa/647-verify-seed-phrase branch October 10, 2023 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verifying the seed phrase
2 participants