From 9e4b0d2f99c18db80db17697ec0875c48d84f328 Mon Sep 17 00:00:00 2001 From: ruthishvitwit <122080147+ruthishvitwit@users.noreply.github.com> Date: Tue, 18 Apr 2023 18:13:58 +0530 Subject: [PATCH] changed q's to k and Repositioned UnWrapSDKContext (#3424) * changed q's to k and repositioned UnWrapSDKContext * add new lines * address review comment * add missing nil message/request check to rpc handlers * Update modules/core/04-channel/keeper/grpc_query.go Co-authored-by: Jim Fasarakis-Hilliard --------- Co-authored-by: Carlos Rodriguez Co-authored-by: Jim Fasarakis-Hilliard --- .../controller/keeper/grpc_query.go | 3 +- .../host/keeper/grpc_query.go | 4 +- modules/apps/transfer/keeper/grpc_query.go | 20 +-- modules/core/02-client/keeper/grpc_query.go | 50 ++++---- .../core/03-connection/keeper/grpc_query.go | 30 ++--- modules/core/04-channel/keeper/grpc_query.go | 74 +++++------ modules/core/keeper/grpc_query.go | 116 +++++++++--------- 7 files changed, 149 insertions(+), 148 deletions(-) diff --git a/modules/apps/27-interchain-accounts/controller/keeper/grpc_query.go b/modules/apps/27-interchain-accounts/controller/keeper/grpc_query.go index 764c8588af5..78e0f37446e 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/grpc_query.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/grpc_query.go @@ -19,12 +19,13 @@ func (k Keeper) InterchainAccount(goCtx context.Context, req *types.QueryInterch return nil, status.Error(codes.InvalidArgument, "empty request") } + ctx := sdk.UnwrapSDKContext(goCtx) + portID, err := icatypes.NewControllerPortID(req.Owner) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "failed to generate portID from owner address: %s", err) } - ctx := sdk.UnwrapSDKContext(goCtx) addr, found := k.GetInterchainAccountAddress(ctx, req.ConnectionId, portID) if !found { return nil, status.Errorf(codes.NotFound, "failed to retrieve account address for %s on connection %s", portID, req.ConnectionId) diff --git a/modules/apps/27-interchain-accounts/host/keeper/grpc_query.go b/modules/apps/27-interchain-accounts/host/keeper/grpc_query.go index 0c09f58db14..41dc2c2e9f0 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/grpc_query.go +++ b/modules/apps/27-interchain-accounts/host/keeper/grpc_query.go @@ -11,9 +11,9 @@ import ( var _ types.QueryServer = (*Keeper)(nil) // Params implements the Query/Params gRPC method -func (q Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { +func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { ctx := sdk.UnwrapSDKContext(c) - params := q.GetParams(ctx) + params := k.GetParams(ctx) return &types.QueryParamsResponse{ Params: ¶ms, diff --git a/modules/apps/transfer/keeper/grpc_query.go b/modules/apps/transfer/keeper/grpc_query.go index e2fa2cc11d9..290f6d5d477 100644 --- a/modules/apps/transfer/keeper/grpc_query.go +++ b/modules/apps/transfer/keeper/grpc_query.go @@ -18,7 +18,7 @@ import ( var _ types.QueryServer = (*Keeper)(nil) // DenomTrace implements the Query/DenomTrace gRPC method -func (q Keeper) DenomTrace(c context.Context, req *types.QueryDenomTraceRequest) (*types.QueryDenomTraceResponse, error) { +func (k Keeper) DenomTrace(c context.Context, req *types.QueryDenomTraceRequest) (*types.QueryDenomTraceResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -29,7 +29,7 @@ func (q Keeper) DenomTrace(c context.Context, req *types.QueryDenomTraceRequest) } ctx := sdk.UnwrapSDKContext(c) - denomTrace, found := q.GetDenomTrace(ctx, hash) + denomTrace, found := k.GetDenomTrace(ctx, hash) if !found { return nil, status.Error( codes.NotFound, @@ -43,7 +43,7 @@ func (q Keeper) DenomTrace(c context.Context, req *types.QueryDenomTraceRequest) } // DenomTraces implements the Query/DenomTraces gRPC method -func (q Keeper) DenomTraces(c context.Context, req *types.QueryDenomTracesRequest) (*types.QueryDenomTracesResponse, error) { +func (k Keeper) DenomTraces(c context.Context, req *types.QueryDenomTracesRequest) (*types.QueryDenomTracesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -51,10 +51,10 @@ func (q Keeper) DenomTraces(c context.Context, req *types.QueryDenomTracesReques ctx := sdk.UnwrapSDKContext(c) traces := types.Traces{} - store := prefix.NewStore(ctx.KVStore(q.storeKey), types.DenomTraceKey) + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.DenomTraceKey) pageRes, err := query.Paginate(store, req.Pagination, func(_, value []byte) error { - result, err := q.UnmarshalDenomTrace(value) + result, err := k.UnmarshalDenomTrace(value) if err != nil { return err } @@ -73,9 +73,9 @@ func (q Keeper) DenomTraces(c context.Context, req *types.QueryDenomTracesReques } // Params implements the Query/Params gRPC method -func (q Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { +func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { ctx := sdk.UnwrapSDKContext(c) - params := q.GetParams(ctx) + params := k.GetParams(ctx) return &types.QueryParamsResponse{ Params: ¶ms, @@ -83,7 +83,7 @@ func (q Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.Q } // DenomHash implements the Query/DenomHash gRPC method -func (q Keeper) DenomHash(c context.Context, req *types.QueryDenomHashRequest) (*types.QueryDenomHashResponse, error) { +func (k Keeper) DenomHash(c context.Context, req *types.QueryDenomHashRequest) (*types.QueryDenomHashResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -96,7 +96,7 @@ func (q Keeper) DenomHash(c context.Context, req *types.QueryDenomHashRequest) ( ctx := sdk.UnwrapSDKContext(c) denomHash := denomTrace.Hash() - found := q.HasDenomTrace(ctx, denomHash) + found := k.HasDenomTrace(ctx, denomHash) if !found { return nil, status.Error( codes.NotFound, @@ -110,7 +110,7 @@ func (q Keeper) DenomHash(c context.Context, req *types.QueryDenomHashRequest) ( } // EscrowAddress implements the EscrowAddress gRPC method -func (q Keeper) EscrowAddress(c context.Context, req *types.QueryEscrowAddressRequest) (*types.QueryEscrowAddressResponse, error) { +func (k Keeper) EscrowAddress(c context.Context, req *types.QueryEscrowAddressRequest) (*types.QueryEscrowAddressResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } diff --git a/modules/core/02-client/keeper/grpc_query.go b/modules/core/02-client/keeper/grpc_query.go index de8484eb8b3..f38087e924c 100644 --- a/modules/core/02-client/keeper/grpc_query.go +++ b/modules/core/02-client/keeper/grpc_query.go @@ -22,7 +22,7 @@ import ( var _ types.QueryServer = (*Keeper)(nil) // ClientState implements the Query/ClientState gRPC method -func (q Keeper) ClientState(c context.Context, req *types.QueryClientStateRequest) (*types.QueryClientStateResponse, error) { +func (k Keeper) ClientState(c context.Context, req *types.QueryClientStateRequest) (*types.QueryClientStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -32,7 +32,7 @@ func (q Keeper) ClientState(c context.Context, req *types.QueryClientStateReques } ctx := sdk.UnwrapSDKContext(c) - clientState, found := q.GetClientState(ctx, req.ClientId) + clientState, found := k.GetClientState(ctx, req.ClientId) if !found { return nil, status.Error( codes.NotFound, @@ -53,7 +53,7 @@ func (q Keeper) ClientState(c context.Context, req *types.QueryClientStateReques } // ClientStates implements the Query/ClientStates gRPC method -func (q Keeper) ClientStates(c context.Context, req *types.QueryClientStatesRequest) (*types.QueryClientStatesResponse, error) { +func (k Keeper) ClientStates(c context.Context, req *types.QueryClientStatesRequest) (*types.QueryClientStatesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -61,7 +61,7 @@ func (q Keeper) ClientStates(c context.Context, req *types.QueryClientStatesRequ ctx := sdk.UnwrapSDKContext(c) clientStates := types.IdentifiedClientStates{} - store := prefix.NewStore(ctx.KVStore(q.storeKey), host.KeyClientStorePrefix) + store := prefix.NewStore(ctx.KVStore(k.storeKey), host.KeyClientStorePrefix) pageRes, err := query.FilteredPaginate(store, req.Pagination, func(key, value []byte, accumulate bool) (bool, error) { // filter any metadata stored under client state key @@ -70,7 +70,7 @@ func (q Keeper) ClientStates(c context.Context, req *types.QueryClientStatesRequ return false, nil } - clientState, err := q.UnmarshalClientState(value) + clientState, err := k.UnmarshalClientState(value) if err != nil { return false, err } @@ -97,7 +97,7 @@ func (q Keeper) ClientStates(c context.Context, req *types.QueryClientStatesRequ } // ConsensusState implements the Query/ConsensusState gRPC method -func (q Keeper) ConsensusState(c context.Context, req *types.QueryConsensusStateRequest) (*types.QueryConsensusStateResponse, error) { +func (k Keeper) ConsensusState(c context.Context, req *types.QueryConsensusStateRequest) (*types.QueryConsensusStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -115,13 +115,13 @@ func (q Keeper) ConsensusState(c context.Context, req *types.QueryConsensusState height := types.NewHeight(req.RevisionNumber, req.RevisionHeight) if req.LatestHeight { - consensusState, found = q.GetLatestClientConsensusState(ctx, req.ClientId) + consensusState, found = k.GetLatestClientConsensusState(ctx, req.ClientId) } else { if req.RevisionHeight == 0 { return nil, status.Error(codes.InvalidArgument, "consensus state height cannot be 0") } - consensusState, found = q.GetClientConsensusState(ctx, req.ClientId, height) + consensusState, found = k.GetClientConsensusState(ctx, req.ClientId, height) } if !found { @@ -144,7 +144,7 @@ func (q Keeper) ConsensusState(c context.Context, req *types.QueryConsensusState } // ConsensusStates implements the Query/ConsensusStates gRPC method -func (q Keeper) ConsensusStates(c context.Context, req *types.QueryConsensusStatesRequest) (*types.QueryConsensusStatesResponse, error) { +func (k Keeper) ConsensusStates(c context.Context, req *types.QueryConsensusStatesRequest) (*types.QueryConsensusStatesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -156,7 +156,7 @@ func (q Keeper) ConsensusStates(c context.Context, req *types.QueryConsensusStat ctx := sdk.UnwrapSDKContext(c) consensusStates := []types.ConsensusStateWithHeight{} - store := prefix.NewStore(ctx.KVStore(q.storeKey), host.FullClientKey(req.ClientId, []byte(fmt.Sprintf("%s/", host.KeyConsensusStatePrefix)))) + store := prefix.NewStore(ctx.KVStore(k.storeKey), host.FullClientKey(req.ClientId, []byte(fmt.Sprintf("%s/", host.KeyConsensusStatePrefix)))) pageRes, err := query.FilteredPaginate(store, req.Pagination, func(key, value []byte, accumulate bool) (bool, error) { // filter any metadata stored under consensus state key @@ -169,7 +169,7 @@ func (q Keeper) ConsensusStates(c context.Context, req *types.QueryConsensusStat return false, err } - consensusState, err := q.UnmarshalConsensusState(value) + consensusState, err := k.UnmarshalConsensusState(value) if err != nil { return false, err } @@ -188,7 +188,7 @@ func (q Keeper) ConsensusStates(c context.Context, req *types.QueryConsensusStat } // ConsensusStateHeights implements the Query/ConsensusStateHeights gRPC method -func (q Keeper) ConsensusStateHeights(c context.Context, req *types.QueryConsensusStateHeightsRequest) (*types.QueryConsensusStateHeightsResponse, error) { +func (k Keeper) ConsensusStateHeights(c context.Context, req *types.QueryConsensusStateHeightsRequest) (*types.QueryConsensusStateHeightsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -200,7 +200,7 @@ func (q Keeper) ConsensusStateHeights(c context.Context, req *types.QueryConsens ctx := sdk.UnwrapSDKContext(c) var consensusStateHeights []types.Height - store := prefix.NewStore(ctx.KVStore(q.storeKey), host.FullClientKey(req.ClientId, []byte(fmt.Sprintf("%s/", host.KeyConsensusStatePrefix)))) + store := prefix.NewStore(ctx.KVStore(k.storeKey), host.FullClientKey(req.ClientId, []byte(fmt.Sprintf("%s/", host.KeyConsensusStatePrefix)))) pageRes, err := query.FilteredPaginate(store, req.Pagination, func(key, _ []byte, accumulate bool) (bool, error) { // filter any metadata stored under consensus state key @@ -227,7 +227,7 @@ func (q Keeper) ConsensusStateHeights(c context.Context, req *types.QueryConsens } // ClientStatus implements the Query/ClientStatus gRPC method -func (q Keeper) ClientStatus(c context.Context, req *types.QueryClientStatusRequest) (*types.QueryClientStatusResponse, error) { +func (k Keeper) ClientStatus(c context.Context, req *types.QueryClientStatusRequest) (*types.QueryClientStatusResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -237,7 +237,7 @@ func (q Keeper) ClientStatus(c context.Context, req *types.QueryClientStatusRequ } ctx := sdk.UnwrapSDKContext(c) - clientState, found := q.GetClientState(ctx, req.ClientId) + clientState, found := k.GetClientState(ctx, req.ClientId) if !found { return nil, status.Error( codes.NotFound, @@ -245,7 +245,7 @@ func (q Keeper) ClientStatus(c context.Context, req *types.QueryClientStatusRequ ) } - status := q.GetClientStatus(ctx, clientState, req.ClientId) + status := k.GetClientStatus(ctx, clientState, req.ClientId) return &types.QueryClientStatusResponse{ Status: status.String(), @@ -253,9 +253,9 @@ func (q Keeper) ClientStatus(c context.Context, req *types.QueryClientStatusRequ } // ClientParams implements the Query/ClientParams gRPC method -func (q Keeper) ClientParams(c context.Context, _ *types.QueryClientParamsRequest) (*types.QueryClientParamsResponse, error) { +func (k Keeper) ClientParams(c context.Context, _ *types.QueryClientParamsRequest) (*types.QueryClientParamsResponse, error) { ctx := sdk.UnwrapSDKContext(c) - params := q.GetParams(ctx) + params := k.GetParams(ctx) return &types.QueryClientParamsResponse{ Params: ¶ms, @@ -263,26 +263,26 @@ func (q Keeper) ClientParams(c context.Context, _ *types.QueryClientParamsReques } // UpgradedClientState implements the Query/UpgradedClientState gRPC method -func (q Keeper) UpgradedClientState(c context.Context, req *types.QueryUpgradedClientStateRequest) (*types.QueryUpgradedClientStateResponse, error) { +func (k Keeper) UpgradedClientState(c context.Context, req *types.QueryUpgradedClientStateRequest) (*types.QueryUpgradedClientStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } ctx := sdk.UnwrapSDKContext(c) - plan, found := q.GetUpgradePlan(ctx) + plan, found := k.GetUpgradePlan(ctx) if !found { return nil, status.Error( codes.NotFound, "upgrade plan not found", ) } - bz, found := q.GetUpgradedClient(ctx, plan.Height) + bz, found := k.GetUpgradedClient(ctx, plan.Height) if !found { return nil, status.Error(codes.NotFound, types.ErrClientNotFound.Error()) } - clientState, err := types.UnmarshalClientState(q.cdc, bz) + clientState, err := types.UnmarshalClientState(k.cdc, bz) if err != nil { return nil, status.Error( codes.Internal, err.Error(), @@ -300,19 +300,19 @@ func (q Keeper) UpgradedClientState(c context.Context, req *types.QueryUpgradedC } // UpgradedConsensusState implements the Query/UpgradedConsensusState gRPC method -func (q Keeper) UpgradedConsensusState(c context.Context, req *types.QueryUpgradedConsensusStateRequest) (*types.QueryUpgradedConsensusStateResponse, error) { +func (k Keeper) UpgradedConsensusState(c context.Context, req *types.QueryUpgradedConsensusStateRequest) (*types.QueryUpgradedConsensusStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } ctx := sdk.UnwrapSDKContext(c) - bz, found := q.GetUpgradedConsensusState(ctx, ctx.BlockHeight()) + bz, found := k.GetUpgradedConsensusState(ctx, ctx.BlockHeight()) if !found { return nil, status.Errorf(codes.NotFound, "%s, height %d", types.ErrConsensusStateNotFound.Error(), ctx.BlockHeight()) } - consensusState, err := types.UnmarshalConsensusState(q.cdc, bz) + consensusState, err := types.UnmarshalConsensusState(k.cdc, bz) if err != nil { return nil, status.Error( codes.Internal, err.Error(), diff --git a/modules/core/03-connection/keeper/grpc_query.go b/modules/core/03-connection/keeper/grpc_query.go index 331ac3e500f..cc32b1f7f44 100644 --- a/modules/core/03-connection/keeper/grpc_query.go +++ b/modules/core/03-connection/keeper/grpc_query.go @@ -18,7 +18,7 @@ import ( var _ types.QueryServer = (*Keeper)(nil) // Connection implements the Query/Connection gRPC method -func (q Keeper) Connection(c context.Context, req *types.QueryConnectionRequest) (*types.QueryConnectionResponse, error) { +func (k Keeper) Connection(c context.Context, req *types.QueryConnectionRequest) (*types.QueryConnectionResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -28,7 +28,7 @@ func (q Keeper) Connection(c context.Context, req *types.QueryConnectionRequest) } ctx := sdk.UnwrapSDKContext(c) - connection, found := q.GetConnection(ctx, req.ConnectionId) + connection, found := k.GetConnection(ctx, req.ConnectionId) if !found { return nil, status.Error( codes.NotFound, @@ -43,7 +43,7 @@ func (q Keeper) Connection(c context.Context, req *types.QueryConnectionRequest) } // Connections implements the Query/Connections gRPC method -func (q Keeper) Connections(c context.Context, req *types.QueryConnectionsRequest) (*types.QueryConnectionsResponse, error) { +func (k Keeper) Connections(c context.Context, req *types.QueryConnectionsRequest) (*types.QueryConnectionsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -51,11 +51,11 @@ func (q Keeper) Connections(c context.Context, req *types.QueryConnectionsReques ctx := sdk.UnwrapSDKContext(c) connections := []*types.IdentifiedConnection{} - store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.KeyConnectionPrefix)) + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(host.KeyConnectionPrefix)) pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { var result types.ConnectionEnd - if err := q.cdc.Unmarshal(value, &result); err != nil { + if err := k.cdc.Unmarshal(value, &result); err != nil { return err } @@ -80,7 +80,7 @@ func (q Keeper) Connections(c context.Context, req *types.QueryConnectionsReques } // ClientConnections implements the Query/ClientConnections gRPC method -func (q Keeper) ClientConnections(c context.Context, req *types.QueryClientConnectionsRequest) (*types.QueryClientConnectionsResponse, error) { +func (k Keeper) ClientConnections(c context.Context, req *types.QueryClientConnectionsRequest) (*types.QueryClientConnectionsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -90,7 +90,7 @@ func (q Keeper) ClientConnections(c context.Context, req *types.QueryClientConne } ctx := sdk.UnwrapSDKContext(c) - clientConnectionPaths, found := q.GetClientConnectionPaths(ctx, req.ClientId) + clientConnectionPaths, found := k.GetClientConnectionPaths(ctx, req.ClientId) if !found { return nil, status.Error( codes.NotFound, @@ -105,7 +105,7 @@ func (q Keeper) ClientConnections(c context.Context, req *types.QueryClientConne } // ConnectionClientState implements the Query/ConnectionClientState gRPC method -func (q Keeper) ConnectionClientState(c context.Context, req *types.QueryConnectionClientStateRequest) (*types.QueryConnectionClientStateResponse, error) { +func (k Keeper) ConnectionClientState(c context.Context, req *types.QueryConnectionClientStateRequest) (*types.QueryConnectionClientStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -116,7 +116,7 @@ func (q Keeper) ConnectionClientState(c context.Context, req *types.QueryConnect ctx := sdk.UnwrapSDKContext(c) - connection, found := q.GetConnection(ctx, req.ConnectionId) + connection, found := k.GetConnection(ctx, req.ConnectionId) if !found { return nil, status.Error( codes.NotFound, @@ -124,7 +124,7 @@ func (q Keeper) ConnectionClientState(c context.Context, req *types.QueryConnect ) } - clientState, found := q.clientKeeper.GetClientState(ctx, connection.ClientId) + clientState, found := k.clientKeeper.GetClientState(ctx, connection.ClientId) if !found { return nil, status.Error( codes.NotFound, @@ -139,7 +139,7 @@ func (q Keeper) ConnectionClientState(c context.Context, req *types.QueryConnect } // ConnectionConsensusState implements the Query/ConnectionConsensusState gRPC method -func (q Keeper) ConnectionConsensusState(c context.Context, req *types.QueryConnectionConsensusStateRequest) (*types.QueryConnectionConsensusStateResponse, error) { +func (k Keeper) ConnectionConsensusState(c context.Context, req *types.QueryConnectionConsensusStateRequest) (*types.QueryConnectionConsensusStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -150,7 +150,7 @@ func (q Keeper) ConnectionConsensusState(c context.Context, req *types.QueryConn ctx := sdk.UnwrapSDKContext(c) - connection, found := q.GetConnection(ctx, req.ConnectionId) + connection, found := k.GetConnection(ctx, req.ConnectionId) if !found { return nil, status.Error( codes.NotFound, @@ -159,7 +159,7 @@ func (q Keeper) ConnectionConsensusState(c context.Context, req *types.QueryConn } height := clienttypes.NewHeight(req.RevisionNumber, req.RevisionHeight) - consensusState, found := q.clientKeeper.GetClientConsensusState(ctx, connection.ClientId, height) + consensusState, found := k.clientKeeper.GetClientConsensusState(ctx, connection.ClientId, height) if !found { return nil, status.Error( codes.NotFound, @@ -177,9 +177,9 @@ func (q Keeper) ConnectionConsensusState(c context.Context, req *types.QueryConn } // ConnectionParams implements the Query/ConnectionParams gRPC method. -func (q Keeper) ConnectionParams(c context.Context, req *types.QueryConnectionParamsRequest) (*types.QueryConnectionParamsResponse, error) { +func (k Keeper) ConnectionParams(c context.Context, req *types.QueryConnectionParamsRequest) (*types.QueryConnectionParamsResponse, error) { ctx := sdk.UnwrapSDKContext(c) - params := q.GetParams(ctx) + params := k.GetParams(ctx) return &types.QueryConnectionParamsResponse{ Params: ¶ms, diff --git a/modules/core/04-channel/keeper/grpc_query.go b/modules/core/04-channel/keeper/grpc_query.go index 333f4e15aae..0f6df54ac9c 100644 --- a/modules/core/04-channel/keeper/grpc_query.go +++ b/modules/core/04-channel/keeper/grpc_query.go @@ -21,7 +21,7 @@ import ( var _ types.QueryServer = (*Keeper)(nil) // Channel implements the Query/Channel gRPC method -func (q Keeper) Channel(c context.Context, req *types.QueryChannelRequest) (*types.QueryChannelResponse, error) { +func (k Keeper) Channel(c context.Context, req *types.QueryChannelRequest) (*types.QueryChannelResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -31,7 +31,7 @@ func (q Keeper) Channel(c context.Context, req *types.QueryChannelRequest) (*typ } ctx := sdk.UnwrapSDKContext(c) - channel, found := q.GetChannel(ctx, req.PortId, req.ChannelId) + channel, found := k.GetChannel(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, @@ -44,7 +44,7 @@ func (q Keeper) Channel(c context.Context, req *types.QueryChannelRequest) (*typ } // Channels implements the Query/Channels gRPC method -func (q Keeper) Channels(c context.Context, req *types.QueryChannelsRequest) (*types.QueryChannelsResponse, error) { +func (k Keeper) Channels(c context.Context, req *types.QueryChannelsRequest) (*types.QueryChannelsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -52,11 +52,11 @@ func (q Keeper) Channels(c context.Context, req *types.QueryChannelsRequest) (*t ctx := sdk.UnwrapSDKContext(c) channels := []*types.IdentifiedChannel{} - store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.KeyChannelEndPrefix)) + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(host.KeyChannelEndPrefix)) pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { var result types.Channel - if err := q.cdc.Unmarshal(value, &result); err != nil { + if err := k.cdc.Unmarshal(value, &result); err != nil { return err } @@ -82,7 +82,7 @@ func (q Keeper) Channels(c context.Context, req *types.QueryChannelsRequest) (*t } // ConnectionChannels implements the Query/ConnectionChannels gRPC method -func (q Keeper) ConnectionChannels(c context.Context, req *types.QueryConnectionChannelsRequest) (*types.QueryConnectionChannelsResponse, error) { +func (k Keeper) ConnectionChannels(c context.Context, req *types.QueryConnectionChannelsRequest) (*types.QueryConnectionChannelsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -94,12 +94,12 @@ func (q Keeper) ConnectionChannels(c context.Context, req *types.QueryConnection ctx := sdk.UnwrapSDKContext(c) channels := []*types.IdentifiedChannel{} - store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.KeyChannelEndPrefix)) + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(host.KeyChannelEndPrefix)) pageRes, err := query.FilteredPaginate(store, req.Pagination, func(key, value []byte, accumulate bool) (bool, error) { // filter any metadata stored under channel key var result types.Channel - if err := q.cdc.Unmarshal(value, &result); err != nil { + if err := k.cdc.Unmarshal(value, &result); err != nil { return false, err } @@ -131,7 +131,7 @@ func (q Keeper) ConnectionChannels(c context.Context, req *types.QueryConnection } // ChannelClientState implements the Query/ChannelClientState gRPC method -func (q Keeper) ChannelClientState(c context.Context, req *types.QueryChannelClientStateRequest) (*types.QueryChannelClientStateResponse, error) { +func (k Keeper) ChannelClientState(c context.Context, req *types.QueryChannelClientStateRequest) (*types.QueryChannelClientStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -142,7 +142,7 @@ func (q Keeper) ChannelClientState(c context.Context, req *types.QueryChannelCli ctx := sdk.UnwrapSDKContext(c) - clientID, clientState, err := q.GetChannelClientState(ctx, req.PortId, req.ChannelId) + clientID, clientState, err := k.GetChannelClientState(ctx, req.PortId, req.ChannelId) if err != nil { return nil, status.Error(codes.NotFound, err.Error()) } @@ -154,7 +154,7 @@ func (q Keeper) ChannelClientState(c context.Context, req *types.QueryChannelCli } // ChannelConsensusState implements the Query/ChannelConsensusState gRPC method -func (q Keeper) ChannelConsensusState(c context.Context, req *types.QueryChannelConsensusStateRequest) (*types.QueryChannelConsensusStateResponse, error) { +func (k Keeper) ChannelConsensusState(c context.Context, req *types.QueryChannelConsensusStateRequest) (*types.QueryChannelConsensusStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -165,7 +165,7 @@ func (q Keeper) ChannelConsensusState(c context.Context, req *types.QueryChannel ctx := sdk.UnwrapSDKContext(c) - channel, found := q.GetChannel(ctx, req.PortId, req.ChannelId) + channel, found := k.GetChannel(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, @@ -173,7 +173,7 @@ func (q Keeper) ChannelConsensusState(c context.Context, req *types.QueryChannel ) } - connection, found := q.connectionKeeper.GetConnection(ctx, channel.ConnectionHops[0]) + connection, found := k.connectionKeeper.GetConnection(ctx, channel.ConnectionHops[0]) if !found { return nil, status.Error( codes.NotFound, @@ -182,7 +182,7 @@ func (q Keeper) ChannelConsensusState(c context.Context, req *types.QueryChannel } consHeight := clienttypes.NewHeight(req.RevisionNumber, req.RevisionHeight) - consensusState, found := q.clientKeeper.GetClientConsensusState(ctx, connection.ClientId, consHeight) + consensusState, found := k.clientKeeper.GetClientConsensusState(ctx, connection.ClientId, consHeight) if !found { return nil, status.Error( codes.NotFound, @@ -200,7 +200,7 @@ func (q Keeper) ChannelConsensusState(c context.Context, req *types.QueryChannel } // PacketCommitment implements the Query/PacketCommitment gRPC method -func (q Keeper) PacketCommitment(c context.Context, req *types.QueryPacketCommitmentRequest) (*types.QueryPacketCommitmentResponse, error) { +func (k Keeper) PacketCommitment(c context.Context, req *types.QueryPacketCommitmentRequest) (*types.QueryPacketCommitmentResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -215,7 +215,7 @@ func (q Keeper) PacketCommitment(c context.Context, req *types.QueryPacketCommit ctx := sdk.UnwrapSDKContext(c) - commitmentBz := q.GetPacketCommitment(ctx, req.PortId, req.ChannelId, req.Sequence) + commitmentBz := k.GetPacketCommitment(ctx, req.PortId, req.ChannelId, req.Sequence) if len(commitmentBz) == 0 { return nil, status.Error(codes.NotFound, "packet commitment hash not found") } @@ -225,7 +225,7 @@ func (q Keeper) PacketCommitment(c context.Context, req *types.QueryPacketCommit } // PacketCommitments implements the Query/PacketCommitments gRPC method -func (q Keeper) PacketCommitments(c context.Context, req *types.QueryPacketCommitmentsRequest) (*types.QueryPacketCommitmentsResponse, error) { +func (k Keeper) PacketCommitments(c context.Context, req *types.QueryPacketCommitmentsRequest) (*types.QueryPacketCommitmentsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -237,7 +237,7 @@ func (q Keeper) PacketCommitments(c context.Context, req *types.QueryPacketCommi ctx := sdk.UnwrapSDKContext(c) commitments := []*types.PacketState{} - store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.PacketCommitmentPrefixPath(req.PortId, req.ChannelId))) + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(host.PacketCommitmentPrefixPath(req.PortId, req.ChannelId))) pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { keySplit := strings.Split(string(key), "/") @@ -264,7 +264,7 @@ func (q Keeper) PacketCommitments(c context.Context, req *types.QueryPacketCommi } // PacketReceipt implements the Query/PacketReceipt gRPC method -func (q Keeper) PacketReceipt(c context.Context, req *types.QueryPacketReceiptRequest) (*types.QueryPacketReceiptResponse, error) { +func (k Keeper) PacketReceipt(c context.Context, req *types.QueryPacketReceiptRequest) (*types.QueryPacketReceiptResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -279,14 +279,14 @@ func (q Keeper) PacketReceipt(c context.Context, req *types.QueryPacketReceiptRe ctx := sdk.UnwrapSDKContext(c) - _, recvd := q.GetPacketReceipt(ctx, req.PortId, req.ChannelId, req.Sequence) + _, recvd := k.GetPacketReceipt(ctx, req.PortId, req.ChannelId, req.Sequence) selfHeight := clienttypes.GetSelfHeight(ctx) return types.NewQueryPacketReceiptResponse(recvd, nil, selfHeight), nil } // PacketAcknowledgement implements the Query/PacketAcknowledgement gRPC method -func (q Keeper) PacketAcknowledgement(c context.Context, req *types.QueryPacketAcknowledgementRequest) (*types.QueryPacketAcknowledgementResponse, error) { +func (k Keeper) PacketAcknowledgement(c context.Context, req *types.QueryPacketAcknowledgementRequest) (*types.QueryPacketAcknowledgementResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -301,7 +301,7 @@ func (q Keeper) PacketAcknowledgement(c context.Context, req *types.QueryPacketA ctx := sdk.UnwrapSDKContext(c) - acknowledgementBz, found := q.GetPacketAcknowledgement(ctx, req.PortId, req.ChannelId, req.Sequence) + acknowledgementBz, found := k.GetPacketAcknowledgement(ctx, req.PortId, req.ChannelId, req.Sequence) if !found || len(acknowledgementBz) == 0 { return nil, status.Error(codes.NotFound, "packet acknowledgement hash not found") } @@ -311,7 +311,7 @@ func (q Keeper) PacketAcknowledgement(c context.Context, req *types.QueryPacketA } // PacketAcknowledgements implements the Query/PacketAcknowledgements gRPC method -func (q Keeper) PacketAcknowledgements(c context.Context, req *types.QueryPacketAcknowledgementsRequest) (*types.QueryPacketAcknowledgementsResponse, error) { +func (k Keeper) PacketAcknowledgements(c context.Context, req *types.QueryPacketAcknowledgementsRequest) (*types.QueryPacketAcknowledgementsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -323,12 +323,12 @@ func (q Keeper) PacketAcknowledgements(c context.Context, req *types.QueryPacket ctx := sdk.UnwrapSDKContext(c) acks := []*types.PacketState{} - store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.PacketAcknowledgementPrefixPath(req.PortId, req.ChannelId))) + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(host.PacketAcknowledgementPrefixPath(req.PortId, req.ChannelId))) // if a list of packet sequences is provided then query for each specific ack and return a list <= len(req.PacketCommitmentSequences) // otherwise, maintain previous behaviour and perform paginated query for _, seq := range req.PacketCommitmentSequences { - acknowledgementBz, found := q.GetPacketAcknowledgement(ctx, req.PortId, req.ChannelId, seq) + acknowledgementBz, found := k.GetPacketAcknowledgement(ctx, req.PortId, req.ChannelId, seq) if !found || len(acknowledgementBz) == 0 { continue } @@ -387,7 +387,7 @@ func (q Keeper) PacketAcknowledgements(c context.Context, req *types.QueryPacket // commitments is correct and will not function properly if the list // is not up to date. Ideally the query height should equal the latest height // on the counterparty's client which represents this chain. -func (q Keeper) UnreceivedPackets(c context.Context, req *types.QueryUnreceivedPacketsRequest) (*types.QueryUnreceivedPacketsResponse, error) { +func (k Keeper) UnreceivedPackets(c context.Context, req *types.QueryUnreceivedPacketsRequest) (*types.QueryUnreceivedPacketsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -398,7 +398,7 @@ func (q Keeper) UnreceivedPackets(c context.Context, req *types.QueryUnreceivedP ctx := sdk.UnwrapSDKContext(c) - channel, found := q.GetChannel(sdk.UnwrapSDKContext(c), req.PortId, req.ChannelId) + channel, found := k.GetChannel(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, @@ -416,12 +416,12 @@ func (q Keeper) UnreceivedPackets(c context.Context, req *types.QueryUnreceivedP } // if the packet receipt does not exist, then it is unreceived - if _, found := q.GetPacketReceipt(ctx, req.PortId, req.ChannelId, seq); !found { + if _, found := k.GetPacketReceipt(ctx, req.PortId, req.ChannelId, seq); !found { unreceivedSequences = append(unreceivedSequences, seq) } } case types.ORDERED: - nextSequenceRecv, found := q.GetNextSequenceRecv(ctx, req.PortId, req.ChannelId) + nextSequenceRecv, found := k.GetNextSequenceRecv(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, @@ -473,7 +473,7 @@ func (q Keeper) UnreceivedPackets(c context.Context, req *types.QueryUnreceivedP // acknowledgements is correct and will not function properly if the list // is not up to date. Ideally the query height should equal the latest height // on the counterparty's client which represents this chain. -func (q Keeper) UnreceivedAcks(c context.Context, req *types.QueryUnreceivedAcksRequest) (*types.QueryUnreceivedAcksResponse, error) { +func (k Keeper) UnreceivedAcks(c context.Context, req *types.QueryUnreceivedAcksRequest) (*types.QueryUnreceivedAcksResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -493,7 +493,7 @@ func (q Keeper) UnreceivedAcks(c context.Context, req *types.QueryUnreceivedAcks // if packet commitment still exists on the original sending chain, then packet ack has not been received // since processing the ack will delete the packet commitment - if commitment := q.GetPacketCommitment(ctx, req.PortId, req.ChannelId, seq); len(commitment) != 0 { + if commitment := k.GetPacketCommitment(ctx, req.PortId, req.ChannelId, seq); len(commitment) != 0 { unreceivedSequences = append(unreceivedSequences, seq) } @@ -507,7 +507,7 @@ func (q Keeper) UnreceivedAcks(c context.Context, req *types.QueryUnreceivedAcks } // NextSequenceReceive implements the Query/NextSequenceReceive gRPC method -func (q Keeper) NextSequenceReceive(c context.Context, req *types.QueryNextSequenceReceiveRequest) (*types.QueryNextSequenceReceiveResponse, error) { +func (k Keeper) NextSequenceReceive(c context.Context, req *types.QueryNextSequenceReceiveRequest) (*types.QueryNextSequenceReceiveResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -517,7 +517,7 @@ func (q Keeper) NextSequenceReceive(c context.Context, req *types.QueryNextSeque } ctx := sdk.UnwrapSDKContext(c) - channel, found := q.GetChannel(ctx, req.PortId, req.ChannelId) + channel, found := k.GetChannel(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, @@ -529,7 +529,7 @@ func (q Keeper) NextSequenceReceive(c context.Context, req *types.QueryNextSeque // do not make use of the next sequence receive. var sequence uint64 if channel.Ordering != types.UNORDERED { - sequence, found = q.GetNextSequenceRecv(ctx, req.PortId, req.ChannelId) + sequence, found = k.GetNextSequenceRecv(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, @@ -542,7 +542,7 @@ func (q Keeper) NextSequenceReceive(c context.Context, req *types.QueryNextSeque } // NextSequenceSend implements the Query/NextSequenceSend gRPC method -func (q Keeper) NextSequenceSend(c context.Context, req *types.QueryNextSequenceSendRequest) (*types.QueryNextSequenceSendResponse, error) { +func (k Keeper) NextSequenceSend(c context.Context, req *types.QueryNextSequenceSendRequest) (*types.QueryNextSequenceSendResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -553,7 +553,7 @@ func (q Keeper) NextSequenceSend(c context.Context, req *types.QueryNextSequence ctx := sdk.UnwrapSDKContext(c) - channel, found := q.GetChannel(ctx, req.PortId, req.ChannelId) + channel, found := k.GetChannel(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, @@ -565,7 +565,7 @@ func (q Keeper) NextSequenceSend(c context.Context, req *types.QueryNextSequence // do not make use of the next sequence send. var sequence uint64 if channel.Ordering != types.UNORDERED { - sequence, found = q.GetNextSequenceSend(ctx, req.PortId, req.ChannelId) + sequence, found = k.GetNextSequenceSend(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, diff --git a/modules/core/keeper/grpc_query.go b/modules/core/keeper/grpc_query.go index 2634de99de7..0a7f7f7ee28 100644 --- a/modules/core/keeper/grpc_query.go +++ b/modules/core/keeper/grpc_query.go @@ -9,146 +9,146 @@ import ( ) // ClientState implements the IBC QueryServer interface -func (q Keeper) ClientState(c context.Context, req *clienttypes.QueryClientStateRequest) (*clienttypes.QueryClientStateResponse, error) { - return q.ClientKeeper.ClientState(c, req) +func (k Keeper) ClientState(c context.Context, req *clienttypes.QueryClientStateRequest) (*clienttypes.QueryClientStateResponse, error) { + return k.ClientKeeper.ClientState(c, req) } // ClientStates implements the IBC QueryServer interface -func (q Keeper) ClientStates(c context.Context, req *clienttypes.QueryClientStatesRequest) (*clienttypes.QueryClientStatesResponse, error) { - return q.ClientKeeper.ClientStates(c, req) +func (k Keeper) ClientStates(c context.Context, req *clienttypes.QueryClientStatesRequest) (*clienttypes.QueryClientStatesResponse, error) { + return k.ClientKeeper.ClientStates(c, req) } // ConsensusState implements the IBC QueryServer interface -func (q Keeper) ConsensusState(c context.Context, req *clienttypes.QueryConsensusStateRequest) (*clienttypes.QueryConsensusStateResponse, error) { - return q.ClientKeeper.ConsensusState(c, req) +func (k Keeper) ConsensusState(c context.Context, req *clienttypes.QueryConsensusStateRequest) (*clienttypes.QueryConsensusStateResponse, error) { + return k.ClientKeeper.ConsensusState(c, req) } // ConsensusStates implements the IBC QueryServer interface -func (q Keeper) ConsensusStates(c context.Context, req *clienttypes.QueryConsensusStatesRequest) (*clienttypes.QueryConsensusStatesResponse, error) { - return q.ClientKeeper.ConsensusStates(c, req) +func (k Keeper) ConsensusStates(c context.Context, req *clienttypes.QueryConsensusStatesRequest) (*clienttypes.QueryConsensusStatesResponse, error) { + return k.ClientKeeper.ConsensusStates(c, req) } // ConsensusStateHeights implements the IBC QueryServer interface -func (q Keeper) ConsensusStateHeights(c context.Context, req *clienttypes.QueryConsensusStateHeightsRequest) (*clienttypes.QueryConsensusStateHeightsResponse, error) { - return q.ClientKeeper.ConsensusStateHeights(c, req) +func (k Keeper) ConsensusStateHeights(c context.Context, req *clienttypes.QueryConsensusStateHeightsRequest) (*clienttypes.QueryConsensusStateHeightsResponse, error) { + return k.ClientKeeper.ConsensusStateHeights(c, req) } // ClientStatus implements the IBC QueryServer interface -func (q Keeper) ClientStatus(c context.Context, req *clienttypes.QueryClientStatusRequest) (*clienttypes.QueryClientStatusResponse, error) { - return q.ClientKeeper.ClientStatus(c, req) +func (k Keeper) ClientStatus(c context.Context, req *clienttypes.QueryClientStatusRequest) (*clienttypes.QueryClientStatusResponse, error) { + return k.ClientKeeper.ClientStatus(c, req) } // ClientParams implements the IBC QueryServer interface -func (q Keeper) ClientParams(c context.Context, req *clienttypes.QueryClientParamsRequest) (*clienttypes.QueryClientParamsResponse, error) { - return q.ClientKeeper.ClientParams(c, req) +func (k Keeper) ClientParams(c context.Context, req *clienttypes.QueryClientParamsRequest) (*clienttypes.QueryClientParamsResponse, error) { + return k.ClientKeeper.ClientParams(c, req) } // UpgradedClientState implements the IBC QueryServer interface -func (q Keeper) UpgradedClientState(c context.Context, req *clienttypes.QueryUpgradedClientStateRequest) (*clienttypes.QueryUpgradedClientStateResponse, error) { - return q.ClientKeeper.UpgradedClientState(c, req) +func (k Keeper) UpgradedClientState(c context.Context, req *clienttypes.QueryUpgradedClientStateRequest) (*clienttypes.QueryUpgradedClientStateResponse, error) { + return k.ClientKeeper.UpgradedClientState(c, req) } // UpgradedConsensusState implements the IBC QueryServer interface -func (q Keeper) UpgradedConsensusState(c context.Context, req *clienttypes.QueryUpgradedConsensusStateRequest) (*clienttypes.QueryUpgradedConsensusStateResponse, error) { - return q.ClientKeeper.UpgradedConsensusState(c, req) +func (k Keeper) UpgradedConsensusState(c context.Context, req *clienttypes.QueryUpgradedConsensusStateRequest) (*clienttypes.QueryUpgradedConsensusStateResponse, error) { + return k.ClientKeeper.UpgradedConsensusState(c, req) } // Connection implements the IBC QueryServer interface -func (q Keeper) Connection(c context.Context, req *connectiontypes.QueryConnectionRequest) (*connectiontypes.QueryConnectionResponse, error) { - return q.ConnectionKeeper.Connection(c, req) +func (k Keeper) Connection(c context.Context, req *connectiontypes.QueryConnectionRequest) (*connectiontypes.QueryConnectionResponse, error) { + return k.ConnectionKeeper.Connection(c, req) } // Connections implements the IBC QueryServer interface -func (q Keeper) Connections(c context.Context, req *connectiontypes.QueryConnectionsRequest) (*connectiontypes.QueryConnectionsResponse, error) { - return q.ConnectionKeeper.Connections(c, req) +func (k Keeper) Connections(c context.Context, req *connectiontypes.QueryConnectionsRequest) (*connectiontypes.QueryConnectionsResponse, error) { + return k.ConnectionKeeper.Connections(c, req) } // ClientConnections implements the IBC QueryServer interface -func (q Keeper) ClientConnections(c context.Context, req *connectiontypes.QueryClientConnectionsRequest) (*connectiontypes.QueryClientConnectionsResponse, error) { - return q.ConnectionKeeper.ClientConnections(c, req) +func (k Keeper) ClientConnections(c context.Context, req *connectiontypes.QueryClientConnectionsRequest) (*connectiontypes.QueryClientConnectionsResponse, error) { + return k.ConnectionKeeper.ClientConnections(c, req) } // ConnectionClientState implements the IBC QueryServer interface -func (q Keeper) ConnectionClientState(c context.Context, req *connectiontypes.QueryConnectionClientStateRequest) (*connectiontypes.QueryConnectionClientStateResponse, error) { - return q.ConnectionKeeper.ConnectionClientState(c, req) +func (k Keeper) ConnectionClientState(c context.Context, req *connectiontypes.QueryConnectionClientStateRequest) (*connectiontypes.QueryConnectionClientStateResponse, error) { + return k.ConnectionKeeper.ConnectionClientState(c, req) } // ConnectionConsensusState implements the IBC QueryServer interface -func (q Keeper) ConnectionConsensusState(c context.Context, req *connectiontypes.QueryConnectionConsensusStateRequest) (*connectiontypes.QueryConnectionConsensusStateResponse, error) { - return q.ConnectionKeeper.ConnectionConsensusState(c, req) +func (k Keeper) ConnectionConsensusState(c context.Context, req *connectiontypes.QueryConnectionConsensusStateRequest) (*connectiontypes.QueryConnectionConsensusStateResponse, error) { + return k.ConnectionKeeper.ConnectionConsensusState(c, req) } // ConnectionParams implements the IBC QueryServer interface -func (q Keeper) ConnectionParams(c context.Context, req *connectiontypes.QueryConnectionParamsRequest) (*connectiontypes.QueryConnectionParamsResponse, error) { - return q.ConnectionKeeper.ConnectionParams(c, req) +func (k Keeper) ConnectionParams(c context.Context, req *connectiontypes.QueryConnectionParamsRequest) (*connectiontypes.QueryConnectionParamsResponse, error) { + return k.ConnectionKeeper.ConnectionParams(c, req) } // Channel implements the IBC QueryServer interface -func (q Keeper) Channel(c context.Context, req *channeltypes.QueryChannelRequest) (*channeltypes.QueryChannelResponse, error) { - return q.ChannelKeeper.Channel(c, req) +func (k Keeper) Channel(c context.Context, req *channeltypes.QueryChannelRequest) (*channeltypes.QueryChannelResponse, error) { + return k.ChannelKeeper.Channel(c, req) } // Channels implements the IBC QueryServer interface -func (q Keeper) Channels(c context.Context, req *channeltypes.QueryChannelsRequest) (*channeltypes.QueryChannelsResponse, error) { - return q.ChannelKeeper.Channels(c, req) +func (k Keeper) Channels(c context.Context, req *channeltypes.QueryChannelsRequest) (*channeltypes.QueryChannelsResponse, error) { + return k.ChannelKeeper.Channels(c, req) } // ConnectionChannels implements the IBC QueryServer interface -func (q Keeper) ConnectionChannels(c context.Context, req *channeltypes.QueryConnectionChannelsRequest) (*channeltypes.QueryConnectionChannelsResponse, error) { - return q.ChannelKeeper.ConnectionChannels(c, req) +func (k Keeper) ConnectionChannels(c context.Context, req *channeltypes.QueryConnectionChannelsRequest) (*channeltypes.QueryConnectionChannelsResponse, error) { + return k.ChannelKeeper.ConnectionChannels(c, req) } // ChannelClientState implements the IBC QueryServer interface -func (q Keeper) ChannelClientState(c context.Context, req *channeltypes.QueryChannelClientStateRequest) (*channeltypes.QueryChannelClientStateResponse, error) { - return q.ChannelKeeper.ChannelClientState(c, req) +func (k Keeper) ChannelClientState(c context.Context, req *channeltypes.QueryChannelClientStateRequest) (*channeltypes.QueryChannelClientStateResponse, error) { + return k.ChannelKeeper.ChannelClientState(c, req) } // ChannelConsensusState implements the IBC QueryServer interface -func (q Keeper) ChannelConsensusState(c context.Context, req *channeltypes.QueryChannelConsensusStateRequest) (*channeltypes.QueryChannelConsensusStateResponse, error) { - return q.ChannelKeeper.ChannelConsensusState(c, req) +func (k Keeper) ChannelConsensusState(c context.Context, req *channeltypes.QueryChannelConsensusStateRequest) (*channeltypes.QueryChannelConsensusStateResponse, error) { + return k.ChannelKeeper.ChannelConsensusState(c, req) } // PacketCommitment implements the IBC QueryServer interface -func (q Keeper) PacketCommitment(c context.Context, req *channeltypes.QueryPacketCommitmentRequest) (*channeltypes.QueryPacketCommitmentResponse, error) { - return q.ChannelKeeper.PacketCommitment(c, req) +func (k Keeper) PacketCommitment(c context.Context, req *channeltypes.QueryPacketCommitmentRequest) (*channeltypes.QueryPacketCommitmentResponse, error) { + return k.ChannelKeeper.PacketCommitment(c, req) } // PacketCommitments implements the IBC QueryServer interface -func (q Keeper) PacketCommitments(c context.Context, req *channeltypes.QueryPacketCommitmentsRequest) (*channeltypes.QueryPacketCommitmentsResponse, error) { - return q.ChannelKeeper.PacketCommitments(c, req) +func (k Keeper) PacketCommitments(c context.Context, req *channeltypes.QueryPacketCommitmentsRequest) (*channeltypes.QueryPacketCommitmentsResponse, error) { + return k.ChannelKeeper.PacketCommitments(c, req) } // PacketReceipt implements the IBC QueryServer interface -func (q Keeper) PacketReceipt(c context.Context, req *channeltypes.QueryPacketReceiptRequest) (*channeltypes.QueryPacketReceiptResponse, error) { - return q.ChannelKeeper.PacketReceipt(c, req) +func (k Keeper) PacketReceipt(c context.Context, req *channeltypes.QueryPacketReceiptRequest) (*channeltypes.QueryPacketReceiptResponse, error) { + return k.ChannelKeeper.PacketReceipt(c, req) } // PacketAcknowledgement implements the IBC QueryServer interface -func (q Keeper) PacketAcknowledgement(c context.Context, req *channeltypes.QueryPacketAcknowledgementRequest) (*channeltypes.QueryPacketAcknowledgementResponse, error) { - return q.ChannelKeeper.PacketAcknowledgement(c, req) +func (k Keeper) PacketAcknowledgement(c context.Context, req *channeltypes.QueryPacketAcknowledgementRequest) (*channeltypes.QueryPacketAcknowledgementResponse, error) { + return k.ChannelKeeper.PacketAcknowledgement(c, req) } // PacketAcknowledgements implements the IBC QueryServer interface -func (q Keeper) PacketAcknowledgements(c context.Context, req *channeltypes.QueryPacketAcknowledgementsRequest) (*channeltypes.QueryPacketAcknowledgementsResponse, error) { - return q.ChannelKeeper.PacketAcknowledgements(c, req) +func (k Keeper) PacketAcknowledgements(c context.Context, req *channeltypes.QueryPacketAcknowledgementsRequest) (*channeltypes.QueryPacketAcknowledgementsResponse, error) { + return k.ChannelKeeper.PacketAcknowledgements(c, req) } // UnreceivedPackets implements the IBC QueryServer interface -func (q Keeper) UnreceivedPackets(c context.Context, req *channeltypes.QueryUnreceivedPacketsRequest) (*channeltypes.QueryUnreceivedPacketsResponse, error) { - return q.ChannelKeeper.UnreceivedPackets(c, req) +func (k Keeper) UnreceivedPackets(c context.Context, req *channeltypes.QueryUnreceivedPacketsRequest) (*channeltypes.QueryUnreceivedPacketsResponse, error) { + return k.ChannelKeeper.UnreceivedPackets(c, req) } // UnreceivedAcks implements the IBC QueryServer interface -func (q Keeper) UnreceivedAcks(c context.Context, req *channeltypes.QueryUnreceivedAcksRequest) (*channeltypes.QueryUnreceivedAcksResponse, error) { - return q.ChannelKeeper.UnreceivedAcks(c, req) +func (k Keeper) UnreceivedAcks(c context.Context, req *channeltypes.QueryUnreceivedAcksRequest) (*channeltypes.QueryUnreceivedAcksResponse, error) { + return k.ChannelKeeper.UnreceivedAcks(c, req) } // NextSequenceReceive implements the IBC QueryServer interface -func (q Keeper) NextSequenceReceive(c context.Context, req *channeltypes.QueryNextSequenceReceiveRequest) (*channeltypes.QueryNextSequenceReceiveResponse, error) { - return q.ChannelKeeper.NextSequenceReceive(c, req) +func (k Keeper) NextSequenceReceive(c context.Context, req *channeltypes.QueryNextSequenceReceiveRequest) (*channeltypes.QueryNextSequenceReceiveResponse, error) { + return k.ChannelKeeper.NextSequenceReceive(c, req) } // NextSequenceSend implements the IBC QueryServer interface -func (q Keeper) NextSequenceSend(c context.Context, req *channeltypes.QueryNextSequenceSendRequest) (*channeltypes.QueryNextSequenceSendResponse, error) { - return q.ChannelKeeper.NextSequenceSend(c, req) +func (k Keeper) NextSequenceSend(c context.Context, req *channeltypes.QueryNextSequenceSendRequest) (*channeltypes.QueryNextSequenceSendResponse, error) { + return k.ChannelKeeper.NextSequenceSend(c, req) }