diff --git a/.gitignore b/.gitignore index 14e117b3bad6..e3083e55dc26 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,8 @@ client/lcd/keys/* coverage.txt profile.out sim_log_file +x/genutil/config +x/genutil/data # Vagrant .vagrant/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 539f92349e6d..8ee86691c2ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -191,6 +191,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/upgrade) [\#10189](https://github.com/cosmos/cosmos-sdk/issues/10189) Removed potential sources of non-determinism in upgrades * [\#10393](https://github.com/cosmos/cosmos-sdk/pull/10422) Add `MinCommissionRate` param to `x/staking` module. * [#10725](https://github.com/cosmos/cosmos-sdk/pull/10725) populate `ctx.ConsensusParams` for begin/end blockers. +* [#10763](https://github.com/cosmos/cosmos-sdk/pull/10763) modify the fields in `TallyParams` to use `string` instead of `bytes` ### Deprecated diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index d98946bc4198..20217b24628d 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -6165,9 +6165,9 @@ TallyParams defines the params for tallying votes on governance proposals. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `quorum` | [bytes](#bytes) | | Minimum percentage of total stake needed to vote for a result to be considered valid. | -| `threshold` | [bytes](#bytes) | | Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. | -| `veto_threshold` | [bytes](#bytes) | | Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. | +| `quorum` | [string](#string) | | Minimum percentage of total stake needed to vote for a result to be considered valid. | +| `threshold` | [string](#string) | | Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. | +| `veto_threshold` | [string](#string) | | Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. | diff --git a/proto/cosmos/gov/v1beta2/genesis.proto b/proto/cosmos/gov/v1beta2/genesis.proto index edb68877f452..082def6ab26d 100644 --- a/proto/cosmos/gov/v1beta2/genesis.proto +++ b/proto/cosmos/gov/v1beta2/genesis.proto @@ -4,7 +4,7 @@ package cosmos.gov.v1beta2; import "cosmos/gov/v1beta2/gov.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; // GenesisState defines the gov module's genesis state. message GenesisState { diff --git a/proto/cosmos/gov/v1beta2/gov.proto b/proto/cosmos/gov/v1beta2/gov.proto index 9f84ffcf803a..81fc4ebee083 100644 --- a/proto/cosmos/gov/v1beta2/gov.proto +++ b/proto/cosmos/gov/v1beta2/gov.proto @@ -8,7 +8,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; // VoteOption enumerates the valid vote options for a given governance proposal. enum VoteOption { @@ -35,7 +35,7 @@ message WeightedVoteOption { message Deposit { uint64 proposal_id = 1; string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3; + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; } // Proposal defines the core field members of a governance proposal. @@ -46,7 +46,7 @@ message Proposal { TallyResult final_tally_result = 4; google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true]; google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true]; - repeated cosmos.base.v1beta1.Coin total_deposit = 7; + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false]; google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true]; google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; } @@ -95,7 +95,7 @@ message Vote { // DepositParams defines the params for deposits on governance proposals. message DepositParams { // Minimum deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin min_deposit = 1; + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [(gogoproto.nullable) = false]; // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 // months. @@ -112,12 +112,12 @@ message VotingParams { message TallyParams { // Minimum percentage of total stake needed to vote for a result to be // considered valid. - bytes quorum = 1; + string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec"]; // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - bytes threshold = 2; + string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; // Minimum value of Veto votes to Total votes ratio for proposal to be // vetoed. Default value: 1/3. - bytes veto_threshold = 3; + string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; } diff --git a/proto/cosmos/gov/v1beta2/query.proto b/proto/cosmos/gov/v1beta2/query.proto index 944a21566fbc..14e97dfb932d 100644 --- a/proto/cosmos/gov/v1beta2/query.proto +++ b/proto/cosmos/gov/v1beta2/query.proto @@ -6,7 +6,7 @@ import "google/api/annotations.proto"; import "cosmos/gov/v1beta2/gov.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; // Query defines the gRPC querier service for gov module service Query { diff --git a/proto/cosmos/gov/v1beta2/tx.proto b/proto/cosmos/gov/v1beta2/tx.proto index c13172ea12f4..cb60a3e9c38b 100644 --- a/proto/cosmos/gov/v1beta2/tx.proto +++ b/proto/cosmos/gov/v1beta2/tx.proto @@ -3,10 +3,11 @@ package cosmos.gov.v1beta2; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/gov/v1beta2/gov.proto"; +import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/any.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; // Msg defines the gov Msg service. service Msg { @@ -29,7 +30,7 @@ service Msg { // proposal Content. message MsgSubmitProposal { repeated google.protobuf.Any messages = 1; - repeated cosmos.base.v1beta1.Coin initial_deposit = 2; + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false]; string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } @@ -66,7 +67,7 @@ message MsgVoteWeightedResponse {} message MsgDeposit { uint64 proposal_id = 1; string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3; + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; } // MsgDepositResponse defines the Msg/Deposit response type. diff --git a/x/genutil/migrations/v043/migrate.go b/x/genutil/migrations/v043/migrate.go index 20669b826852..8c37ee61d456 100644 --- a/x/genutil/migrations/v043/migrate.go +++ b/x/genutil/migrations/v043/migrate.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil/types" v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" - gov "github.com/cosmos/cosmos-sdk/x/gov/types" + gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // Migrate migrates exported state from v0.40 to a v0.43 genesis state. diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index d9b059d0ac69..ffd31d816415 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -12,8 +12,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" gcutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/gov/client/testutil/cli_test.go b/x/gov/client/testutil/cli_test.go index 1376be6c2b21..907879f502b6 100644 --- a/x/gov/client/testutil/cli_test.go +++ b/x/gov/client/testutil/cli_test.go @@ -17,9 +17,11 @@ func TestIntegrationTestSuite(t *testing.T) { cfg.NumValidators = 1 suite.Run(t, NewIntegrationTestSuite(cfg)) + dp := types.NewDepositParams(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, types.DefaultMinDepositTokens)), time.Duration(15)*time.Second) + vp := types.NewVotingParams(time.Duration(5) * time.Second) genesisState := types.DefaultGenesisState() - genesisState.DepositParams = types.NewDepositParams(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, types.DefaultMinDepositTokens)), time.Duration(15)*time.Second) - genesisState.VotingParams = types.NewVotingParams(time.Duration(5) * time.Second) + genesisState.DepositParams = &dp + genesisState.VotingParams = &vp bz, err := cfg.Codec.MarshalJSON(genesisState) require.NoError(t, err) cfg.GenesisState["gov"] = bz diff --git a/x/gov/migrations/v043/json.go b/x/gov/migrations/v043/json.go index 16de6cdf4743..f5eca24d9a39 100644 --- a/x/gov/migrations/v043/json.go +++ b/x/gov/migrations/v043/json.go @@ -1,12 +1,12 @@ package v043 import ( - "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // migrateWeightedVotes migrates the ADR-037 weighted votes. -func migrateJSONWeightedVotes(oldVotes types.Votes) types.Votes { - newVotes := make(types.Votes, len(oldVotes)) +func migrateJSONWeightedVotes(oldVotes v1beta1.Votes) v1beta1.Votes { + newVotes := make(v1beta1.Votes, len(oldVotes)) for i, oldVote := range oldVotes { newVotes[i] = migrateVote(oldVote) } @@ -18,8 +18,8 @@ func migrateJSONWeightedVotes(oldVotes types.Votes) types.Votes { // v0.43 x/gov genesis state. The migration includes: // // - Gov weighted votes. -func MigrateJSON(oldState *types.GenesisState) *types.GenesisState { - return &types.GenesisState{ +func MigrateJSON(oldState *v1beta1.GenesisState) *v1beta1.GenesisState { + return &v1beta1.GenesisState{ StartingProposalId: oldState.StartingProposalId, Deposits: oldState.Deposits, Votes: migrateJSONWeightedVotes(oldState.Votes), diff --git a/x/gov/migrations/v043/json_test.go b/x/gov/migrations/v043/json_test.go index 13762858e707..abe85162429e 100644 --- a/x/gov/migrations/v043/json_test.go +++ b/x/gov/migrations/v043/json_test.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" - "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func TestMigrateJSON(t *testing.T) { @@ -23,13 +23,13 @@ func TestMigrateJSON(t *testing.T) { voter, err := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh") require.NoError(t, err) - govGenState := &types.GenesisState{ - Votes: types.Votes{ - types.Vote{ProposalId: 1, Voter: voter.String(), Option: types.OptionAbstain}, - types.Vote{ProposalId: 2, Voter: voter.String(), Option: types.OptionEmpty}, - types.Vote{ProposalId: 3, Voter: voter.String(), Option: types.OptionNo}, - types.Vote{ProposalId: 4, Voter: voter.String(), Option: types.OptionNoWithVeto}, - types.Vote{ProposalId: 5, Voter: voter.String(), Option: types.OptionYes}, + govGenState := &v1beta1.GenesisState{ + Votes: v1beta1.Votes{ + v1beta1.Vote{ProposalId: 1, Voter: voter.String(), Option: v1beta1.OptionAbstain}, + v1beta1.Vote{ProposalId: 2, Voter: voter.String(), Option: v1beta1.OptionEmpty}, + v1beta1.Vote{ProposalId: 3, Voter: voter.String(), Option: v1beta1.OptionNo}, + v1beta1.Vote{ProposalId: 4, Voter: voter.String(), Option: v1beta1.OptionNoWithVeto}, + v1beta1.Vote{ProposalId: 5, Voter: voter.String(), Option: v1beta1.OptionYes}, }, } diff --git a/x/gov/migrations/v043/store.go b/x/gov/migrations/v043/store.go index b71c6b8d7430..886279ac93eb 100644 --- a/x/gov/migrations/v043/store.go +++ b/x/gov/migrations/v043/store.go @@ -9,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) const proposalIDLen = 8 @@ -37,11 +38,11 @@ func migratePrefixProposalAddress(store sdk.KVStore, prefixBz []byte) { // migrateStoreWeightedVotes migrates a legacy vote to an ADR-037 weighted vote. // Important: the `oldVote` has its `Option` field set, whereas the new weighted // vote has its `Options` field set. -func migrateVote(oldVote types.Vote) types.Vote { - return types.Vote{ +func migrateVote(oldVote v1beta1.Vote) v1beta1.Vote { + return v1beta1.Vote{ ProposalId: oldVote.ProposalId, Voter: oldVote.Voter, - Options: types.NewNonSplitVoteOption(oldVote.Option), + Options: v1beta1.NewNonSplitVoteOption(oldVote.Option), } } @@ -51,7 +52,7 @@ func migrateStoreWeightedVotes(store sdk.KVStore, cdc codec.BinaryCodec) error { defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var oldVote types.Vote + var oldVote v1beta1.Vote err := cdc.Unmarshal(iterator.Value(), &oldVote) if err != nil { return err diff --git a/x/gov/migrations/v043/store_test.go b/x/gov/migrations/v043/store_test.go index 63c8a7257744..56d2ae2d815b 100644 --- a/x/gov/migrations/v043/store_test.go +++ b/x/gov/migrations/v043/store_test.go @@ -14,6 +14,7 @@ import ( v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func TestMigrateStore(t *testing.T) { @@ -28,9 +29,9 @@ func TestMigrateStore(t *testing.T) { // Use dummy value for keys where we don't test values. dummyValue := []byte("foo") // Use real values for votes, as we're testing weighted votes. - oldVote := types.Vote{ProposalId: 1, Voter: "foobar", Option: types.OptionNoWithVeto} + oldVote := v1beta1.Vote{ProposalId: 1, Voter: "foobar", Option: v1beta1.OptionNoWithVeto} oldVoteValue := cdc.MustMarshal(&oldVote) - newVote := types.Vote{ProposalId: 1, Voter: "foobar", Options: types.WeightedVoteOptions{{Option: types.OptionNoWithVeto, Weight: sdk.NewDec(1)}}} + newVote := v1beta1.Vote{ProposalId: 1, Voter: "foobar", Options: v1beta1.WeightedVoteOptions{{Option: v1beta1.OptionNoWithVeto, Weight: sdk.NewDec(1)}}} newVoteValue := cdc.MustMarshal(&newVote) testCases := []struct { diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index db8b98bff103..a7e7e4bd4145 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -44,16 +44,16 @@ func TestRandomizedGenState(t *testing.T) { dec2, _ := sdk.NewDecFromStr("0.512000000000000000") dec3, _ := sdk.NewDecFromStr("0.267000000000000000") - require.Equal(t, "905stake", govGenesis.DepositParams.MinDeposit.String()) + require.Equal(t, "905stake", govGenesis.DepositParams.MinDeposit[0].String()) require.Equal(t, "77h26m10s", govGenesis.DepositParams.MaxDepositPeriod.String()) require.Equal(t, float64(148296), govGenesis.VotingParams.VotingPeriod.Seconds()) - require.Equal(t, dec1, govGenesis.TallyParams.Quorum) - require.Equal(t, dec2, govGenesis.TallyParams.Threshold) - require.Equal(t, dec3, govGenesis.TallyParams.VetoThreshold) + require.Equal(t, dec1.String(), govGenesis.TallyParams.Quorum) + require.Equal(t, dec2.String(), govGenesis.TallyParams.Threshold) + require.Equal(t, dec3.String(), govGenesis.TallyParams.VetoThreshold) require.Equal(t, uint64(0x28), govGenesis.StartingProposalId) - require.Equal(t, types.Deposits{}, govGenesis.Deposits) - require.Equal(t, types.Votes{}, govGenesis.Votes) - require.Equal(t, types.Proposals{}, govGenesis.Proposals) + require.Equal(t, []*types.Deposit{}, govGenesis.Deposits) + require.Equal(t, []*types.Vote{}, govGenesis.Votes) + require.Equal(t, []*types.Proposal{}, govGenesis.Proposals) } // TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. diff --git a/x/gov/types/deposit.go b/x/gov/types/deposit.go index 9cd16f4777c0..5f106859f1d3 100644 --- a/x/gov/types/deposit.go +++ b/x/gov/types/deposit.go @@ -3,8 +3,6 @@ package types import ( "fmt" - "sigs.k8s.io/yaml" - sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -14,11 +12,6 @@ func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) D return Deposit{proposalID, depositor.String(), amount} } -func (d Deposit) String() string { - out, _ := yaml.Marshal(d) - return string(out) -} - // Deposits is a collection of Deposit objects type Deposits []Deposit @@ -47,8 +40,3 @@ func (d Deposits) String() string { } return out } - -// Empty returns whether a deposit is empty. -func (d Deposit) Empty() bool { - return d.String() == Deposit{}.String() -} diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 7f2d138ae300..276a06c442a6 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -1,19 +1,19 @@ package types import ( + "errors" "fmt" "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" ) // NewGenesisState creates a new genesis state for the governance module func NewGenesisState(startingProposalID uint64, dp DepositParams, vp VotingParams, tp TallyParams) *GenesisState { return &GenesisState{ StartingProposalId: startingProposalID, - DepositParams: dp, - VotingParams: vp, - TallyParams: tp, + DepositParams: &dp, + VotingParams: &vp, + TallyParams: &tp, } } @@ -27,38 +27,30 @@ func DefaultGenesisState() *GenesisState { ) } -func (data GenesisState) Equal(other GenesisState) bool { - return data.StartingProposalId == other.StartingProposalId && - data.Deposits.Equal(other.Deposits) && - data.Votes.Equal(other.Votes) && - data.Proposals.Equal(other.Proposals) && - data.DepositParams.Equal(other.DepositParams) && - data.TallyParams.Equal(other.TallyParams) && - data.VotingParams.Equal(other.VotingParams) -} - // Empty returns true if a GenesisState is empty func (data GenesisState) Empty() bool { - return data.Equal(GenesisState{}) + return data.StartingProposalId == 0 || + data.DepositParams == nil || + data.VotingParams == nil || + data.TallyParams == nil } // ValidateGenesis checks if parameters are within valid ranges func ValidateGenesis(data *GenesisState) error { - threshold := data.TallyParams.Threshold - if threshold.IsNegative() || threshold.GT(sdk.OneDec()) { - return fmt.Errorf("governance vote threshold should be positive and less or equal to one, is %s", - threshold.String()) + if data.StartingProposalId == 0 { + return errors.New("Starting proposal id must be greater than 0") + } + + if err := validateTallyParams(data.TallyParams); err != nil { + return fmt.Errorf("invalid tally params: %w", err) } - veto := data.TallyParams.VetoThreshold - if veto.IsNegative() || veto.GT(sdk.OneDec()) { - return fmt.Errorf("governance vote veto threshold should be positive and less or equal to one, is %s", - veto.String()) + if err := validateVotingParams(data.VotingParams); err != nil { + return fmt.Errorf("invalid voting params: %w", err) } - if !data.DepositParams.MinDeposit.IsValid() { - return fmt.Errorf("governance deposit amount must be a valid sdk.Coins amount, is %s", - data.DepositParams.MinDeposit.String()) + if err := validateDepositParams(data.DepositParams); err != nil { + return fmt.Errorf("invalid deposit params: %w", err) } return nil diff --git a/x/gov/types/genesis.pb.go b/x/gov/types/genesis.pb.go index 4eb8a5da2d47..8f6fece87aa8 100644 --- a/x/gov/types/genesis.pb.go +++ b/x/gov/types/genesis.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -26,19 +25,19 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the gov module's genesis state. type GenesisState struct { // starting_proposal_id is the ID of the starting proposal. - StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty" yaml:"starting_proposal_id"` + StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty"` // deposits defines all the deposits present at genesis. - Deposits Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"` + Deposits []*Deposit `protobuf:"bytes,2,rep,name=deposits,proto3" json:"deposits,omitempty"` // votes defines all the votes present at genesis. - Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` + Votes []*Vote `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` // proposals defines all the proposals present at genesis. - Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` + Proposals []*Proposal `protobuf:"bytes,4,rep,name=proposals,proto3" json:"proposals,omitempty"` // params defines all the paramaters of related to deposit. - DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params" yaml:"deposit_params"` + DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` // params defines all the paramaters of related to voting. - VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params" yaml:"voting_params"` + VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` // params defines all the paramaters of related to tally. - TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params" yaml:"tally_params"` + TallyParams *TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -81,46 +80,46 @@ func (m *GenesisState) GetStartingProposalId() uint64 { return 0 } -func (m *GenesisState) GetDeposits() Deposits { +func (m *GenesisState) GetDeposits() []*Deposit { if m != nil { return m.Deposits } return nil } -func (m *GenesisState) GetVotes() Votes { +func (m *GenesisState) GetVotes() []*Vote { if m != nil { return m.Votes } return nil } -func (m *GenesisState) GetProposals() Proposals { +func (m *GenesisState) GetProposals() []*Proposal { if m != nil { return m.Proposals } return nil } -func (m *GenesisState) GetDepositParams() DepositParams { +func (m *GenesisState) GetDepositParams() *DepositParams { if m != nil { return m.DepositParams } - return DepositParams{} + return nil } -func (m *GenesisState) GetVotingParams() VotingParams { +func (m *GenesisState) GetVotingParams() *VotingParams { if m != nil { return m.VotingParams } - return VotingParams{} + return nil } -func (m *GenesisState) GetTallyParams() TallyParams { +func (m *GenesisState) GetTallyParams() *TallyParams { if m != nil { return m.TallyParams } - return TallyParams{} + return nil } func init() { @@ -130,34 +129,29 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/genesis.proto", fileDescriptor_7915ab39bb5aa171) } var fileDescriptor_7915ab39bb5aa171 = []byte{ - // 430 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xb1, 0x8e, 0xd3, 0x40, - 0x10, 0x86, 0x63, 0x2e, 0x39, 0xee, 0x36, 0x09, 0x82, 0x25, 0x48, 0xd6, 0x25, 0xd8, 0xc6, 0x55, - 0x1a, 0x6c, 0x11, 0x3a, 0x24, 0x1a, 0x0b, 0x09, 0x5d, 0x81, 0x74, 0x18, 0x44, 0x41, 0x13, 0x6d, - 0xe2, 0xd5, 0x62, 0x61, 0xdf, 0x58, 0x9e, 0xc5, 0x22, 0x6f, 0xc1, 0x73, 0xf0, 0x24, 0x57, 0x5e, - 0x49, 0x15, 0x50, 0x52, 0xd1, 0xde, 0x13, 0x20, 0xef, 0xae, 0xc1, 0x11, 0x86, 0x2a, 0xf1, 0xec, - 0xbf, 0xdf, 0x37, 0x3b, 0x1a, 0xe2, 0xad, 0x01, 0x73, 0xc0, 0x50, 0x40, 0x15, 0x56, 0x4f, 0x56, - 0x5c, 0xb2, 0x45, 0x28, 0xf8, 0x25, 0xc7, 0x14, 0x83, 0xa2, 0x04, 0x09, 0x94, 0xea, 0x44, 0x20, - 0xa0, 0x0a, 0x4c, 0xe2, 0x6c, 0x22, 0x40, 0x80, 0x3a, 0x0e, 0xeb, 0x7f, 0x3a, 0x79, 0x36, 0xeb, - 0x62, 0x41, 0xa5, 0x4f, 0xf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3, 0xfd, 0xe3, 0xf9, 0xf5, - 0xf8, 0xb5, 0x66, 0x66, 0x34, 0x13, 0xad, 0x39, 0x80, 0xf8, 0xf1, 0xa8, 0x6a, 0x65, 0xe9, 0x92, - 0x8c, 0x24, 0xcb, 0xb2, 0x4d, 0xe3, 0xb8, 0xad, 0x1c, 0x6e, 0x97, 0xe3, 0x6d, 0x9d, 0x33, 0x8a, - 0xa9, 0x51, 0xdc, 0xd7, 0x8a, 0x36, 0xc2, 0x8f, 0x87, 0xb2, 0x95, 0x8c, 0xae, 0x76, 0x8e, 0x75, - 0xbd, 0x73, 0xac, 0x1f, 0x3b, 0xc7, 0xfa, 0xb2, 0x77, 0x7a, 0xd7, 0x7b, 0xa7, 0xf7, 0x6d, 0xef, - 0xf4, 0xde, 0xcf, 0x45, 0x2a, 0x3f, 0x7c, 0x5a, 0x05, 0x6b, 0xc8, 0x43, 0xb3, 0xae, 0xfa, 0xe7, - 0x31, 0x26, 0x1f, 0xc3, 0xcf, 0x6a, 0x77, 0xe5, 0xa6, 0xe0, 0xb8, 0x3a, 0x56, 0x6b, 0xfb, 0xf4, - 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0xfd, 0x9f, 0x57, 0x22, 0x03, 0x00, 0x00, + // 341 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xbd, 0x4e, 0xc3, 0x30, + 0x14, 0x85, 0x1b, 0xfa, 0x03, 0xb8, 0x2d, 0x83, 0xc5, 0x10, 0x41, 0x15, 0x02, 0x53, 0x16, 0x1c, + 0x28, 0x03, 0x12, 0x63, 0x05, 0x02, 0xb6, 0x2a, 0x20, 0x06, 0x96, 0xca, 0x6d, 0xac, 0x10, 0xd1, + 0xf6, 0x46, 0xf1, 0xc5, 0xa2, 0x6f, 0xc1, 0xf3, 0xf0, 0x04, 0x8c, 0x1d, 0x19, 0x51, 0xf3, 0x22, + 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da, 0x2f, 0xef, 0xca, 0x78, 0x5a, 0x6a, 0x6d, 0xa2, + 0x3d, 0xd2, 0x42, 0x3e, 0x1e, 0xcf, 0x0a, 0xcb, 0xa6, 0xb6, 0x1c, 0x94, 0x59, 0xee, 0x97, 0x5c, + 0x2e, 0x69, 0xe2, 0x6a, 0xe8, 0xf5, 0x3e, 0x16, 0x8e, 0x35, 0x5f, 0x38, 0xd6, 0xd7, 0xc2, 0xb1, + 0xde, 0x32, 0xa7, 0x32, 0xcf, 0x9c, 0xca, 0x67, 0xe6, 0x54, 0x1e, 0xbd, 0x28, 0xc6, 0xa7, 0x97, + 0x21, 0x1b, 0xc1, 0xc4, 0xcf, 0xdf, 0xdf, 0x7c, 0x8e, 0x65, 0xf8, 0xec, 0xbf, 0xea, 0x65, 0xc0, + 0x59, 0x22, 0xe4, 0xb0, 0xa1, 0xf7, 0xe0, 0xec, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x73, 0x78, + 0xdf, 0x5d, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -180,36 +174,42 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.TallyParams != nil { + { + size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a } - i-- - dAtA[i] = 0x3a - { - size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.VotingParams != nil { + { + size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 } - i-- - dAtA[i] = 0x32 - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.DepositParams != nil { + { + size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a } - i-- - dAtA[i] = 0x2a if len(m.Proposals) > 0 { for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { { @@ -298,12 +298,18 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - l = m.DepositParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.VotingParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.TallyParams.Size() - n += 1 + l + sovGenesis(uint64(l)) + if m.DepositParams != nil { + l = m.DepositParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.VotingParams != nil { + l = m.VotingParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.TallyParams != nil { + l = m.TallyParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + } return n } @@ -390,7 +396,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Deposits = append(m.Deposits, Deposit{}) + m.Deposits = append(m.Deposits, &Deposit{}) if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -424,7 +430,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Votes = append(m.Votes, Vote{}) + m.Votes = append(m.Votes, &Vote{}) if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -458,7 +464,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Proposals = append(m.Proposals, Proposal{}) + m.Proposals = append(m.Proposals, &Proposal{}) if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -492,6 +498,9 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.DepositParams == nil { + m.DepositParams = &DepositParams{} + } if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -525,6 +534,9 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.VotingParams == nil { + m.VotingParams = &VotingParams{} + } if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -558,6 +570,9 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.TallyParams == nil { + m.TallyParams = &TallyParams{} + } if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/gov/types/genesis_test.go b/x/gov/types/genesis_test.go index 3a3e6e4282e3..6f13c5ebae42 100644 --- a/x/gov/types/genesis_test.go +++ b/x/gov/types/genesis_test.go @@ -6,17 +6,10 @@ import ( "github.com/stretchr/testify/require" ) -func TestEqualProposalID(t *testing.T) { +func TestEmptyGenesis(t *testing.T) { state1 := GenesisState{} - state2 := GenesisState{} - require.Equal(t, state1, state2) + require.True(t, state1.Empty()) - // Proposals - state1.StartingProposalId = 1 - require.NotEqual(t, state1, state2) - require.False(t, state1.Equal(state2)) - - state2.StartingProposalId = 1 - require.Equal(t, state1, state2) - require.True(t, state1.Equal(state2)) + state2 := DefaultGenesisState() + require.False(t, state2.Empty()) } diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index e6ec82ef985d..0a9ad1dac4c4 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -7,7 +7,6 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types1 "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -37,15 +36,15 @@ type VoteOption int32 const ( // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - OptionEmpty VoteOption = 0 + VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 // VOTE_OPTION_YES defines a yes vote option. - OptionYes VoteOption = 1 + VoteOption_VOTE_OPTION_YES VoteOption = 1 // VOTE_OPTION_ABSTAIN defines an abstain vote option. - OptionAbstain VoteOption = 2 + VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 // VOTE_OPTION_NO defines a no vote option. - OptionNo VoteOption = 3 + VoteOption_VOTE_OPTION_NO VoteOption = 3 // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - OptionNoWithVeto VoteOption = 4 + VoteOption_VOTE_OPTION_NO_WITH_VETO VoteOption = 4 ) var VoteOption_name = map[int32]string{ @@ -77,22 +76,22 @@ type ProposalStatus int32 const ( // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. - StatusNil ProposalStatus = 0 + ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED ProposalStatus = 0 // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit // period. - StatusDepositPeriod ProposalStatus = 1 + ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD ProposalStatus = 1 // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting // period. - StatusVotingPeriod ProposalStatus = 2 + ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD ProposalStatus = 2 // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has // passed. - StatusPassed ProposalStatus = 3 + ProposalStatus_PROPOSAL_STATUS_PASSED ProposalStatus = 3 // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has // been rejected. - StatusRejected ProposalStatus = 4 + ProposalStatus_PROPOSAL_STATUS_REJECTED ProposalStatus = 4 // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. - StatusFailed ProposalStatus = 5 + ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 ) var ProposalStatus_name = map[int32]string{ @@ -123,12 +122,13 @@ func (ProposalStatus) EnumDescriptor() ([]byte, []int) { // WeightedVoteOption defines a unit of vote for vote split. type WeightedVoteOption struct { - Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta2.VoteOption" json:"option,omitempty"` - Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight"` + Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta2.VoteOption" json:"option,omitempty"` + Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` } -func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } -func (*WeightedVoteOption) ProtoMessage() {} +func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } +func (m *WeightedVoteOption) String() string { return proto.CompactTextString(m) } +func (*WeightedVoteOption) ProtoMessage() {} func (*WeightedVoteOption) Descriptor() ([]byte, []int) { return fileDescriptor_5abf7b8852811c49, []int{0} } @@ -159,16 +159,31 @@ func (m *WeightedVoteOption) XXX_DiscardUnknown() { var xxx_messageInfo_WeightedVoteOption proto.InternalMessageInfo +func (m *WeightedVoteOption) GetOption() VoteOption { + if m != nil { + return m.Option + } + return VoteOption_VOTE_OPTION_UNSPECIFIED +} + +func (m *WeightedVoteOption) GetWeight() string { + if m != nil { + return m.Weight + } + return "" +} + // Deposit defines an amount deposited by an account address to an active // proposal. type Deposit struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` + Amount []types.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"` } -func (m *Deposit) Reset() { *m = Deposit{} } -func (*Deposit) ProtoMessage() {} +func (m *Deposit) Reset() { *m = Deposit{} } +func (m *Deposit) String() string { return proto.CompactTextString(m) } +func (*Deposit) ProtoMessage() {} func (*Deposit) Descriptor() ([]byte, []int) { return fileDescriptor_5abf7b8852811c49, []int{1} } @@ -199,21 +214,43 @@ func (m *Deposit) XXX_DiscardUnknown() { var xxx_messageInfo_Deposit proto.InternalMessageInfo +func (m *Deposit) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *Deposit) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + +func (m *Deposit) GetAmount() []types.Coin { + if m != nil { + return m.Amount + } + return nil +} + // Proposal defines the core field members of a governance proposal. type Proposal struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"id" yaml:"id"` - Messages []*types1.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` - Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta2.ProposalStatus" json:"status,omitempty" yaml:"proposal_status"` - FinalTallyResult TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result" yaml:"final_tally_result"` - SubmitTime time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time" yaml:"submit_time"` - DepositEndTime time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time" yaml:"deposit_end_time"` - TotalDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total_deposit" yaml:"total_deposit"` - VotingStartTime time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time" yaml:"voting_start_time"` - VotingEndTime time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time" yaml:"voting_end_time"` -} - -func (m *Proposal) Reset() { *m = Proposal{} } -func (*Proposal) ProtoMessage() {} + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + Messages []*types1.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` + Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta2.ProposalStatus" json:"status,omitempty"` + FinalTallyResult *TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result,omitempty"` + SubmitTime *time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time,omitempty"` + DepositEndTime *time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time,omitempty"` + TotalDeposit []types.Coin `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3" json:"total_deposit"` + VotingStartTime *time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time,omitempty"` + VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` +} + +func (m *Proposal) Reset() { *m = Proposal{} } +func (m *Proposal) String() string { return proto.CompactTextString(m) } +func (*Proposal) ProtoMessage() {} func (*Proposal) Descriptor() ([]byte, []int) { return fileDescriptor_5abf7b8852811c49, []int{2} } @@ -244,16 +281,80 @@ func (m *Proposal) XXX_DiscardUnknown() { var xxx_messageInfo_Proposal proto.InternalMessageInfo +func (m *Proposal) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *Proposal) GetMessages() []*types1.Any { + if m != nil { + return m.Messages + } + return nil +} + +func (m *Proposal) GetStatus() ProposalStatus { + if m != nil { + return m.Status + } + return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED +} + +func (m *Proposal) GetFinalTallyResult() *TallyResult { + if m != nil { + return m.FinalTallyResult + } + return nil +} + +func (m *Proposal) GetSubmitTime() *time.Time { + if m != nil { + return m.SubmitTime + } + return nil +} + +func (m *Proposal) GetDepositEndTime() *time.Time { + if m != nil { + return m.DepositEndTime + } + return nil +} + +func (m *Proposal) GetTotalDeposit() []types.Coin { + if m != nil { + return m.TotalDeposit + } + return nil +} + +func (m *Proposal) GetVotingStartTime() *time.Time { + if m != nil { + return m.VotingStartTime + } + return nil +} + +func (m *Proposal) GetVotingEndTime() *time.Time { + if m != nil { + return m.VotingEndTime + } + return nil +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { - Yes github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=yes,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"yes"` - Abstain github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=abstain,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"abstain"` - No github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=no,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"no"` - NoWithVeto github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"no_with_veto"` + Yes string `protobuf:"bytes,1,opt,name=yes,proto3" json:"yes,omitempty"` + Abstain string `protobuf:"bytes,2,opt,name=abstain,proto3" json:"abstain,omitempty"` + No string `protobuf:"bytes,3,opt,name=no,proto3" json:"no,omitempty"` + NoWithVeto string `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3" json:"no_with_veto,omitempty"` } -func (m *TallyResult) Reset() { *m = TallyResult{} } -func (*TallyResult) ProtoMessage() {} +func (m *TallyResult) Reset() { *m = TallyResult{} } +func (m *TallyResult) String() string { return proto.CompactTextString(m) } +func (*TallyResult) ProtoMessage() {} func (*TallyResult) Descriptor() ([]byte, []int) { return fileDescriptor_5abf7b8852811c49, []int{3} } @@ -284,6 +385,34 @@ func (m *TallyResult) XXX_DiscardUnknown() { var xxx_messageInfo_TallyResult proto.InternalMessageInfo +func (m *TallyResult) GetYes() string { + if m != nil { + return m.Yes + } + return "" +} + +func (m *TallyResult) GetAbstain() string { + if m != nil { + return m.Abstain + } + return "" +} + +func (m *TallyResult) GetNo() string { + if m != nil { + return m.No + } + return "" +} + +func (m *TallyResult) GetNoWithVeto() string { + if m != nil { + return m.NoWithVeto + } + return "" +} + // Vote defines a vote on a governance proposal. // A Vote consists of a proposal ID, the voter, and the vote option. type Vote struct { @@ -292,12 +421,13 @@ type Vote struct { // Deprecated: Prefer to use `options` instead. This field is set in queries // if and only if `len(options) == 1` and that option has weight 1. In all // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta2.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. - Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta2.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. + Options []*WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` } -func (m *Vote) Reset() { *m = Vote{} } -func (*Vote) ProtoMessage() {} +func (m *Vote) Reset() { *m = Vote{} } +func (m *Vote) String() string { return proto.CompactTextString(m) } +func (*Vote) ProtoMessage() {} func (*Vote) Descriptor() ([]byte, []int) { return fileDescriptor_5abf7b8852811c49, []int{4} } @@ -328,17 +458,47 @@ func (m *Vote) XXX_DiscardUnknown() { var xxx_messageInfo_Vote proto.InternalMessageInfo +func (m *Vote) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *Vote) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + +// Deprecated: Do not use. +func (m *Vote) GetOption() VoteOption { + if m != nil { + return m.Option + } + return VoteOption_VOTE_OPTION_UNSPECIFIED +} + +func (m *Vote) GetOptions() []*WeightedVoteOption { + if m != nil { + return m.Options + } + return nil +} + // DepositParams defines the params for deposits on governance proposals. 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"` + MinDeposit []types.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"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"` + MaxDepositPeriod *time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` } -func (m *DepositParams) Reset() { *m = DepositParams{} } -func (*DepositParams) ProtoMessage() {} +func (m *DepositParams) Reset() { *m = DepositParams{} } +func (m *DepositParams) String() string { return proto.CompactTextString(m) } +func (*DepositParams) ProtoMessage() {} func (*DepositParams) Descriptor() ([]byte, []int) { return fileDescriptor_5abf7b8852811c49, []int{5} } @@ -369,14 +529,29 @@ func (m *DepositParams) XXX_DiscardUnknown() { var xxx_messageInfo_DepositParams proto.InternalMessageInfo +func (m *DepositParams) GetMinDeposit() []types.Coin { + if m != nil { + return m.MinDeposit + } + return nil +} + +func (m *DepositParams) GetMaxDepositPeriod() *time.Duration { + if m != nil { + return m.MaxDepositPeriod + } + return nil +} + // VotingParams defines the params for voting on governance proposals. 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"` + VotingPeriod *time.Duration `protobuf:"bytes,1,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` } -func (m *VotingParams) Reset() { *m = VotingParams{} } -func (*VotingParams) ProtoMessage() {} +func (m *VotingParams) Reset() { *m = VotingParams{} } +func (m *VotingParams) String() string { return proto.CompactTextString(m) } +func (*VotingParams) ProtoMessage() {} func (*VotingParams) Descriptor() ([]byte, []int) { return fileDescriptor_5abf7b8852811c49, []int{6} } @@ -407,20 +582,28 @@ func (m *VotingParams) XXX_DiscardUnknown() { var xxx_messageInfo_VotingParams proto.InternalMessageInfo +func (m *VotingParams) GetVotingPeriod() *time.Duration { + if m != nil { + return m.VotingPeriod + } + return nil +} + // TallyParams defines the params for tallying votes on governance proposals. 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"` + Quorum string `protobuf:"bytes,1,opt,name=quorum,proto3" json:"quorum,omitempty"` // Minimum proportion of Yes votes for proposal to pass. Default 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"` + Threshold string `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` // Minimum value of Veto votes to Total votes ratio for proposal to be // vetoed. Default value: 1/3. - VetoThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"veto_threshold,omitempty"` + VetoThreshold string `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` } -func (m *TallyParams) Reset() { *m = TallyParams{} } -func (*TallyParams) ProtoMessage() {} +func (m *TallyParams) Reset() { *m = TallyParams{} } +func (m *TallyParams) String() string { return proto.CompactTextString(m) } +func (*TallyParams) ProtoMessage() {} func (*TallyParams) Descriptor() ([]byte, []int) { return fileDescriptor_5abf7b8852811c49, []int{7} } @@ -451,6 +634,27 @@ func (m *TallyParams) XXX_DiscardUnknown() { var xxx_messageInfo_TallyParams proto.InternalMessageInfo +func (m *TallyParams) GetQuorum() string { + if m != nil { + return m.Quorum + } + return "" +} + +func (m *TallyParams) GetThreshold() string { + if m != nil { + return m.Threshold + } + return "" +} + +func (m *TallyParams) GetVetoThreshold() string { + if m != nil { + return m.VetoThreshold + } + return "" +} + func init() { proto.RegisterEnum("cosmos.gov.v1beta2.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos.gov.v1beta2.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -467,187 +671,73 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) } var fileDescriptor_5abf7b8852811c49 = []byte{ - // 1386 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x4f, 0x6f, 0x13, 0x47, - 0x1b, 0xf7, 0xda, 0xc6, 0x49, 0x26, 0x4e, 0x58, 0x26, 0x79, 0x93, 0x8d, 0x5f, 0xde, 0xdd, 0x7d, - 0x97, 0x0a, 0x45, 0x08, 0x1c, 0x48, 0x2b,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, 0xb0, 0x95, 0x88, 0x00, 0x3d, 0x20, - 0xf2, 0x73, 0x61, 0xa3, 0xc0, 0x65, 0x0e, 0x99, 0x89, 0x0e, 0x67, 0xb8, 0xc3, 0x32, 0x73, 0x18, - 0x57, 0x60, 0x36, 0xf3, 0x7c, 0xd9, 0x08, 0x5c, 0x6a, 0xf5, 0x40, 0x00, 0x73, 0x04, 0x13, 0xa7, - 0x65, 0xf3, 0x0d, 0x69, 0x6a, 0xd2, 0xe9, 0xbb, 0xca, 0x7d, 0x16, 0x99, 0xcf, 0x08, 0x5b, 0x3b, - 0xd6, 0xa9, 0xcc, 0x52, 0x6e, 0xdc, 0x59, 0x2d, 0x70, 0x6a, 0x07, 0x13, 0x2f, 0x68, 0x46, 0xaf, - 0xb7, 0xc3, 0x0b, 0x3b, 0x3d, 0x31, 0xed, 0x8f, 0x78, 0x38, 0x12, 0x0b, 0xe7, 0x90, 0x04, 0xcb, - 0xfb, 0x24, 0x5b, 0xaf, 0x45, 0xcb, 0x34, 0xf1, 0x3b, 0x80, 0x2f, 0x1d, 0x94, 0x78, 0x66, 0xa2, - 0x97, 0xc6, 0xbd, 0x96, 0x46, 0xbc, 0x46, 0x2b, 0x3c, 0xc7, 0x56, 0x79, 0x81, 0x37, 0xd2, 0x6f, - 0x1e, 0x2b, 0x82, 0xf6, 0x67, 0x12, 0xcc, 0x0e, 0x1f, 0x9f, 0x32, 0x48, 0xed, 0xa2, 0x90, 0x36, - 0xda, 0xf1, 0x86, 0x54, 0x29, 0x20, 0x43, 0x43, 0xaa, 0x14, 0x10, 0x33, 0x12, 0x82, 0x75, 0x30, - 0xe5, 0x6c, 0x85, 0xc4, 0xf1, 0x82, 0x7f, 0x31, 0xf8, 0x0e, 0x6b, 0xc6, 0x62, 0xf0, 0x3a, 0x48, - 0x06, 0x98, 0x36, 0xeb, 0x87, 0x4a, 0x26, 0x03, 0x0c, 0xbf, 0x02, 0xd9, 0x00, 0xdb, 0xf7, 0x3c, - 0xb2, 0x6d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af, 0x85, 0x5c, 0x56, 0x4e, 0xbd, 0xfc, 0xf4, 0x95, 0x9c, 0x78, 0xf1, 0x4a, - 0x4e, 0x7c, 0xbb, 0x27, 0x27, 0x9e, 0xee, 0xc9, 0xc2, 0xb3, 0x3d, 0x59, 0xf8, 0x6d, 0x4f, 0x16, - 0x1e, 0xbe, 0x96, 0x13, 0xcf, 0x5e, 0xcb, 0x89, 0x17, 0xaf, 0xe5, 0xc4, 0xed, 0x7f, 0x9e, 0x5f, - 0xf7, 0xe9, 0x7f, 0x55, 0xf4, 0xd8, 0x6e, 0x65, 0xe8, 0x44, 0xf8, 0xf8, 0xef, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x0c, 0xf2, 0xd0, 0x1b, 0x70, 0x0d, 0x00, 0x00, -} - -func (this *Proposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Proposal) - if !ok { - that2, ok := that.(Proposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProposalId != that1.ProposalId { - return false - } - if len(this.Messages) != len(that1.Messages) { - return false - } - for i := range this.Messages { - if !this.Messages[i].Equal(that1.Messages[i]) { - return false - } - } - if this.Status != that1.Status { - return false - } - if !this.FinalTallyResult.Equal(&that1.FinalTallyResult) { - return false - } - if !this.SubmitTime.Equal(that1.SubmitTime) { - return false - } - if !this.DepositEndTime.Equal(that1.DepositEndTime) { - return false - } - if len(this.TotalDeposit) != len(that1.TotalDeposit) { - return false - } - for i := range this.TotalDeposit { - if !this.TotalDeposit[i].Equal(&that1.TotalDeposit[i]) { - return false - } - } - if !this.VotingStartTime.Equal(that1.VotingStartTime) { - return false - } - if !this.VotingEndTime.Equal(that1.VotingEndTime) { - return false - } - return true + // 1019 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xc1, 0x6e, 0xdb, 0x46, + 0x10, 0x35, 0x25, 0x59, 0xb6, 0x47, 0xb6, 0xc2, 0x6e, 0x8c, 0x86, 0x76, 0x52, 0xca, 0xd5, 0xc1, + 0x10, 0x82, 0x5a, 0x8a, 0x5d, 0x34, 0x05, 0x7a, 0x8a, 0x64, 0x32, 0x0d, 0x03, 0xc7, 0x14, 0x48, + 0x46, 0x46, 0x7b, 0x21, 0x28, 0x73, 0x43, 0x11, 0x15, 0xb9, 0x2a, 0x77, 0xe5, 0xd8, 0x9f, 0xd0, + 0x5b, 0x8e, 0x45, 0x7b, 0xe9, 0xbd, 0xd7, 0x7c, 0x44, 0x4e, 0x45, 0x10, 0x20, 0x40, 0x4f, 0x6d, + 0x61, 0xff, 0x48, 0xc1, 0xe5, 0xd2, 0x96, 0x65, 0x05, 0xd6, 0xc9, 0xab, 0x99, 0xf7, 0xde, 0xce, + 0xec, 0xbe, 0x1d, 0x13, 0x1e, 0x1c, 0x13, 0x1a, 0x11, 0xda, 0x0a, 0xc8, 0x49, 0xeb, 0x64, 0xb7, + 0x8f, 0x99, 0xb7, 0x97, 0xae, 0x9b, 0xa3, 0x84, 0x30, 0x82, 0x50, 0x96, 0x6d, 0xa6, 0x11, 0x91, + 0xdd, 0x54, 0x05, 0xa3, 0xef, 0x51, 0x2c, 0x28, 0xbb, 0xad, 0x63, 0x12, 0xc6, 0x19, 0x67, 0x73, + 0x3d, 0x20, 0x01, 0xe1, 0xcb, 0x56, 0xba, 0x12, 0xd1, 0x5a, 0x40, 0x48, 0x30, 0xc4, 0x2d, 0xfe, + 0xab, 0x3f, 0x7e, 0xd5, 0x62, 0x61, 0x84, 0x29, 0xf3, 0xa2, 0x91, 0x00, 0x6c, 0x4c, 0x03, 0xbc, + 0xf8, 0x4c, 0xa4, 0xd4, 0xe9, 0x94, 0x3f, 0x4e, 0x3c, 0x16, 0x92, 0x7c, 0xc7, 0x8d, 0xac, 0x22, + 0x37, 0xdb, 0x54, 0x94, 0xcc, 0x7f, 0xd4, 0x19, 0xa0,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e, 0x66, 0x38, + 0x90, 0x0f, 0xeb, 0x2c, 0x8b, 0xbe, 0x82, 0x15, 0x36, 0x48, 0x30, 0x1d, 0x90, 0xa1, 0xff, 0x89, + 0xb9, 0x7e, 0x05, 0x40, 0xdf, 0x40, 0x35, 0x35, 0x98, 0x7b, 0x45, 0x29, 0xce, 0xa4, 0xac, 0xa5, + 0x28, 0x27, 0x07, 0x3d, 0xfc, 0x45, 0x02, 0x98, 0xf8, 0x07, 0x74, 0x1f, 0xee, 0xf5, 0x4c, 0x47, + 0x77, 0xcd, 0xae, 0x63, 0x98, 0x87, 0xee, 0xcb, 0x43, 0xbb, 0xab, 0xef, 0x1b, 0x4f, 0x0d, 0x5d, + 0x93, 0x17, 0xd0, 0x5d, 0xb8, 0x33, 0x99, 0xfc, 0x41, 0xb7, 0x65, 0x09, 0xdd, 0x83, 0xbb, 0x93, + 0xc1, 0x76, 0xc7, 0x76, 0xda, 0xc6, 0xa1, 0x5c, 0x40, 0x08, 0xaa, 0x93, 0x89, 0x43, 0x53, 0x2e, + 0xa2, 0x07, 0xa0, 0x5c, 0x8f, 0xb9, 0x47, 0x86, 0xf3, 0xcc, 0xed, 0xe9, 0x8e, 0x29, 0x97, 0x1e, + 0xfe, 0x25, 0x41, 0xf5, 0xfa, 0xf8, 0x45, 0x35, 0xb8, 0xdf, 0xb5, 0xcc, 0xae, 0x69, 0xb7, 0x0f, + 0x5c, 0xdb, 0x69, 0x3b, 0x2f, 0xed, 0xa9, 0x9a, 0xea, 0xa0, 0x4e, 0x03, 0x34, 0xbd, 0x6b, 0xda, + 0x86, 0xe3, 0x76, 0x75, 0xcb, 0x30, 0x35, 0x59, 0x42, 0x5f, 0xc2, 0x17, 0xd3, 0x98, 0x9e, 0xe9, + 0x18, 0x87, 0xdf, 0xe7, 0x90, 0x02, 0xda, 0x84, 0xcf, 0xa7, 0x21, 0xdd, 0xb6, 0x6d, 0xeb, 0x5a, + 0x56, 0xf4, 0x74, 0xce, 0xd2, 0x9f, 0xeb, 0xfb, 0x8e, 0xae, 0xc9, 0xa5, 0x59, 0xcc, 0xa7, 0x6d, + 0xe3, 0x40, 0xd7, 0xe4, 0xc5, 0x4e, 0xe7, 0xdd, 0xb9, 0x2a, 0xbd, 0x3f, 0x57, 0xa5, 0xff, 0xce, + 0x55, 0xe9, 0xcd, 0x85, 0xba, 0xf0, 0xfe, 0x42, 0x5d, 0xf8, 0xfb, 0x42, 0x5d, 0xf8, 0xb1, 0x11, + 0x84, 0x6c, 0x30, 0xee, 0x37, 0x8f, 0x49, 0x24, 0xbe, 0x0b, 0xc4, 0x9f, 0x1d, 0xea, 0xff, 0xd4, + 0x3a, 0xe5, 0x5f, 0x3d, 0xec, 0x6c, 0x84, 0x69, 0xbf, 0xcc, 0x4d, 0xf6, 0xf5, 0xff, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xa4, 0x3d, 0x7c, 0xd7, 0x10, 0x09, 0x00, 0x00, } -func (this *TallyResult) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TallyResult) - if !ok { - that2, ok := that.(TallyResult) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Yes.Equal(that1.Yes) { - return false - } - if !this.Abstain.Equal(that1.Abstain) { - return false - } - if !this.No.Equal(that1.No) { - return false - } - if !this.NoWithVeto.Equal(that1.NoWithVeto) { - return false - } - return true -} func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -668,16 +758,13 @@ func (m *WeightedVoteOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) + if len(m.Weight) > 0 { + i -= len(m.Weight) + copy(dAtA[i:], m.Weight) + i = encodeVarintGov(dAtA, i, uint64(len(m.Weight))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 if m.Option != 0 { i = encodeVarintGov(dAtA, i, uint64(m.Option)) i-- @@ -755,22 +842,26 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.VotingEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingEndTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintGov(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x4a - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.VotingStartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingStartTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintGov(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x42 + if m.VotingEndTime != nil { + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.VotingEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingEndTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintGov(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x4a + } + if m.VotingStartTime != nil { + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.VotingStartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingStartTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintGov(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x42 + } if len(m.TotalDeposit) > 0 { for iNdEx := len(m.TotalDeposit) - 1; iNdEx >= 0; iNdEx-- { { @@ -785,32 +876,38 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x3a } } - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.DepositEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.DepositEndTime):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintGov(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x32 - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.SubmitTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintGov(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x2a - { - size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.DepositEndTime != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.DepositEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.DepositEndTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintGov(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x32 + } + if m.SubmitTime != nil { + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.SubmitTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.SubmitTime):]) + if err4 != nil { + return 0, err4 } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) + i -= n4 + i = encodeVarintGov(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x2a + } + if m.FinalTallyResult != nil { + { + size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x22 if m.Status != 0 { i = encodeVarintGov(dAtA, i, uint64(m.Status)) i-- @@ -858,46 +955,34 @@ func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.NoWithVeto.Size() - i -= size - if _, err := m.NoWithVeto.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.No.Size() - i -= size - if _, err := m.No.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.Abstain.Size() - i -= size - if _, err := m.Abstain.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.Yes.Size() - i -= size - if _, err := m.Yes.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) + if len(m.NoWithVeto) > 0 { + i -= len(m.NoWithVeto) + copy(dAtA[i:], m.NoWithVeto) + i = encodeVarintGov(dAtA, i, uint64(len(m.NoWithVeto))) + i-- + dAtA[i] = 0x22 + } + if len(m.No) > 0 { + i -= len(m.No) + copy(dAtA[i:], m.No) + i = encodeVarintGov(dAtA, i, uint64(len(m.No))) + i-- + dAtA[i] = 0x1a + } + if len(m.Abstain) > 0 { + i -= len(m.Abstain) + copy(dAtA[i:], m.Abstain) + i = encodeVarintGov(dAtA, i, uint64(len(m.Abstain))) + i-- + dAtA[i] = 0x12 + } + if len(m.Yes) > 0 { + i -= len(m.Yes) + copy(dAtA[i:], m.Yes) + i = encodeVarintGov(dAtA, i, uint64(len(m.Yes))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -975,14 +1060,16 @@ func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxDepositPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintGov(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x12 + if m.MaxDepositPeriod != nil { + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintGov(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x12 + } if len(m.MinDeposit) > 0 { for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { { @@ -1020,14 +1107,16 @@ func (m *VotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.VotingPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintGov(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0xa + if m.VotingPeriod != nil { + n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.VotingPeriod):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintGov(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1051,36 +1140,27 @@ func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.VetoThreshold.Size() - i -= size - if _, err := m.VetoThreshold.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)) + if len(m.VetoThreshold) > 0 { + i -= len(m.VetoThreshold) + copy(dAtA[i:], m.VetoThreshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.VetoThreshold))) + i-- + dAtA[i] = 0x1a + } + if len(m.Threshold) > 0 { + i -= len(m.Threshold) + copy(dAtA[i:], m.Threshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.Threshold))) + i-- + dAtA[i] = 0x12 + } + if len(m.Quorum) > 0 { + i -= len(m.Quorum) + copy(dAtA[i:], m.Quorum) + i = encodeVarintGov(dAtA, i, uint64(len(m.Quorum))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1104,8 +1184,10 @@ func (m *WeightedVoteOption) Size() (n int) { if m.Option != 0 { n += 1 + sovGov(uint64(m.Option)) } - l = m.Weight.Size() - n += 1 + l + sovGov(uint64(l)) + l = len(m.Weight) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -1149,22 +1231,32 @@ func (m *Proposal) Size() (n int) { if m.Status != 0 { n += 1 + sovGov(uint64(m.Status)) } - l = m.FinalTallyResult.Size() - n += 1 + l + sovGov(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime) - n += 1 + l + sovGov(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.DepositEndTime) - n += 1 + l + sovGov(uint64(l)) + if m.FinalTallyResult != nil { + l = m.FinalTallyResult.Size() + n += 1 + l + sovGov(uint64(l)) + } + if m.SubmitTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.SubmitTime) + n += 1 + l + sovGov(uint64(l)) + } + if m.DepositEndTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.DepositEndTime) + n += 1 + l + sovGov(uint64(l)) + } if len(m.TotalDeposit) > 0 { for _, e := range m.TotalDeposit { l = e.Size() n += 1 + l + sovGov(uint64(l)) } } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingStartTime) - n += 1 + l + sovGov(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingEndTime) - n += 1 + l + sovGov(uint64(l)) + if m.VotingStartTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingStartTime) + n += 1 + l + sovGov(uint64(l)) + } + if m.VotingEndTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingEndTime) + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -1174,14 +1266,22 @@ func (m *TallyResult) Size() (n int) { } var l int _ = l - l = m.Yes.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.Abstain.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.No.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.NoWithVeto.Size() - n += 1 + l + sovGov(uint64(l)) + l = len(m.Yes) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Abstain) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.No) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.NoWithVeto) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -1222,8 +1322,10 @@ func (m *DepositParams) Size() (n int) { n += 1 + l + sovGov(uint64(l)) } } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod) - n += 1 + l + sovGov(uint64(l)) + if m.MaxDepositPeriod != nil { + l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.MaxDepositPeriod) + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -1233,8 +1335,10 @@ func (m *VotingParams) Size() (n int) { } var l int _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod) - n += 1 + l + sovGov(uint64(l)) + if m.VotingPeriod != nil { + l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.VotingPeriod) + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -1244,12 +1348,18 @@ func (m *TallyParams) Size() (n int) { } 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.VetoThreshold.Size() - n += 1 + l + sovGov(uint64(l)) + l = len(m.Quorum) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Threshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.VetoThreshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -1337,9 +1447,7 @@ func (m *WeightedVoteOption) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Weight = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1627,6 +1735,9 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.FinalTallyResult == nil { + m.FinalTallyResult = &TallyResult{} + } if err := m.FinalTallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1660,7 +1771,10 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.SubmitTime, dAtA[iNdEx:postIndex]); err != nil { + if m.SubmitTime == nil { + m.SubmitTime = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.SubmitTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1693,7 +1807,10 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.DepositEndTime, dAtA[iNdEx:postIndex]); err != nil { + if m.DepositEndTime == nil { + m.DepositEndTime = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.DepositEndTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1760,7 +1877,10 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.VotingStartTime, dAtA[iNdEx:postIndex]); err != nil { + if m.VotingStartTime == nil { + m.VotingStartTime = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.VotingStartTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1793,7 +1913,10 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.VotingEndTime, dAtA[iNdEx:postIndex]); err != nil { + if m.VotingEndTime == nil { + m.VotingEndTime = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.VotingEndTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1877,9 +2000,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Yes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Yes = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -1911,9 +2032,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Abstain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Abstain = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -1945,9 +2064,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.No.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.No = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -1979,9 +2096,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.NoWithVeto.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.NoWithVeto = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2132,7 +2247,7 @@ func (m *Vote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Options = append(m.Options, WeightedVoteOption{}) + m.Options = append(m.Options, &WeightedVoteOption{}) if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2250,7 +2365,10 @@ func (m *DepositParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { + if m.MaxDepositPeriod == nil { + m.MaxDepositPeriod = new(time.Duration) + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2333,7 +2451,10 @@ func (m *VotingParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { + if m.VotingPeriod == nil { + m.VotingPeriod = new(time.Duration) + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2391,7 +2512,7 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGov @@ -2401,30 +2522,29 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGov } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGov } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Quorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Quorum = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGov @@ -2434,30 +2554,29 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGov } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGov } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Threshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Threshold = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGov @@ -2467,24 +2586,23 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGov } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGov } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.VetoThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.VetoThreshold = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index 3de923fd6d90..8b9a6e58bb8b 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -3,8 +3,6 @@ package types import ( "fmt" - "sigs.k8s.io/yaml" - "github.com/gogo/protobuf/proto" "github.com/cosmos/cosmos-sdk/codec/types" @@ -42,14 +40,7 @@ func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer return m, nil } -func (m *MsgSubmitProposal) GetInitialDeposit() sdk.Coins { return m.InitialDeposit } - -func (m *MsgSubmitProposal) GetProposer() sdk.AccAddress { - proposer, _ := sdk.AccAddressFromBech32(m.Proposer) - return proposer -} - -func (m *MsgSubmitProposal) GetMessages() ([]sdk.Msg, error) { +func (m *MsgSubmitProposal) GetMsgs() ([]sdk.Msg, error) { return sdktx.GetMsgs(m.Messages, "sdk.MsgProposal") } @@ -90,11 +81,14 @@ func (m MsgSubmitProposal) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Proposer); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid proposer address: %s", err) } - if !m.InitialDeposit.IsValid() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.InitialDeposit.String()) + + deposit := sdk.NewCoins(m.InitialDeposit...) + if !deposit.IsValid() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, deposit.String()) } - if m.InitialDeposit.IsAnyNegative() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.InitialDeposit.String()) + + if deposit.IsAnyNegative() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, deposit.String()) } // Empty messages are not allowed @@ -103,7 +97,7 @@ func (m MsgSubmitProposal) ValidateBasic() error { // return ErrNoProposalMsgs // } - msgs, err := m.GetMessages() + msgs, err := m.GetMsgs() if err != nil { return err } @@ -130,12 +124,6 @@ func (m MsgSubmitProposal) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{proposer} } -// String implements the Stringer interface -func (m MsgSubmitProposal) String() string { - out, _ := yaml.Marshal(m) - return string(out) -} - // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (m MsgSubmitProposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { return sdktx.UnpackInterfaces(unpacker, m.Messages) @@ -158,22 +146,17 @@ func (msg MsgDeposit) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Depositor); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid depositor address: %s", err) } - if !msg.Amount.IsValid() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + amount := sdk.NewCoins(msg.Amount...) + if !amount.IsValid() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, amount.String()) } - if msg.Amount.IsAnyNegative() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + if amount.IsAnyNegative() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, amount.String()) } return nil } -// String implements the Stringer interface -func (msg MsgDeposit) String() string { - out, _ := yaml.Marshal(msg) - return string(out) -} - // GetSignBytes implements Msg func (msg MsgDeposit) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(&msg) @@ -210,12 +193,6 @@ func (msg MsgVote) ValidateBasic() error { return nil } -// String implements the Stringer interface -func (msg MsgVote) String() string { - out, _ := yaml.Marshal(msg) - return string(out) -} - // GetSignBytes implements Msg func (msg MsgVote) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(&msg) @@ -252,10 +229,14 @@ func (msg MsgVoteWeighted) ValidateBasic() error { totalWeight := sdk.NewDec(0) usedOptions := make(map[VoteOption]bool) for _, option := range msg.Options { - if !ValidWeightedVoteOption(option) { + if !option.IsValid() { return sdkerrors.Wrap(ErrInvalidVote, option.String()) } - totalWeight = totalWeight.Add(option.Weight) + weight, err := sdk.NewDecFromStr(option.Weight) + if err != nil { + return sdkerrors.Wrapf(ErrInvalidVote, "Invalid weight: %s", err) + } + totalWeight = totalWeight.Add(weight) if usedOptions[option.Option] { return sdkerrors.Wrap(ErrInvalidVote, "Duplicated vote option") } @@ -273,12 +254,6 @@ func (msg MsgVoteWeighted) ValidateBasic() error { return nil } -// String implements the Stringer interface -func (msg MsgVoteWeighted) String() string { - out, _ := yaml.Marshal(msg) - return string(out) -} - // GetSignBytes implements Msg func (msg MsgVoteWeighted) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(&msg) diff --git a/x/gov/types/msgs_test.go b/x/gov/types/msgs_test.go index 6f426937e93c..616023e1deaa 100644 --- a/x/gov/types/msgs_test.go +++ b/x/gov/types/msgs_test.go @@ -27,7 +27,7 @@ func TestMsgDepositGetSignBytes(t *testing.T) { msg := NewMsgDeposit(addr, 0, coinsPos) res := msg.GetSignBytes() - expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5","proposal_id":"0"}}` + expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5"}}` require.Equal(t, expected, string(res)) } @@ -95,23 +95,23 @@ func TestMsgVoteWeighted(t *testing.T) { {0, addrs[0], NewNonSplitVoteOption(OptionNoWithVeto), true}, {0, addrs[0], NewNonSplitVoteOption(OptionAbstain), true}, {0, addrs[0], WeightedVoteOptions{ // weight sum > 1 - WeightedVoteOption{Option: OptionYes, Weight: sdk.NewDec(1)}, - WeightedVoteOption{Option: OptionAbstain, Weight: sdk.NewDec(1)}, + NewWeightedVoteOption(OptionYes, sdk.NewDec(1)), + NewWeightedVoteOption(OptionAbstain, sdk.NewDec(1)), }, false}, {0, addrs[0], WeightedVoteOptions{ // duplicate option - WeightedVoteOption{Option: OptionYes, Weight: sdk.NewDecWithPrec(5, 1)}, - WeightedVoteOption{Option: OptionYes, Weight: sdk.NewDecWithPrec(5, 1)}, + NewWeightedVoteOption(OptionYes, sdk.NewDecWithPrec(5, 1)), + NewWeightedVoteOption(OptionYes, sdk.NewDecWithPrec(5, 1)), }, false}, {0, addrs[0], WeightedVoteOptions{ // zero weight - WeightedVoteOption{Option: OptionYes, Weight: sdk.NewDec(0)}, + NewWeightedVoteOption(OptionYes, sdk.NewDec(0)), }, false}, {0, addrs[0], WeightedVoteOptions{ // negative weight - WeightedVoteOption{Option: OptionYes, Weight: sdk.NewDec(-1)}, + NewWeightedVoteOption(OptionYes, sdk.NewDec(-1)), }, false}, {0, addrs[0], WeightedVoteOptions{}, false}, {0, addrs[0], NewNonSplitVoteOption(VoteOption(0x13)), false}, {0, addrs[0], WeightedVoteOptions{ // weight sum <1 - WeightedVoteOption{Option: OptionYes, Weight: sdk.NewDecWithPrec(5, 1)}, + NewWeightedVoteOption(OptionYes, sdk.NewDecWithPrec(5, 1)), }, false}, } diff --git a/x/gov/types/params.go b/x/gov/types/params.go index 0313076d81bf..a4ab8d965927 100644 --- a/x/gov/types/params.go +++ b/x/gov/types/params.go @@ -1,11 +1,10 @@ package types import ( + "errors" "fmt" "time" - "sigs.k8s.io/yaml" - sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -43,7 +42,7 @@ func ParamKeyTable() paramtypes.KeyTable { func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) DepositParams { return DepositParams{ MinDeposit: minDeposit, - MaxDepositPeriod: maxDepositPeriod, + MaxDepositPeriod: &maxDepositPeriod, } } @@ -55,15 +54,9 @@ func DefaultDepositParams() DepositParams { ) } -// String implements stringer insterface -func (dp DepositParams) String() string { - out, _ := yaml.Marshal(dp) - return string(out) -} - // Equal checks equality of DepositParams func (dp DepositParams) Equal(dp2 DepositParams) bool { - return dp.MinDeposit.IsEqual(dp2.MinDeposit) && dp.MaxDepositPeriod == dp2.MaxDepositPeriod + return sdk.NewCoins(dp.MinDeposit...).IsEqual(sdk.NewCoins(dp2.MinDeposit...)) && dp.MaxDepositPeriod == dp2.MaxDepositPeriod } func validateDepositParams(i interface{}) error { @@ -72,10 +65,11 @@ func validateDepositParams(i interface{}) error { return fmt.Errorf("invalid parameter type: %T", i) } - if !v.MinDeposit.IsValid() { + minDeposit := sdk.NewCoins(v.MinDeposit...) + if !minDeposit.IsValid() { return fmt.Errorf("invalid minimum deposit: %s", v.MinDeposit) } - if v.MaxDepositPeriod <= 0 { + if v.MaxDepositPeriod == nil || v.MaxDepositPeriod.Seconds() <= 0 { return fmt.Errorf("maximum deposit period must be positive: %d", v.MaxDepositPeriod) } @@ -85,9 +79,9 @@ func validateDepositParams(i interface{}) error { // NewTallyParams creates a new TallyParams object func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) TallyParams { return TallyParams{ - Quorum: quorum, - Threshold: threshold, - VetoThreshold: vetoThreshold, + Quorum: quorum.String(), + Threshold: threshold.String(), + VetoThreshold: vetoThreshold.String(), } } @@ -98,13 +92,7 @@ func DefaultTallyParams() TallyParams { // Equal checks equality of TallyParams func (tp TallyParams) Equal(other TallyParams) bool { - return tp.Quorum.Equal(other.Quorum) && tp.Threshold.Equal(other.Threshold) && tp.VetoThreshold.Equal(other.VetoThreshold) -} - -// String implements stringer insterface -func (tp TallyParams) String() string { - out, _ := yaml.Marshal(tp) - return string(out) + return tp.Quorum == other.Quorum && tp.Threshold == other.Threshold && tp.VetoThreshold == other.VetoThreshold } func validateTallyParams(i interface{}) error { @@ -113,22 +101,36 @@ func validateTallyParams(i interface{}) error { return fmt.Errorf("invalid parameter type: %T", i) } - if v.Quorum.IsNegative() { - return fmt.Errorf("quorom cannot be negative: %s", v.Quorum) + quorum, err := sdk.NewDecFromStr(v.Quorum) + if err != nil { + return fmt.Errorf("invalid quorum string: %w", err) + } + if quorum.IsNegative() { + return fmt.Errorf("quorom cannot be negative: %s", quorum) } - if v.Quorum.GT(sdk.OneDec()) { + if quorum.GT(sdk.OneDec()) { return fmt.Errorf("quorom too large: %s", v) } - if !v.Threshold.IsPositive() { - return fmt.Errorf("vote threshold must be positive: %s", v.Threshold) + + threshold, err := sdk.NewDecFromStr(v.Threshold) + if err != nil { + return fmt.Errorf("invalid threshold string: %w", err) + } + if !threshold.IsPositive() { + return fmt.Errorf("vote threshold must be positive: %s", threshold) } - if v.Threshold.GT(sdk.OneDec()) { + if threshold.GT(sdk.OneDec()) { return fmt.Errorf("vote threshold too large: %s", v) } - if !v.VetoThreshold.IsPositive() { - return fmt.Errorf("veto threshold must be positive: %s", v.Threshold) + + vetoThreshold, err := sdk.NewDecFromStr(v.VetoThreshold) + if err != nil { + return fmt.Errorf("invalid vetoThreshold string: %w", err) + } + if !vetoThreshold.IsPositive() { + return fmt.Errorf("veto threshold must be positive: %s", vetoThreshold) } - if v.VetoThreshold.GT(sdk.OneDec()) { + if vetoThreshold.GT(sdk.OneDec()) { return fmt.Errorf("veto threshold too large: %s", v) } @@ -138,7 +140,7 @@ func validateTallyParams(i interface{}) error { // NewVotingParams creates a new VotingParams object func NewVotingParams(votingPeriod time.Duration) VotingParams { return VotingParams{ - VotingPeriod: votingPeriod, + VotingPeriod: &votingPeriod, } } @@ -152,19 +154,17 @@ func (vp VotingParams) Equal(other VotingParams) bool { return vp.VotingPeriod == other.VotingPeriod } -// String implements stringer interface -func (vp VotingParams) String() string { - out, _ := yaml.Marshal(vp) - return string(out) -} - func validateVotingParams(i interface{}) error { v, ok := i.(VotingParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } - if v.VotingPeriod <= 0 { + if v.VotingPeriod == nil { + return errors.New("voting period must not be nil") + } + + if v.VotingPeriod.Seconds() <= 0 { return fmt.Errorf("voting period must be positive: %s", v.VotingPeriod) } diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index 0f106b69d6bc..b22808f9c5cd 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -5,15 +5,22 @@ import ( "strings" "time" - "sigs.k8s.io/yaml" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdktx "github.com/cosmos/cosmos-sdk/types/tx" ) -// DefaultStartingProposalID is 1 -const DefaultStartingProposalID uint64 = 1 +const ( + // DefaultStartingProposalID is 1 + DefaultStartingProposalID uint64 = 1 + + StatusNil = ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED + StatusDepositPeriod = ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD + StatusVotingPeriod = ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD + StatusPassed = ProposalStatus_PROPOSAL_STATUS_PASSED + StatusRejected = ProposalStatus_PROPOSAL_STATUS_REJECTED + StatusFailed = ProposalStatus_PROPOSAL_STATUS_FAILED +) // NewProposal creates a new Proposal instance func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time) (Proposal, error) { @@ -29,21 +36,15 @@ func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time. Status: StatusDepositPeriod, FinalTallyResult: EmptyTallyResult(), TotalDeposit: sdk.NewCoins(), - SubmitTime: submitTime, - DepositEndTime: depositEndTime, + SubmitTime: &submitTime, + DepositEndTime: &depositEndTime, } return p, nil } -// String implements stringer interface -func (p Proposal) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} - // GetMessages returns the proposal messages -func (p Proposal) GetMessages() ([]sdk.Msg, error) { +func (p Proposal) GetMsgs() ([]sdk.Msg, error) { return sdktx.GetMsgs(p.Messages, "sdk.MsgProposal") } @@ -57,21 +58,6 @@ type Proposals []Proposal var _ types.UnpackInterfacesMessage = Proposals{} -// Equal returns true if two slices (order-dependant) of proposals are equal. -func (p Proposals) Equal(other Proposals) bool { - if len(p) != len(other) { - return false - } - - for i, proposal := range p { - if !proposal.Equal(other[i]) { - return false - } - } - - return true -} - // String implements stringer interface func (p Proposals) String() string { out := "ID - (Status) [Type] Title\n" diff --git a/x/gov/types/query.pb.go b/x/gov/types/query.pb.go index 606cc1ff783d..d696f322c0c7 100644 --- a/x/gov/types/query.pb.go +++ b/x/gov/types/query.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -79,7 +78,7 @@ func (m *QueryProposalRequest) GetProposalId() uint64 { // 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"` + Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` } func (m *QueryProposalResponse) Reset() { *m = QueryProposalResponse{} } @@ -115,11 +114,11 @@ func (m *QueryProposalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryProposalResponse proto.InternalMessageInfo -func (m *QueryProposalResponse) GetProposal() Proposal { +func (m *QueryProposalResponse) GetProposal() *Proposal { if m != nil { return m.Proposal } - return Proposal{} + return nil } // QueryProposalsRequest is the request type for the Query/Proposals RPC method. @@ -167,10 +166,38 @@ func (m *QueryProposalsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryProposalsRequest proto.InternalMessageInfo +func (m *QueryProposalsRequest) GetProposalStatus() ProposalStatus { + if m != nil { + return m.ProposalStatus + } + return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED +} + +func (m *QueryProposalsRequest) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + +func (m *QueryProposalsRequest) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + +func (m *QueryProposalsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + 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"` + Proposals []*Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals,omitempty"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -208,7 +235,7 @@ func (m *QueryProposalsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryProposalsResponse proto.InternalMessageInfo -func (m *QueryProposalsResponse) GetProposals() []Proposal { +func (m *QueryProposalsResponse) GetProposals() []*Proposal { if m != nil { return m.Proposals } @@ -263,10 +290,24 @@ func (m *QueryVoteRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryVoteRequest proto.InternalMessageInfo +func (m *QueryVoteRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryVoteRequest) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + // QueryVoteResponse is the response type for the Query/Vote RPC method. type QueryVoteResponse struct { // vote defined the queried vote. - Vote Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"` + Vote *Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` } func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} } @@ -302,11 +343,11 @@ func (m *QueryVoteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo -func (m *QueryVoteResponse) GetVote() Vote { +func (m *QueryVoteResponse) GetVote() *Vote { if m != nil { return m.Vote } - return Vote{} + return nil } // QueryVotesRequest is the request type for the Query/Votes RPC method. @@ -367,7 +408,7 @@ func (m *QueryVotesRequest) GetPagination() *query.PageRequest { // QueryVotesResponse is the response type for the Query/Votes RPC method. type QueryVotesResponse struct { // votes defined the queried votes. - Votes []Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"` + Votes []*Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes,omitempty"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -405,7 +446,7 @@ func (m *QueryVotesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryVotesResponse proto.InternalMessageInfo -func (m *QueryVotesResponse) GetVotes() []Vote { +func (m *QueryVotesResponse) GetVotes() []*Vote { if m != nil { return m.Votes } @@ -469,11 +510,11 @@ func (m *QueryParamsRequest) GetParamsType() string { // QueryParamsResponse is the response type for the Query/Params RPC method. type QueryParamsResponse struct { // voting_params defines the parameters related to voting. - VotingParams VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` + VotingParams *VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` // deposit_params defines the parameters related to deposit. - DepositParams DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` + DepositParams *DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` // tally_params defines the parameters related to tally. - TallyParams TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` + TallyParams *TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -509,25 +550,25 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetVotingParams() VotingParams { +func (m *QueryParamsResponse) GetVotingParams() *VotingParams { if m != nil { return m.VotingParams } - return VotingParams{} + return nil } -func (m *QueryParamsResponse) GetDepositParams() DepositParams { +func (m *QueryParamsResponse) GetDepositParams() *DepositParams { if m != nil { return m.DepositParams } - return DepositParams{} + return nil } -func (m *QueryParamsResponse) GetTallyParams() TallyParams { +func (m *QueryParamsResponse) GetTallyParams() *TallyParams { if m != nil { return m.TallyParams } - return TallyParams{} + return nil } // QueryDepositRequest is the request type for the Query/Deposit RPC method. @@ -571,10 +612,24 @@ func (m *QueryDepositRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDepositRequest proto.InternalMessageInfo +func (m *QueryDepositRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryDepositRequest) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + // QueryDepositResponse is the response type for the Query/Deposit RPC method. type QueryDepositResponse struct { // deposit defines the requested deposit. - Deposit Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit"` + Deposit *Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit,omitempty"` } func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } @@ -610,11 +665,11 @@ func (m *QueryDepositResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo -func (m *QueryDepositResponse) GetDeposit() Deposit { +func (m *QueryDepositResponse) GetDeposit() *Deposit { if m != nil { return m.Deposit } - return Deposit{} + return nil } // QueryDepositsRequest is the request type for the Query/Deposits RPC method. @@ -674,7 +729,7 @@ func (m *QueryDepositsRequest) GetPagination() *query.PageRequest { // 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"` + Deposits []*Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits,omitempty"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -712,7 +767,7 @@ func (m *QueryDepositsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDepositsResponse proto.InternalMessageInfo -func (m *QueryDepositsResponse) GetDeposits() []Deposit { +func (m *QueryDepositsResponse) GetDeposits() []*Deposit { if m != nil { return m.Deposits } @@ -775,7 +830,7 @@ func (m *QueryTallyResultRequest) GetProposalId() uint64 { // QueryTallyResultResponse is the response type for the Query/Tally RPC method. type QueryTallyResultResponse struct { // tally defines the requested tally. - Tally TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally"` + Tally *TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally,omitempty"` } func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultResponse{} } @@ -811,11 +866,11 @@ func (m *QueryTallyResultResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryTallyResultResponse proto.InternalMessageInfo -func (m *QueryTallyResultResponse) GetTally() TallyResult { +func (m *QueryTallyResultResponse) GetTally() *TallyResult { if m != nil { return m.Tally } - return TallyResult{} + return nil } func init() { @@ -840,70 +895,67 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/query.proto", fileDescriptor_3efdc0c4615c3665) } var fileDescriptor_3efdc0c4615c3665 = []byte{ - // 998 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x38, 0x4e, 0x6b, 0x4f, 0xda, 0x00, 0x8f, 0x00, 0xc6, 0x14, 0x3b, 0xac, 0x68, 0x6b, - 0x52, 0xb2, 0x4b, 0x9c, 0x52, 0xd4, 0x16, 0x50, 0x6b, 0xa1, 0xb6, 0xa8, 0x12, 0x0a, 0x4e, 0x05, - 0x12, 0x97, 0x68, 0x53, 0xaf, 0x96, 0x15, 0x8e, 0x67, 0xbb, 0x33, 0xb6, 0x1a, 0x85, 0x08, 0x89, - 0x13, 0x88, 0x0b, 0xa8, 0x88, 0x1b, 0x50, 0xa9, 0x12, 0xbf, 0x80, 0x1f, 0xd1, 0x63, 0x05, 0x1c, - 0x38, 0x21, 0x94, 0x70, 0xe0, 0x47, 0x70, 0x40, 0x3b, 0xf3, 0x66, 0xbd, 0x9b, 0xac, 0xbd, 0xeb, - 0x12, 0x71, 0x8a, 0x3d, 0xf3, 0x7d, 0xef, 0x7d, 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33, 0x71, 0x28, 0xeb, 0x35, 0x29, 0x6b, 0x09, 0x9a, 0xa9, 0xb2, 0x24, 0xd6, 0xda, 0x89, 0x3d, - 0x3f, 0xbb, 0xf0, 0x13, 0xa1, 0xc7, 0xf1, 0x86, 0xc3, 0xf8, 0x34, 0xc9, 0x61, 0x5c, 0x6b, 0x66, - 0x03, 0x51, 0xd0, 0x0d, 0x29, 0xa8, 0x0d, 0x57, 0xa6, 0xf1, 0x49, 0x8f, 0x18, 0x6b, 0x27, 0x1a, - 0xd3, 0xbb, 0xf0, 0x3d, 0xa1, 0x65, 0x3d, 0xc2, 0x20, 0x53, 0x00, 0xcf, 0xbe, 0x86, 0x07, 0xe7, - 0xa1, 0xf1, 0xa6, 0xd4, 0x7a, 0x01, 0xce, 0x3f, 0x8e, 0x56, 0x78, 0x40, 0xe8, 0x5c, 0x6c, 0x9a, - 0xc0, 0xb9, 0xb1, 0x89, 0x0f, 0xcf, 0xb9, 0xda, 0xab, 0xf9, 0xc0, 0xff, 0xa5, 0xf9, 0xe4, 0x58, - 0x6b, 0xb7, 0x1f, 0xee, 0xd5, 0xc9, 0xa3, 0xbd, 0x3a, 0xf9, 0x73, 0xaf, 0x4e, 0xbe, 0xde, 0xaf, - 0x17, 0x1e, 0xed, 0xd7, 0x0b, 0xbf, 0xef, 0xd7, 0x0b, 0x1f, 0x35, 0x5d, 0x4f, 0x7c, 0x3c, 0xd8, - 0x34, 0x6f, 0xb3, 0x2d, 0x1d, 0x56, 0xfd, 0x59, 0xe6, 0xdd, 0x4f, 0xac, 0xbb, 0x32, 0x47, 0xd8, - 0x32, 0x7c, 0xf3, 0x98, 0xfc, 0x1f, 0x68, 0xf5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xda, - 0x91, 0x66, 0xd2, 0x0d, 0x00, 0x00, + // 952 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0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0x8d, 0x5b, 0xfd, 0x67, 0x45, 0xb4, 0x3e, 0x73, 0x3e, 0x57, + 0x31, 0xe2, 0x91, 0x11, 0xdb, 0xa7, 0xd4, 0x2f, 0x95, 0xf5, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x6d, 0xa1, 0x92, 0x20, 0x62, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1302,16 +1354,18 @@ func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Proposal != nil { + { + size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1473,16 +1527,18 @@ func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Vote != nil { + { + size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1625,36 +1681,42 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.TallyParams != nil { + { + size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.DepositParams != nil { + { + size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 - { - size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.VotingParams != nil { + { + size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1713,16 +1775,18 @@ func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Deposit != nil { + { + size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1863,16 +1927,18 @@ func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l - { - size, err := m.Tally.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Tally != nil { + { + size, err := m.Tally.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1905,8 +1971,10 @@ func (m *QueryProposalResponse) Size() (n int) { } var l int _ = l - l = m.Proposal.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Proposal != nil { + l = m.Proposal.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -1975,8 +2043,10 @@ func (m *QueryVoteResponse) Size() (n int) { } var l int _ = l - l = m.Vote.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Vote != nil { + l = m.Vote.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -2034,12 +2104,18 @@ func (m *QueryParamsResponse) Size() (n int) { } 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)) + if m.VotingParams != nil { + l = m.VotingParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.DepositParams != nil { + l = m.DepositParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.TallyParams != nil { + l = m.TallyParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -2065,8 +2141,10 @@ func (m *QueryDepositResponse) Size() (n int) { } var l int _ = l - l = m.Deposit.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Deposit != nil { + l = m.Deposit.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -2123,8 +2201,10 @@ func (m *QueryTallyResultResponse) Size() (n int) { } var l int _ = l - l = m.Tally.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Tally != nil { + l = m.Tally.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -2261,6 +2341,9 @@ func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Proposal == nil { + m.Proposal = &Proposal{} + } if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2513,7 +2596,7 @@ func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Proposals = append(m.Proposals, Proposal{}) + m.Proposals = append(m.Proposals, &Proposal{}) if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2734,6 +2817,9 @@ func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Vote == nil { + m.Vote = &Vote{} + } if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2922,7 +3008,7 @@ func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Votes = append(m.Votes, Vote{}) + m.Votes = append(m.Votes, &Vote{}) if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3124,6 +3210,9 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.VotingParams == nil { + m.VotingParams = &VotingParams{} + } if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3157,6 +3246,9 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.DepositParams == nil { + m.DepositParams = &DepositParams{} + } if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3190,6 +3282,9 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.TallyParams == nil { + m.TallyParams = &TallyParams{} + } if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3374,6 +3469,9 @@ func (m *QueryDepositResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Deposit == nil { + m.Deposit = &Deposit{} + } if err := m.Deposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3562,7 +3660,7 @@ func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Deposits = append(m.Deposits, Deposit{}) + m.Deposits = append(m.Deposits, &Deposit{}) if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3751,6 +3849,9 @@ func (m *QueryTallyResultResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Tally == nil { + m.Tally = &TallyResult{} + } if err := m.Tally.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/gov/types/tally.go b/x/gov/types/tally.go index 247bcecbc8a1..25d1e35846f5 100644 --- a/x/gov/types/tally.go +++ b/x/gov/types/tally.go @@ -1,8 +1,6 @@ package types import ( - "sigs.k8s.io/yaml" - sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -29,17 +27,17 @@ func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens sdk.Int, delegator } // NewTallyResult creates a new TallyResult instance -func NewTallyResult(yes, abstain, no, noWithVeto sdk.Int) TallyResult { - return TallyResult{ - Yes: yes, - Abstain: abstain, - No: no, - NoWithVeto: noWithVeto, +func NewTallyResult(yes, abstain, no, noWithVeto sdk.Int) *TallyResult { + return &TallyResult{ + Yes: yes.String(), + Abstain: abstain.String(), + No: no.String(), + NoWithVeto: noWithVeto.String(), } } // NewTallyResultFromMap creates a new TallyResult instance from a Option -> Dec map -func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) TallyResult { +func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) *TallyResult { return NewTallyResult( results[OptionYes].TruncateInt(), results[OptionAbstain].TruncateInt(), @@ -49,20 +47,14 @@ func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) TallyResult { } // EmptyTallyResult returns an empty TallyResult. -func EmptyTallyResult() TallyResult { +func EmptyTallyResult() *TallyResult { return NewTallyResult(sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroInt()) } -// Equals returns if two proposals are equal. +// Equals returns if two tally results are equal. func (tr TallyResult) Equals(comp TallyResult) bool { - return tr.Yes.Equal(comp.Yes) && - tr.Abstain.Equal(comp.Abstain) && - tr.No.Equal(comp.No) && - tr.NoWithVeto.Equal(comp.NoWithVeto) -} - -// String implements stringer interface -func (tr TallyResult) String() string { - out, _ := yaml.Marshal(tr) - return string(out) + return tr.Yes == comp.Yes && + tr.Abstain == comp.Abstain && + tr.No == comp.No && + tr.NoWithVeto == comp.NoWithVeto } diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index 1ba0d1d0c49a..c6062c7c8267 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -35,13 +34,14 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary // proposal Content. type MsgSubmitProposal struct { - Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` - InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit"` - Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` + Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + InitialDeposit []types1.Coin `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit"` + Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` } -func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } -func (*MsgSubmitProposal) ProtoMessage() {} +func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } +func (m *MsgSubmitProposal) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitProposal) ProtoMessage() {} func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { return fileDescriptor_4214261f6b3f9ed4, []int{0} } @@ -72,9 +72,30 @@ func (m *MsgSubmitProposal) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo +func (m *MsgSubmitProposal) GetMessages() []*types.Any { + if m != nil { + return m.Messages + } + return nil +} + +func (m *MsgSubmitProposal) GetInitialDeposit() []types1.Coin { + if m != nil { + return m.InitialDeposit + } + return nil +} + +func (m *MsgSubmitProposal) GetProposer() string { + if m != nil { + return m.Proposer + } + return "" +} + // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. type MsgSubmitProposalResponse struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` } func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} } @@ -119,13 +140,14 @@ func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { // MsgVote defines a message to cast a vote. type MsgVote struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta2.VoteOption" json:"option,omitempty"` } -func (m *MsgVote) Reset() { *m = MsgVote{} } -func (*MsgVote) ProtoMessage() {} +func (m *MsgVote) Reset() { *m = MsgVote{} } +func (m *MsgVote) String() string { return proto.CompactTextString(m) } +func (*MsgVote) ProtoMessage() {} func (*MsgVote) Descriptor() ([]byte, []int) { return fileDescriptor_4214261f6b3f9ed4, []int{2} } @@ -156,6 +178,27 @@ func (m *MsgVote) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVote proto.InternalMessageInfo +func (m *MsgVote) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *MsgVote) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + +func (m *MsgVote) GetOption() VoteOption { + if m != nil { + return m.Option + } + return VoteOption_VOTE_OPTION_UNSPECIFIED +} + // MsgVoteResponse defines the Msg/Vote response type. type MsgVoteResponse struct { } @@ -197,13 +240,14 @@ var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo // // Since: cosmos-sdk 0.43 type MsgVoteWeighted struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Options []WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + Options []*WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` } -func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } -func (*MsgVoteWeighted) ProtoMessage() {} +func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } +func (m *MsgVoteWeighted) String() string { return proto.CompactTextString(m) } +func (*MsgVoteWeighted) ProtoMessage() {} func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { return fileDescriptor_4214261f6b3f9ed4, []int{4} } @@ -234,6 +278,27 @@ func (m *MsgVoteWeighted) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVoteWeighted proto.InternalMessageInfo +func (m *MsgVoteWeighted) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *MsgVoteWeighted) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + +func (m *MsgVoteWeighted) GetOptions() []*WeightedVoteOption { + if m != nil { + return m.Options + } + return nil +} + // MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. // // Since: cosmos-sdk 0.43 @@ -275,13 +340,14 @@ var xxx_messageInfo_MsgVoteWeightedResponse proto.InternalMessageInfo // MsgDeposit defines a message to submit a deposit to an existing proposal. type MsgDeposit struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` + Amount []types1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"` } -func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } -func (*MsgDeposit) ProtoMessage() {} +func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } +func (m *MsgDeposit) String() string { return proto.CompactTextString(m) } +func (*MsgDeposit) ProtoMessage() {} func (*MsgDeposit) Descriptor() ([]byte, []int) { return fileDescriptor_4214261f6b3f9ed4, []int{6} } @@ -312,6 +378,27 @@ func (m *MsgDeposit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo +func (m *MsgDeposit) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *MsgDeposit) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + +func (m *MsgDeposit) GetAmount() []types1.Coin { + if m != nil { + return m.Amount + } + return nil +} + // MsgDepositResponse defines the Msg/Deposit response type. type MsgDepositResponse struct { } @@ -363,49 +450,44 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) } var fileDescriptor_4214261f6b3f9ed4 = []byte{ - // 667 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x4f, 0x13, 0x4f, - 0x14, 0xdf, 0x6d, 0xf9, 0xf2, 0xe3, 0xf1, 0x0d, 0xc8, 0xa4, 0xd1, 0x6d, 0x31, 0xbb, 0x4d, 0x0d, - 0xa4, 0x89, 0x61, 0x17, 0xaa, 0xc1, 0x84, 0x1b, 0xd5, 0x10, 0x3d, 0x34, 0xea, 0x92, 0x68, 0xe2, - 0x05, 0xb7, 0xdd, 0x61, 0x98, 0xd8, 0xee, 0x6c, 0x3a, 0xd3, 0x86, 0xde, 0x4c, 0xbc, 0x78, 0xf4, - 0xe8, 0x91, 0xb3, 0x67, 0xff, 0x08, 0x12, 0x2f, 0xc4, 0x78, 0xf0, 0x60, 0xd0, 0xc0, 0xc5, 0x18, - 0xbd, 0xf8, 0x17, 0x98, 0x9d, 0x9d, 0x5d, 0x10, 0x96, 0x82, 0x89, 0x9e, 0x60, 0xde, 0xe7, 0xf3, - 0x79, 0xf3, 0x3e, 0x6f, 0xde, 0xdb, 0xc2, 0x6c, 0x8b, 0xf1, 0x0e, 0xe3, 0x0e, 0x61, 0x7d, 0xa7, - 0xbf, 0xd4, 0xc4, 0xc2, 0xab, 0x39, 0x62, 0xdb, 0x0e, 0xbb, 0x4c, 0x30, 0x84, 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0x24, 0x9a, 0x37, 0x37, 0x11, 0x67, 0x38, 0x2d, 0xc2, - 0x95, 0x13, 0xae, 0x52, 0xc7, 0x3f, 0x74, 0x80, 0x06, 0x27, 0xc9, 0xe0, 0xfd, 0xf1, 0x4c, 0xa0, - 0x65, 0x98, 0x50, 0x8b, 0xc1, 0xce, 0x77, 0x7a, 0x44, 0x45, 0x2d, 0x18, 0xf5, 0x3a, 0xac, 0x17, - 0x08, 0x65, 0xf6, 0xaf, 0xee, 0x93, 0x4a, 0x9d, 0xd1, 0x8a, 0x02, 0xa0, 0x23, 0xbb, 0x49, 0x17, - 0x6a, 0xdf, 0x73, 0x90, 0x6f, 0x70, 0x82, 0x36, 0x61, 0xea, 0xc4, 0x17, 0x63, 0x2e, 0xeb, 0x0d, - 0x4e, 0xed, 0x54, 0x69, 0xe1, 0x42, 0xb4, 0x74, 0xf5, 0xee, 0xc2, 0x88, 0x5c, 0xa2, 0xd9, 0x33, - 0x64, 0x11, 0x58, 0xba, 0x36, 0x04, 0x4c, 0x33, 0x3d, 0x85, 0xff, 0x7f, 0x9b, 0xd6, 0x61, 0xa2, - 0x84, 0x54, 0xba, 0x7e, 0x01, 0x52, 0x7a, 0xc3, 0x43, 0x18, 0x4b, 0xa6, 0xc3, 0x3c, 0x43, 0xa7, - 0xf0, 0xd2, 0xfc, 0x70, 0x3c, 0x49, 0x59, 0xaf, 0xef, 0x1e, 0x98, 0xfa, 0xde, 0x81, 0xa9, 0x7f, - 0x39, 0x30, 0xf5, 0x57, 0x87, 0xa6, 0xb6, 0x77, 0x68, 0x6a, 0x1f, 0x0f, 0x4d, 0xed, 0xc9, 0xf0, - 0x27, 0xde, 0x96, 0x3f, 0x1c, 0xf2, 0xa1, 0x9b, 0xa3, 0xf2, 0x83, 0x7d, 0xe3, 0x57, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x5d, 0x24, 0xb4, 0x1c, 0xa4, 0x06, 0x00, 0x00, + // 585 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0x8d, 0x9b, 0x7e, 0xfd, 0xb9, 0xfd, 0x94, 0xaa, 0x56, 0x24, 0x1c, 0x17, 0xb9, 0x91, 0x11, + 0x55, 0x24, 0x94, 0x31, 0x09, 0xa8, 0x6c, 0x58, 0xd0, 0xc0, 0xa2, 0x2c, 0x22, 0xc0, 0x95, 0x40, + 0x62, 0x13, 0xec, 0x78, 0x3a, 0x1d, 0x91, 0xf8, 0x5a, 0x9e, 0x49, 0xd4, 0xbc, 0x05, 0xe2, 0x01, + 0x58, 0xf1, 0x08, 0xbc, 0x02, 0x52, 0x97, 0x15, 0x2b, 0x56, 0x08, 0x25, 0x5b, 0x1e, 0x02, 0xc5, + 0x1e, 0xbb, 0xd0, 0xa4, 0x49, 0x17, 0xac, 0xe2, 0xdc, 0x73, 0xce, 0xbd, 0xe7, 0x7a, 0x8e, 0x07, + 0x76, 0xbb, 0x28, 0xfa, 0x28, 0x1c, 0x86, 0x43, 0x67, 0xd8, 0xf0, 0xa9, 0xf4, 0x9a, 0x8e, 0x3c, + 0x23, 0x51, 0x8c, 0x12, 0x75, 0x3d, 0x05, 0x09, 0xc3, 0x21, 0x51, 0xa0, 0x69, 0x29, 0x81, 0xef, + 0x09, 0xaa, 0x14, 0x0d, 0xa7, 0x8b, 0x3c, 0x4c, 0x35, 0xe6, 0xed, 0x39, 0x0d, 0xa7, 0xfa, 0x14, + 0x2d, 0x33, 0x64, 0x98, 0x3c, 0x3a, 0xd3, 0x27, 0x55, 0xad, 0xa4, 0x9a, 0x4e, 0x0a, 0xa8, 0xa1, + 0x0a, 0x62, 0x88, 0xac, 0x47, 0x9d, 0xe4, 0x9f, 0x3f, 0x38, 0x71, 0xbc, 0x70, 0x94, 0x42, 0xf6, + 0x57, 0x0d, 0x76, 0xda, 0x82, 0x1d, 0x0f, 0xfc, 0x3e, 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0x93, 0x2e, 0xf6, 0xd5, 0x1d, 0xa7, 0x7e, 0xea, 0x22, 0x78, 0xef, 0x9c, 0x25, + 0x37, 0xa6, 0x1c, 0x45, 0x54, 0xf8, 0x6b, 0xc9, 0x4d, 0xf5, 0xe0, 0x77, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xe7, 0x3b, 0xf1, 0xb1, 0x9d, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1543,7 +1625,7 @@ func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Options = append(m.Options, WeightedVoteOption{}) + m.Options = append(m.Options, &WeightedVoteOption{}) if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/gov/types/v1beta2/genesis.pb.go b/x/gov/types/v1beta2/genesis.pb.go deleted file mode 100644 index 36df7540052d..000000000000 --- a/x/gov/types/v1beta2/genesis.pb.go +++ /dev/null @@ -1,684 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta2/genesis.proto - -package v1beta2 - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - 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 - -// GenesisState defines the gov module's genesis state. -type GenesisState struct { - // starting_proposal_id is the ID of the starting proposal. - StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty"` - // deposits defines all the deposits present at genesis. - Deposits []*Deposit `protobuf:"bytes,2,rep,name=deposits,proto3" json:"deposits,omitempty"` - // votes defines all the votes present at genesis. - Votes []*Vote `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` - // proposals defines all the proposals present at genesis. - Proposals []*Proposal `protobuf:"bytes,4,rep,name=proposals,proto3" json:"proposals,omitempty"` - // params defines all the paramaters of related to deposit. - DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` - // params defines all the paramaters of related to voting. - VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` - // params defines all the paramaters of related to tally. - TallyParams *TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_7915ab39bb5aa171, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetStartingProposalId() uint64 { - if m != nil { - return m.StartingProposalId - } - return 0 -} - -func (m *GenesisState) GetDeposits() []*Deposit { - if m != nil { - return m.Deposits - } - return nil -} - -func (m *GenesisState) GetVotes() []*Vote { - if m != nil { - return m.Votes - } - return nil -} - -func (m *GenesisState) GetProposals() []*Proposal { - if m != nil { - return m.Proposals - } - return nil -} - -func (m *GenesisState) GetDepositParams() *DepositParams { - if m != nil { - return m.DepositParams - } - return nil -} - -func (m *GenesisState) GetVotingParams() *VotingParams { - if m != nil { - return m.VotingParams - } - return nil -} - -func (m *GenesisState) GetTallyParams() *TallyParams { - if m != nil { - return m.TallyParams - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1beta2.GenesisState") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta2/genesis.proto", fileDescriptor_7915ab39bb5aa171) } - -var fileDescriptor_7915ab39bb5aa171 = []byte{ - // 345 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xbb, 0x4e, 0xc3, 0x30, - 0x14, 0x86, 0x1b, 0x7a, 0x01, 0xdc, 0x96, 0xc1, 0x62, 0x88, 0xa0, 0x0a, 0x81, 0xa9, 0x0b, 0x4e, - 0x29, 0x03, 0x12, 0x63, 0x05, 0xe2, 0x32, 0x55, 0x01, 0x31, 0xb0, 0x54, 0x6e, 0x63, 0x85, 0x88, - 0xb6, 0x27, 0x8a, 0x0f, 0x16, 0x7d, 0x0b, 0x9e, 0x87, 0x27, 0x60, 0xec, 0xc8, 0x88, 0x9a, 0x17, - 0x41, 0xb5, 0x13, 0x5a, 0x89, 0xc0, 0x14, 0x1d, 0xf9, 0xfb, 0xbf, 0xfc, 0xb2, 0x0f, 0x71, 0x47, - 0x20, 0x27, 0x20, 0xbd, 0x10, 0x94, 0xa7, 0x4e, 0x86, 0x02, 0x79, 0xd7, 0x0b, 0xc5, 0x54, 0xc8, - 0x48, 0xb2, 0x38, 0x01, 0x04, 0x4a, 0x0d, 0xc1, 0x42, 0x50, 0x2c, 0x23, 0xf6, 0x5a, 0x45, 0x29, - 0x50, 0x26, 0x71, 0xf4, 0x5e, 0x26, 0x8d, 0x2b, 0xe3, 0xb8, 0x43, 0x8e, 0x82, 0x76, 0xc8,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97, 0xbd, 0xbf, 0xf9, 0x1c, 0xcb, 0xe0, 0xd9, 0x7b, 0xd5, 0xcb, - 0x80, 0xb3, 0x58, 0xc8, 0x7c, 0x25, 0x86, 0x35, 0xbd, 0x0f, 0xa7, 0xdf, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xb6, 0x88, 0x7e, 0xc1, 0x65, 0x02, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TallyParams != nil { - { - size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.VotingParams != nil { - { - size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.DepositParams != nil { - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - 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 = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - 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 = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - 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 = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.StartingProposalId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.StartingProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StartingProposalId != 0 { - n += 1 + sovGenesis(uint64(m.StartingProposalId)) - } - if len(m.Deposits) > 0 { - for _, e := range m.Deposits { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Votes) > 0 { - for _, e := range m.Votes { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Proposals) > 0 { - for _, e := range m.Proposals { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.DepositParams != nil { - l = m.DepositParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - if m.VotingParams != nil { - l = m.VotingParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - if m.TallyParams != nil { - l = m.TallyParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartingProposalId", wireType) - } - m.StartingProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartingProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - 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 3: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - 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 4: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - 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 5: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DepositParams == nil { - m.DepositParams = &DepositParams{} - } - if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VotingParams == nil { - m.VotingParams = &VotingParams{} - } - if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TallyParams == nil { - m.TallyParams = &TallyParams{} - } - if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gov/types/v1beta2/gov.pb.go b/x/gov/types/v1beta2/gov.pb.go deleted file mode 100644 index 7b97c7318e52..000000000000 --- a/x/gov/types/v1beta2/gov.pb.go +++ /dev/null @@ -1,2717 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta2/gov.proto - -package v1beta2 - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// VoteOption enumerates the valid vote options for a given governance proposal. -type VoteOption int32 - -const ( - // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 - // VOTE_OPTION_YES defines a yes vote option. - VoteOption_VOTE_OPTION_YES VoteOption = 1 - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 - // VOTE_OPTION_NO defines a no vote option. - VoteOption_VOTE_OPTION_NO VoteOption = 3 - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VoteOption_VOTE_OPTION_NO_WITH_VETO VoteOption = 4 -) - -var VoteOption_name = map[int32]string{ - 0: "VOTE_OPTION_UNSPECIFIED", - 1: "VOTE_OPTION_YES", - 2: "VOTE_OPTION_ABSTAIN", - 3: "VOTE_OPTION_NO", - 4: "VOTE_OPTION_NO_WITH_VETO", -} - -var VoteOption_value = map[string]int32{ - "VOTE_OPTION_UNSPECIFIED": 0, - "VOTE_OPTION_YES": 1, - "VOTE_OPTION_ABSTAIN": 2, - "VOTE_OPTION_NO": 3, - "VOTE_OPTION_NO_WITH_VETO": 4, -} - -func (x VoteOption) String() string { - return proto.EnumName(VoteOption_name, int32(x)) -} - -func (VoteOption) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{0} -} - -// ProposalStatus enumerates the valid statuses of a proposal. -type ProposalStatus int32 - -const ( - // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. - ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED ProposalStatus = 0 - // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - // period. - ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD ProposalStatus = 1 - // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - // period. - ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD ProposalStatus = 2 - // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - // passed. - ProposalStatus_PROPOSAL_STATUS_PASSED ProposalStatus = 3 - // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - // been rejected. - ProposalStatus_PROPOSAL_STATUS_REJECTED ProposalStatus = 4 - // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - // failed. - ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 -) - -var ProposalStatus_name = map[int32]string{ - 0: "PROPOSAL_STATUS_UNSPECIFIED", - 1: "PROPOSAL_STATUS_DEPOSIT_PERIOD", - 2: "PROPOSAL_STATUS_VOTING_PERIOD", - 3: "PROPOSAL_STATUS_PASSED", - 4: "PROPOSAL_STATUS_REJECTED", - 5: "PROPOSAL_STATUS_FAILED", -} - -var ProposalStatus_value = map[string]int32{ - "PROPOSAL_STATUS_UNSPECIFIED": 0, - "PROPOSAL_STATUS_DEPOSIT_PERIOD": 1, - "PROPOSAL_STATUS_VOTING_PERIOD": 2, - "PROPOSAL_STATUS_PASSED": 3, - "PROPOSAL_STATUS_REJECTED": 4, - "PROPOSAL_STATUS_FAILED": 5, -} - -func (x ProposalStatus) String() string { - return proto.EnumName(ProposalStatus_name, int32(x)) -} - -func (ProposalStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{1} -} - -// WeightedVoteOption defines a unit of vote for vote split. -type WeightedVoteOption struct { - Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta2.VoteOption" json:"option,omitempty"` - Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` -} - -func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } -func (m *WeightedVoteOption) String() string { return proto.CompactTextString(m) } -func (*WeightedVoteOption) ProtoMessage() {} -func (*WeightedVoteOption) Descriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{0} -} -func (m *WeightedVoteOption) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WeightedVoteOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WeightedVoteOption.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 *WeightedVoteOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_WeightedVoteOption.Merge(m, src) -} -func (m *WeightedVoteOption) XXX_Size() int { - return m.Size() -} -func (m *WeightedVoteOption) XXX_DiscardUnknown() { - xxx_messageInfo_WeightedVoteOption.DiscardUnknown(m) -} - -var xxx_messageInfo_WeightedVoteOption proto.InternalMessageInfo - -func (m *WeightedVoteOption) GetOption() VoteOption { - if m != nil { - return m.Option - } - return VoteOption_VOTE_OPTION_UNSPECIFIED -} - -func (m *WeightedVoteOption) GetWeight() string { - if m != nil { - return m.Weight - } - return "" -} - -// Deposit defines an amount deposited by an account address to an active -// proposal. -type Deposit struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` - Amount []*types.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount,omitempty"` -} - -func (m *Deposit) Reset() { *m = Deposit{} } -func (m *Deposit) String() string { return proto.CompactTextString(m) } -func (*Deposit) ProtoMessage() {} -func (*Deposit) Descriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{1} -} -func (m *Deposit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Deposit.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 *Deposit) XXX_Merge(src proto.Message) { - xxx_messageInfo_Deposit.Merge(m, src) -} -func (m *Deposit) XXX_Size() int { - return m.Size() -} -func (m *Deposit) XXX_DiscardUnknown() { - xxx_messageInfo_Deposit.DiscardUnknown(m) -} - -var xxx_messageInfo_Deposit proto.InternalMessageInfo - -func (m *Deposit) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *Deposit) GetDepositor() string { - if m != nil { - return m.Depositor - } - return "" -} - -func (m *Deposit) GetAmount() []*types.Coin { - if m != nil { - return m.Amount - } - return nil -} - -// Proposal defines the core field members of a governance proposal. -type Proposal struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - Messages []*types1.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` - Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta2.ProposalStatus" json:"status,omitempty"` - FinalTallyResult *TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result,omitempty"` - SubmitTime *time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time,omitempty"` - DepositEndTime *time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time,omitempty"` - TotalDeposit []*types.Coin `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3" json:"total_deposit,omitempty"` - VotingStartTime *time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time,omitempty"` - VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` -} - -func (m *Proposal) Reset() { *m = Proposal{} } -func (m *Proposal) String() string { return proto.CompactTextString(m) } -func (*Proposal) ProtoMessage() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{2} -} -func (m *Proposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proposal.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 *Proposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proposal.Merge(m, src) -} -func (m *Proposal) XXX_Size() int { - return m.Size() -} -func (m *Proposal) XXX_DiscardUnknown() { - xxx_messageInfo_Proposal.DiscardUnknown(m) -} - -var xxx_messageInfo_Proposal proto.InternalMessageInfo - -func (m *Proposal) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *Proposal) GetMessages() []*types1.Any { - if m != nil { - return m.Messages - } - return nil -} - -func (m *Proposal) GetStatus() ProposalStatus { - if m != nil { - return m.Status - } - return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED -} - -func (m *Proposal) GetFinalTallyResult() *TallyResult { - if m != nil { - return m.FinalTallyResult - } - return nil -} - -func (m *Proposal) GetSubmitTime() *time.Time { - if m != nil { - return m.SubmitTime - } - return nil -} - -func (m *Proposal) GetDepositEndTime() *time.Time { - if m != nil { - return m.DepositEndTime - } - return nil -} - -func (m *Proposal) GetTotalDeposit() []*types.Coin { - if m != nil { - return m.TotalDeposit - } - return nil -} - -func (m *Proposal) GetVotingStartTime() *time.Time { - if m != nil { - return m.VotingStartTime - } - return nil -} - -func (m *Proposal) GetVotingEndTime() *time.Time { - if m != nil { - return m.VotingEndTime - } - return nil -} - -// TallyResult defines a standard tally for a governance proposal. -type TallyResult struct { - Yes string `protobuf:"bytes,1,opt,name=yes,proto3" json:"yes,omitempty"` - Abstain string `protobuf:"bytes,2,opt,name=abstain,proto3" json:"abstain,omitempty"` - No string `protobuf:"bytes,3,opt,name=no,proto3" json:"no,omitempty"` - NoWithVeto string `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3" json:"no_with_veto,omitempty"` -} - -func (m *TallyResult) Reset() { *m = TallyResult{} } -func (m *TallyResult) String() string { return proto.CompactTextString(m) } -func (*TallyResult) ProtoMessage() {} -func (*TallyResult) Descriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{3} -} -func (m *TallyResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TallyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TallyResult.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 *TallyResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_TallyResult.Merge(m, src) -} -func (m *TallyResult) XXX_Size() int { - return m.Size() -} -func (m *TallyResult) XXX_DiscardUnknown() { - xxx_messageInfo_TallyResult.DiscardUnknown(m) -} - -var xxx_messageInfo_TallyResult proto.InternalMessageInfo - -func (m *TallyResult) GetYes() string { - if m != nil { - return m.Yes - } - return "" -} - -func (m *TallyResult) GetAbstain() string { - if m != nil { - return m.Abstain - } - return "" -} - -func (m *TallyResult) GetNo() string { - if m != nil { - return m.No - } - return "" -} - -func (m *TallyResult) GetNoWithVeto() string { - if m != nil { - return m.NoWithVeto - } - return "" -} - -// Vote defines a vote on a governance proposal. -// A Vote consists of a proposal ID, the voter, and the vote option. -type Vote struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // Deprecated: Prefer to use `options` instead. This field is set in queries - // if and only if `len(options) == 1` and that option has weight 1. In all - // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta2.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. - Options []*WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (m *Vote) String() string { return proto.CompactTextString(m) } -func (*Vote) ProtoMessage() {} -func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{4} -} -func (m *Vote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Vote.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 *Vote) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vote.Merge(m, src) -} -func (m *Vote) XXX_Size() int { - return m.Size() -} -func (m *Vote) XXX_DiscardUnknown() { - xxx_messageInfo_Vote.DiscardUnknown(m) -} - -var xxx_messageInfo_Vote proto.InternalMessageInfo - -func (m *Vote) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *Vote) GetVoter() string { - if m != nil { - return m.Voter - } - return "" -} - -// Deprecated: Do not use. -func (m *Vote) GetOption() VoteOption { - if m != nil { - return m.Option - } - return VoteOption_VOTE_OPTION_UNSPECIFIED -} - -func (m *Vote) GetOptions() []*WeightedVoteOption { - if m != nil { - return m.Options - } - return nil -} - -// DepositParams defines the params for deposits on governance proposals. -type DepositParams struct { - // Minimum deposit for a proposal to enter voting period. - MinDeposit []*types.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit,omitempty"` - // 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"` -} - -func (m *DepositParams) Reset() { *m = DepositParams{} } -func (m *DepositParams) String() string { return proto.CompactTextString(m) } -func (*DepositParams) ProtoMessage() {} -func (*DepositParams) Descriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{5} -} -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 - -func (m *DepositParams) GetMinDeposit() []*types.Coin { - if m != nil { - return m.MinDeposit - } - return nil -} - -func (m *DepositParams) GetMaxDepositPeriod() *time.Duration { - if m != nil { - return m.MaxDepositPeriod - } - return nil -} - -// VotingParams defines the params for voting on governance proposals. -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"` -} - -func (m *VotingParams) Reset() { *m = VotingParams{} } -func (m *VotingParams) String() string { return proto.CompactTextString(m) } -func (*VotingParams) ProtoMessage() {} -func (*VotingParams) Descriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{6} -} -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 - -func (m *VotingParams) GetVotingPeriod() *time.Duration { - if m != nil { - return m.VotingPeriod - } - return nil -} - -// TallyParams defines the params for tallying votes on governance proposals. -type TallyParams struct { - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. - Quorum []byte `protobuf:"bytes,1,opt,name=quorum,proto3" json:"quorum,omitempty"` - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - Threshold []byte `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - VetoThreshold []byte `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` -} - -func (m *TallyParams) Reset() { *m = TallyParams{} } -func (m *TallyParams) String() string { return proto.CompactTextString(m) } -func (*TallyParams) ProtoMessage() {} -func (*TallyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{7} -} -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 (m *TallyParams) GetQuorum() []byte { - if m != nil { - return m.Quorum - } - return nil -} - -func (m *TallyParams) GetThreshold() []byte { - if m != nil { - return m.Threshold - } - return nil -} - -func (m *TallyParams) GetVetoThreshold() []byte { - if m != nil { - return m.VetoThreshold - } - return nil -} - -func init() { - proto.RegisterEnum("cosmos.gov.v1beta2.VoteOption", VoteOption_name, VoteOption_value) - proto.RegisterEnum("cosmos.gov.v1beta2.ProposalStatus", ProposalStatus_name, ProposalStatus_value) - proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1beta2.WeightedVoteOption") - proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1beta2.Deposit") - proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1beta2.Proposal") - proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1beta2.TallyResult") - proto.RegisterType((*Vote)(nil), "cosmos.gov.v1beta2.Vote") - proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1beta2.DepositParams") - proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1beta2.VotingParams") - proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1beta2.TallyParams") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) } - -var fileDescriptor_5abf7b8852811c49 = []byte{ - // 1013 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 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, 0xf3, 0xa2, 0xa7, 0x73, 0xb6, 0x71, 0x60, 0xec, 0xbb, - 0x86, 0x2e, 0x57, 0xee, 0x62, 0xbe, 0x68, 0x9b, 0x87, 0x86, 0x2e, 0xcf, 0x77, 0x0e, 0xfe, 0xbc, - 0x50, 0xa5, 0x0f, 0x17, 0xaa, 0xf4, 0xff, 0x85, 0x2a, 0xbd, 0xbb, 0x54, 0xe7, 0x3e, 0x5c, 0xaa, - 0x73, 0xff, 0x5e, 0xaa, 0x73, 0x3f, 0xec, 0x84, 0x11, 0x1b, 0x8c, 0xfb, 0xda, 0x09, 0x89, 0xc5, - 0x9f, 0xba, 0xf8, 0xd9, 0xa6, 0xc1, 0x4f, 0xad, 0x33, 0xfe, 0xc9, 0xc2, 0xce, 0x47, 0x98, 0x16, - 0x1f, 0x2e, 0xfd, 0x2a, 0xf7, 0xce, 0x57, 0x9f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x86, 0x85, - 0x38, 0xd5, 0x08, 0x00, 0x00, -} - -func (m *WeightedVoteOption) 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 *WeightedVoteOption) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WeightedVoteOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Weight) > 0 { - i -= len(m.Weight) - copy(dAtA[i:], m.Weight) - i = encodeVarintGov(dAtA, i, uint64(len(m.Weight))) - i-- - dAtA[i] = 0x12 - } - if m.Option != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Deposit) 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 *Deposit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Deposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintGov(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Proposal) 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 *Proposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.VotingEndTime != nil { - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.VotingEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingEndTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintGov(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x4a - } - if m.VotingStartTime != nil { - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.VotingStartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingStartTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintGov(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x42 - } - if len(m.TotalDeposit) > 0 { - for iNdEx := len(m.TotalDeposit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TotalDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.DepositEndTime != nil { - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.DepositEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.DepositEndTime):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintGov(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x32 - } - if m.SubmitTime != nil { - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.SubmitTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.SubmitTime):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintGov(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x2a - } - if m.FinalTallyResult != nil { - { - size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Status != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x18 - } - if len(m.Messages) > 0 { - for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TallyResult) 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 *TallyResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NoWithVeto) > 0 { - i -= len(m.NoWithVeto) - copy(dAtA[i:], m.NoWithVeto) - i = encodeVarintGov(dAtA, i, uint64(len(m.NoWithVeto))) - i-- - dAtA[i] = 0x22 - } - if len(m.No) > 0 { - i -= len(m.No) - copy(dAtA[i:], m.No) - i = encodeVarintGov(dAtA, i, uint64(len(m.No))) - i-- - dAtA[i] = 0x1a - } - if len(m.Abstain) > 0 { - i -= len(m.Abstain) - copy(dAtA[i:], m.Abstain) - i = encodeVarintGov(dAtA, i, uint64(len(m.Abstain))) - i-- - dAtA[i] = 0x12 - } - if len(m.Yes) > 0 { - i -= len(m.Yes) - copy(dAtA[i:], m.Yes) - i = encodeVarintGov(dAtA, i, uint64(len(m.Yes))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Vote) 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 *Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Option != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x18 - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintGov(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - 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 - if m.MaxDepositPeriod != nil { - n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintGov(dAtA, i, uint64(n6)) - 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 - if m.VotingPeriod != nil { - n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.VotingPeriod):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintGov(dAtA, i, uint64(n7)) - 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 - if len(m.VetoThreshold) > 0 { - i -= len(m.VetoThreshold) - copy(dAtA[i:], m.VetoThreshold) - i = encodeVarintGov(dAtA, i, uint64(len(m.VetoThreshold))) - i-- - dAtA[i] = 0x1a - } - if len(m.Threshold) > 0 { - i -= len(m.Threshold) - copy(dAtA[i:], m.Threshold) - i = encodeVarintGov(dAtA, i, uint64(len(m.Threshold))) - i-- - dAtA[i] = 0x12 - } - if len(m.Quorum) > 0 { - i -= len(m.Quorum) - copy(dAtA[i:], m.Quorum) - i = encodeVarintGov(dAtA, i, uint64(len(m.Quorum))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGov(dAtA []byte, offset int, v uint64) int { - offset -= sovGov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *WeightedVoteOption) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Option != 0 { - n += 1 + sovGov(uint64(m.Option)) - } - l = len(m.Weight) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *Deposit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(uint64(m.ProposalId)) - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - return n -} - -func (m *Proposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(uint64(m.ProposalId)) - } - if len(m.Messages) > 0 { - for _, e := range m.Messages { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - if m.Status != 0 { - n += 1 + sovGov(uint64(m.Status)) - } - if m.FinalTallyResult != nil { - l = m.FinalTallyResult.Size() - n += 1 + l + sovGov(uint64(l)) - } - if m.SubmitTime != nil { - l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.SubmitTime) - n += 1 + l + sovGov(uint64(l)) - } - if m.DepositEndTime != nil { - l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.DepositEndTime) - n += 1 + l + sovGov(uint64(l)) - } - if len(m.TotalDeposit) > 0 { - for _, e := range m.TotalDeposit { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - if m.VotingStartTime != nil { - l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingStartTime) - n += 1 + l + sovGov(uint64(l)) - } - if m.VotingEndTime != nil { - l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingEndTime) - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *TallyResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Yes) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Abstain) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.No) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.NoWithVeto) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if m.Option != 0 { - n += 1 + sovGov(uint64(m.Option)) - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - 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)) - } - } - if m.MaxDepositPeriod != nil { - 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 - if m.VotingPeriod != nil { - 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 = len(m.Quorum) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Threshold) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.VetoThreshold) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func sovGov(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGov(x uint64) (n int) { - return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *WeightedVoteOption) 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: WeightedVoteOption: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WeightedVoteOption: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Weight = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Deposit) 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: Deposit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Deposit: 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 ErrIntOverflowGov - } - 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 stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = append(m.Amount, &types.Coin{}) - if err := m.Amount[len(m.Amount)-1].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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Proposal) 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: Proposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proposal: 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 ErrIntOverflowGov - } - 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 Messages", 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.Messages = append(m.Messages, &types1.Any{}) - if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= ProposalStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalTallyResult", 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 m.FinalTallyResult == nil { - m.FinalTallyResult = &TallyResult{} - } - if err := m.FinalTallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubmitTime", 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 m.SubmitTime == nil { - m.SubmitTime = new(time.Time) - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.SubmitTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositEndTime", 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 m.DepositEndTime == nil { - m.DepositEndTime = new(time.Time) - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.DepositEndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposit", 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.TotalDeposit = append(m.TotalDeposit, &types.Coin{}) - if err := m.TotalDeposit[len(m.TotalDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingStartTime", 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 m.VotingStartTime == nil { - m.VotingStartTime = new(time.Time) - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.VotingStartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingEndTime", 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 m.VotingEndTime == nil { - m.VotingEndTime = new(time.Time) - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.VotingEndTime, 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TallyResult) 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: TallyResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TallyResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Yes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Yes = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Abstain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Abstain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field No", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.No = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NoWithVeto", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NoWithVeto = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Vote) 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: Vote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vote: 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 ErrIntOverflowGov - } - 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 stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", 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.Options = append(m.Options, &WeightedVoteOption{}) - if err := m.Options[len(m.Options)-1].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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - 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, &types.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 m.MaxDepositPeriod == nil { - m.MaxDepositPeriod = new(time.Duration) - } - 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) || (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 m.VotingPeriod == nil { - m.VotingPeriod = new(time.Duration) - } - 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) || (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 - } - m.Quorum = append(m.Quorum[:0], dAtA[iNdEx:postIndex]...) - if m.Quorum == nil { - m.Quorum = []byte{} - } - 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 - } - m.Threshold = append(m.Threshold[:0], dAtA[iNdEx:postIndex]...) - if m.Threshold == nil { - m.Threshold = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", 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 - } - m.VetoThreshold = append(m.VetoThreshold[:0], dAtA[iNdEx:postIndex]...) - if m.VetoThreshold == nil { - m.VetoThreshold = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - 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, ErrIntOverflowGov - } - 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, ErrIntOverflowGov - } - 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, ErrInvalidLengthGov - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGov - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGov - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gov/types/v1beta2/query.pb.go b/x/gov/types/v1beta2/query.pb.go deleted file mode 100644 index 7605012ba695..000000000000 --- a/x/gov/types/v1beta2/query.pb.go +++ /dev/null @@ -1,3963 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta2/query.proto - -package v1beta2 - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - query "github.com/cosmos/cosmos-sdk/types/query" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - 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 { - // proposal_id defines the 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_3efdc0c4615c3665, []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,omitempty"` -} - -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_3efdc0c4615c3665, []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 nil -} - -// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -type QueryProposalsRequest struct { - // proposal_status defines the status of the proposals. - ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1beta2.ProposalStatus" json:"proposal_status,omitempty"` - // voter defines the voter address for the proposals. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,3,opt,name=depositor,proto3" json:"depositor,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,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_3efdc0c4615c3665, []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 ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED -} - -func (m *QueryProposalsRequest) GetVoter() string { - if m != nil { - return m.Voter - } - return "" -} - -func (m *QueryProposalsRequest) GetDepositor() string { - if m != nil { - return m.Depositor - } - return "" -} - -func (m *QueryProposalsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - 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,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,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_3efdc0c4615c3665, []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) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryVoteRequest is the request type for the Query/Vote RPC method. -type QueryVoteRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // voter defines the oter address for the proposals. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" 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_3efdc0c4615c3665, []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() string { - if m != nil { - return m.Voter - } - return "" -} - -// QueryVoteResponse is the response type for the Query/Vote RPC method. -type QueryVoteResponse struct { - // vote defined the queried vote. - Vote *Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` -} - -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_3efdc0c4615c3665, []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 nil -} - -// QueryVotesRequest is the request type for the Query/Votes RPC method. -type QueryVotesRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,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_3efdc0c4615c3665, []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) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryVotesResponse is the response type for the Query/Votes RPC method. -type QueryVotesResponse struct { - // votes defined the queried votes. - Votes []*Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,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_3efdc0c4615c3665, []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) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -type QueryParamsRequest struct { - // params_type defines which parameters to query for, can be one of "voting", - // "tallying" or "deposit". - 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_3efdc0c4615c3665, []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 { - // voting_params defines the parameters related to voting. - VotingParams *VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` - // deposit_params defines the parameters related to deposit. - DepositParams *DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` - // tally_params defines the parameters related to tally. - TallyParams *TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` -} - -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_3efdc0c4615c3665, []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 nil -} - -func (m *QueryParamsResponse) GetDepositParams() *DepositParams { - if m != nil { - return m.DepositParams - } - return nil -} - -func (m *QueryParamsResponse) GetTallyParams() *TallyParams { - if m != nil { - return m.TallyParams - } - return nil -} - -// QueryDepositRequest is the request type for the Query/Deposit RPC method. -type QueryDepositRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" 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_3efdc0c4615c3665, []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() string { - if m != nil { - return m.Depositor - } - return "" -} - -// QueryDepositResponse is the response type for the Query/Deposit RPC method. -type QueryDepositResponse struct { - // deposit defines the requested deposit. - Deposit *Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit,omitempty"` -} - -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_3efdc0c4615c3665, []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 nil -} - -// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -type QueryDepositsRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,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_3efdc0c4615c3665, []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) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - 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,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,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_3efdc0c4615c3665, []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) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -type QueryTallyResultRequest struct { - // proposal_id defines the 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_3efdc0c4615c3665, []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 defines the requested tally. - Tally *TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally,omitempty"` -} - -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_3efdc0c4615c3665, []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 nil -} - -func init() { - proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1beta2.QueryProposalRequest") - proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1beta2.QueryProposalResponse") - proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1beta2.QueryProposalsRequest") - proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1beta2.QueryProposalsResponse") - proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1beta2.QueryVoteRequest") - proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1beta2.QueryVoteResponse") - proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1beta2.QueryVotesRequest") - proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1beta2.QueryVotesResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1beta2.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1beta2.QueryParamsResponse") - proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1beta2.QueryDepositRequest") - proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1beta2.QueryDepositResponse") - proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1beta2.QueryDepositsRequest") - proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1beta2.QueryDepositsResponse") - proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1beta2.QueryTallyResultRequest") - proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1beta2.QueryTallyResultResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta2/query.proto", fileDescriptor_3efdc0c4615c3665) } - -var fileDescriptor_3efdc0c4615c3665 = []byte{ - // 955 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x38, 0x49, 0x1b, 0xbf, 0xb4, 0x01, 0x1e, 0x05, 0x8c, 0x29, 0x4e, 0x58, 0xd1, 0xd6, - 0xa4, 0xcd, 0x6e, 0x93, 0xd0, 0x96, 0x16, 0x0e, 0x24, 0x82, 0x52, 0x40, 0x48, 0xa9, 0x5b, 0x71, - 0xe0, 0x12, 0x6d, 0xe2, 0xd5, 0xb2, 0xc2, 0xd9, 0xd9, 0xee, 0x8c, 0x2d, 0xa2, 0x10, 0x21, 0x71, - 0x43, 0x08, 0x09, 0x44, 0x85, 0xc4, 0xa1, 0x27, 0x24, 0x3e, 0x01, 0x1f, 0x82, 0x63, 0x05, 0x1c, - 0x38, 0xa2, 0x84, 0x13, 0x9f, 0x02, 0xed, 0xcc, 0x9b, 0xf5, 0x6e, 0xb2, 0xf6, 0xda, 0xa5, 0xea, - 0x29, 0x9a, 0x99, 0xdf, 0x7b, 0xef, 0xf7, 0xfe, 0xec, 0xef, 0xc5, 0xd0, 0xd8, 0xe6, 0x62, 0x87, - 0x0b, 0xc7, 0xe7, 0x3d, 0xa7, 0xb7, 0xbc, 0xe5, 0x49, 0x77, 0xc5, 0xb9, 0xd7, 0xf5, 0xe2, 0x5d, - 0x3b, 0x8a, 0xb9, 0xe4, 0x88, 0xfa, 0xdd, 0xf6, 0x79, 0xcf, 0xa6, 0xf7, 0xfa, 0x22, 0xd9, 0x6c, - 0xb9, 0xc2, 0xd3, 0x60, 0x32, 0x5d, 0x76, 0x22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, 0x59, 0x5b, 0xff, 0xe0, 0xb7, 0x83, 0x06, 0x7b, 0x78, 0xd0, 0x60, 0x7f, 0x1f, 0x34, 0xd8, - 0x77, 0x87, 0x8d, 0x89, 0x87, 0x87, 0x8d, 0x89, 0xbf, 0x0e, 0x1b, 0x13, 0x9f, 0x5c, 0xf6, 0x03, - 0xf9, 0x69, 0x77, 0xcb, 0xde, 0xe6, 0x3b, 0xc6, 0xad, 0xfe, 0xb3, 0x24, 0xda, 0x9f, 0x39, 0x9f, - 0xab, 0x18, 0xc9, 0xc8, 0x08, 0x13, 0x69, 0xeb, 0x84, 0xfa, 0xc5, 0xb2, 0xfa, 0x5f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xb2, 0x31, 0x71, 0x47, 0x6a, 0x0d, 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 parameters of the gov module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. - Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) - // Deposits queries all deposits of a single proposal. - Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) - // TallyResult queries the tally of a proposal vote. - TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) -} - -type queryClient struct { - cc 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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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 parameters of the gov module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. - Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) - // Deposits queries all deposits of a single proposal. - Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) - // TallyResult queries the tally of a proposal vote. - TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) -} - -// 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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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.v1beta2.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/v1beta2/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 - if m.Proposal != nil { - { - 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.Pagination != nil { - { - size, err := m.Pagination.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.Pagination != nil { - { - size, err := m.Pagination.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 - if m.Vote != nil { - { - 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.Pagination != nil { - { - size, err := m.Pagination.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.Pagination != nil { - { - size, err := m.Pagination.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 - if m.TallyParams != nil { - { - 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 - } - if m.DepositParams != nil { - { - 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 - } - if m.VotingParams != nil { - { - 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 - if m.Deposit != nil { - { - 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.Pagination != nil { - { - size, err := m.Pagination.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.Pagination != nil { - { - size, err := m.Pagination.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 - if m.Tally != nil { - { - 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 - if m.Proposal != nil { - 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.Pagination != nil { - l = m.Pagination.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.Pagination != nil { - l = m.Pagination.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 - if m.Vote != nil { - 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.Pagination != nil { - l = m.Pagination.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.Pagination != nil { - l = m.Pagination.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 - if m.VotingParams != nil { - l = m.VotingParams.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.DepositParams != nil { - l = m.DepositParams.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.TallyParams != nil { - 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 - if m.Deposit != nil { - 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.Pagination != nil { - l = m.Pagination.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.Pagination != nil { - l = m.Pagination.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 - if m.Tally != nil { - 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) || (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 m.Proposal == nil { - m.Proposal = &Proposal{} - } - 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) || (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 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.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) || (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 Pagination", 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.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.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) || (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 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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 m.Vote == nil { - m.Vote = &Vote{} - } - 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) || (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 Pagination", 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.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.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) || (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 Pagination", 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.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.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) || (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) || (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 m.VotingParams == nil { - m.VotingParams = &VotingParams{} - } - 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 m.DepositParams == nil { - m.DepositParams = &DepositParams{} - } - 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 m.TallyParams == nil { - m.TallyParams = &TallyParams{} - } - 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) || (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 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.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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 m.Deposit == nil { - m.Deposit = &Deposit{} - } - 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) || (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 Pagination", 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.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.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) || (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 Pagination", 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.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.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) || (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) || (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 m.Tally == nil { - m.Tally = &TallyResult{} - } - 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) || (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") -) diff --git a/x/gov/types/v1beta2/query.pb.gw.go b/x/gov/types/v1beta2/query.pb.gw.go deleted file mode 100644 index 73fbf22e789d..000000000000 --- a/x/gov/types/v1beta2/query.pb.gw.go +++ /dev/null @@ -1,932 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/gov/v1beta2/query.proto - -/* -Package v1beta2 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package v1beta2 - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := client.Proposal(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := server.Proposal(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Proposals_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Proposals(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Proposals(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVoteRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["voter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") - } - - protoReq.Voter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) - } - - msg, err := client.Vote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVoteRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["voter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") - } - - protoReq.Voter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) - } - - msg, err := server.Vote(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Votes_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVotesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Votes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVotesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Votes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["params_type"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") - } - - protoReq.ParamsType, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) - } - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["params_type"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") - } - - protoReq.ParamsType, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) - } - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["depositor"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") - } - - protoReq.Depositor, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) - } - - msg, err := client.Deposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["depositor"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") - } - - protoReq.Depositor, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) - } - - msg, err := server.Deposit(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Deposits_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Deposits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Deposits(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTallyResultRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := client.TallyResult(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTallyResultRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := server.TallyResult(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Proposal_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Proposals_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Vote_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Votes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Deposit_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Deposits_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TallyResult_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Proposal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1beta2", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "gov", "v1beta2", "proposals"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Vote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1beta2", "proposals", "proposal_id", "votes", "voter"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Votes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1beta2", "proposals", "proposal_id", "votes"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1beta2", "params", "params_type"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Deposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1beta2", "proposals", "proposal_id", "deposits", "depositor"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Deposits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1beta2", "proposals", "proposal_id", "deposits"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_TallyResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1beta2", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Proposal_0 = runtime.ForwardResponseMessage - - forward_Query_Proposals_0 = runtime.ForwardResponseMessage - - forward_Query_Vote_0 = runtime.ForwardResponseMessage - - forward_Query_Votes_0 = runtime.ForwardResponseMessage - - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Deposit_0 = runtime.ForwardResponseMessage - - forward_Query_Deposits_0 = runtime.ForwardResponseMessage - - forward_Query_TallyResult_0 = runtime.ForwardResponseMessage -) diff --git a/x/gov/types/v1beta2/tx.pb.go b/x/gov/types/v1beta2/tx.pb.go deleted file mode 100644 index ef0634f82118..000000000000 --- a/x/gov/types/v1beta2/tx.pb.go +++ /dev/null @@ -1,1970 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta2/tx.proto - -package v1beta2 - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - types1 "github.com/cosmos/cosmos-sdk/types" - grpc1 "github.com/gogo/protobuf/grpc" - 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 - -// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -// proposal Content. -type MsgSubmitProposal struct { - Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` - InitialDeposit []*types1.Coin `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit,omitempty"` - Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` -} - -func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } -func (m *MsgSubmitProposal) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitProposal) ProtoMessage() {} -func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{0} -} -func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitProposal.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 *MsgSubmitProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitProposal.Merge(m, src) -} -func (m *MsgSubmitProposal) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitProposal) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo - -func (m *MsgSubmitProposal) GetMessages() []*types.Any { - if m != nil { - return m.Messages - } - return nil -} - -func (m *MsgSubmitProposal) GetInitialDeposit() []*types1.Coin { - if m != nil { - return m.InitialDeposit - } - return nil -} - -func (m *MsgSubmitProposal) GetProposer() string { - if m != nil { - return m.Proposer - } - return "" -} - -// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -type MsgSubmitProposalResponse struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` -} - -func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} } -func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitProposalResponse) ProtoMessage() {} -func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{1} -} -func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitProposalResponse.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 *MsgSubmitProposalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitProposalResponse.Merge(m, src) -} -func (m *MsgSubmitProposalResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitProposalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitProposalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitProposalResponse proto.InternalMessageInfo - -func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// MsgVote defines a message to cast a vote. -type MsgVote struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta2.VoteOption" json:"option,omitempty"` -} - -func (m *MsgVote) Reset() { *m = MsgVote{} } -func (m *MsgVote) String() string { return proto.CompactTextString(m) } -func (*MsgVote) ProtoMessage() {} -func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{2} -} -func (m *MsgVote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVote.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 *MsgVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVote.Merge(m, src) -} -func (m *MsgVote) XXX_Size() int { - return m.Size() -} -func (m *MsgVote) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVote.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVote proto.InternalMessageInfo - -func (m *MsgVote) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *MsgVote) GetVoter() string { - if m != nil { - return m.Voter - } - return "" -} - -func (m *MsgVote) GetOption() VoteOption { - if m != nil { - return m.Option - } - return VoteOption_VOTE_OPTION_UNSPECIFIED -} - -// MsgVoteResponse defines the Msg/Vote response type. -type MsgVoteResponse struct { -} - -func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} } -func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) } -func (*MsgVoteResponse) ProtoMessage() {} -func (*MsgVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{3} -} -func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVoteResponse.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 *MsgVoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVoteResponse.Merge(m, src) -} -func (m *MsgVoteResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgVoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVoteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo - -// MsgVoteWeighted defines a message to cast a vote. -// -// Since: cosmos-sdk 0.43 -type MsgVoteWeighted struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Options []*WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` -} - -func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } -func (m *MsgVoteWeighted) String() string { return proto.CompactTextString(m) } -func (*MsgVoteWeighted) ProtoMessage() {} -func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{4} -} -func (m *MsgVoteWeighted) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVoteWeighted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVoteWeighted.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 *MsgVoteWeighted) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVoteWeighted.Merge(m, src) -} -func (m *MsgVoteWeighted) XXX_Size() int { - return m.Size() -} -func (m *MsgVoteWeighted) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVoteWeighted.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVoteWeighted proto.InternalMessageInfo - -func (m *MsgVoteWeighted) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *MsgVoteWeighted) GetVoter() string { - if m != nil { - return m.Voter - } - return "" -} - -func (m *MsgVoteWeighted) GetOptions() []*WeightedVoteOption { - if m != nil { - return m.Options - } - return nil -} - -// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -// -// Since: cosmos-sdk 0.43 -type MsgVoteWeightedResponse struct { -} - -func (m *MsgVoteWeightedResponse) Reset() { *m = MsgVoteWeightedResponse{} } -func (m *MsgVoteWeightedResponse) String() string { return proto.CompactTextString(m) } -func (*MsgVoteWeightedResponse) ProtoMessage() {} -func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{5} -} -func (m *MsgVoteWeightedResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVoteWeightedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVoteWeightedResponse.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 *MsgVoteWeightedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVoteWeightedResponse.Merge(m, src) -} -func (m *MsgVoteWeightedResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgVoteWeightedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVoteWeightedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVoteWeightedResponse proto.InternalMessageInfo - -// MsgDeposit defines a message to submit a deposit to an existing proposal. -type MsgDeposit struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` - Amount []*types1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount,omitempty"` -} - -func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } -func (m *MsgDeposit) String() string { return proto.CompactTextString(m) } -func (*MsgDeposit) ProtoMessage() {} -func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{6} -} -func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgDeposit.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 *MsgDeposit) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDeposit.Merge(m, src) -} -func (m *MsgDeposit) XXX_Size() int { - return m.Size() -} -func (m *MsgDeposit) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDeposit.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo - -func (m *MsgDeposit) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *MsgDeposit) GetDepositor() string { - if m != nil { - return m.Depositor - } - return "" -} - -func (m *MsgDeposit) GetAmount() []*types1.Coin { - if m != nil { - return m.Amount - } - return nil -} - -// MsgDepositResponse defines the Msg/Deposit response type. -type MsgDepositResponse struct { -} - -func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } -func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } -func (*MsgDepositResponse) ProtoMessage() {} -func (*MsgDepositResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{7} -} -func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgDepositResponse.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 *MsgDepositResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDepositResponse.Merge(m, src) -} -func (m *MsgDepositResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgDepositResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDepositResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1beta2.MsgSubmitProposal") - proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta2.MsgSubmitProposalResponse") - proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta2.MsgVote") - proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta2.MsgVoteResponse") - proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1beta2.MsgVoteWeighted") - proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1beta2.MsgVoteWeightedResponse") - proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta2.MsgDeposit") - proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta2.MsgDepositResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) } - -var fileDescriptor_4214261f6b3f9ed4 = []byte{ - // 569 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xad, 0x9b, 0x92, 0xb4, 0x53, 0x94, 0xaa, 0xab, 0x48, 0x38, 0x2e, 0x32, 0x91, 0x11, 0x55, - 0x24, 0x94, 0x75, 0x13, 0x50, 0x4f, 0x1c, 0x68, 0xe0, 0x00, 0x48, 0x11, 0xe0, 0x4a, 0x20, 0x71, - 0x09, 0x76, 0xbc, 0xdd, 0xae, 0x48, 0xbc, 0x96, 0x77, 0x13, 0x35, 0x7f, 0x81, 0x38, 0xf1, 0x01, - 0x7c, 0x02, 0x77, 0xae, 0x1c, 0x2b, 0x4e, 0x1c, 0x51, 0x72, 0xe5, 0x23, 0x50, 0xec, 0x5d, 0x17, - 0x9a, 0x34, 0xe9,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, 0x6a, 0x5c, 0x8b, 0x96, 0xcf, 0xea, 0x33, 0xd8, 0x48, 0xc7, 0x70, 0xef, 0x0a, 0xd9, 0x0c, - 0xb4, 0xee, 0x2e, 0x01, 0xf3, 0x4a, 0xef, 0xe1, 0xe6, 0x3f, 0x83, 0xb2, 0x4c, 0xa4, 0x49, 0xd6, - 0xfd, 0x6b, 0x90, 0xf2, 0x17, 0x5e, 0x43, 0x49, 0x37, 0xd2, 0xbe, 0x42, 0xa7, 0x70, 0x6b, 0x7f, - 0x39, 0xae, 0x4b, 0xb6, 0x5f, 0x7c, 0x9f, 0xd8, 0xc6, 0xf9, 0xc4, 0x36, 0x7e, 0x4d, 0x6c, 0xe3, - 0xe3, 0xd4, 0x5e, 0x3b, 0x9f, 0xda, 0x6b, 0x3f, 0xa7, 0xf6, 0xda, 0xbb, 0x03, 0xca, 0xe4, 0xe9, - 0x30, 0xc0, 0x3d, 0x3e, 0x50, 0x7b, 0x4d, 0xfd, 0x34, 0x44, 0xf8, 0xc1, 0x3d, 0x4b, 0xf7, 0xa1, - 0x1c, 0xc7, 0x44, 0xe8, 0xad, 0x18, 0x14, 0xd3, 0x2d, 0xf5, 0xe0, 0x4f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x35, 0x23, 0x1d, 0xe1, 0x83, 0x05, 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 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // SubmitProposal defines a method to create new proposal given a content. - SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) - // Vote defines a method to add a vote on a specific proposal. - Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - // - // Since: cosmos-sdk 0.43 - VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) - // Deposit defines a method to add deposit on a specific proposal. - Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { - out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/SubmitProposal", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { - out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/Vote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { - out := new(MsgVoteWeightedResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/VoteWeighted", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { - out := new(MsgDepositResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/Deposit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // SubmitProposal defines a method to create new proposal given a content. - SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) - // Vote defines a method to add a vote on a specific proposal. - Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - // - // Since: cosmos-sdk 0.43 - VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) - // Deposit defines a method to add deposit on a specific proposal. - Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) SubmitProposal(ctx context.Context, req *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") -} -func (*UnimplementedMsgServer) Vote(ctx context.Context, req *MsgVote) (*MsgVoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") -} -func (*UnimplementedMsgServer) VoteWeighted(ctx context.Context, req *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VoteWeighted not implemented") -} -func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitProposal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitProposal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta2.Msg/SubmitProposal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgVote) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Vote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta2.Msg/Vote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Vote(ctx, req.(*MsgVote)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_VoteWeighted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgVoteWeighted) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).VoteWeighted(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta2.Msg/VoteWeighted", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).VoteWeighted(ctx, req.(*MsgVoteWeighted)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgDeposit) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Deposit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta2.Msg/Deposit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.gov.v1beta2.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SubmitProposal", - Handler: _Msg_SubmitProposal_Handler, - }, - { - MethodName: "Vote", - Handler: _Msg_Vote_Handler, - }, - { - MethodName: "VoteWeighted", - Handler: _Msg_VoteWeighted_Handler, - }, - { - MethodName: "Deposit", - Handler: _Msg_Deposit_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/gov/v1beta2/tx.proto", -} - -func (m *MsgSubmitProposal) 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 *MsgSubmitProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Proposer) > 0 { - i -= len(m.Proposer) - copy(dAtA[i:], m.Proposer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) - i-- - dAtA[i] = 0x1a - } - if len(m.InitialDeposit) > 0 { - for iNdEx := len(m.InitialDeposit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InitialDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Messages) > 0 { - for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MsgSubmitProposalResponse) 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 *MsgSubmitProposalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgVote) 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 *MsgVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Option != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x18 - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgVoteResponse) 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 *MsgVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgVoteWeighted) 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 *MsgVoteWeighted) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVoteWeighted) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgVoteWeightedResponse) 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 *MsgVoteWeightedResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVoteWeightedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgDeposit) 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 *MsgDeposit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgDepositResponse) 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 *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgSubmitProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Messages) > 0 { - for _, e := range m.Messages { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - if len(m.InitialDeposit) > 0 { - for _, e := range m.InitialDeposit { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.Proposer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSubmitProposalResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - return n -} - -func (m *MsgVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Option != 0 { - n += 1 + sovTx(uint64(m.Option)) - } - return n -} - -func (m *MsgVoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgVoteWeighted) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgVoteWeightedResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgDeposit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgDepositResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgSubmitProposal) 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 ErrIntOverflowTx - } - 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: MsgSubmitProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Messages = append(m.Messages, &types.Any{}) - if err := m.Messages[len(m.Messages)-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 InitialDeposit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InitialDeposit = append(m.InitialDeposit, &types1.Coin{}) - if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSubmitProposalResponse) 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 ErrIntOverflowTx - } - 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: MsgSubmitProposalResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProposalResponse: 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 ErrIntOverflowTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgVote) 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 ErrIntOverflowTx - } - 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: MsgVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVote: 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 ErrIntOverflowTx - } - 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 stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgVoteResponse) 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 ErrIntOverflowTx - } - 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: MsgVoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgVoteWeighted) 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 ErrIntOverflowTx - } - 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: MsgVoteWeighted: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteWeighted: 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 ErrIntOverflowTx - } - 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 stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &WeightedVoteOption{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgVoteWeightedResponse) 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 ErrIntOverflowTx - } - 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: MsgVoteWeightedResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteWeightedResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgDeposit) 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 ErrIntOverflowTx - } - 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: MsgDeposit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDeposit: 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 ErrIntOverflowTx - } - 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 stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Amount = append(m.Amount, &types1.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgDepositResponse) 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 ErrIntOverflowTx - } - 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: MsgDepositResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gov/types/vote.go b/x/gov/types/vote.go index d68eea8a4fc8..4b83d3ac325d 100644 --- a/x/gov/types/vote.go +++ b/x/gov/types/vote.go @@ -1,34 +1,33 @@ package types import ( - "encoding/json" "fmt" "strings" - "sigs.k8s.io/yaml" - sdk "github.com/cosmos/cosmos-sdk/types" ) +const ( + OptionEmpty = VoteOption_VOTE_OPTION_UNSPECIFIED + OptionYes = VoteOption_VOTE_OPTION_YES + OptionNo = VoteOption_VOTE_OPTION_NO + OptionNoWithVeto = VoteOption_VOTE_OPTION_NO_WITH_VETO + OptionAbstain = VoteOption_VOTE_OPTION_ABSTAIN +) + // NewVote creates a new Vote instance //nolint:interfacer func NewVote(proposalID uint64, voter sdk.AccAddress, options WeightedVoteOptions) Vote { return Vote{ProposalId: proposalID, Voter: voter.String(), Options: options} } -// String returns a string representation of Vote -func (v Vote) String() string { - out, _ := yaml.Marshal(v) - return string(out) -} - // Empty returns whether a vote is empty. func (v Vote) Empty() bool { - return v.String() == Vote{}.String() + return v.ProposalId == 0 || v.Voter == "" || len(v.Options) == 0 } // Votes is a collection of Vote objects -type Votes []Vote +type Votes []*Vote // Equal returns true if two slices (order-dependant) of votes are equal. func (v Votes) Equal(other Votes) bool { @@ -56,18 +55,31 @@ func (v Votes) String() string { return out } -// NewNonSplitVoteOption creates a single option vote with weight 1 -func NewNonSplitVoteOption(option VoteOption) WeightedVoteOptions { - return WeightedVoteOptions{{option, sdk.NewDec(1)}} +func NewWeightedVoteOption(option VoteOption, weight sdk.Dec) *WeightedVoteOption { + return &WeightedVoteOption{Option: option, Weight: weight.String()} } -func (v WeightedVoteOption) String() string { - out, _ := json.Marshal(v) - return string(out) +// IsValid returns true if the sub vote is valid and false otherwise. +func (w *WeightedVoteOption) IsValid() bool { + weight, err := sdk.NewDecFromStr(w.Weight) + if err != nil { + return false + } + + if !weight.IsPositive() || weight.GT(sdk.NewDec(1)) { + return false + } + + return ValidVoteOption(w.Option) +} + +// NewNonSplitVoteOption creates a single option vote with weight 1 +func NewNonSplitVoteOption(option VoteOption) WeightedVoteOptions { + return WeightedVoteOptions{{option, sdk.NewDec(1).String()}} } // WeightedVoteOptions describes array of WeightedVoteOptions -type WeightedVoteOptions []WeightedVoteOption +type WeightedVoteOptions []*WeightedVoteOption func (v WeightedVoteOptions) String() (out string) { for _, opt := range v { @@ -77,14 +89,6 @@ func (v WeightedVoteOptions) String() (out string) { return strings.TrimSpace(out) } -// ValidWeightedVoteOption returns true if the sub vote is valid and false otherwise. -func ValidWeightedVoteOption(option WeightedVoteOption) bool { - if !option.Weight.IsPositive() || option.Weight.GT(sdk.NewDec(1)) { - return false - } - return ValidVoteOption(option.Option) -} - // VoteOptionFromString returns a VoteOption from a string. It returns an error // if the string is invalid. func VoteOptionFromString(str string) (VoteOption, error) { @@ -112,7 +116,7 @@ func WeightedVoteOptionsFromString(str string) (WeightedVoteOptions, error) { if err != nil { return options, err } - options = append(options, WeightedVoteOption{option, weight}) + options = append(options, NewWeightedVoteOption(option, weight)) } return options, nil }