Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helpers for parsing the protobuf MsgInstantiate and MsgExecute responses #480

Closed
ethanfrey opened this issue Oct 8, 2021 · 1 comment · Fixed by #502
Closed

Add helpers for parsing the protobuf MsgInstantiate and MsgExecute responses #480

ethanfrey opened this issue Oct 8, 2021 · 1 comment · Fixed by #502
Assignees
Milestone

Comments

@ethanfrey
Copy link
Member

ethanfrey commented Oct 8, 2021

When we call into another contract using SubMsg::reply_on_success, we get data fields with important info from the other contract. Especially the address on instantiate.

Let's provide some helper functions for this as it is a common task that needs a bit of knowledge of the internals.

Maybe multiple implementations - one to parse from the data field, the other from the events fields.

Events defined here See the instantiate and execute events.

You can alternately (also) extract from the data field. That is a protobuf encoded message:

InstantiateResponse

ExecuteResponse

It seems very heavy to import protobuf libs here. Best would be to manually decode this. (Write 2 functions to parse those particular protobuf formats and test them against a test suite using eg prost/protobuf as dev dependency)

There is working code for this in tgrade-valset (when it calls tg4-engagement). The point here is to make this general.

@ethanfrey
Copy link
Member Author

ethanfrey commented Oct 8, 2021

Related to CosmWasm/wasmd#623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants