Skip to content

Commit

Permalink
fix(client/grpc): node.NewQueryServer method not setting cfg (bac…
Browse files Browse the repository at this point in the history
…kport #20969) (#20973)
  • Loading branch information
mergify[bot] authored Jul 17, 2024
1 parent 451683b commit 7d0d59d
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 @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
## Bug Fixes

* [#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`.

## [v0.50.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.8) - 2024-07-15

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 7d0d59d

Please sign in to comment.