CosmWasm / sylvia

CosmWasm smart contract framework
Apache License 2.0
90 stars 14 forks source link

Better model of `sudo` test in examples. #316

Open jawoznia opened 5 months ago

jawoznia commented 5 months ago
          Is there any test case asserting that when we call sudo_custom, the Sudo message is generated and sent under the hood? I can imagine a situation where `#[msg(sudo)]` and `sudo_custom()` might, by mistake, operate on an Exec or Query message.

_Originally posted by @kulikthebird in https://github.com/CosmWasm/sylvia/pull/301#discussion_r1486041632_

While testing the exec message we model the flow as: multitest(sends message) -> contract (receives message and return custom message) -> custom module (receives and parses custom message)

In case of sudo the flow should be reversed multitest(sends message) -> custom module -> contract (receives message and return custom message) custom module (receives and parses custom message)

Discuss with @DariuszDepta how such flow should be modeled in multitest.