374 lines
14 KiB
Go
374 lines
14 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc (unknown)
|
|
// source: cosmos/gov/v1beta1/query.proto
|
|
|
|
package govv1beta1
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.32.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion7
|
|
|
|
// QueryClient is the client API for Query service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
type QueryClient interface {
|
|
// Proposal queries proposal details based on ProposalID.
|
|
Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error)
|
|
// Proposals queries all proposals based on given status.
|
|
Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error)
|
|
// Vote queries voted information based on proposalID, voterAddr.
|
|
Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error)
|
|
// Votes queries votes of a given proposal.
|
|
Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error)
|
|
// Params queries all parameters of the gov module.
|
|
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
|
// Deposit queries single deposit information based proposalID, depositAddr.
|
|
Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error)
|
|
// Deposits queries all deposits of a single proposal.
|
|
Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error)
|
|
// TallyResult queries the tally of a proposal vote.
|
|
TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error)
|
|
}
|
|
|
|
type queryClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
|
return &queryClient{cc}
|
|
}
|
|
|
|
func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) {
|
|
out := new(QueryProposalResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Proposal", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) {
|
|
out := new(QueryProposalsResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Proposals", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) {
|
|
out := new(QueryVoteResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Vote", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) {
|
|
out := new(QueryVotesResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Votes", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
|
out := new(QueryParamsResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Params", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) {
|
|
out := new(QueryDepositResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposit", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) {
|
|
out := new(QueryDepositsResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposits", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) {
|
|
out := new(QueryTallyResultResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/TallyResult", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// QueryServer is the server API for Query service.
|
|
// All implementations must embed UnimplementedQueryServer
|
|
// for forward compatibility
|
|
type QueryServer interface {
|
|
// Proposal queries proposal details based on ProposalID.
|
|
Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error)
|
|
// Proposals queries all proposals based on given status.
|
|
Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error)
|
|
// Vote queries voted information based on proposalID, voterAddr.
|
|
Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error)
|
|
// Votes queries votes of a given proposal.
|
|
Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error)
|
|
// Params queries all parameters of the gov module.
|
|
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
|
// Deposit queries single deposit information based proposalID, depositAddr.
|
|
Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error)
|
|
// Deposits queries all deposits of a single proposal.
|
|
Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error)
|
|
// TallyResult queries the tally of a proposal vote.
|
|
TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error)
|
|
mustEmbedUnimplementedQueryServer()
|
|
}
|
|
|
|
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedQueryServer struct {
|
|
}
|
|
|
|
func (UnimplementedQueryServer) Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Proposals not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Votes not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Deposits not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
|
|
|
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to QueryServer will
|
|
// result in compilation errors.
|
|
type UnsafeQueryServer interface {
|
|
mustEmbedUnimplementedQueryServer()
|
|
}
|
|
|
|
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
|
s.RegisterService(&Query_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryProposalRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Proposal(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.gov.v1beta1.Query/Proposal",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryProposalsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Proposals(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.gov.v1beta1.Query/Proposals",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryVoteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Vote(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.gov.v1beta1.Query/Vote",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryVotesRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Votes(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.gov.v1beta1.Query/Votes",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryParamsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Params(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.gov.v1beta1.Query/Params",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryDepositRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Deposit(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.gov.v1beta1.Query/Deposit",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryDepositsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Deposits(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.gov.v1beta1.Query/Deposits",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryTallyResultRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).TallyResult(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.gov.v1beta1.Query/TallyResult",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Query_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "cosmos.gov.v1beta1.Query",
|
|
HandlerType: (*QueryServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Proposal",
|
|
Handler: _Query_Proposal_Handler,
|
|
},
|
|
{
|
|
MethodName: "Proposals",
|
|
Handler: _Query_Proposals_Handler,
|
|
},
|
|
{
|
|
MethodName: "Vote",
|
|
Handler: _Query_Vote_Handler,
|
|
},
|
|
{
|
|
MethodName: "Votes",
|
|
Handler: _Query_Votes_Handler,
|
|
},
|
|
{
|
|
MethodName: "Params",
|
|
Handler: _Query_Params_Handler,
|
|
},
|
|
{
|
|
MethodName: "Deposit",
|
|
Handler: _Query_Deposit_Handler,
|
|
},
|
|
{
|
|
MethodName: "Deposits",
|
|
Handler: _Query_Deposits_Handler,
|
|
},
|
|
{
|
|
MethodName: "TallyResult",
|
|
Handler: _Query_TallyResult_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "cosmos/gov/v1beta1/query.proto",
|
|
}
|