osmosis-labs / test-tube

Test tube for cosmos-sdk chains integration test, written in Rust!
Apache License 2.0
53 stars 31 forks source link

Non UTF-8 Go code #48

Open Buckram123 opened 8 months ago

Buckram123 commented 8 months ago

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 commented 6 months ago

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?

iboss-ptk commented 3 months ago

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

Buckram123 commented 3 months ago

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