Skip to content

Commit

Permalink
add grpc query for controller and host params (#574)
Browse files Browse the repository at this point in the history
Adds gRPC routes for controller params and host params. Add tests and registers the gRPC gateways on the ica module
  • Loading branch information
colin-axner authored Dec 1, 2021
1 parent eedb0cb commit e6e4caa
Show file tree
Hide file tree
Showing 11 changed files with 1,515 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package keeper

import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ibc-go/v2/modules/apps/27-interchain-accounts/controller/types"
)

var _ types.QueryServer = Keeper{}

// Params implements the Query/Params gRPC method
func (q Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
params := q.GetParams(ctx)

return &types.QueryParamsResponse{
Params: &params,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package keeper_test

import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/cosmos/ibc-go/v2/modules/apps/27-interchain-accounts/controller/types"
)

func (suite *KeeperTestSuite) TestQueryParams() {
ctx := sdk.WrapSDKContext(suite.chainA.GetContext())
expParams := types.DefaultParams()
res, _ := suite.chainA.GetSimApp().ICAControllerKeeper.Params(ctx, &types.QueryParamsRequest{})
suite.Require().Equal(&expParams, res.Params)
}
Loading

0 comments on commit e6e4caa

Please sign in to comment.