Skip to content

feat(cosmwasm): surface contract set_data on ExecuteResult - #1974

Open
gomesalexandre wants to merge 1 commit into
cosmos:mainfrom
gomesalexandre:feat_execute_result_data
Open

gomesalexandre wants to merge 1 commit into
cosmos:mainfrom
gomesalexandre:feat_execute_result_data

Conversation

@gomesalexandre

Copy link
Copy Markdown

closes #1648

what

ExecuteResult only surfaced events, so the binary data a contract returns via Response::set_data(...) was dropped. Adds a data field to ExecuteResult:

readonly data: readonly Uint8Array[]

one entry per instruction, decoded from the transaction's MsgExecuteContractResponse message responses in executeMultiple (which execute delegates to). Empty for chains on Cosmos SDK < 0.46, which do not expose message responses.

receipts

The decode surfaces the bytes (standalone, against the repo's cosmjs-types):

MsgExecuteContractResponse.decode(encode({ data: 0xdeadbeef })).data === 0xdeadbeef   → true
  • tsc typechecks the package (the data field and MsgExecuteContractResponse.decode(...).data compile).
  • prettier + eslint clean.
  • Extended the execute and executeMultiple specs to assert one data entry per instruction (these run against the wasmd integration harness in CI).

Follow-up worth considering: a test contract that actually calls set_data would let the integration suite assert the returned bytes end to end.

ExecuteResult only exposed events, dropping the binary data a contract returns
via Response::set_data (cosmos#1648). Add a `data: readonly Uint8Array[]`
field decoded from the tx's MsgExecuteContractResponse msgResponses, one entry
per instruction in order. Empty for Cosmos SDK < 0.46, which does not expose
message responses. Verified the decode round-trips the data; extended the
execute and executeMultiple specs to assert one data entry per instruction.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown

PR author is not in the allowed authors list.

This branch has not been deployed

No deployments
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 this pull request may close these issues.

ExecuteResult in cosmwasm-stargate does not return data set by .set_data()

1 participant