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

Complete main/0.52 indexer BaseApp Integration #21526

Closed
Tracked by #20352
aaronc opened this issue Sep 3, 2024 · 0 comments · Fixed by #21965
Closed
Tracked by #20352

Complete main/0.52 indexer BaseApp Integration #21526

aaronc opened this issue Sep 3, 2024 · 0 comments · Fixed by #21965
Assignees

Comments

@aaronc
Copy link
Member

aaronc commented Sep 3, 2024

BaseApp currently has some basic integration with cosmossdk.io/schema/indexer but indexing of events, transactions, and block headers hasn't been done.

We need to add the relevant code here:

func (p listenerWrapper) ListenFinalizeBlock(_ context.Context, req abci.FinalizeBlockRequest, res abci.FinalizeBlockResponse) error {
if p.listener.StartBlock != nil {
err := p.listener.StartBlock(appdata.StartBlockData{
Height: uint64(req.Height),
})
if err != nil {
return err
}
}
//// TODO txs, events
return nil
}

The implementation should:

  • correctly convert data from FinalizeBlockRequest into appdata.StartBlockData and appdata.TxData
  • and convert the events from FinalizeBlockResponse inside FinalizeBlockResponse into appdata.EventData
  • and call the appropriate StartBlock, OnTx and OnEvent functions on Listener

One challenge will be properly extracting the TxIndex, MsgIndex and EventIndex attributes for appdata.Event.

If possible, we should do some lightweight unit testing using mock data, with the understanding that more thorough testing end to end testing also needs to be done later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

3 participants