test-tube icon indicating copy to clipboard operation
test-tube copied to clipboard

Non UTF-8 Go code

Open Buckram123 opened this issue 1 year ago • 3 comments

I just got this panic:

thread 'deposit_lands' panicked at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/test-tube-0.3.0/src/runner/result.rs:222:18:
Go code must encode valid UTF-8 string: Utf8Error { valid_up_to: 127, error_len: Some(1)

You can see it here: https://github.com/osmosis-labs/test-tube/blob/be0251e1c11cf2b80729ee692371896c665acf4e/packages/test-tube/src/runner/result.rs#L219-L223

Converting error to the lossy string helped me figure out the issue:

[.../.cargo/registry/src/index.crates.io-6f17d22bba15001f/test-tube-0.3.0/src/runner/result.rs:221] lossy = "failed to execute message; message index: 0: dispatch: submessages: dispatch: submessages: failed to update grant with key \u{1}\u{14}\u{f6ec} ��Gl�O�=\u{1e}�\u{18}N�L�* �=\u{10}�\u{11}�V\t�\u{10}\u{1b}��mr>����G��tn�R\u{b}j��W/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition: authorization not found"

I would like to at least get the lossy error in case of the Non UTF-8 strings

Buckram123 avatar Jan 24 '24 10:01 Buckram123

https://github.com/osmosis-labs/test-tube/issues/50#issuecomment-1958579871

@iboss-ptk I would like to contribute on this! Would you prefer just always lossy string or different error type if it's non-utf8?

Buckram123 avatar Feb 27 '24 11:02 Buckram123

Hey! Wonder what creates non-utf8 content, what does that look like?

iboss-ptk avatar Jun 21 '24 03:06 iboss-ptk

Hey! Wonder what creates non-utf8 content, what does that look like?

The error that is in description was from smart contract trying to use authz grant, but that grant didn't exist. Grant keys are non utf-8

See #51

Buckram123 avatar Jun 21 '24 05:06 Buckram123