snaps
snaps copied to clipboard
perf: Preload encrypted state of preinstalled Snaps
This adds a new preloadSnap function to the SnapController, which is automatically called for preinstalled Snaps when the client is unlocked (i.e., when KeyringController:unlock is emitted). It decrypts and caches the state for the Snaps, so state doesn't need to be decrypted when first interacting with the Snap.
This change requires KeyringController:unlock to be added to the list of allowed events for the SnapController.