-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: Refactor encryption to enable caching (#2316)
This PR is a refactor of the Snap state encryption logic, it moves the logic from the manageState RPC method implementation to the SnapController. It re-implements the encryption/decryption logic using a different set of methods, as the previously used implementation had encapsulated the encryption key. With this refactor it is now possible to cache the encryption key used by the Snap in the runtime, making continuous requests to update the state much faster (numbers TBD). With this refactor it is now the responsibility of the SnapController to manage encrypting/decrypting the Snap state and thus the method hooks `getSnapState` and `updateSnapState` have had breaking changes, they are now asynchronous and expected to fully handle encryption/decryption. Because of that, this change required changes to both snaps-jest and snaps-simulator for compatibility. This will not work as-is on mobile, since the encryptor on mobile does not have feature parity with `browser-passworder`. This will need to be addressed before we can use this change on mobile. Closes #2315 --------- Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
- Loading branch information
1 parent
6f9ca36
commit f6ac2b0
Showing
32 changed files
with
657 additions
and
545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"branches": 90.82, | ||
"functions": 96.57, | ||
"lines": 97.8, | ||
"statements": 97.46 | ||
"branches": 90.9, | ||
"functions": 96.58, | ||
"lines": 97.85, | ||
"statements": 97.52 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.