public-awesome/cw-ics721

Update comment once we learn how CosmWasm message ordering works

0xekez opened this issue · 1 comments

i think the CosmWasm documentation and code are a little self-contradictory about message ordering. this doesn't impact the functionality of this contract, but we'll need to update a comment in the code depending on the outcome of this:

CosmWasm/cosmwasm#1514

the comment:

https://github.com/public-awesome/ics721/blob/52852e07446c91983a91495e85103370f49814a7/contracts/cw-ics721-bridge/src/contract.rs#L356-L361

If I understand the code correctly, there is 1 messages Vec, add_* functions are just helpers to append messages without the SubMsg wrapper.

Its safe to assume messages[0] will be called first and messages[1] second.

I wonder if it follows the whole tree of the SubMsg first, so if messages[0] has another SubMsg in it, will messages[0][0] be called before messages[1]? can we assume messages[0] full tree of messages is finished before messages[1] is called?