github.com/okex/exchain@v1.8.0/libs/ibc-go/modules/core/keeper/grpc_query.go (about)

     1  package keeper
     2  
     3  import (
     4  	"context"
     5  	porttypes "github.com/okex/exchain/libs/ibc-go/modules/core/05-port/types"
     6  
     7  	sdk "github.com/okex/exchain/libs/cosmos-sdk/types"
     8  	clienttypes "github.com/okex/exchain/libs/ibc-go/modules/core/02-client/types"
     9  	connectiontypes "github.com/okex/exchain/libs/ibc-go/modules/core/03-connection/types"
    10  	channeltypes "github.com/okex/exchain/libs/ibc-go/modules/core/04-channel/types"
    11  	"github.com/okex/exchain/libs/ibc-go/modules/core/types"
    12  )
    13  
    14  // ClientState implements the IBC QueryServer interface
    15  func (q Keeper) ClientState(c context.Context, req *clienttypes.QueryClientStateRequest) (*clienttypes.QueryClientStateResponse, error) {
    16  	return q.ClientKeeper.ClientState(c, req)
    17  }
    18  
    19  // ClientStates implements the IBC QueryServer interface
    20  func (q Keeper) ClientStates(c context.Context, req *clienttypes.QueryClientStatesRequest) (*clienttypes.QueryClientStatesResponse, error) {
    21  	return q.ClientKeeper.ClientStates(c, req)
    22  }
    23  
    24  // ConsensusState implements the IBC QueryServer interface
    25  func (q Keeper) ConsensusState(c context.Context, req *clienttypes.QueryConsensusStateRequest) (*clienttypes.QueryConsensusStateResponse, error) {
    26  	return q.ClientKeeper.ConsensusState(c, req)
    27  }
    28  
    29  // ConsensusStates implements the IBC QueryServer interface
    30  func (q Keeper) ConsensusStates(c context.Context, req *clienttypes.QueryConsensusStatesRequest) (*clienttypes.QueryConsensusStatesResponse, error) {
    31  	return q.ClientKeeper.ConsensusStates(c, req)
    32  }
    33  
    34  // ConsensusStateHeights implements the IBC QueryServer interface
    35  func (q Keeper) ConsensusStateHeights(c context.Context, req *clienttypes.QueryConsensusStateHeightsRequest) (*clienttypes.QueryConsensusStateHeightsResponse, error) {
    36  	return q.ClientKeeper.ConsensusStateHeights(c, req)
    37  }
    38  
    39  // ClientStatus implements the IBC QueryServer interface
    40  func (q Keeper) ClientStatus(c context.Context, req *clienttypes.QueryClientStatusRequest) (*clienttypes.QueryClientStatusResponse, error) {
    41  	return q.ClientKeeper.ClientStatus(c, req)
    42  }
    43  
    44  // ClientParams implements the IBC QueryServer interface
    45  func (q Keeper) ClientParams(c context.Context, req *clienttypes.QueryClientParamsRequest) (*clienttypes.QueryClientParamsResponse, error) {
    46  	return q.ClientKeeper.ClientParams(c, req)
    47  }
    48  
    49  // UpgradedClientState implements the IBC QueryServer interface
    50  func (q Keeper) UpgradedClientState(c context.Context, req *clienttypes.QueryUpgradedClientStateRequest) (*clienttypes.QueryUpgradedClientStateResponse, error) {
    51  	return q.ClientKeeper.UpgradedClientState(c, req)
    52  }
    53  
    54  // Connection implements the IBC QueryServer interface
    55  func (q Keeper) Connection(c context.Context, req *connectiontypes.QueryConnectionRequest) (*connectiontypes.QueryConnectionResponse, error) {
    56  	return q.ConnectionKeeper.Connection(c, req)
    57  }
    58  
    59  // Connections implements the IBC QueryServer interface
    60  func (q Keeper) Connections(c context.Context, req *connectiontypes.QueryConnectionsRequest) (*connectiontypes.QueryConnectionsResponse, error) {
    61  	return q.ConnectionKeeper.Connections(c, req)
    62  }
    63  
    64  // ClientConnections implements the IBC QueryServer interface
    65  func (q Keeper) ClientConnections(c context.Context, req *connectiontypes.QueryClientConnectionsRequest) (*connectiontypes.QueryClientConnectionsResponse, error) {
    66  	return q.ConnectionKeeper.ClientConnections(c, req)
    67  }
    68  
    69  // ConnectionClientState implements the IBC QueryServer interface
    70  func (q Keeper) ConnectionClientState(c context.Context, req *connectiontypes.QueryConnectionClientStateRequest) (*connectiontypes.QueryConnectionClientStateResponse, error) {
    71  	return q.ConnectionKeeper.ConnectionClientState(c, req)
    72  }
    73  
    74  // ConnectionConsensusState implements the IBC QueryServer interface
    75  func (q Keeper) ConnectionConsensusState(c context.Context, req *connectiontypes.QueryConnectionConsensusStateRequest) (*connectiontypes.QueryConnectionConsensusStateResponse, error) {
    76  	return q.ConnectionKeeper.ConnectionConsensusState(c, req)
    77  }
    78  
    79  // Channel implements the IBC QueryServer interface
    80  func (q Keeper) Channel(c context.Context, req *channeltypes.QueryChannelRequest) (*channeltypes.QueryChannelResponse, error) {
    81  	return q.ChannelKeeper.Channel(c, req)
    82  }
    83  
    84  // Channels implements the IBC QueryServer interface
    85  func (q Keeper) Channels(c context.Context, req *channeltypes.QueryChannelsRequest) (*channeltypes.QueryChannelsResponse, error) {
    86  	return q.ChannelKeeper.Channels(c, req)
    87  }
    88  
    89  // ConnectionChannels implements the IBC QueryServer interface
    90  func (q Keeper) ConnectionChannels(c context.Context, req *channeltypes.QueryConnectionChannelsRequest) (*channeltypes.QueryConnectionChannelsResponse, error) {
    91  	return q.ChannelKeeper.ConnectionChannels(c, req)
    92  }
    93  
    94  // ChannelClientState implements the IBC QueryServer interface
    95  func (q Keeper) ChannelClientState(c context.Context, req *channeltypes.QueryChannelClientStateRequest) (*channeltypes.QueryChannelClientStateResponse, error) {
    96  	return q.ChannelKeeper.ChannelClientState(c, req)
    97  }
    98  
    99  // ChannelConsensusState implements the IBC QueryServer interface
   100  func (q Keeper) ChannelConsensusState(c context.Context, req *channeltypes.QueryChannelConsensusStateRequest) (*channeltypes.QueryChannelConsensusStateResponse, error) {
   101  	return q.ChannelKeeper.ChannelConsensusState(c, req)
   102  }
   103  
   104  // PacketCommitment implements the IBC QueryServer interface
   105  func (q Keeper) PacketCommitment(c context.Context, req *channeltypes.QueryPacketCommitmentRequest) (*channeltypes.QueryPacketCommitmentResponse, error) {
   106  	return q.ChannelKeeper.PacketCommitment(c, req)
   107  }
   108  
   109  // PacketCommitments implements the IBC QueryServer interface
   110  func (q Keeper) PacketCommitments(c context.Context, req *channeltypes.QueryPacketCommitmentsRequest) (*channeltypes.QueryPacketCommitmentsResponse, error) {
   111  	return q.ChannelKeeper.PacketCommitments(c, req)
   112  }
   113  
   114  // PacketReceipt implements the IBC QueryServer interface
   115  func (q Keeper) PacketReceipt(c context.Context, req *channeltypes.QueryPacketReceiptRequest) (*channeltypes.QueryPacketReceiptResponse, error) {
   116  	return q.ChannelKeeper.PacketReceipt(c, req)
   117  }
   118  
   119  // PacketAcknowledgement implements the IBC QueryServer interface
   120  func (q Keeper) PacketAcknowledgement(c context.Context, req *channeltypes.QueryPacketAcknowledgementRequest) (*channeltypes.QueryPacketAcknowledgementResponse, error) {
   121  	return q.ChannelKeeper.PacketAcknowledgement(c, req)
   122  }
   123  
   124  // PacketAcknowledgements implements the IBC QueryServer interface
   125  func (q Keeper) PacketAcknowledgements(c context.Context, req *channeltypes.QueryPacketAcknowledgementsRequest) (*channeltypes.QueryPacketAcknowledgementsResponse, error) {
   126  	return q.ChannelKeeper.PacketAcknowledgements(c, req)
   127  }
   128  
   129  // UnreceivedPackets implements the IBC QueryServer interface
   130  func (q Keeper) UnreceivedPackets(c context.Context, req *channeltypes.QueryUnreceivedPacketsRequest) (*channeltypes.QueryUnreceivedPacketsResponse, error) {
   131  	return q.ChannelKeeper.UnreceivedPackets(c, req)
   132  }
   133  
   134  // UnreceivedAcks implements the IBC QueryServer interface
   135  func (q Keeper) UnreceivedAcks(c context.Context, req *channeltypes.QueryUnreceivedAcksRequest) (*channeltypes.QueryUnreceivedAcksResponse, error) {
   136  	return q.ChannelKeeper.UnreceivedAcks(c, req)
   137  }
   138  
   139  // NextSequenceReceive implements the IBC QueryServer interface
   140  func (q Keeper) NextSequenceReceive(c context.Context, req *channeltypes.QueryNextSequenceReceiveRequest) (*channeltypes.QueryNextSequenceReceiveResponse, error) {
   141  	return q.ChannelKeeper.NextSequenceReceive(c, req)
   142  }
   143  
   144  // AppVersion implements the IBC QueryServer interface
   145  func (q Keeper) AppVersion(c context.Context, req *porttypes.QueryAppVersionRequest) (*porttypes.QueryAppVersionResponse, error) {
   146  	return q.PortKeeper.AppVersion(c, req)
   147  }
   148  
   149  func (q Keeper) IbcParams(c context.Context, req *types.QueryIbcParamsRequest) (*types.QueryIbcParamsResponse, error) {
   150  	ctx := sdk.UnwrapSDKContext(c)
   151  	params := q.GetParams(ctx)
   152  
   153  	return &types.QueryIbcParamsResponse{
   154  		Params: &params,
   155  	}, nil
   156  }
   157  
   158  func (q Keeper) UpgradedConsensusState(c context.Context, req *clienttypes.QueryUpgradedConsensusStateRequest) (*clienttypes.QueryUpgradedConsensusStateResponse, error) {
   159  	return q.ClientKeeper.UpgradedConsensusState(c, req)
   160  }