Skip to content

Commit

Permalink
add grpc query for controller and host params
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 committed Dec 1, 2021
1 parent d681c0d commit 209b27f
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 209b27f

Please sign in to comment.