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 transaction index implemented as counter #601

Closed
webmaster128 opened this issue Sep 8, 2021 · 1 comment · Fixed by #621
Closed

Add transaction index implemented as counter #601

webmaster128 opened this issue Sep 8, 2021 · 1 comment · Fixed by #621
Milestone

Comments

@webmaster128
Copy link
Member

We'd like to expose the index of a transaction in a block in CosmWasm/cosmwasm#1077. This allows contracts to get a pair (block height, transaction index) that uniquely identifies the transaction on a given chain. This transaction index should be easy to work with in other tools, e.g. by looking in a block explorer or using a call like

curl -sS "https://rpc.cosmos-hub.app.beta.starport.cloud/block?height=7590762" | jq .result.block.data.txs

In https://github.com/CosmWasm/wasmd/blob/v0.18.0/proto/cosmwasm/wasm/v1/types.proto#L123-L131 the gas meter is used for ordering, but the values from this are hard to work with. So what we look for is an 0-based index 0, 1, 2, ….

@ethanfrey
Copy link
Member

Good request. And made me curious was tx[5] is? It is about 23KB after base64 decoding...

A pdf embedded in a gov proposal?

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