From 2d5983c829e000468fa58e65862392cd500e3599 Mon Sep 17 00:00:00 2001 From: zakir <80246097+zakir-code@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:00:10 +0800 Subject: [PATCH] fix(client/grpc): `node.NewQueryServer` method not setting `cfg` (#20969) --- CHANGELOG.md | 1 + client/grpc/node/service.go | 1 + client/grpc/node/service_test.go | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce85e98b7fd2..1c8ccf61811e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -116,6 +116,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * [#19833](https://github.com/cosmos/cosmos-sdk/pull/19833) Fix some places in which we call Remove inside a Walk. * [#19851](https://github.com/cosmos/cosmos-sdk/pull/19851) Fix some places in which we call Remove inside a Walk (x/staking and x/gov). * [#20939](https://github.com/cosmos/cosmos-sdk/pull/20939) Fix collection reverse iterator to include `pagination.key` in the result. +* (client/grpc) [#20969](https://github.com/cosmos/cosmos-sdk/pull/20969) Fix `node.NewQueryServer` method not setting `cfg`. ### API Breaking Changes diff --git a/client/grpc/node/service.go b/client/grpc/node/service.go index 5c9bb960025e..f9fc13ea35df 100644 --- a/client/grpc/node/service.go +++ b/client/grpc/node/service.go @@ -32,6 +32,7 @@ type queryServer struct { func NewQueryServer(clientCtx client.Context, cfg config.Config) ServiceServer { return queryServer{ clientCtx: clientCtx, + cfg: cfg, } } diff --git a/client/grpc/node/service_test.go b/client/grpc/node/service_test.go index 41ce2a2cc50c..fc9ddbb5101e 100644 --- a/client/grpc/node/service_test.go +++ b/client/grpc/node/service_test.go @@ -12,6 +12,9 @@ import ( func TestServiceServer_Config(t *testing.T) { defaultCfg := config.DefaultConfig() + defaultCfg.PruningKeepRecent = "2000" + defaultCfg.PruningInterval = "10" + defaultCfg.HaltHeight = 100 svr := NewQueryServer(client.Context{}, *defaultCfg) ctx := sdk.Context{}.WithMinGasPrices(sdk.NewDecCoins(sdk.NewInt64DecCoin("stake", 15))) @@ -19,5 +22,7 @@ func TestServiceServer_Config(t *testing.T) { require.NoError(t, err) require.NotNil(t, resp) require.Equal(t, ctx.MinGasPrices().String(), resp.MinimumGasPrice) + require.Equal(t, defaultCfg.PruningKeepRecent, resp.PruningKeepRecent) + require.Equal(t, defaultCfg.PruningInterval, resp.PruningInterval) require.Equal(t, defaultCfg.HaltHeight, resp.HaltHeight) }