Skip to content

Commit

Permalink
chore(query): Add block results query (#148)
Browse files Browse the repository at this point in the history
Needed by api querying block execution results
  • Loading branch information
gitferry authored Oct 10, 2024
1 parent 0b203a6 commit 223c541
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## Unreleased

### Improvements

* [#148](https://github.com/babylonlabs-io/babylon/pull/148) Add block results query

## v0.12.0

### State Machine Breaking
Expand Down
7 changes: 7 additions & 0 deletions client/query/tendermint.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ func (c *QueryClient) GetTx(hash []byte) (*coretypes.ResultTx, error) {
return c.RPCClient.Tx(ctx, hash, false)
}

func (c *QueryClient) BlockResults(height int64) (*coretypes.ResultBlockResults, error) {
ctx, cancel := c.getQueryContext()
defer cancel()

return c.RPCClient.BlockResults(ctx, &height)
}

func (c *QueryClient) Subscribe(subscriber, query string, outCapacity ...int) (out <-chan coretypes.ResultEvent, err error) {
return c.RPCClient.Subscribe(context.Background(), subscriber, query, outCapacity...)
}
Expand Down

0 comments on commit 223c541

Please sign in to comment.