Group Msg Pattern: expose tx messages introspection #9244
robert-zaremba
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
This sounds like interesting functionality but I'm not seeing how it's relevant for Cosmos. In general, I really prefer to spend design energy on ideas motivated by use cases arising in our ecosystem. I can also imagine downsides to this sort of design and we do allow cross-module calls in Cosmos so I'm not seeing what the need is. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proposal
Currently we don't provide a clear way for handler to check other messages in the same transaction.
Proposal: put all decoded transaction in the context and allow handlers to know what's the current
msg
index, and browse other messages.Motivation
Grouping messages in a transaction allows to make an atomic operations. This is a very powerful pattern. It allows to more advanced message composition, without creating more complex messages and handlers which would aggregate that operations.
This pattern is widely used by Algorand smart contracts: user groups many transactions in a single group transaction. Usually, one of the transaction is a smart contract call, which will check other transaction types. Example: a token vote. Vote call on a contract will only be validated if:
Here is another example presented on Algorand with more details and design.
NOTE: in Algorand, there is no cross-smart contract calls, so this pattern is very important there.
Ref:
Beta Was this translation helpful? Give feedback.
All reactions