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

deserialize_bytes and deserialize_byte_buf support for custom deserializers #63

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

Conversation

luca992
Copy link

@luca992 luca992 commented Oct 9, 2023

I would like to be able to use my own deserializer to parse the raw bytes in my own project. This would allow me to do things like being able to deserialize untagged enums without needing to use serde_cw_value which increases my wasm size by about 200kb :/ ....
Here's an example where I am able to deserialize an untagged enum #43 by trial and error since I have access to the raw bytes.

https://github.com/eqoty-labs/snip721-migratable/blob/0fc9028f497d2e5393d55209b9a49d24cea8d15a/contracts/snip721-migratable/src/msg_untagged_deserializer.rs

There very could be a better way to do this, but this is the best solution I have come up so far.

Plus giving people the ability to write custom deserializers with access to the raw bytes opens the door for other message serialization formats other than json.

@luca992 luca992 changed the title deserialize_bytes and deserialize_byte_buf support deserialize_bytes and deserialize_byte_buf support for custom deserializers Oct 9, 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.

None yet

1 participant