diff --git a/proto/cosmos/gov/gov.proto b/proto/cosmos/gov/gov.proto index 165e283c8b6e..ea47e818d90d 100644 --- a/proto/cosmos/gov/gov.proto +++ b/proto/cosmos/gov/gov.proto @@ -6,6 +6,7 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; option (gogoproto.goproto_stringer_all) = false; @@ -160,3 +161,57 @@ message Vote { bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; VoteOption option = 3; } + +// DepositParams defines the params around deposits for governance +message DepositParams { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.Coin min_deposit = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"min_deposit\"", + (gogoproto.jsontag) = "min_deposit,omitempty" + ]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. + google.protobuf.Duration max_deposit_period = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "max_deposit_period,omitempty", + (gogoproto.moretags) = "yaml:\"max_deposit_period\"" + ]; +} + +// VotingParams defines the params around Voting in governance +message VotingParams { + // Length of the voting period. + google.protobuf.Duration voting_period = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "voting_period,omitempty", + (gogoproto.moretags) = "yaml:\"voting_period\"" + ]; +} + +// TallyParams defines the params around Tallying votes in governance +message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be considered valid. + bytes quorum = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "quorum,omitempty" + ]; + + // Minimum proportion of Yes votes for proposal to pass. Initial value: 0.5. + bytes threshold = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "threshold,omitempty" + ]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3. + bytes veto = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "veto,omitempty" + ]; +} diff --git a/proto/cosmos/gov/query.proto b/proto/cosmos/gov/query.proto new file mode 100644 index 000000000000..210129afb364 --- /dev/null +++ b/proto/cosmos/gov/query.proto @@ -0,0 +1,148 @@ +syntax = "proto3"; +package cosmos.gov; + +import "cosmos/query/pagination.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/gov/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID + rpc Proposal (QueryProposalRequest) returns (QueryProposalResponse) {} + + // Proposals queries all proposals based on given status + rpc Proposals (QueryProposalsRequest) returns (QueryProposalsResponse) {} + + // Vote queries Voted information based on proposalID, voterAddr + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) {} + + // Votes queries votes of a given proposal + rpc Votes (QueryVotesRequest) returns (QueryVotesResponse) {} + + // Params queries all params + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {} + + // Deposit queries single deposit information based proposalID, depositAddr + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) {} + + // Deposits queries all deposits of a single proposal + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) {} + + // TallyResult queries the tally of a proposal vote + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) {} +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method +message QueryProposalRequest { + // unique id of the proposal + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method +message QueryProposalResponse { + Proposal proposal = 1 [(gogoproto.nullable) = false]; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method +message QueryProposalsRequest { + // status of the proposals. + ProposalStatus proposal_status = 1 ; + + // Voter address for the proposals. + bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + + // Deposit addresses from the proposals. + bytes depositor = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + + cosmos.query.PageRequest req = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC method +message QueryProposalsResponse { + repeated Proposal proposals = 1 [(gogoproto.nullable) = false]; + + cosmos.query.PageResponse res = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method +message QueryVoteRequest { + // unique id of the proposal + uint64 proposal_id = 1; + + // Voter address for the proposals. + bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method +message QueryVoteResponse { + Vote vote = 1 [(gogoproto.nullable) = false]; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method +message QueryVotesRequest { + // unique id of the proposal + uint64 proposal_id = 1; + + cosmos.query.PageRequest req = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method +message QueryVotesResponse { + repeated Vote votes = 1 [(gogoproto.nullable) = false]; + + cosmos.query.PageResponse res = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method +message QueryParamsRequest { + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method +message QueryParamsResponse { + VotingParams voting_params = 1 [(gogoproto.nullable) = false]; + DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; + TallyParams tally_params = 3 [(gogoproto.nullable) = false]; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method +message QueryDepositRequest { + // unique id of the proposal + uint64 proposal_id = 1; + + // Deposit addresses from the proposals. + bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method +message QueryDepositResponse { + Deposit deposit = 1 [(gogoproto.nullable) = false]; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method +message QueryDepositsRequest { + // unique id of the proposal + uint64 proposal_id = 1; + + cosmos.query.PageRequest req = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method +message QueryDepositsResponse { + repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; + + cosmos.query.PageResponse res = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method +message QueryTallyResultRequest { + // unique id of the proposal + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method +message QueryTallyResultResponse { + TallyResult tally = 1 [(gogoproto.nullable) = false]; +} diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go new file mode 100644 index 000000000000..39f9c5f7e638 --- /dev/null +++ b/x/gov/keeper/grpc_query.go @@ -0,0 +1,260 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/cosmos-sdk/x/gov/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +var _ types.QueryServer = Keeper{} + +// Proposal returns proposal details based on ProposalID +func (q Keeper) Proposal(c context.Context, req *types.QueryProposalRequest) (*types.QueryProposalResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.ProposalId == 0 { + return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") + } + + ctx := sdk.UnwrapSDKContext(c) + + proposal, found := q.GetProposal(ctx, req.ProposalId) + if !found { + return nil, status.Errorf(codes.NotFound, "proposal %d doesn't exist", req.ProposalId) + } + + return &types.QueryProposalResponse{Proposal: proposal}, nil +} + +// Proposals implements the Query/Proposals gRPC method +func (q Keeper) Proposals(c context.Context, req *types.QueryProposalsRequest) (*types.QueryProposalsResponse, error) { + var filteredProposals types.Proposals + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(q.storeKey) + proposalStore := prefix.NewStore(store, types.ProposalsKeyPrefix) + + res, err := query.FilteredPaginate(proposalStore, req.Req, func(key []byte, value []byte, accumulate bool) (bool, error) { + var p types.Proposal + if err := q.cdc.UnmarshalBinaryBare(value, &p); err != nil { + return false, status.Error(codes.Internal, err.Error()) + } + + matchVoter, matchDepositor, matchStatus := true, true, true + + // match status (if supplied/valid) + if types.ValidProposalStatus(req.ProposalStatus) { + matchStatus = p.Status == req.ProposalStatus + } + + // match voter address (if supplied) + if len(req.Voter) > 0 { + _, matchVoter = q.GetVote(ctx, p.ProposalID, req.Voter) + } + + // match depositor (if supplied) + if len(req.Depositor) > 0 { + _, matchDepositor = q.GetDeposit(ctx, p.ProposalID, req.Depositor) + } + + if matchVoter && matchDepositor && matchStatus { + if accumulate { + filteredProposals = append(filteredProposals, p) + } + + return true, nil + } + + return false, nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryProposalsResponse{Proposals: filteredProposals, Res: res}, nil +} + +// Vote returns Voted information based on proposalID, voterAddr +func (q Keeper) Vote(c context.Context, req *types.QueryVoteRequest) (*types.QueryVoteResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.ProposalId == 0 { + return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") + } + + if req.Voter == nil { + return nil, status.Error(codes.InvalidArgument, "empty voter address") + } + + ctx := sdk.UnwrapSDKContext(c) + + vote, found := q.GetVote(ctx, req.ProposalId, req.Voter) + if !found { + return nil, status.Errorf(codes.InvalidArgument, + "voter: %v not found for proposal: %v", req.Voter, req.ProposalId) + } + + return &types.QueryVoteResponse{Vote: vote}, nil +} + +// Votes returns single proposal's votes +func (q Keeper) Votes(c context.Context, req *types.QueryVotesRequest) (*types.QueryVotesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.ProposalId == 0 { + return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") + } + + var votes types.Votes + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(q.storeKey) + votesStore := prefix.NewStore(store, types.VotesKey(req.ProposalId)) + + res, err := query.Paginate(votesStore, req.Req, func(key []byte, value []byte) error { + var vote types.Vote + if err := q.cdc.UnmarshalBinaryBare(value, &vote); err != nil { + return err + } + + votes = append(votes, vote) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryVotesResponse{Votes: votes, Res: res}, nil +} + +// Params queries all params +func (q Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(c) + + switch req.ParamsType { + case types.ParamDeposit: + depositParmas := q.GetDepositParams(ctx) + return &types.QueryParamsResponse{DepositParams: depositParmas}, nil + + case types.ParamVoting: + votingParmas := q.GetVotingParams(ctx) + return &types.QueryParamsResponse{VotingParams: votingParmas}, nil + + case types.ParamTallying: + tallyParams := q.GetTallyParams(ctx) + return &types.QueryParamsResponse{TallyParams: tallyParams}, nil + + default: + return nil, status.Errorf(codes.InvalidArgument, + "%s is not a valid parameter type", req.ParamsType) + } +} + +// Deposit queries single deposit information based proposalID, depositAddr +func (q Keeper) Deposit(c context.Context, req *types.QueryDepositRequest) (*types.QueryDepositResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.ProposalId == 0 { + return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") + } + + if req.Depositor == nil { + return nil, status.Error(codes.InvalidArgument, "empty depositor address") + } + + ctx := sdk.UnwrapSDKContext(c) + + deposit, found := q.GetDeposit(ctx, req.ProposalId, req.Depositor) + if !found { + return nil, status.Errorf(codes.InvalidArgument, + "depositer: %v not found for proposal: %v", req.Depositor, req.ProposalId) + } + + return &types.QueryDepositResponse{Deposit: deposit}, nil +} + +// Deposits returns single proposal's all deposits +func (q Keeper) Deposits(c context.Context, req *types.QueryDepositsRequest) (*types.QueryDepositsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.ProposalId == 0 { + return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") + } + + var deposits types.Deposits + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(q.storeKey) + depositStore := prefix.NewStore(store, types.DepositsKey(req.ProposalId)) + + res, err := query.Paginate(depositStore, req.Req, func(key []byte, value []byte) error { + var deposit types.Deposit + if err := q.cdc.UnmarshalBinaryBare(value, &deposit); err != nil { + return err + } + + deposits = append(deposits, deposit) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryDepositsResponse{Deposits: deposits, Res: res}, nil +} + +// TallyResult queries the tally of a proposal vote +func (q Keeper) TallyResult(c context.Context, req *types.QueryTallyResultRequest) (*types.QueryTallyResultResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.ProposalId == 0 { + return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") + } + + ctx := sdk.UnwrapSDKContext(c) + + proposal, ok := q.GetProposal(ctx, req.ProposalId) + if !ok { + return nil, status.Errorf(codes.NotFound, "proposal %d doesn't exist", req.ProposalId) + } + + var tallyResult types.TallyResult + + switch { + case proposal.Status == types.StatusDepositPeriod: + tallyResult = types.EmptyTallyResult() + + case proposal.Status == types.StatusPassed || proposal.Status == types.StatusRejected: + tallyResult = proposal.FinalTallyResult + + default: + // proposal is in voting period + _, _, tallyResult = q.Tally(ctx, proposal) + } + + return &types.QueryTallyResultResponse{Tally: tallyResult}, nil +} diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go new file mode 100644 index 000000000000..9fb3aa5e7a67 --- /dev/null +++ b/x/gov/keeper/grpc_query_test.go @@ -0,0 +1,815 @@ +package keeper_test + +import ( + gocontext "context" + "fmt" + "strconv" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +func (suite *KeeperTestSuite) TestGRPCQueryProposal() { + app, ctx, queryClient := suite.app, suite.ctx, suite.queryClient + + var ( + req *types.QueryProposalRequest + expProposal types.Proposal + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty request", + func() { + req = &types.QueryProposalRequest{} + }, + false, + }, + { + "non existing proposal request", + func() { + req = &types.QueryProposalRequest{ProposalId: 3} + }, + false, + }, + { + "zero proposal id request", + func() { + req = &types.QueryProposalRequest{ProposalId: 0} + }, + false, + }, + { + "valid request", + func() { + req = &types.QueryProposalRequest{ProposalId: 1} + testProposal := types.NewTextProposal("Proposal", "testing proposal") + submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal) + suite.Require().NoError(err) + suite.Require().NotEmpty(submittedProposal) + + expProposal = submittedProposal + }, + true, + }, + } + + for _, testCase := range testCases { + suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { + testCase.malleate() + + proposalRes, err := queryClient.Proposal(gocontext.Background(), req) + + if testCase.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expProposal.String(), proposalRes.Proposal.String()) + } else { + suite.Require().Error(err) + suite.Require().Nil(proposalRes) + } + }) + } +} + +func (suite *KeeperTestSuite) TestGRPCQueryProposals() { + app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs + + testProposals := []types.Proposal{} + + var ( + req *types.QueryProposalsRequest + expRes *types.QueryProposalsResponse + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty state request", + func() { + req = &types.QueryProposalsRequest{} + }, + true, + }, + { + "request proposals with limit 3", + func() { + // create 5 test proposals + for i := 0; i < 5; i++ { + num := strconv.Itoa(i + 1) + testProposal := types.NewTextProposal("Proposal"+num, "testing proposal "+num) + proposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal) + suite.Require().NotEmpty(proposal) + suite.Require().NoError(err) + testProposals = append(testProposals, proposal) + } + + req = &types.QueryProposalsRequest{ + Req: &query.PageRequest{Limit: 3}, + } + + expRes = &types.QueryProposalsResponse{ + Proposals: testProposals[:3], + } + }, + true, + }, + { + "request 2nd page with limit 4", + func() { + req = &types.QueryProposalsRequest{ + Req: &query.PageRequest{Offset: 3, Limit: 3}, + } + + expRes = &types.QueryProposalsResponse{ + Proposals: testProposals[3:], + } + }, + true, + }, + { + "request with limit 2 and count true", + func() { + req = &types.QueryProposalsRequest{ + Req: &query.PageRequest{Limit: 2, CountTotal: true}, + } + + expRes = &types.QueryProposalsResponse{ + Proposals: testProposals[:2], + } + }, + true, + }, + { + "request with filter of status deposit period", + func() { + req = &types.QueryProposalsRequest{ + ProposalStatus: types.StatusDepositPeriod, + } + + expRes = &types.QueryProposalsResponse{ + Proposals: testProposals, + } + }, + true, + }, + { + "request with filter of deposit address", + func() { + depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(20))) + deposit := types.NewDeposit(testProposals[0].ProposalID, addrs[0], depositCoins) + app.GovKeeper.SetDeposit(ctx, deposit) + + req = &types.QueryProposalsRequest{ + Depositor: addrs[0], + } + + expRes = &types.QueryProposalsResponse{ + Proposals: testProposals[:1], + } + }, + true, + }, + { + "request with filter of deposit address", + func() { + testProposals[1].Status = types.StatusVotingPeriod + app.GovKeeper.SetProposal(ctx, testProposals[1]) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, testProposals[1].ProposalID, addrs[0], types.OptionAbstain)) + + req = &types.QueryProposalsRequest{ + Voter: addrs[0], + } + + expRes = &types.QueryProposalsResponse{ + Proposals: testProposals[1:2], + } + }, + true, + }, + } + + for _, testCase := range testCases { + suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { + testCase.malleate() + + proposals, err := queryClient.Proposals(gocontext.Background(), req) + + if testCase.expPass { + suite.Require().NoError(err) + + suite.Require().Len(proposals.GetProposals(), len(expRes.GetProposals())) + for i := 0; i < len(proposals.GetProposals()); i++ { + suite.Require().Equal(proposals.GetProposals()[i].String(), expRes.GetProposals()[i].String()) + } + + } else { + suite.Require().Error(err) + suite.Require().Nil(proposals) + } + }) + } +} + +func (suite *KeeperTestSuite) TestGRPCQueryVote() { + app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs + + var ( + req *types.QueryVoteRequest + expRes *types.QueryVoteResponse + proposal types.Proposal + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty request", + func() { + req = &types.QueryVoteRequest{} + }, + false, + }, + { + "zero proposal id request", + func() { + req = &types.QueryVoteRequest{ + ProposalId: 0, + Voter: addrs[0], + } + }, + false, + }, + { + "empty voter request", + func() { + req = &types.QueryVoteRequest{ + ProposalId: 1, + Voter: nil, + } + }, + false, + }, + { + "non existed proposal", + func() { + req = &types.QueryVoteRequest{ + ProposalId: 3, + Voter: addrs[0], + } + }, + false, + }, + { + "no votes present", + func() { + var err error + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + suite.Require().NoError(err) + + req = &types.QueryVoteRequest{ + ProposalId: proposal.ProposalID, + Voter: addrs[0], + } + + expRes = &types.QueryVoteResponse{} + }, + false, + }, + { + "valid request", + func() { + proposal.Status = types.StatusVotingPeriod + app.GovKeeper.SetProposal(ctx, proposal) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalID, addrs[0], types.OptionAbstain)) + + req = &types.QueryVoteRequest{ + ProposalId: proposal.ProposalID, + Voter: addrs[0], + } + + expRes = &types.QueryVoteResponse{Vote: types.NewVote(proposal.ProposalID, addrs[0], types.OptionAbstain)} + }, + true, + }, + { + "wrong voter id request", + func() { + req = &types.QueryVoteRequest{ + ProposalId: proposal.ProposalID, + Voter: addrs[1], + } + + expRes = &types.QueryVoteResponse{} + }, + false, + }, + } + + for _, testCase := range testCases { + suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { + testCase.malleate() + + vote, err := queryClient.Vote(gocontext.Background(), req) + + if testCase.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expRes, vote) + } else { + suite.Require().Error(err) + suite.Require().Nil(vote) + } + }) + } +} + +func (suite *KeeperTestSuite) TestGRPCQueryVotes() { + app, ctx, queryClient := suite.app, suite.ctx, suite.queryClient + + addrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(30000000)) + + var ( + req *types.QueryVotesRequest + expRes *types.QueryVotesResponse + proposal types.Proposal + votes types.Votes + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty request", + func() { + req = &types.QueryVotesRequest{} + }, + false, + }, + { + "zero proposal id request", + func() { + req = &types.QueryVotesRequest{ + ProposalId: 0, + } + }, + false, + }, + { + "non existed proposals", + func() { + req = &types.QueryVotesRequest{ + ProposalId: 2, + } + }, + true, + }, + { + "create a proposal and get votes", + func() { + var err error + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + suite.Require().NoError(err) + + req = &types.QueryVotesRequest{ + ProposalId: proposal.ProposalID, + } + }, + true, + }, + { + "request after adding 2 votes", + func() { + proposal.Status = types.StatusVotingPeriod + app.GovKeeper.SetProposal(ctx, proposal) + + votes = []types.Vote{ + {proposal.ProposalID, addrs[0], types.OptionAbstain}, + {proposal.ProposalID, addrs[1], types.OptionYes}, + } + + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalID, votes[0].Voter, votes[0].Option)) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalID, votes[1].Voter, votes[1].Option)) + + req = &types.QueryVotesRequest{ + ProposalId: proposal.ProposalID, + } + + expRes = &types.QueryVotesResponse{ + Votes: votes, + } + }, + true, + }, + } + + for _, testCase := range testCases { + suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { + testCase.malleate() + + votes, err := queryClient.Votes(gocontext.Background(), req) + + if testCase.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expRes.GetVotes(), votes.GetVotes()) + } else { + suite.Require().Error(err) + suite.Require().Nil(votes) + } + }) + } +} + +func (suite *KeeperTestSuite) TestGRPCQueryParams() { + queryClient := suite.queryClient + + var ( + req *types.QueryParamsRequest + expRes *types.QueryParamsResponse + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty request", + func() { + req = &types.QueryParamsRequest{} + }, + false, + }, + { + "deposit params request", + func() { + req = &types.QueryParamsRequest{ParamsType: types.ParamDeposit} + expRes = &types.QueryParamsResponse{ + DepositParams: types.DefaultDepositParams(), + TallyParams: types.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)), + } + }, + true, + }, + { + "voting params request", + func() { + req = &types.QueryParamsRequest{ParamsType: types.ParamVoting} + expRes = &types.QueryParamsResponse{ + VotingParams: types.DefaultVotingParams(), + TallyParams: types.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)), + } + }, + true, + }, + { + "tally params request", + func() { + req = &types.QueryParamsRequest{ParamsType: types.ParamTallying} + expRes = &types.QueryParamsResponse{ + TallyParams: types.DefaultTallyParams(), + } + }, + true, + }, + { + "invalid request", + func() { + req = &types.QueryParamsRequest{ParamsType: "wrongPath"} + expRes = &types.QueryParamsResponse{} + }, + false, + }, + } + + for _, testCase := range testCases { + suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { + testCase.malleate() + + params, err := queryClient.Params(gocontext.Background(), req) + + if testCase.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expRes.GetDepositParams(), params.GetDepositParams()) + suite.Require().Equal(expRes.GetVotingParams(), params.GetVotingParams()) + suite.Require().Equal(expRes.GetTallyParams(), params.GetTallyParams()) + } else { + suite.Require().Error(err) + suite.Require().Nil(params) + } + }) + } +} + +func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { + app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs + + var ( + req *types.QueryDepositRequest + expRes *types.QueryDepositResponse + proposal types.Proposal + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty request", + func() { + req = &types.QueryDepositRequest{} + }, + false, + }, + { + "zero proposal id request", + func() { + req = &types.QueryDepositRequest{ + ProposalId: 0, + Depositor: addrs[0], + } + }, + false, + }, + { + "empty deposit address request", + func() { + req = &types.QueryDepositRequest{ + ProposalId: 1, + Depositor: nil, + } + }, + false, + }, + { + "non existed proposal", + func() { + req = &types.QueryDepositRequest{ + ProposalId: 2, + Depositor: addrs[0], + } + }, + false, + }, + { + "no deposits proposal", + func() { + var err error + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + suite.Require().NoError(err) + suite.Require().NotNil(proposal) + + req = &types.QueryDepositRequest{ + ProposalId: proposal.ProposalID, + Depositor: addrs[0], + } + }, + false, + }, + { + "valid request", + func() { + depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(20))) + deposit := types.NewDeposit(proposal.ProposalID, addrs[0], depositCoins) + app.GovKeeper.SetDeposit(ctx, deposit) + + req = &types.QueryDepositRequest{ + ProposalId: proposal.ProposalID, + Depositor: addrs[0], + } + + expRes = &types.QueryDepositResponse{Deposit: deposit} + }, + true, + }, + } + + for _, testCase := range testCases { + suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { + testCase.malleate() + + deposit, err := queryClient.Deposit(gocontext.Background(), req) + + if testCase.expPass { + suite.Require().NoError(err) + suite.Require().Equal(deposit.GetDeposit(), expRes.GetDeposit()) + } else { + suite.Require().Error(err) + suite.Require().Nil(expRes) + } + }) + } +} + +func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { + app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs + + var ( + req *types.QueryDepositsRequest + expRes *types.QueryDepositsResponse + proposal types.Proposal + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty request", + func() { + req = &types.QueryDepositsRequest{} + }, + false, + }, + { + "zero proposal id request", + func() { + req = &types.QueryDepositsRequest{ + ProposalId: 0, + } + }, + false, + }, + { + "non existed proposal", + func() { + req = &types.QueryDepositsRequest{ + ProposalId: 2, + } + }, + true, + }, + { + "create a proposal and get deposits", + func() { + var err error + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + suite.Require().NoError(err) + + req = &types.QueryDepositsRequest{ + ProposalId: proposal.ProposalID, + } + }, + true, + }, + { + "get deposits with default limit", + func() { + depositAmount1 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(20))) + deposit1 := types.NewDeposit(proposal.ProposalID, addrs[0], depositAmount1) + app.GovKeeper.SetDeposit(ctx, deposit1) + + depositAmount2 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(30))) + deposit2 := types.NewDeposit(proposal.ProposalID, addrs[1], depositAmount2) + app.GovKeeper.SetDeposit(ctx, deposit2) + + deposits := types.Deposits{deposit1, deposit2} + + req = &types.QueryDepositsRequest{ + ProposalId: proposal.ProposalID, + } + + expRes = &types.QueryDepositsResponse{ + Deposits: deposits, + } + }, + true, + }, + } + + for _, testCase := range testCases { + suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { + testCase.malleate() + + deposits, err := queryClient.Deposits(gocontext.Background(), req) + + if testCase.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expRes.GetDeposits(), deposits.GetDeposits()) + } else { + suite.Require().Error(err) + suite.Require().Nil(deposits) + } + }) + } +} + +func (suite *KeeperTestSuite) TestGRPCQueryTally() { + app, ctx, queryClient := suite.app, suite.ctx, suite.queryClient + + addrs, _ := createValidators(ctx, app, []int64{5, 5, 5}) + + var ( + req *types.QueryTallyResultRequest + expRes *types.QueryTallyResultResponse + proposal types.Proposal + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty request", + func() { + req = &types.QueryTallyResultRequest{} + }, + false, + }, + { + "zero proposal id request", + func() { + req = &types.QueryTallyResultRequest{ProposalId: 0} + }, + false, + }, + { + "query non existed proposal", + func() { + req = &types.QueryTallyResultRequest{ProposalId: 1} + }, + false, + }, + { + "create a proposal and get tally", + func() { + var err error + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + suite.Require().NoError(err) + suite.Require().NotNil(proposal) + + req = &types.QueryTallyResultRequest{ProposalId: proposal.ProposalID} + + expRes = &types.QueryTallyResultResponse{ + Tally: types.EmptyTallyResult(), + } + }, + true, + }, + { + "request tally after few votes", + func() { + proposal.Status = types.StatusVotingPeriod + app.GovKeeper.SetProposal(ctx, proposal) + + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalID, addrs[0], types.OptionYes)) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalID, addrs[1], types.OptionYes)) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalID, addrs[2], types.OptionYes)) + + req = &types.QueryTallyResultRequest{ProposalId: proposal.ProposalID} + + expRes = &types.QueryTallyResultResponse{ + Tally: types.TallyResult{ + Yes: sdk.NewInt(3 * 5 * 1000000), + }, + } + }, + true, + }, + { + "request final tally after status changed", + func() { + proposal.Status = types.StatusPassed + app.GovKeeper.SetProposal(ctx, proposal) + proposal, _ = app.GovKeeper.GetProposal(ctx, proposal.ProposalID) + + req = &types.QueryTallyResultRequest{ProposalId: proposal.ProposalID} + + expRes = &types.QueryTallyResultResponse{ + Tally: proposal.FinalTallyResult, + } + }, + true, + }, + } + + for _, testCase := range testCases { + suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { + testCase.malleate() + + tally, err := queryClient.TallyResult(gocontext.Background(), req) + + if testCase.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expRes.String(), tally.String()) + } else { + suite.Require().Error(err) + suite.Require().Nil(tally) + } + }) + } +} diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index 3e367226478a..3c3d63f82801 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -4,12 +4,38 @@ import ( "testing" "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" ) +type KeeperTestSuite struct { + suite.Suite + + app *simapp.SimApp + ctx sdk.Context + queryClient types.QueryClient + addrs []sdk.AccAddress +} + +func (suite *KeeperTestSuite) SetupTest() { + app := simapp.Setup(false) + ctx := app.BaseApp.NewContext(false, abci.Header{}) + + queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) + types.RegisterQueryServer(queryHelper, app.GovKeeper) + queryClient := types.NewQueryClient(queryHelper) + + suite.app = app + suite.ctx = ctx + suite.queryClient = queryClient + suite.addrs = simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(30000000)) +} + func TestIncrementProposalNumber(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) @@ -60,3 +86,7 @@ func TestProposalQueues(t *testing.T) { activeIterator.Close() } + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} diff --git a/x/gov/module.go b/x/gov/module.go index cc5b179511ed..27593ee6072a 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -150,7 +150,9 @@ func (am AppModule) NewQuerierHandler() sdk.Querier { return keeper.NewQuerier(am.keeper) } -func (am AppModule) RegisterQueryService(grpc.Server) {} +func (am AppModule) RegisterQueryService(server grpc.Server) { + types.RegisterQueryServer(server, am.keeper) +} // InitGenesis performs genesis initialization for the gov module. It returns // no validator updates. diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index 2bec81b30b98..6e0d3ec8b92a 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -12,6 +12,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/duration" _ "github.com/golang/protobuf/ptypes/timestamp" _ "github.com/regen-network/cosmos-proto" io "io" @@ -429,6 +430,126 @@ func (m *Vote) XXX_DiscardUnknown() { var xxx_messageInfo_Vote proto.InternalMessageInfo +// DepositParams defines the params around deposits for governance +type DepositParams struct { + // Minimum deposit for a proposal to enter voting period. + MinDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"min_deposit,omitempty" yaml:"min_deposit"` + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. + MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty" yaml:"max_deposit_period"` +} + +func (m *DepositParams) Reset() { *m = DepositParams{} } +func (*DepositParams) ProtoMessage() {} +func (*DepositParams) Descriptor() ([]byte, []int) { + return fileDescriptor_67fb57f9a603bed5, []int{8} +} +func (m *DepositParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DepositParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DepositParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_DepositParams.Merge(m, src) +} +func (m *DepositParams) XXX_Size() int { + return m.Size() +} +func (m *DepositParams) XXX_DiscardUnknown() { + xxx_messageInfo_DepositParams.DiscardUnknown(m) +} + +var xxx_messageInfo_DepositParams proto.InternalMessageInfo + +// VotingParams defines the params around Voting in governance +type VotingParams struct { + // Length of the voting period. + VotingPeriod time.Duration `protobuf:"bytes,1,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty" yaml:"voting_period"` +} + +func (m *VotingParams) Reset() { *m = VotingParams{} } +func (*VotingParams) ProtoMessage() {} +func (*VotingParams) Descriptor() ([]byte, []int) { + return fileDescriptor_67fb57f9a603bed5, []int{9} +} +func (m *VotingParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VotingParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VotingParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_VotingParams.Merge(m, src) +} +func (m *VotingParams) XXX_Size() int { + return m.Size() +} +func (m *VotingParams) XXX_DiscardUnknown() { + xxx_messageInfo_VotingParams.DiscardUnknown(m) +} + +var xxx_messageInfo_VotingParams proto.InternalMessageInfo + +// TallyParams defines the params around Tallying votes in governance +type TallyParams struct { + // Minimum percentage of total stake needed to vote for a result to be considered valid. + Quorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=quorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quorum,omitempty"` + // Minimum proportion of Yes votes for proposal to pass. Initial value: 0.5. + Threshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=threshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"threshold,omitempty"` + // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3. + Veto github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=veto,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"veto,omitempty"` +} + +func (m *TallyParams) Reset() { *m = TallyParams{} } +func (*TallyParams) ProtoMessage() {} +func (*TallyParams) Descriptor() ([]byte, []int) { + return fileDescriptor_67fb57f9a603bed5, []int{10} +} +func (m *TallyParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TallyParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TallyParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_TallyParams.Merge(m, src) +} +func (m *TallyParams) XXX_Size() int { + return m.Size() +} +func (m *TallyParams) XXX_DiscardUnknown() { + xxx_messageInfo_TallyParams.DiscardUnknown(m) +} + +var xxx_messageInfo_TallyParams proto.InternalMessageInfo + func init() { proto.RegisterEnum("cosmos.gov.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos.gov.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -440,90 +561,107 @@ func init() { proto.RegisterType((*Proposal)(nil), "cosmos.gov.Proposal") proto.RegisterType((*TallyResult)(nil), "cosmos.gov.TallyResult") proto.RegisterType((*Vote)(nil), "cosmos.gov.Vote") + proto.RegisterType((*DepositParams)(nil), "cosmos.gov.DepositParams") + proto.RegisterType((*VotingParams)(nil), "cosmos.gov.VotingParams") + proto.RegisterType((*TallyParams)(nil), "cosmos.gov.TallyParams") } func init() { proto.RegisterFile("cosmos/gov/gov.proto", fileDescriptor_67fb57f9a603bed5) } var fileDescriptor_67fb57f9a603bed5 = []byte{ - // 1247 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x6e, 0x7e, 0x3f, 0x3b, 0xc9, 0x76, 0x12, 0x25, 0xee, 0x22, 0xd6, 0x5b, 0x53, 0xa1, - 0xa8, 0x6a, 0x9d, 0x92, 0x9e, 0x28, 0x12, 0xc2, 0x8e, 0xb7, 0xad, 0xab, 0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8, 0x3e, - 0xae, 0xa3, 0x8b, 0x90, 0x1c, 0x47, 0x9b, 0xc6, 0x75, 0x63, 0xdb, 0x32, 0xf2, 0xca, 0xb4, 0x8a, - 0x7a, 0x7d, 0x7d, 0x89, 0xe3, 0x4d, 0xfc, 0x2e, 0xae, 0x51, 0x7c, 0xa2, 0xfe, 0x95, 0x6c, 0xe1, - 0x86, 0x91, 0x57, 0x66, 0xa2, 0xfa, 0x57, 0x1c, 0xb7, 0x89, 0xeb, 0xa3, 0xb6, 0xe6, 0x8a, 0x87, - 0x8f, 0xb5, 0xd8, 0xc3, 0xc7, 0x5a, 0xec, 0xc3, 0x23, 0x2d, 0x76, 0x78, 0xa4, 0x49, 0x0f, 0x8e, - 0x34, 0xe9, 0xc7, 0x23, 0x4d, 0xba, 0xf7, 0x44, 0x8b, 0x3d, 0x78, 0xa2, 0xc5, 0x1e, 0x3e, 0xd1, - 0x62, 0x6f, 0xff, 0xf9, 0x6c, 0xbe, 0xcb, 0xfe, 0x51, 0x62, 0xfd, 0xbd, 0x3b, 0xcb, 0xc6, 0xdf, - 0xa5, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xa5, 0x92, 0x7f, 0x43, 0x0d, 0x00, 0x00, + // 1468 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcf, 0x6b, 0x1b, 0xd7, + 0x16, 0xd6, 0xc8, 0xbf, 0x8f, 0x64, 0x7b, 0x72, 0xed, 0x67, 0x2b, 0xf3, 0xde, 0x9b, 0x51, 0xf4, + 0xc2, 0xc3, 0x84, 0x44, 0xce, 0x73, 0x56, 0x2f, 0x81, 0x47, 0x24, 0x6b, 0x92, 0x28, 0xc4, 0x92, + 0x18, 0x4d, 0x14, 0x92, 0xb7, 0x18, 0xc6, 0xd2, 0x44, 0x9e, 0x56, 0x33, 0x57, 0xd5, 0x5c, 0xb9, + 0x36, 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, 0x0c, 0x9c, 0xd2, 0x38, 0x0b, 0xda, 0x02, 0x74, 0xdf, 0x76, 0xcd, 0x86, 0x41, 0xcc, 0x46, + 0x63, 0xd7, 0x68, 0x59, 0x5e, 0xbb, 0x41, 0x12, 0xe3, 0xb4, 0xae, 0xe5, 0x30, 0xb7, 0xee, 0x9f, + 0x6b, 0xf4, 0x38, 0x7b, 0x86, 0xef, 0xc4, 0xd3, 0x8c, 0xfc, 0x28, 0x41, 0x4a, 0x13, 0x69, 0x30, + 0x04, 0x42, 0xff, 0x87, 0x98, 0x47, 0xf7, 0xb7, 0xe1, 0x3f, 0x18, 0x12, 0x13, 0xf4, 0x0a, 0xe9, + 0x48, 0xeb, 0x7a, 0xf0, 0xd4, 0xc8, 0xca, 0xfc, 0x16, 0x3e, 0x4f, 0x21, 0x70, 0xea, 0xd1, 0x33, + 0x45, 0xd0, 0x80, 0x45, 0x7c, 0x00, 0xb2, 0x41, 0xe4, 0xf3, 0x60, 0x58, 0x6e, 0x8d, 0xdd, 0x30, + 0x79, 0xe2, 0x0d, 0xff, 0xe2, 0x37, 0x2c, 0xb3, 0x1b, 0x86, 0x19, 0xd8, 0x35, 0x73, 0x3c, 0xac, + 0xba, 0x35, 0x7a, 0xd5, 0x03, 0x98, 0x25, 0x98, 0x84, 0x9e, 0x1a, 0x53, 0xc7, 0x0c, 0xdd, 0x0d, + 0xce, 0xbc, 0xc8, 0x98, 0x07, 0x00, 0xa3, 0x3d, 0x33, 0xe2, 0x14, 0x1b, 0x58, 0xb0, 0x01, 0xa7, + 0xb6, 0x31, 0xb1, 0xdd, 0xba, 0xff, 0x43, 0xb6, 0xb8, 0x94, 0xd3, 0x27, 0x36, 0x7a, 0x96, 0x97, + 0x93, 0x60, 0xe5, 0x1c, 0xa1, 0x60, 0x9d, 0xce, 0xb3, 0x78, 0xd9, 0x0f, 0xd3, 0x56, 0xef, 0x03, + 0x0f, 0xf5, 0x45, 0x9d, 0x39, 0xf1, 0xae, 0xd4, 0xe0,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, 0xca, 0x94, 0xcb, 0x6a, + 0x4e, 0x1c, 0x93, 0xc4, 0x4e, 0x37, 0x19, 0x67, 0x98, 0x92, 0xe9, 0x79, 0x56, 0x0d, 0x5d, 0x84, + 0xc4, 0x70, 0xb6, 0xa6, 0xde, 0x54, 0xd7, 0x75, 0x35, 0x27, 0x8e, 0x4b, 0xa8, 0xd3, 0x4d, 0xce, + 0xb1, 0x7c, 0xcd, 0x7a, 0xcd, 0xaa, 0x12, 0xeb, 0x58, 0xfe, 0x6b, 0x99, 0xfc, 0x2d, 0x35, 0x27, + 0x4e, 0x84, 0xf9, 0xaf, 0x99, 0x76, 0xc3, 0xaa, 0x0d, 0xca, 0x9a, 0x2d, 0xec, 0x3d, 0x97, 0x23, + 0x4f, 0x9f, 0xcb, 0x91, 0xb7, 0xf6, 0xe5, 0xc8, 0xde, 0xbe, 0x2c, 0x3c, 0xd9, 0x97, 0x85, 0x6f, + 0xf7, 0x65, 0xe1, 0xd1, 0x0b, 0x39, 0xf2, 0xe4, 0x85, 0x1c, 0x79, 0xfa, 0x42, 0x8e, 0xdc, 0xfb, + 0xe5, 0x4d, 0xb7, 0x43, 0xff, 0x62, 0x40, 0x67, 0x76, 0x73, 0x92, 0x2e, 0x87, 0x4b, 0x3f, 0x07, + 0x00, 0x00, 0xff, 0xff, 0xc6, 0x9e, 0x45, 0x50, 0x4c, 0x10, 0x00, 0x00, } func (this *MsgSubmitProposal) Equal(that interface{}) bool { @@ -1239,6 +1377,135 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DepositParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DepositParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n8, err8 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxDepositPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintGov(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x12 + if len(m.MinDeposit) > 0 { + for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *VotingParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VotingParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n9, err9 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.VotingPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintGov(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *TallyParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TallyParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Veto.Size() + i -= size + if _, err := m.Veto.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.Threshold.Size() + i -= size + if _, err := m.Threshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Quorum.Size() + i -= size + if _, err := m.Quorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintGov(dAtA []byte, offset int, v uint64) int { offset -= sovGov(v) base := offset @@ -1424,6 +1691,49 @@ func (m *Vote) Size() (n int) { return n } +func (m *DepositParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MinDeposit) > 0 { + for _, e := range m.MinDeposit { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod) + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *VotingParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod) + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *TallyParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Quorum.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.Threshold.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.Veto.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + func sovGov(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2749,6 +3059,364 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } return nil } +func (m *DepositParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DepositParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DepositParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinDeposit = append(m.MinDeposit, types1.Coin{}) + if err := m.MinDeposit[len(m.MinDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDepositPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VotingParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VotingParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VotingParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TallyParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TallyParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TallyParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Quorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Threshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Veto", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Veto.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGov(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/params.go b/x/gov/types/params.go index 087e17217237..3321e3e40a0e 100644 --- a/x/gov/types/params.go +++ b/x/gov/types/params.go @@ -39,12 +39,6 @@ func ParamKeyTable() paramtypes.KeyTable { ) } -// DepositParams defines the params around deposits for governance -type DepositParams struct { - MinDeposit sdk.Coins `json:"min_deposit,omitempty" yaml:"min_deposit,omitempty"` // Minimum deposit for a proposal to enter voting period. - MaxDepositPeriod time.Duration `json:"max_deposit_period,omitempty" yaml:"max_deposit_period,omitempty"` // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months -} - // NewDepositParams creates a new DepositParams object func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) DepositParams { return DepositParams{ @@ -88,13 +82,6 @@ func validateDepositParams(i interface{}) error { return nil } -// TallyParams defines the params around Tallying votes in governance -type TallyParams struct { - Quorum sdk.Dec `json:"quorum,omitempty" yaml:"quorum,omitempty"` // Minimum percentage of total stake needed to vote for a result to be considered valid - Threshold sdk.Dec `json:"threshold,omitempty" yaml:"threshold,omitempty"` // Minimum proportion of Yes votes for proposal to pass. Initial value: 0.5 - Veto sdk.Dec `json:"veto,omitempty" yaml:"veto,omitempty"` // Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Initial value: 1/3 -} - // NewTallyParams creates a new TallyParams object func NewTallyParams(quorum, threshold, veto sdk.Dec) TallyParams { return TallyParams{ @@ -148,11 +135,6 @@ func validateTallyParams(i interface{}) error { return nil } -// VotingParams defines the params around Voting in governance -type VotingParams struct { - VotingPeriod time.Duration `json:"voting_period,omitempty" yaml:"voting_period,omitempty"` // Length of the voting period. -} - // NewVotingParams creates a new VotingParams object func NewVotingParams(votingPeriod time.Duration) VotingParams { return VotingParams{ diff --git a/x/gov/types/query.pb.go b/x/gov/types/query.pb.go new file mode 100644 index 000000000000..a3aa67de42ea --- /dev/null +++ b/x/gov/types/query.pb.go @@ -0,0 +1,3945 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/query.proto + +package types + +import ( + context "context" + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + grpc1 "github.com/gogo/protobuf/grpc" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryProposalRequest is the request type for the Query/Proposal RPC method +type QueryProposalRequest struct { + // unique id of the proposal + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *QueryProposalRequest) Reset() { *m = QueryProposalRequest{} } +func (m *QueryProposalRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposalRequest) ProtoMessage() {} +func (*QueryProposalRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{0} +} +func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposalRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalRequest.Merge(m, src) +} +func (m *QueryProposalRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalRequest proto.InternalMessageInfo + +func (m *QueryProposalRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method +type QueryProposalResponse struct { + Proposal Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"` +} + +func (m *QueryProposalResponse) Reset() { *m = QueryProposalResponse{} } +func (m *QueryProposalResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposalResponse) ProtoMessage() {} +func (*QueryProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{1} +} +func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalResponse.Merge(m, src) +} +func (m *QueryProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalResponse proto.InternalMessageInfo + +func (m *QueryProposalResponse) GetProposal() Proposal { + if m != nil { + return m.Proposal + } + return Proposal{} +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method +type QueryProposalsRequest struct { + // status of the proposals. + ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.ProposalStatus" json:"proposal_status,omitempty"` + // Voter address for the proposals. + Voter github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=voter,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"voter,omitempty"` + // Deposit addresses from the proposals. + Depositor github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=depositor,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"depositor,omitempty"` + Req *query.PageRequest `protobuf:"bytes,4,opt,name=req,proto3" json:"req,omitempty"` +} + +func (m *QueryProposalsRequest) Reset() { *m = QueryProposalsRequest{} } +func (m *QueryProposalsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposalsRequest) ProtoMessage() {} +func (*QueryProposalsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{2} +} +func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposalsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalsRequest.Merge(m, src) +} +func (m *QueryProposalsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalsRequest proto.InternalMessageInfo + +func (m *QueryProposalsRequest) GetProposalStatus() ProposalStatus { + if m != nil { + return m.ProposalStatus + } + return StatusNil +} + +func (m *QueryProposalsRequest) GetVoter() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Voter + } + return nil +} + +func (m *QueryProposalsRequest) GetDepositor() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Depositor + } + return nil +} + +func (m *QueryProposalsRequest) GetReq() *query.PageRequest { + if m != nil { + return m.Req + } + return nil +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC method +type QueryProposalsResponse struct { + Proposals []Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals"` + Res *query.PageResponse `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` +} + +func (m *QueryProposalsResponse) Reset() { *m = QueryProposalsResponse{} } +func (m *QueryProposalsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposalsResponse) ProtoMessage() {} +func (*QueryProposalsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{3} +} +func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposalsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalsResponse.Merge(m, src) +} +func (m *QueryProposalsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalsResponse proto.InternalMessageInfo + +func (m *QueryProposalsResponse) GetProposals() []Proposal { + if m != nil { + return m.Proposals + } + return nil +} + +func (m *QueryProposalsResponse) GetRes() *query.PageResponse { + if m != nil { + return m.Res + } + return nil +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method +type QueryVoteRequest struct { + // unique id of the proposal + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // Voter address for the proposals. + Voter github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=voter,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"voter,omitempty"` +} + +func (m *QueryVoteRequest) Reset() { *m = QueryVoteRequest{} } +func (m *QueryVoteRequest) String() string { return proto.CompactTextString(m) } +func (*QueryVoteRequest) ProtoMessage() {} +func (*QueryVoteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{4} +} +func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVoteRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryVoteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVoteRequest.Merge(m, src) +} +func (m *QueryVoteRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryVoteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVoteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVoteRequest proto.InternalMessageInfo + +func (m *QueryVoteRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryVoteRequest) GetVoter() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Voter + } + return nil +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method +type QueryVoteResponse struct { + Vote Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"` +} + +func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} } +func (m *QueryVoteResponse) String() string { return proto.CompactTextString(m) } +func (*QueryVoteResponse) ProtoMessage() {} +func (*QueryVoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{5} +} +func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVoteResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVoteResponse.Merge(m, src) +} +func (m *QueryVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVoteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo + +func (m *QueryVoteResponse) GetVote() Vote { + if m != nil { + return m.Vote + } + return Vote{} +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method +type QueryVotesRequest struct { + // unique id of the proposal + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + Req *query.PageRequest `protobuf:"bytes,2,opt,name=req,proto3" json:"req,omitempty"` +} + +func (m *QueryVotesRequest) Reset() { *m = QueryVotesRequest{} } +func (m *QueryVotesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryVotesRequest) ProtoMessage() {} +func (*QueryVotesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{6} +} +func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVotesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryVotesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVotesRequest.Merge(m, src) +} +func (m *QueryVotesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryVotesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVotesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVotesRequest proto.InternalMessageInfo + +func (m *QueryVotesRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryVotesRequest) GetReq() *query.PageRequest { + if m != nil { + return m.Req + } + return nil +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method +type QueryVotesResponse struct { + Votes []Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"` + Res *query.PageResponse `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` +} + +func (m *QueryVotesResponse) Reset() { *m = QueryVotesResponse{} } +func (m *QueryVotesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryVotesResponse) ProtoMessage() {} +func (*QueryVotesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{7} +} +func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVotesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryVotesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVotesResponse.Merge(m, src) +} +func (m *QueryVotesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryVotesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVotesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVotesResponse proto.InternalMessageInfo + +func (m *QueryVotesResponse) GetVotes() []Vote { + if m != nil { + return m.Votes + } + return nil +} + +func (m *QueryVotesResponse) GetRes() *query.PageResponse { + if m != nil { + return m.Res + } + return nil +} + +// QueryParamsRequest is the request type for the Query/Params RPC method +type QueryParamsRequest struct { + ParamsType string `protobuf:"bytes,1,opt,name=params_type,json=paramsType,proto3" json:"params_type,omitempty"` +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{8} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +func (m *QueryParamsRequest) GetParamsType() string { + if m != nil { + return m.ParamsType + } + return "" +} + +// QueryParamsResponse is the response type for the Query/Params RPC method +type QueryParamsResponse struct { + VotingParams VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` + DepositParams DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` + TallyParams TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{9} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetVotingParams() VotingParams { + if m != nil { + return m.VotingParams + } + return VotingParams{} +} + +func (m *QueryParamsResponse) GetDepositParams() DepositParams { + if m != nil { + return m.DepositParams + } + return DepositParams{} +} + +func (m *QueryParamsResponse) GetTallyParams() TallyParams { + if m != nil { + return m.TallyParams + } + return TallyParams{} +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method +type QueryDepositRequest struct { + // unique id of the proposal + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // Deposit addresses from the proposals. + Depositor github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=depositor,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"depositor,omitempty"` +} + +func (m *QueryDepositRequest) Reset() { *m = QueryDepositRequest{} } +func (m *QueryDepositRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDepositRequest) ProtoMessage() {} +func (*QueryDepositRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{10} +} +func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDepositRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositRequest.Merge(m, src) +} +func (m *QueryDepositRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositRequest proto.InternalMessageInfo + +func (m *QueryDepositRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryDepositRequest) GetDepositor() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Depositor + } + return nil +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method +type QueryDepositResponse struct { + Deposit Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit"` +} + +func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } +func (m *QueryDepositResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDepositResponse) ProtoMessage() {} +func (*QueryDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{11} +} +func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositResponse.Merge(m, src) +} +func (m *QueryDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo + +func (m *QueryDepositResponse) GetDeposit() Deposit { + if m != nil { + return m.Deposit + } + return Deposit{} +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method +type QueryDepositsRequest struct { + // unique id of the proposal + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + Req *query.PageRequest `protobuf:"bytes,2,opt,name=req,proto3" json:"req,omitempty"` +} + +func (m *QueryDepositsRequest) Reset() { *m = QueryDepositsRequest{} } +func (m *QueryDepositsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDepositsRequest) ProtoMessage() {} +func (*QueryDepositsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{12} +} +func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDepositsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositsRequest.Merge(m, src) +} +func (m *QueryDepositsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositsRequest proto.InternalMessageInfo + +func (m *QueryDepositsRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryDepositsRequest) GetReq() *query.PageRequest { + if m != nil { + return m.Req + } + return nil +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method +type QueryDepositsResponse struct { + Deposits []Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits"` + Res *query.PageResponse `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` +} + +func (m *QueryDepositsResponse) Reset() { *m = QueryDepositsResponse{} } +func (m *QueryDepositsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDepositsResponse) ProtoMessage() {} +func (*QueryDepositsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{13} +} +func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDepositsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositsResponse.Merge(m, src) +} +func (m *QueryDepositsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositsResponse proto.InternalMessageInfo + +func (m *QueryDepositsResponse) GetDeposits() []Deposit { + if m != nil { + return m.Deposits + } + return nil +} + +func (m *QueryDepositsResponse) GetRes() *query.PageResponse { + if m != nil { + return m.Res + } + return nil +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method +type QueryTallyResultRequest struct { + // unique id of the proposal + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *QueryTallyResultRequest) Reset() { *m = QueryTallyResultRequest{} } +func (m *QueryTallyResultRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTallyResultRequest) ProtoMessage() {} +func (*QueryTallyResultRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{14} +} +func (m *QueryTallyResultRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTallyResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTallyResultRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTallyResultRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTallyResultRequest.Merge(m, src) +} +func (m *QueryTallyResultRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTallyResultRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTallyResultRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTallyResultRequest proto.InternalMessageInfo + +func (m *QueryTallyResultRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method +type QueryTallyResultResponse struct { + Tally TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally"` +} + +func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultResponse{} } +func (m *QueryTallyResultResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTallyResultResponse) ProtoMessage() {} +func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6efb1c1bc2595eda, []int{15} +} +func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTallyResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTallyResultResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTallyResultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTallyResultResponse.Merge(m, src) +} +func (m *QueryTallyResultResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTallyResultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTallyResultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTallyResultResponse proto.InternalMessageInfo + +func (m *QueryTallyResultResponse) GetTally() TallyResult { + if m != nil { + return m.Tally + } + return TallyResult{} +} + +func init() { + proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.QueryProposalRequest") + proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.QueryProposalResponse") + proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.QueryProposalsRequest") + proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.QueryProposalsResponse") + proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.QueryVoteRequest") + proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.QueryVoteResponse") + proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.QueryVotesRequest") + proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.QueryVotesResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.QueryParamsResponse") + proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.QueryDepositRequest") + proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.QueryDepositResponse") + proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.QueryDepositsRequest") + proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.QueryDepositsResponse") + proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.QueryTallyResultRequest") + proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.QueryTallyResultResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/query.proto", fileDescriptor_6efb1c1bc2595eda) } + +var fileDescriptor_6efb1c1bc2595eda = []byte{ + // 807 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4b, 0x4f, 0x13, 0x51, + 0x14, 0xee, 0xf4, 0x01, 0xed, 0x29, 0x20, 0x5e, 0x10, 0xea, 0x44, 0xda, 0x3a, 0xba, 0x20, 0x0a, + 0x6d, 0x84, 0xa0, 0xc6, 0x8d, 0x52, 0x7c, 0x86, 0x44, 0x60, 0x24, 0x2e, 0xd8, 0x90, 0xa1, 0x33, + 0x19, 0x1b, 0x4b, 0xef, 0x30, 0xf7, 0xb6, 0xb1, 0x09, 0x0b, 0x77, 0xae, 0x4c, 0xfc, 0x0f, 0xfe, + 0x19, 0x96, 0x2c, 0x5d, 0x11, 0x03, 0xfe, 0x0a, 0x57, 0x66, 0xee, 0x63, 0x3a, 0xd3, 0xe9, 0xd4, + 0xe2, 0x63, 0x45, 0x39, 0xf7, 0x3b, 0xdf, 0xfd, 0xce, 0x77, 0xce, 0x3d, 0x2d, 0xcc, 0xd5, 0x31, + 0x39, 0xc4,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0xdd, 0x80, + 0xc9, 0x0e, 0xa6, 0x8d, 0x96, 0xbd, 0xcf, 0xc1, 0xc2, 0xd8, 0x42, 0x9f, 0xe4, 0x46, 0xcb, 0xe6, + 0x89, 0x42, 0xfa, 0x44, 0x27, 0x10, 0x43, 0xcf, 0x61, 0x4a, 0x0c, 0xb9, 0x64, 0xe9, 0x73, 0xcf, + 0x63, 0x79, 0xca, 0x11, 0x21, 0x9a, 0x49, 0x33, 0x18, 0x44, 0x4f, 0x60, 0x82, 0x1a, 0xcd, 0x66, + 0x57, 0xb2, 0xa4, 0x18, 0xcb, 0x7c, 0x90, 0x65, 0xd7, 0x3b, 0x0f, 0x71, 0xe4, 0x69, 0x2f, 0xa4, + 0x7d, 0x92, 0x65, 0x8a, 0xdb, 0x46, 0xee, 0x7a, 0xe8, 0xad, 0x27, 0xff, 0xfe, 0xad, 0x6b, 0x9b, + 0x62, 0xdd, 0xfa, 0x42, 0x84, 0xe1, 0xab, 0x30, 0x2e, 0x40, 0xc2, 0xea, 0x99, 0x01, 0x26, 0x89, + 0xd2, 0x24, 0x52, 0x33, 0xc3, 0x64, 0xff, 0x69, 0x98, 0x8f, 0xc5, 0x5a, 0xee, 0xdd, 0x22, 0x34, + 0xaf, 0x41, 0x56, 0x28, 0x91, 0x23, 0x3d, 0x44, 0xb4, 0x0f, 0xbd, 0xe4, 0x60, 0x3f, 0x82, 0x79, + 0x76, 0x3b, 0xeb, 0xb0, 0x6e, 0x91, 0x76, 0x93, 0x5e, 0xe2, 0x2b, 0xaa, 0x10, 0xcd, 0xf5, 0x0d, + 0xcf, 0xb0, 0x09, 0x11, 0x76, 0x47, 0xa7, 0x89, 0xe3, 0xe5, 0x9b, 0x64, 0xd8, 0x95, 0xcf, 0x19, + 0xc8, 0x30, 0x46, 0xb4, 0x03, 0x59, 0xb9, 0x4e, 0x51, 0x39, 0x98, 0x3b, 0xe8, 0xcb, 0x54, 0xbd, + 0x39, 0x04, 0xc1, 0xf5, 0x68, 0x09, 0xb4, 0x0b, 0x39, 0x7f, 0xa7, 0xa3, 0xf8, 0x0c, 0xd9, 0x65, + 0x55, 0x1b, 0x06, 0xf1, 0x59, 0x9f, 0x41, 0xda, 0xdb, 0x2d, 0xe8, 0x46, 0x04, 0x1d, 0x58, 0xdf, + 0xea, 0x42, 0xcc, 0xa9, 0x4f, 0xf3, 0x12, 0x32, 0x6c, 0x99, 0xa1, 0xc1, 0x48, 0x5f, 0x54, 0x31, + 0xee, 0xd8, 0x67, 0xda, 0x84, 0x31, 0xf1, 0xae, 0xa3, 0xd8, 0xd0, 0xf6, 0x52, 0x4b, 0xb1, 0xe7, + 0x3e, 0xd9, 0x6b, 0x18, 0x17, 0x63, 0x86, 0xa2, 0xe8, 0xf0, 0x63, 0x57, 0xcb, 0xf1, 0x00, 0x9f, + 0x6f, 0x07, 0xb2, 0x72, 0xcc, 0x51, 0x2c, 0x9e, 0xc4, 0xb7, 0xb5, 0xff, 0x8d, 0x68, 0x09, 0xb4, + 0x07, 0xf9, 0xc0, 0x3c, 0xa1, 0x5b, 0x91, 0x9c, 0xe8, 0x64, 0xab, 0xb7, 0x87, 0x83, 0x24, 0x77, + 0xad, 0x76, 0x72, 0x5e, 0x54, 0x4e, 0xcf, 0x8b, 0xca, 0xf7, 0xf3, 0xa2, 0xf2, 0xe5, 0xa2, 0x98, + 0x38, 0xbd, 0x28, 0x26, 0xbe, 0x5d, 0x14, 0x13, 0x7b, 0x8b, 0x43, 0x37, 0xd4, 0x07, 0xf6, 0x23, + 0x90, 0xed, 0xa9, 0x83, 0x31, 0xf6, 0x3b, 0x70, 0xf5, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, + 0xc2, 0x0e, 0x6f, 0x78, 0x0a, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#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 params + 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 grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) 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.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.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.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.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.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.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.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.Query/TallyResult", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +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 params + 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) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Proposal(ctx context.Context, req *QueryProposalRequest) (*QueryProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented") +} +func (*UnimplementedQueryServer) Proposals(ctx context.Context, req *QueryProposalsRequest) (*QueryProposalsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposals not implemented") +} +func (*UnimplementedQueryServer) Vote(ctx context.Context, req *QueryVoteRequest) (*QueryVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") +} +func (*UnimplementedQueryServer) Votes(ctx context.Context, req *QueryVotesRequest) (*QueryVotesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Votes not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Deposit(ctx context.Context, req *QueryDepositRequest) (*QueryDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +} +func (*UnimplementedQueryServer) Deposits(ctx context.Context, req *QueryDepositsRequest) (*QueryDepositsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposits not implemented") +} +func (*UnimplementedQueryServer) TallyResult(ctx context.Context, req *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") +} + +func RegisterQueryServer(s grpc1.Server, 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.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.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.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.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.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.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.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.Query/TallyResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.gov.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/query.proto", +} + +func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryProposalsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Req != nil { + { + size, err := m.Req.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x1a + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalStatus != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalStatus)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Res != nil { + { + size, err := m.Res.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Proposals) > 0 { + for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryVoteRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryVoteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryVoteResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryVotesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryVotesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVotesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Req != nil { + { + size, err := m.Req.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryVotesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryVotesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVotesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Res != nil { + { + size, err := m.Res.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Votes) > 0 { + for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ParamsType) > 0 { + i -= len(m.ParamsType) + copy(dAtA[i:], m.ParamsType) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ParamsType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryDepositRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryDepositsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Req != nil { + { + size, err := m.Req.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Res != nil { + { + size, err := m.Res.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Deposits) > 0 { + for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryTallyResultRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTallyResultRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTallyResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryTallyResultResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTallyResultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Tally.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryProposalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Proposal.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryProposalsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalStatus != 0 { + n += 1 + sovQuery(uint64(m.ProposalStatus)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Req != nil { + l = m.Req.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProposalsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Proposals) > 0 { + for _, e := range m.Proposals { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Res != nil { + l = m.Res.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVoteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Vote.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryVotesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + if m.Req != nil { + l = m.Req.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVotesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Votes) > 0 { + for _, e := range m.Votes { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Res != nil { + l = m.Res.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ParamsType) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.VotingParams.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.DepositParams.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.TallyParams.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDepositRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Deposit.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDepositsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + if m.Req != nil { + l = m.Req.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Deposits) > 0 { + for _, e := range m.Deposits { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Res != nil { + l = m.Res.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTallyResultRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryTallyResultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Tally.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalStatus", wireType) + } + m.ProposalStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalStatus |= ProposalStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = append(m.Voter[:0], dAtA[iNdEx:postIndex]...) + if m.Voter == nil { + m.Voter = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Depositor = append(m.Depositor[:0], dAtA[iNdEx:postIndex]...) + if m.Depositor == nil { + m.Depositor = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Req", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Req == nil { + m.Req = &query.PageRequest{} + } + if err := m.Req.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposals = append(m.Proposals, Proposal{}) + if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Res", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Res == nil { + m.Res = &query.PageResponse{} + } + if err := m.Res.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVoteRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVoteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = append(m.Voter[:0], dAtA[iNdEx:postIndex]...) + if m.Voter == nil { + m.Voter = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVotesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVotesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVotesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Req", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Req == nil { + m.Req = &query.PageRequest{} + } + if err := m.Req.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVotesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Votes = append(m.Votes, Vote{}) + if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Res", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Res == nil { + m.Res = &query.PageResponse{} + } + if err := m.Res.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParamsType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ParamsType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDepositRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Depositor = append(m.Depositor[:0], dAtA[iNdEx:postIndex]...) + if m.Depositor == nil { + m.Depositor = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Deposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDepositsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Req", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Req == nil { + m.Req = &query.PageRequest{} + } + if err := m.Req.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDepositsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposits = append(m.Deposits, Deposit{}) + if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Res", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Res == nil { + m.Res = &query.PageResponse{} + } + if err := m.Res.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTallyResultRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTallyResultRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTallyResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTallyResultResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTallyResultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTallyResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tally", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Tally.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +)