Skip to content
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

Metamask permits #9

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

kent-3
Copy link

@kent-3 kent-3 commented Jul 5, 2023

I've found an existing crate to transform the compact form of JSON string from serde-json-wasm into a "pretty" version, with an indent of 4 spaces. It's using String manipulations, so I don't think there are any floating point issues with this approach, but have not tested uploading this as a contract.

@kent-3
Copy link
Author

kent-3 commented Jul 9, 2023

I decided it would be better to create a custom serde Serializer for this instead. I can either include the 'pretty' module directly in this repo, or add it to a fork of serde-json-wasm and use that as a dependency (like I've done here: https://github.com/kent-3/serde-json-wasm).

Copy link

@DrPresident DrPresident left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from what I can tell, not super familiar with how this encryption works and I didn't scrutinize the pretty-printing in depth. Tests look good, would be nice to add one that actually verifies an ethereum permit.

@kent-3 kent-3 mentioned this pull request Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants