-
Notifications
You must be signed in to change notification settings - Fork 586
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add grpc query for controller and host params
Adds gRPC routes for controller params and host params. Add tests and registers the gRPC gateways on the ica module
- Loading branch information
1 parent
d681c0d
commit 209b27f
Showing
11 changed files
with
1,515 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
modules/apps/27-interchain-accounts/controller/keeper/grpc_query.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ¶ms, | ||
}, nil | ||
} |
14 changes: 14 additions & 0 deletions
14
modules/apps/27-interchain-accounts/controller/keeper/grpc_query_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
Oops, something went wrong.