-
Notifications
You must be signed in to change notification settings - Fork 984
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
fix(wallet/accounts): don't store derived account when it exists in app db #10408
Conversation
Pull Request Checklist
|
Jenkins Builds
|
accounts (:multiaccount/accounts db)] | ||
{::import-account-seed {:passphrase passphrase | ||
:hashed-password hashed-password | ||
:accounts accounts }})))) |
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.
a perfectionist is crying :)
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.
As mentioned in the Review Notes, I'm very happy to iterate over this and change it to make it more reframe-y. Thoughts?
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.
i mean formatting, and btw lint has failed
and also this |
4a9d2ba
to
b321de4
Compare
Thanks for the pointer @flexsurfer totally forgot that |
99% of end-end tests have passed
Failed tests (1)Click to expand
Passed tests (91)Click to expand |
0% of end-end tests have passed
Failed tests (1)Click to expand
|
100% of end-end tests have passed
Passed tests (1) |
Tested:
Looks good to me. |
…pp db As discussed in status-im#10326 and later in status-im/status-go#1939, it turns out that, when a user tries to add an account (from a seed phrase), while an account with the same address (that the seed phrase would result in) exists in the application state, the application would still go ahead and store the derived account in status-go. After that it still reports to the user that the 'Account already exits'. This commit ensures that Status doesn't try to store the derived account when the account already exists in the application database. Fixes status-im#10326 Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
b321de4
to
3fce002
Compare
Summary
As discussed in #10326 and later in status-im/status-go#1939, it turns out
that, when a user tries to add an account (from a seed phrase), while an account
with the same address (that the seed phrase would result in) exists in the application
state, the application would still go ahead and store the derived account in
status-go.
After that it still reports to the user that the 'Account already exits'.
This commit ensures that Status doesn't try to store the derived account when
the account already exists in the application database.
Fixes #10326
Review notes
We need to check whether the address in question already exists in
multiaccount/accounts
so we need access todb
insidederive-and-store-account
. However since this is a normal function, that doesn't have access to it per se, I decided to pass downaccounts
from the outside before the function is called in the first place.Wouldn't be surprised if there's a "cleaner" more re-frame-like way to do this.
Testing notes
Follow reproduction steps in #10326, should get expected results.