CosmWasm / cw-multi-test

CosmWasm multi-contract testing framework
Apache License 2.0
48 stars 42 forks source link

Cosmwasm Std Empty String Attribute Causes Failure #178

Closed gluax closed 5 months ago

gluax commented 5 months ago

If you have an attribute with an empty string as a value, when returning a response, it fails to send the response.

i.e. an execute msg that returns: Ok(Response::<Empty>::new().add_attribute("oopa", "")) will fail.

I am testing this using cw-multi-test

"Error executing WasmMsg:\n  sender: seda190vqdjtlpcq27xslcveglfmr4ynfwg7gmw86cnun4acakxrdd6gqcvkq45\n  Execute { contract_addr: \"contract0\", msg: {\"register_and_stake\":{\"public_key\":[2,116,118,117,180,232,142,56,102,99,116,236,213,232,115,227,219,19,252,0,182,237,97,27,66,160,175,139,129,164,203,169,134],\"proof\":[2,201,238,162,70,3,146,233,143,208,28,179,229,228,129,161,134,245,134,69,219,121,171,179,194,112,133,26,211,236,163,201,253,234,54,241,6,21,194,4,119,246,65,137,87,185,44,146,188,72,205,104,135,72,53,180,72,97,114,143,250,90,244,46,89,14,154,66,253,16,106,148,170,144,253,236,101,236,13,1,60],\"memo\":null}}, funds: [Coin { 1 \"aseda\" }] }",

Versions:

cosmwasm-std = { version = "1.5.5" }
cw-multi-test = "1.1.0"

Rust: rustc 1.77.2 (25ef9e3d8 2024-04-09)

This may be fixed on newer versions, or maybe this is caused by cw-multi?

chipshort commented 5 months ago

Part of this issue was previously raised in https://github.com/CosmWasm/wasmd/issues/1617 and subsequently changed in https://github.com/CosmWasm/wasmd/pull/1618. So, on the actual chain, this is allowed since wasmd v0.45.0.

That still leaves the cw-multi-test implementation to be changed. I'm moving this over to the multi test repo.

DariuszDepta commented 5 months ago

@gluax : fixes will be applied to version 2.1.0 (#180) and backported to version 1.2.0 (#181) of MultiTest.

DariuszDepta commented 5 months ago

Hi @gluax, there is a new version 1.2.0 of MultiTest published. You can check if your test case works fine.

gluax commented 5 months ago

Confirmed it does work! Thanks all!