-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add JSON storage limit utilities #14
Conversation
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.
Great start! Left some comments
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.
I think we should prefer avoiding any
whenever possible.
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 👍
d1e06bb
to
b6482a7
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 - Good work on this!
This PR will add utility functions to handle limits and validation of JSON storage used by Snaps.
This is still work in progress.
The main goal of this PR is to implement the following function:
This function has two capabilities:
JSON.stringify(...)
)Size calculation can be skipped by setting
skipSizingProcess=true
in which case only the validation process will be done and0
will be returned for a size.Fixes https://app.zenhub.com/workspaces/snaps-platform-615b3a7c08d2b20015eb6c4e/issues/metamask/snaps-skunkworks/571
Fixes MetaMask/snaps#571
Related to: MetaMask/snaps#209