-
-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Labels
team-wallet-frameworkDeprecated: Please use `team-core-platform` instead.Deprecated: Please use `team-core-platform` instead.
Description
After #4182 is merged, KeyringController will be responsible for ensuring each operation is mutually exclusive, updating keyring instances and the vault in the same mutex lock.
However, the ability of clients to have direct access to a keyring instance represents a loophole, as with the current implementation they don’t have to comply with the rules enforced by the controller: we should provide a way for clients to interact with a keyring instance through safeguards provided by KeyringController.
The current behavior is this one:
- Client obtains a keyring instance through
getKeyringForAccount - Client interacts with the instance
- Client calls
persistAllKeyrings
We should, instead, have something like this:
- Client calls a
withKeyringmethod, passing a keyring selector and a callback - KeyringController selects the keyring instance and calls the callback with it, after locking the controller operation mutex
- Client interacts with the keyring instance safely, inside the callback
- KeyringController, after the callback execution, internally updates the vault and then releases the lock
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
team-wallet-frameworkDeprecated: Please use `team-core-platform` instead.Deprecated: Please use `team-core-platform` instead.