diff --git a/CHANGELOG.md b/CHANGELOG.md index c11bed963..6f6061b64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/client/query/tendermint.go b/client/query/tendermint.go index cf00304dc..b1afd123c 100644 --- a/client/query/tendermint.go +++ b/client/query/tendermint.go @@ -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...) }