Skip to content

Commit e6e4caa

Browse files
authored
add grpc query for controller and host params (#574)
Adds gRPC routes for controller params and host params. Add tests and registers the gRPC gateways on the ica module
1 parent eedb0cb commit e6e4caa

File tree

11 files changed

+1515
-0
lines changed

11 files changed

+1515
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package keeper
2+
3+
import (
4+
"context"
5+
sdk "github.com/cosmos/cosmos-sdk/types"
6+
"github.com/cosmos/ibc-go/v2/modules/apps/27-interchain-accounts/controller/types"
7+
)
8+
9+
var _ types.QueryServer = Keeper{}
10+
11+
// Params implements the Query/Params gRPC method
12+
func (q Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
13+
ctx := sdk.UnwrapSDKContext(c)
14+
params := q.GetParams(ctx)
15+
16+
return &types.QueryParamsResponse{
17+
Params: &params,
18+
}, nil
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package keeper_test
2+
3+
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
5+
6+
"github.com/cosmos/ibc-go/v2/modules/apps/27-interchain-accounts/controller/types"
7+
)
8+
9+
func (suite *KeeperTestSuite) TestQueryParams() {
10+
ctx := sdk.WrapSDKContext(suite.chainA.GetContext())
11+
expParams := types.DefaultParams()
12+
res, _ := suite.chainA.GetSimApp().ICAControllerKeeper.Params(ctx, &types.QueryParamsRequest{})
13+
suite.Require().Equal(&expParams, res.Params)
14+
}

0 commit comments

Comments
 (0)