From bb52cfd5ffe90bb663cdf1d867d47943d3b96830 Mon Sep 17 00:00:00 2001 From: Fangyu Gai Date: Wed, 9 Oct 2024 12:22:16 +0800 Subject: [PATCH 1/2] add block results query --- client/query/tendermint.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/query/tendermint.go b/client/query/tendermint.go index cf00304dc..f923dd637 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(ctx context.Context, 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...) } From 1bbd526f637b11f0219f43f331d84f2b7215828a Mon Sep 17 00:00:00 2001 From: Fangyu Gai Date: Wed, 9 Oct 2024 12:24:42 +0800 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + client/query/tendermint.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8425796a9..c99cad687 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ messages inside `authz.MsgExec`. ### Improvements +* [#148](https://github.com/babylonlabs-io/babylon/pull/148) Add block results query * [#144](https://github.com/babylonlabs-io/babylon/pull/144) Add new finality provider events * [#131](https://github.com/babylonlabs-io/babylon/pull/131) Add new staking events * [#113](https://github.com/babylonlabs-io/babylon/pull/113) Add multibuild binary diff --git a/client/query/tendermint.go b/client/query/tendermint.go index f923dd637..b1afd123c 100644 --- a/client/query/tendermint.go +++ b/client/query/tendermint.go @@ -47,7 +47,7 @@ func (c *QueryClient) GetTx(hash []byte) (*coretypes.ResultTx, error) { return c.RPCClient.Tx(ctx, hash, false) } -func (c *QueryClient) BlockResults(ctx context.Context, height int64) (*coretypes.ResultBlockResults, error) { +func (c *QueryClient) BlockResults(height int64) (*coretypes.ResultBlockResults, error) { ctx, cancel := c.getQueryContext() defer cancel()