-
-
Notifications
You must be signed in to change notification settings - Fork 204
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: throw explicit error when KeyringController
is locked
#5172
base: main
Are you sure you want to change the base?
Conversation
5834c49
to
5a86062
Compare
b8a66bc
to
c60cc5a
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.
@mikesposito What are your thoughts on adding tests for all the cases which we need to assert that the controller is locked? I know there are a lot of methods you're changing, and also there are more changes planned, so not sure if this is unblocking some more work later or if much of this code will disappear later anyway or what.
Regardless of the above comment, I reviewed this and it looks like the controller does not need to be in unlocked state to call these methods:
Is that right? |
Blocked by:
KeyringController
#5170Explanation
No specific error is thrown when an operation that requires an unlocked vault is attempted while
KeyringController.state.isUnlocked
is false. This doesn't make the operations possible, but it doesn't give a clear error message either.This PR adds an assertion on almost all
KeyringController
methods to check if the controller is unlocked and to throw an error when it isn't.References
Changelog
@metamask/keyring-controller
Checklist