-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
importAccountWithStrategy
shouldn't select address
#1309
Conversation
4644392
to
d6a88a0
Compare
importAccountWithStrategy
shouldn't select address
).rejects.toThrow( | ||
'Expected private key to be an Uint8Array with length 32', | ||
); | ||
it('should not select imported account', async () => { |
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.
Nit: Should we repeat this test for the JSON input as well? Or maybe bring it to the top-level of the importAccountWithStrategy
block to show that it's not expected to differ between strategies?
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.
Uhm, good point - I think it would make more sense to add it for the JSON input, rather than moving it to the top-level group because otherwise it would go along with:
- using strategy privateKey
- using strategy json
- using unrecognized strategy
EDIT: Also, the actual test would be different, as we would use a different strategy - so I think it makes even more sense to repeat it for JSON
d6a88a0
to
78d3c40
Compare
bee319d
to
edd0460
Compare
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.
LGTM!
* feat: importAccountWithStrategy doesn't select new address * test: add test case for json import
* feat: importAccountWithStrategy doesn't select new address * test: add test case for json import
Description
This PR refactors the
importAccountWithStrategy
method from KeyringController to not select the imported account.As a new test case has been added, I took the chance to refactor tests groups for the
importAccountWithStrategy
.Changes
KeyringController.importAccountWithStrategy
to not select imported addressReferences
importAccountWithStrategy
should not change selected account #1249Checklist