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

Error with user entered invalid UTF8 for protobuf structs. #448

Open
penso opened this issue Nov 1, 2023 · 0 comments
Open

Error with user entered invalid UTF8 for protobuf structs. #448

penso opened this issue Nov 1, 2023 · 0 comments

Comments

@penso
Copy link
Contributor

penso commented Nov 1, 2023

If you look at https://testnet-explorer.publicawesome.dev/stargaze/tx/F31D90E03B1F9020A5B99D726E82B65BB24CE938CC99DDD0B40DA28BA9B178A9 the description field is malformed UTF8 and trying to decode it gets me a failed to decode Protobuf message: SudoContractProposal.description: invalid string value: data is not UTF-8 encoded

The protobuf type is defined at:

pub struct SudoContractProposal {

with description as a String.

Since those String are user-defined, this error could easily occurs. This prevents me from parsing the whole message, and therefor see other attributes. I'm not sure what's the best solution here.

One way could be having Vec<u8> instead of String for user-defined attributes instead, and then suggest to convert that to UTF8 if needs to be? Having two structs, one with String and one with Vec<u8> feels overkill.

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

No branches or pull requests

1 participant