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

Cosmos: Add the message handler #3975

Merged
merged 12 commits into from
Sep 29, 2022

Conversation

pienkowb
Copy link
Contributor

This PR extends the Cosmos integration with a new type of handler, which enables subgraph developers to access transaction data in a more granular way.

Each Cosmos transaction contains multiple messages. Until now, in order to access a single message a subgraph developer had to define a transaction handler and loop over the message array inside the mapping function. With the introduction of the message handler, the same goal can be achieved just by adding a message handler and specifying a message type.

The data passed to the message handler includes the transaction context, which is a light-weight structure that contains the most important information about a transaction (hash, index, status code, gas information). The same structure is also passed to the event handler.

Copy link
Contributor

@evaporei evaporei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me 👍

I'm just curious, what's gas_wanted?

@pienkowb
Copy link
Contributor Author

Looks correct to me 👍

I'm just curious, what's gas_wanted?

@evaporei It's the amount of gas requested for a transaction.

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.

4 participants