-
Notifications
You must be signed in to change notification settings - Fork 37
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
[Refactor] Decouple the wallet class #197
Conversation
Before I add the "Awaiting Review" label to this PR, the 'Testing' section is going to need to be more detailed (the Quality Control team need to understand what to test, too vague and we might not get enough tests by folks). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise this is looking very clean and is a massive organisation to what we had before, I like it! 👍 🚀
I have some minor nits related to the MasterKey and Wallet classes, but many of them are out of scope to the PR (decoupling refactor) so I'll probably work on them in a different PR to keep this small and quick.
To real nits: I'm not sure cypher.js
quite fits what we're using it for, maybe encoding.js
would fit better? It is more En/Decoding than cyphering.
I'll get testing in the meantime. 🔧
totally agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK, tested wallet creation, sent to addresses + contacts and everything works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the leftover comment, tACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK e6ddb9e
We also received positive tests from 4 Quality Control members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK e6ddb9e
Ledger is also working again LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK ledger works fine
Abstract
The file
wallet.js
is a real mess: There is no actual wallet manager class and it mixes GUI, crypto functions, ledger stuff and masterKeys. This PR begins a process of refactoring the class:wallet.js
. In the future Wallet will manage UTXOs, balance, addresses, masternodes...masterkey.js
, masterkeys should have the ONLY role of managing internally the generation of new addresses.masterKey
has been removed in favor of a global variable of typeWallet
that hasmasterKey
as a private field. At the moment I added a getter tomasterKey
(or the refactor would have been to big), in future PRs we should try to avoid exposing masterkey outside the wallet.ledger.js
encoding.js
has been created. It contains the low-level cryptographic functions that were previously in the wallet file.Testing
Test that the wallet functionality are still working as expected for example:
Note
As I already said the refactor is not final and I did not want to change too much lines. In future PRs the getter to
masterKey
and the functiongetDerivationPath
should both be removed from theWallet
class. We should also really try to decouple the logic from the GUI