Skip to content

Commit

Permalink
fix(client/grpc): node.NewQueryServer method not setting cfg (#20969
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zakir-code authored Jul 17, 2024
1 parent 56810eb commit 2d5983c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions client/grpc/node/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type queryServer struct {
func NewQueryServer(clientCtx client.Context, cfg config.Config) ServiceServer {
return queryServer{
clientCtx: clientCtx,
cfg: cfg,
}
}

Expand Down
5 changes: 5 additions & 0 deletions client/grpc/node/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ 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)))

resp, err := svr.Config(ctx, &ConfigRequest{})
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)
}

0 comments on commit 2d5983c

Please sign in to comment.