Skip to content

deserialize_bytes and deserialize_byte_buf support for custom deserializers#63

Open
luca992 wants to merge 3 commits into
CosmWasm:mainfrom
luca992:deserialize-bytes
Open

deserialize_bytes and deserialize_byte_buf support for custom deserializers#63
luca992 wants to merge 3 commits into
CosmWasm:mainfrom
luca992:deserialize-bytes

Conversation

@luca992

@luca992 luca992 commented Oct 9, 2023

Copy link
Copy Markdown

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.

1 participant