Skip to content

twelve words backup screen UI and logic #78

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

Merged
merged 5 commits into from
Apr 7, 2019
Merged

Conversation

yhaspel
Copy link
Contributor

@yhaspel yhaspel commented Apr 3, 2019

In this commit:
Create 12 words backup page. Displaying the words only for now. (no print or copy yet).

Screen Shot 2019-04-03 at 2 33 29 PM

@yhaspel yhaspel requested a review from IlyaVi April 3, 2019 11:39
@@ -14,7 +14,7 @@ class KeyGeneratorService {
const seedAsUint8Array = Buffer.from(seed, 'hex');
const left32BitsOfSeed = seedAsUint8Array.slice(0, nacl.sign.seedLength);
const { publicKey, secretKey } = nacl.sign.keyPair.fromSeed(left32BitsOfSeed);
return { publicKey: Buffer.from(publicKey).toString('hex'), secretKey: Buffer.from(secretKey).toString('hex'), seed };
return { publicKey: Buffer.from(publicKey).toString('hex'), secretKey: Buffer.from(secretKey).toString('hex'), seed, resolvedMnemonic };
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to mnemonic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will clash with "mnemonic" param in wallet actions.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can rename it like this { mnemonic: returnedMnemonic }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renaming on destructuring still does not solve the issue. Unless I change the "mnemonic" parmam name in the saveNewWallet fuction to something else, like so:
in keyGenService:
return { publicKey: Buffer.from(publicKey).toString('hex'), secretKey: Buffer.from(secretKey).toString('hex'), seed, mnemonic: resolvedMnemonic };

in wallet actions:

Screen Shot 2019-04-03 at 5 20 14 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

this works just fine:
Screen Shot 2019-04-04 at 10 10 06
Screen Shot 2019-04-04 at 10 09 27

What you've done - changed param name in function params destruct without changing param name in all usages of this function => broken app functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK np, this brings us back to how it was coded to begin with.

Copy link
Contributor

Choose a reason for hiding this comment

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

it's not the same, the important thing is not breaking the app with untested changes

@IlyaVi IlyaVi changed the title twelve words backup screen - initial dev twelve words backup screen UI and logic Apr 4, 2019
@IlyaVi IlyaVi merged commit 237803d into develop Apr 7, 2019
@IlyaVi IlyaVi deleted the wallet-backup-12words branch April 7, 2019 08:28
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.

None yet

2 participants