From 5c757743377e5a897a9de27a33820c7f00746595 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 5 Oct 2021 20:05:44 +0200 Subject: [PATCH 01/28] create v1 gov messages --- client/grpc/tmservice/query.pb.go | 2 +- .../internal/ecdsa/privkey_internal_test.go | 2 +- db/version_manager.go | 6 +- docs/core/proto-docs.md | 336 +- proto/cosmos/auth/v1beta1/query.proto | 4 +- proto/cosmos/gov/v1/genesis.proto | 31 + proto/cosmos/gov/v1/gov.proto | 37 + proto/cosmos/gov/{v1beta1 => v1}/query.proto | 37 +- proto/cosmos/gov/{v1beta1 => v1}/tx.proto | 30 +- proto/cosmos/gov/v1beta1/genesis.proto | 10 +- proto/cosmos/gov/v1beta1/gov.proto | 53 +- proto/cosmos/vesting/v1beta1/tx.proto | 7 +- types/module/simulation.go | 15 - types/simulation/types.go | 17 - x/auth/keeper/grpc_query_test.go | 22 +- x/auth/module.go | 5 - x/authz/client/testutil/tx.go | 8 - x/authz/module/module.go | 6 - x/bank/module.go | 5 - x/capability/module.go | 5 - x/distribution/client/cli/tx.go | 5 +- x/distribution/module.go | 6 - x/distribution/simulation/proposals.go | 51 - x/distribution/simulation/proposals_test.go | 49 - x/distribution/types/proposal.go | 5 - x/evidence/module.go | 6 - x/feegrant/client/testutil/suite.go | 6 +- x/feegrant/module/module.go | 6 - x/genutil/migrations/v040/migrate.go | 4 +- x/genutil/migrations/v045/migrate.go | 25 + x/gov/abci.go | 32 +- x/gov/abci_test.go | 21 +- x/gov/client/cli/parse.go | 44 - x/gov/client/cli/parse_test.go | 69 - x/gov/client/cli/tx.go | 48 +- x/gov/client/testutil/deposits.go | 5 +- x/gov/client/testutil/helpers.go | 10 +- x/gov/client/testutil/suite.go | 56 +- x/gov/client/utils/utils.go | 11 - x/gov/common_test.go | 2 - x/gov/genesis_test.go | 4 +- x/gov/keeper/common_test.go | 2 +- x/gov/keeper/grpc_query_test.go | 8 +- x/gov/keeper/keeper.go | 15 +- x/gov/keeper/msg_server.go | 22 +- x/gov/keeper/proposal.go | 28 +- x/gov/keeper/proposal_test.go | 23 +- x/gov/migrations/v040/migrate.go | 2 +- x/gov/migrations/v040/types.go | 112 + x/gov/migrations/v043/json.go | 5 +- x/gov/migrations/v043/json_test.go | 3 +- x/gov/migrations/v043/keys.go | 6 - x/gov/migrations/v043/types.go | 16 + x/gov/migrations/v045/migrate.go | 54 + x/gov/migrations/v045/migrate_test.go | 127 + x/gov/module.go | 8 +- x/gov/simulation/decoder_test.go | 6 +- x/gov/simulation/operations.go | 34 +- x/gov/simulation/operations_test.go | 61 +- x/gov/simulation/proposals.go | 33 - x/gov/simulation/proposals_test.go | 40 - x/gov/types/codec.go | 8 +- x/gov/types/content.go | 31 - x/gov/types/errors.go | 14 +- x/gov/types/events.go | 3 + x/gov/types/genesis.pb.go | 66 +- x/gov/types/gov.pb.go | 2825 ----------------- x/gov/types/msgs.go | 117 +- x/gov/types/msgs_test.go | 26 +- x/gov/types/proposal.go | 150 +- x/gov/types/query.pb.go | 237 +- x/gov/types/query.pb.gw.go | 18 +- x/gov/types/tx.pb.go | 559 +++- x/mint/module.go | 5 - x/nft/genesis.pb.go | 4 +- x/nft/nft.pb.go | 171 +- x/nft/query.pb.go | 4 +- x/nft/tx.pb.go | 10 +- x/params/client/cli/tx.go | 5 +- x/params/module.go | 7 - x/params/simulation/operations.go | 53 - x/params/simulation/operations_test.go | 65 - x/params/simulation/proposals.go | 21 - x/params/simulation/proposals_test.go | 51 - x/params/types/proposal/proposal.go | 6 - x/simulation/params.go | 26 - x/simulation/params_test.go | 31 - x/slashing/module.go | 5 - x/staking/module.go | 5 - x/upgrade/client/cli/tx.go | 54 +- x/upgrade/types/proposal.go | 6 +- 91 files changed, 1759 insertions(+), 4532 deletions(-) create mode 100644 proto/cosmos/gov/v1/genesis.proto create mode 100644 proto/cosmos/gov/v1/gov.proto rename proto/cosmos/gov/{v1beta1 => v1}/query.proto (80%) rename proto/cosmos/gov/{v1beta1 => v1}/tx.proto (77%) delete mode 100644 x/distribution/simulation/proposals.go delete mode 100644 x/distribution/simulation/proposals_test.go create mode 100644 x/genutil/migrations/v045/migrate.go delete mode 100644 x/gov/client/cli/parse.go delete mode 100644 x/gov/client/cli/parse_test.go create mode 100644 x/gov/migrations/v040/types.go delete mode 100644 x/gov/migrations/v043/keys.go create mode 100644 x/gov/migrations/v043/types.go create mode 100644 x/gov/migrations/v045/migrate.go create mode 100644 x/gov/migrations/v045/migrate_test.go delete mode 100644 x/gov/simulation/proposals.go delete mode 100644 x/gov/simulation/proposals_test.go delete mode 100644 x/gov/types/gov.pb.go delete mode 100644 x/params/simulation/operations.go delete mode 100644 x/params/simulation/operations_test.go delete mode 100644 x/params/simulation/proposals.go delete mode 100644 x/params/simulation/proposals_test.go diff --git a/client/grpc/tmservice/query.pb.go b/client/grpc/tmservice/query.pb.go index 92b24cc3246d..6712577b4f2a 100644 --- a/client/grpc/tmservice/query.pb.go +++ b/client/grpc/tmservice/query.pb.go @@ -633,7 +633,7 @@ func (m *GetNodeInfoRequest) XXX_DiscardUnknown() { var xxx_messageInfo_GetNodeInfoRequest proto.InternalMessageInfo -// GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. +// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. type GetNodeInfoResponse struct { DefaultNodeInfo *p2p.DefaultNodeInfo `protobuf:"bytes,1,opt,name=default_node_info,json=defaultNodeInfo,proto3" json:"default_node_info,omitempty"` ApplicationVersion *VersionInfo `protobuf:"bytes,2,opt,name=application_version,json=applicationVersion,proto3" json:"application_version,omitempty"` diff --git a/crypto/keys/internal/ecdsa/privkey_internal_test.go b/crypto/keys/internal/ecdsa/privkey_internal_test.go index 1eae718f698f..3574d37dca8d 100644 --- a/crypto/keys/internal/ecdsa/privkey_internal_test.go +++ b/crypto/keys/internal/ecdsa/privkey_internal_test.go @@ -80,7 +80,7 @@ func (suite *SKSuite) TestSign() { // leave r untouched! high_s := new(big.Int).Mod(new(big.Int).Neg(low_s), elliptic.P256().Params().N) - require.False(suite.pk.VerifySignature(msg, signatureRaw(r,high_s))) + require.False(suite.pk.VerifySignature(msg, signatureRaw(r, high_s))) // Valid signature using low_s, but too long sigCpy = make([]byte, len(sig)+2) diff --git a/db/version_manager.go b/db/version_manager.go index 55d88e97a2f1..5019826bb3c3 100644 --- a/db/version_manager.go +++ b/db/version_manager.go @@ -68,7 +68,7 @@ func (vm *VersionManager) Save(target uint64) (uint64, error) { } func findLimit(m map[uint64]struct{}, cmp func(uint64, uint64) bool, init uint64) uint64 { - for x, _ := range m { + for x := range m { if cmp(x, init) { init = x } @@ -102,7 +102,7 @@ func (vi *vmIterator) Value() uint64 { return vi.buf } func (vm *VersionManager) Iterator() VersionIterator { ch := make(chan uint64) go func() { - for ver, _ := range vm.versions { + for ver := range vm.versions { ch <- ver } close(ch) @@ -128,7 +128,7 @@ func (vm *VersionManager) Equal(that VersionSet) bool { func (vm *VersionManager) Copy() *VersionManager { vmap := make(map[uint64]struct{}) - for ver, _ := range vm.versions { + for ver := range vm.versions { vmap[ver] = struct{}{} } return &VersionManager{versions: vmap, initial: vm.initial, last: vm.last} diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index af296094f071..6871e28f43f4 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -346,54 +346,55 @@ - [cosmos/genutil/v1beta1/genesis.proto](#cosmos/genutil/v1beta1/genesis.proto) - [GenesisState](#cosmos.genutil.v1beta1.GenesisState) -- [cosmos/gov/v1beta1/gov.proto](#cosmos/gov/v1beta1/gov.proto) - - [Deposit](#cosmos.gov.v1beta1.Deposit) - - [DepositParams](#cosmos.gov.v1beta1.DepositParams) - - [Proposal](#cosmos.gov.v1beta1.Proposal) - - [TallyParams](#cosmos.gov.v1beta1.TallyParams) - - [TallyResult](#cosmos.gov.v1beta1.TallyResult) - - [TextProposal](#cosmos.gov.v1beta1.TextProposal) - - [Vote](#cosmos.gov.v1beta1.Vote) - - [VotingParams](#cosmos.gov.v1beta1.VotingParams) - - [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) +- [cosmos/gov/v1/gov.proto](#cosmos/gov/v1/gov.proto) + - [Deposit](#cosmos.gov.v1.Deposit) + - [DepositParams](#cosmos.gov.v1.DepositParams) + - [Proposal](#cosmos.gov.v1.Proposal) + - [TallyParams](#cosmos.gov.v1.TallyParams) + - [TallyResult](#cosmos.gov.v1.TallyResult) + - [Vote](#cosmos.gov.v1.Vote) + - [VotingParams](#cosmos.gov.v1.VotingParams) + - [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) - - [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) - - [VoteOption](#cosmos.gov.v1beta1.VoteOption) + - [ProposalStatus](#cosmos.gov.v1.ProposalStatus) + - [VoteOption](#cosmos.gov.v1.VoteOption) -- [cosmos/gov/v1beta1/genesis.proto](#cosmos/gov/v1beta1/genesis.proto) - - [GenesisState](#cosmos.gov.v1beta1.GenesisState) +- [cosmos/gov/v1/genesis.proto](#cosmos/gov/v1/genesis.proto) + - [GenesisState](#cosmos.gov.v1.GenesisState) -- [cosmos/gov/v1beta1/query.proto](#cosmos/gov/v1beta1/query.proto) - - [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) - - [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) - - [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) - - [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) - - [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) - - [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) - - [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) - - [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) - - [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) - - [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) - - [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) - - [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) - - [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) - - [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) - - [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) +- [cosmos/gov/v1/query.proto](#cosmos/gov/v1/query.proto) + - [QueryDepositRequest](#cosmos.gov.v1.QueryDepositRequest) + - [QueryDepositResponse](#cosmos.gov.v1.QueryDepositResponse) + - [QueryDepositsRequest](#cosmos.gov.v1.QueryDepositsRequest) + - [QueryDepositsResponse](#cosmos.gov.v1.QueryDepositsResponse) + - [QueryParamsRequest](#cosmos.gov.v1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.gov.v1.QueryParamsResponse) + - [QueryProposalRequest](#cosmos.gov.v1.QueryProposalRequest) + - [QueryProposalResponse](#cosmos.gov.v1.QueryProposalResponse) + - [QueryProposalsRequest](#cosmos.gov.v1.QueryProposalsRequest) + - [QueryProposalsResponse](#cosmos.gov.v1.QueryProposalsResponse) + - [QueryTallyResultRequest](#cosmos.gov.v1.QueryTallyResultRequest) + - [QueryTallyResultResponse](#cosmos.gov.v1.QueryTallyResultResponse) + - [QueryVoteRequest](#cosmos.gov.v1.QueryVoteRequest) + - [QueryVoteResponse](#cosmos.gov.v1.QueryVoteResponse) + - [QueryVotesRequest](#cosmos.gov.v1.QueryVotesRequest) + - [QueryVotesResponse](#cosmos.gov.v1.QueryVotesResponse) - - [Query](#cosmos.gov.v1beta1.Query) + - [Query](#cosmos.gov.v1.Query) -- [cosmos/gov/v1beta1/tx.proto](#cosmos/gov/v1beta1/tx.proto) - - [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) - - [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) - - [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) - - [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) - - [MsgVote](#cosmos.gov.v1beta1.MsgVote) - - [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) - - [MsgVoteWeighted](#cosmos.gov.v1beta1.MsgVoteWeighted) - - [MsgVoteWeightedResponse](#cosmos.gov.v1beta1.MsgVoteWeightedResponse) +- [cosmos/gov/v1/tx.proto](#cosmos/gov/v1/tx.proto) + - [MsgDeposit](#cosmos.gov.v1.MsgDeposit) + - [MsgDepositResponse](#cosmos.gov.v1.MsgDepositResponse) + - [MsgSignal](#cosmos.gov.v1.MsgSignal) + - [MsgSignalResponse](#cosmos.gov.v1.MsgSignalResponse) + - [MsgSubmitProposal](#cosmos.gov.v1.MsgSubmitProposal) + - [MsgSubmitProposalResponse](#cosmos.gov.v1.MsgSubmitProposalResponse) + - [MsgVote](#cosmos.gov.v1.MsgVote) + - [MsgVoteResponse](#cosmos.gov.v1.MsgVoteResponse) + - [MsgVoteWeighted](#cosmos.gov.v1.MsgVoteWeighted) + - [MsgVoteWeightedResponse](#cosmos.gov.v1.MsgVoteWeightedResponse) - - [Msg](#cosmos.gov.v1beta1.Msg) + - [Msg](#cosmos.gov.v1.Msg) - [cosmos/group/v1beta1/types.proto](#cosmos/group/v1beta1/types.proto) - [GroupAccountInfo](#cosmos.group.v1beta1.GroupAccountInfo) @@ -3189,7 +3190,7 @@ GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. ### GetNodeInfoResponse -GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. +GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. | Field | Type | Label | Description | @@ -5155,14 +5156,14 @@ GenesisState defines the raw genesis transaction in JSON. - +

Top

-## cosmos/gov/v1beta1/gov.proto +## cosmos/gov/v1/gov.proto - + ### Deposit Deposit defines an amount deposited by an account address to an active @@ -5180,7 +5181,7 @@ proposal. - + ### DepositParams DepositParams defines the params for deposits on governance proposals. @@ -5196,7 +5197,7 @@ DepositParams defines the params for deposits on governance proposals. - + ### Proposal Proposal defines the core field members of a governance proposal. @@ -5205,9 +5206,9 @@ Proposal defines the core field members of a governance proposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | -| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | -| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `status` | [ProposalStatus](#cosmos.gov.v1.ProposalStatus) | | | +| `final_tally_result` | [TallyResult](#cosmos.gov.v1.TallyResult) | | | | `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | | `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | | `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | @@ -5219,7 +5220,7 @@ Proposal defines the core field members of a governance proposal. - + ### TallyParams TallyParams defines the params for tallying votes on governance proposals. @@ -5236,7 +5237,7 @@ TallyParams defines the params for tallying votes on governance proposals. - + ### TallyResult TallyResult defines a standard tally for a governance proposal. @@ -5254,24 +5255,7 @@ TallyResult defines a standard tally for a governance proposal. - - -### TextProposal -TextProposal defines a standard text proposal whose changes need to be -manually updated in case of approval. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | - - - - - - - + ### Vote Vote defines a vote on a governance proposal. @@ -5282,15 +5266,15 @@ A Vote consists of a proposal ID, the voter, and the vote option. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** 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. | -| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | +| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | **Deprecated.** 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. | +| `options` | [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) | repeated | | - + ### VotingParams VotingParams defines the params for voting on governance proposals. @@ -5305,7 +5289,7 @@ VotingParams defines the params for voting on governance proposals. - + ### WeightedVoteOption WeightedVoteOption defines a unit of vote for vote split. @@ -5313,7 +5297,7 @@ WeightedVoteOption defines a unit of vote for vote split. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | +| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | | | `weight` | [string](#string) | | | @@ -5323,7 +5307,7 @@ WeightedVoteOption defines a unit of vote for vote split. - + ### ProposalStatus ProposalStatus enumerates the valid statuses of a proposal. @@ -5339,7 +5323,7 @@ ProposalStatus enumerates the valid statuses of a proposal. - + ### VoteOption VoteOption enumerates the valid vote options for a given governance proposal. @@ -5361,14 +5345,14 @@ VoteOption enumerates the valid vote options for a given governance proposal. - +

Top

-## cosmos/gov/v1beta1/genesis.proto +## cosmos/gov/v1/genesis.proto - + ### GenesisState GenesisState defines the gov module's genesis state. @@ -5377,12 +5361,12 @@ GenesisState defines the gov module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | -| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | -| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | -| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | proposals defines all the proposals present at genesis. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | -| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | -| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | +| `deposits` | [Deposit](#cosmos.gov.v1.Deposit) | repeated | deposits defines all the deposits present at genesis. | +| `votes` | [Vote](#cosmos.gov.v1.Vote) | repeated | votes defines all the votes present at genesis. | +| `proposals` | [Proposal](#cosmos.gov.v1.Proposal) | repeated | proposals defines all the proposals present at genesis. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1.DepositParams) | | params defines all the paramaters of related to deposit. | +| `voting_params` | [VotingParams](#cosmos.gov.v1.VotingParams) | | params defines all the paramaters of related to voting. | +| `tally_params` | [TallyParams](#cosmos.gov.v1.TallyParams) | | params defines all the paramaters of related to tally. | @@ -5398,14 +5382,14 @@ GenesisState defines the gov module's genesis state. - +

Top

-## cosmos/gov/v1beta1/query.proto +## cosmos/gov/v1/query.proto - + ### QueryDepositRequest QueryDepositRequest is the request type for the Query/Deposit RPC method. @@ -5421,7 +5405,7 @@ QueryDepositRequest is the request type for the Query/Deposit RPC method. - + ### QueryDepositResponse QueryDepositResponse is the response type for the Query/Deposit RPC method. @@ -5429,14 +5413,14 @@ QueryDepositResponse is the response type for the Query/Deposit RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposit` | [Deposit](#cosmos.gov.v1beta1.Deposit) | | deposit defines the requested deposit. | +| `deposit` | [Deposit](#cosmos.gov.v1.Deposit) | | deposit defines the requested deposit. | - + ### QueryDepositsRequest QueryDepositsRequest is the request type for the Query/Deposits RPC method. @@ -5452,7 +5436,7 @@ QueryDepositsRequest is the request type for the Query/Deposits RPC method. - + ### QueryDepositsResponse QueryDepositsResponse is the response type for the Query/Deposits RPC method. @@ -5460,7 +5444,7 @@ QueryDepositsResponse is the response type for the Query/Deposits RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | | +| `deposits` | [Deposit](#cosmos.gov.v1.Deposit) | repeated | | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -5468,7 +5452,7 @@ QueryDepositsResponse is the response type for the Query/Deposits RPC method. - + ### QueryParamsRequest QueryParamsRequest is the request type for the Query/Params RPC method. @@ -5483,7 +5467,7 @@ QueryParamsRequest is the request type for the Query/Params RPC method. - + ### QueryParamsResponse QueryParamsResponse is the response type for the Query/Params RPC method. @@ -5491,16 +5475,16 @@ QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | voting_params defines the parameters related to voting. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | deposit_params defines the parameters related to deposit. | -| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | tally_params defines the parameters related to tally. | +| `voting_params` | [VotingParams](#cosmos.gov.v1.VotingParams) | | voting_params defines the parameters related to voting. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1.DepositParams) | | deposit_params defines the parameters related to deposit. | +| `tally_params` | [TallyParams](#cosmos.gov.v1.TallyParams) | | tally_params defines the parameters related to tally. | - + ### QueryProposalRequest QueryProposalRequest is the request type for the Query/Proposal RPC method. @@ -5515,7 +5499,7 @@ QueryProposalRequest is the request type for the Query/Proposal RPC method. - + ### QueryProposalResponse QueryProposalResponse is the response type for the Query/Proposal RPC method. @@ -5523,14 +5507,14 @@ QueryProposalResponse is the response type for the Query/Proposal RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal` | [Proposal](#cosmos.gov.v1beta1.Proposal) | | | +| `proposal` | [Proposal](#cosmos.gov.v1.Proposal) | | | - + ### QueryProposalsRequest QueryProposalsRequest is the request type for the Query/Proposals RPC method. @@ -5538,7 +5522,7 @@ QueryProposalsRequest is the request type for the Query/Proposals RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | proposal_status defines the status of the proposals. | +| `proposal_status` | [ProposalStatus](#cosmos.gov.v1.ProposalStatus) | | proposal_status defines the status of the proposals. | | `voter` | [string](#string) | | voter defines the voter address for the proposals. | | `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | @@ -5548,7 +5532,7 @@ QueryProposalsRequest is the request type for the Query/Proposals RPC method. - + ### QueryProposalsResponse QueryProposalsResponse is the response type for the Query/Proposals RPC @@ -5557,7 +5541,7 @@ method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | | +| `proposals` | [Proposal](#cosmos.gov.v1.Proposal) | repeated | | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -5565,7 +5549,7 @@ method. - + ### QueryTallyResultRequest QueryTallyResultRequest is the request type for the Query/Tally RPC method. @@ -5580,7 +5564,7 @@ QueryTallyResultRequest is the request type for the Query/Tally RPC method. - + ### QueryTallyResultResponse QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -5588,14 +5572,14 @@ QueryTallyResultResponse is the response type for the Query/Tally RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `tally` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | tally defines the requested tally. | +| `tally` | [TallyResult](#cosmos.gov.v1.TallyResult) | | tally defines the requested tally. | - + ### QueryVoteRequest QueryVoteRequest is the request type for the Query/Vote RPC method. @@ -5611,7 +5595,7 @@ QueryVoteRequest is the request type for the Query/Vote RPC method. - + ### QueryVoteResponse QueryVoteResponse is the response type for the Query/Vote RPC method. @@ -5619,14 +5603,14 @@ QueryVoteResponse is the response type for the Query/Vote RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `vote` | [Vote](#cosmos.gov.v1beta1.Vote) | | vote defined the queried vote. | +| `vote` | [Vote](#cosmos.gov.v1.Vote) | | vote defined the queried vote. | - + ### QueryVotesRequest QueryVotesRequest is the request type for the Query/Votes RPC method. @@ -5642,7 +5626,7 @@ QueryVotesRequest is the request type for the Query/Votes RPC method. - + ### QueryVotesResponse QueryVotesResponse is the response type for the Query/Votes RPC method. @@ -5650,7 +5634,7 @@ QueryVotesResponse is the response type for the Query/Votes RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defined the queried votes. | +| `votes` | [Vote](#cosmos.gov.v1.Vote) | repeated | votes defined the queried votes. | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -5664,34 +5648,34 @@ QueryVotesResponse is the response type for the Query/Votes RPC method. - + ### Query Query defines the gRPC querier service for gov module | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}| -| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1beta1/proposals| -| `Vote` | [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}| -| `Votes` | [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes| -| `Params` | [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1beta1/params/{params_type}| -| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}| -| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits| -| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/tally| +| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1/proposals/{proposal_id}| +| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1/proposals| +| `Vote` | [QueryVoteRequest](#cosmos.gov.v1.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}| +| `Votes` | [QueryVotesRequest](#cosmos.gov.v1.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1/proposals/{proposal_id}/votes| +| `Params` | [QueryParamsRequest](#cosmos.gov.v1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1/params/{params_type}| +| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}| +| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1/proposals/{proposal_id}/deposits| +| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1/proposals/{proposal_id}/tally| - +

Top

-## cosmos/gov/v1beta1/tx.proto +## cosmos/gov/v1/tx.proto - + ### MsgDeposit MsgDeposit defines a message to submit a deposit to an existing proposal. @@ -5708,7 +5692,7 @@ MsgDeposit defines a message to submit a deposit to an existing proposal. - + ### MsgDepositResponse MsgDepositResponse defines the Msg/Deposit response type. @@ -5718,7 +5702,34 @@ MsgDepositResponse defines the Msg/Deposit response type. - + + +### MsgSignal +MsgSignal is functionally a no-op message that can be submitted in a proposal to signal +an intention for members to vote on. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | + + + + + + + + +### MsgSignalResponse +MsgSignalResponse defined the Msg/Signal response type + + + + + + + ### MsgSubmitProposal MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -5727,7 +5738,7 @@ proposal Content. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | | `initial_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | | `proposer` | [string](#string) | | | @@ -5736,7 +5747,7 @@ proposal Content. - + ### MsgSubmitProposalResponse MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. @@ -5751,7 +5762,7 @@ MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. - + ### MsgVote MsgVote defines a message to cast a vote. @@ -5761,14 +5772,14 @@ MsgVote defines a message to cast a vote. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | +| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | | - + ### MsgVoteResponse MsgVoteResponse defines the Msg/Vote response type. @@ -5778,7 +5789,7 @@ MsgVoteResponse defines the Msg/Vote response type. - + ### MsgVoteWeighted MsgVoteWeighted defines a message to cast a vote. @@ -5788,14 +5799,14 @@ MsgVoteWeighted defines a message to cast a vote. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | +| `options` | [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) | repeated | | - + ### MsgVoteWeightedResponse MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. @@ -5811,17 +5822,18 @@ MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. - + ### Msg -Msg defines the bank Msg service. +Msg defines the gov Msg service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | -| `Vote` | [MsgVote](#cosmos.gov.v1beta1.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | -| `VoteWeighted` | [MsgVoteWeighted](#cosmos.gov.v1beta1.MsgVoteWeighted) | [MsgVoteWeightedResponse](#cosmos.gov.v1beta1.MsgVoteWeightedResponse) | VoteWeighted defines a method to add a weighted vote on a specific proposal. | | -| `Deposit` | [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | +| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | +| `Vote` | [MsgVote](#cosmos.gov.v1.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | +| `VoteWeighted` | [MsgVoteWeighted](#cosmos.gov.v1.MsgVoteWeighted) | [MsgVoteWeightedResponse](#cosmos.gov.v1.MsgVoteWeightedResponse) | VoteWeighted defines a method to add a weighted vote on a specific proposal. | | +| `Deposit` | [MsgDeposit](#cosmos.gov.v1.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | +| `Signal` | [MsgSignal](#cosmos.gov.v1.MsgSignal) | [MsgSignalResponse](#cosmos.gov.v1.MsgSignalResponse) | Signal is a basic governance proposal message which has no functionality but is used to gather signal on a certain intention. | | @@ -7090,11 +7102,12 @@ Class defines the class of the nft type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `id` | [string](#string) | | | -| `name` | [string](#string) | | | -| `symbol` | [string](#string) | | | -| `description` | [string](#string) | | | -| `uri` | [string](#string) | | | +| `id` | [string](#string) | | id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 | +| `name` | [string](#string) | | name defines the human-readable name of the NFT classification | +| `symbol` | [string](#string) | | symbol is an abbreviated name for nft classification | +| `description` | [string](#string) | | description is a brief description of nft classification | +| `uri` | [string](#string) | | uri is a URI may point to a JSON file that conforms to the nft classification Metadata JSON Schema. | +| `uri_hash` | [string](#string) | | uri_hash is a hash of the document pointed to uri | @@ -7104,15 +7117,16 @@ Class defines the class of the nft type. ### NFT -NFT defines the nft. +NFT defines the NFT. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `class_id` | [string](#string) | | | -| `id` | [string](#string) | | | -| `uri` | [string](#string) | | | -| `data` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `class_id` | [string](#string) | | class_id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 | +| `id` | [string](#string) | | id defines the unique identification of NFT | +| `uri` | [string](#string) | | uri defines NFT's metadata storage address outside the chain | +| `uri_hash` | [string](#string) | | uri_hash is a hash of the document pointed to uri | +| `data` | [google.protobuf.Any](#google.protobuf.Any) | | data is the metadata of the NFT | @@ -7143,8 +7157,8 @@ Entry Defines all nft owned by a person | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `owner` | [string](#string) | | | -| `nfts` | [NFT](#cosmos.nft.v1beta1.NFT) | repeated | | +| `owner` | [string](#string) | | owner is the owner address of the following nft | +| `nfts` | [NFT](#cosmos.nft.v1beta1.NFT) | repeated | nfts is a group of nfts of the same owner | @@ -7415,7 +7429,7 @@ Query defines the gRPC querier service. | ----------- | ------------ | ------------- | ------------| ------- | -------- | | `Balance` | [QueryBalanceRequest](#cosmos.nft.v1beta1.QueryBalanceRequest) | [QueryBalanceResponse](#cosmos.nft.v1beta1.QueryBalanceResponse) | Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 | GET|/cosmos/nft/v1beta1/balance/{class_id}/{owner}| | `Owner` | [QueryOwnerRequest](#cosmos.nft.v1beta1.QueryOwnerRequest) | [QueryOwnerResponse](#cosmos.nft.v1beta1.QueryOwnerResponse) | Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 | GET|/cosmos/nft/v1beta1/owner/{class_id}/{id}| -| `Supply` | [QuerySupplyRequest](#cosmos.nft.v1beta1.QuerySupplyRequest) | [QuerySupplyResponse](#cosmos.nft.v1beta1.QuerySupplyResponse) | Supply queries the number of nft based on the class, same as totalSupply of ERC721 | GET|/cosmos/nft/v1beta1/supply/{class_id}| +| `Supply` | [QuerySupplyRequest](#cosmos.nft.v1beta1.QuerySupplyRequest) | [QuerySupplyResponse](#cosmos.nft.v1beta1.QuerySupplyResponse) | Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. | GET|/cosmos/nft/v1beta1/supply/{class_id}| | `NFTsOfClass` | [QueryNFTsOfClassRequest](#cosmos.nft.v1beta1.QueryNFTsOfClassRequest) | [QueryNFTsOfClassResponse](#cosmos.nft.v1beta1.QueryNFTsOfClassResponse) | NFTsOfClass queries all NFTs of a given class or optional owner, similar to tokenByIndex in ERC721Enumerable | GET|/cosmos/nft/v1beta1/nfts/{class_id}| | `NFT` | [QueryNFTRequest](#cosmos.nft.v1beta1.QueryNFTRequest) | [QueryNFTResponse](#cosmos.nft.v1beta1.QueryNFTResponse) | NFT queries an NFT based on its class and id. | GET|/cosmos/nft/v1beta1/nfts/{class_id}/{id}| | `Class` | [QueryClassRequest](#cosmos.nft.v1beta1.QueryClassRequest) | [QueryClassResponse](#cosmos.nft.v1beta1.QueryClassResponse) | Class queries an NFT class based on its id | GET|/cosmos/nft/v1beta1/classes/{class_id}| @@ -7440,10 +7454,10 @@ MsgSend represents a message to send a nft from one account to another account. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `class_id` | [string](#string) | | | -| `id` | [string](#string) | | | -| `sender` | [string](#string) | | | -| `receiver` | [string](#string) | | | +| `class_id` | [string](#string) | | class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 | +| `id` | [string](#string) | | id defines the unique identification of nft | +| `sender` | [string](#string) | | sender is the address of the owner of nft | +| `receiver` | [string](#string) | | receiver is the receiver address of nft | diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto index b7ad5401483f..9cbac476c3bc 100644 --- a/proto/cosmos/auth/v1beta1/query.proto +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -96,10 +96,10 @@ message QueryModuleAccountsResponse { } // Bech32PrefixRequest is the request type for Bech32Prefix rpc method -message Bech32PrefixRequest {} +message Bech32PrefixRequest {} // Bech32PrefixResponse is the response type for Bech32Prefix rpc method -message Bech32PrefixResponse { +message Bech32PrefixResponse { string bech32_prefix = 1; } diff --git a/proto/cosmos/gov/v1/genesis.proto b/proto/cosmos/gov/v1/genesis.proto new file mode 100644 index 000000000000..bb14d3f018cc --- /dev/null +++ b/proto/cosmos/gov/v1/genesis.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package cosmos.gov.v1; + +import "gogoproto/gogo.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos/gov/v1/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; + +// GenesisState defines the gov module's genesis state. +message GenesisState { + // starting_proposal_id is the ID of the starting proposal. + uint64 starting_proposal_id = 1 [(gogoproto.moretags) = "yaml:\"starting_proposal_id\""]; + // deposits defines all the deposits present at genesis. + repeated cosmos.gov.v1beta1.Deposit deposits = 2 + [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; + // votes defines all the votes present at genesis. + repeated cosmos.gov.v1beta1.Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false]; + // proposals defines all the proposals present at genesis. + repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false]; + // params defines all the paramaters of related to deposit. + cosmos.gov.v1beta1.DepositParams deposit_params = 5 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_params\""]; + // params defines all the paramaters of related to voting. + cosmos.gov.v1beta1.VotingParams voting_params = 6 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_params\""]; + // params defines all the paramaters of related to tally. + cosmos.gov.v1beta1.TallyParams tally_params = 7 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"tally_params\""]; +} diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto new file mode 100644 index 000000000000..32561e651710 --- /dev/null +++ b/proto/cosmos/gov/v1/gov.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "cosmos/gov/v1beta1/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// Proposal defines the core field members of a governance proposal. +message Proposal { + option (gogoproto.equal) = true; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; + repeated google.protobuf.Any messages = 2; + cosmos.gov.v1beta1.ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; + cosmos.gov.v1beta1.TallyResult final_tally_result = 4 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; + google.protobuf.Timestamp deposit_end_time = 6 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_end_time\""]; + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"total_deposit\"" + ]; + google.protobuf.Timestamp voting_start_time = 8 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_start_time\""]; + google.protobuf.Timestamp voting_end_time = 9 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""]; +} diff --git a/proto/cosmos/gov/v1beta1/query.proto b/proto/cosmos/gov/v1/query.proto similarity index 80% rename from proto/cosmos/gov/v1beta1/query.proto rename to proto/cosmos/gov/v1/query.proto index da62bdbad16b..10654b231f47 100644 --- a/proto/cosmos/gov/v1beta1/query.proto +++ b/proto/cosmos/gov/v1/query.proto @@ -1,9 +1,10 @@ syntax = "proto3"; -package cosmos.gov.v1beta1; +package cosmos.gov.v1; import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; +import "cosmos/gov/v1/gov.proto"; import "cosmos/gov/v1beta1/gov.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; @@ -12,42 +13,42 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; service Query { // Proposal queries proposal details based on ProposalID. rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}"; } // Proposals queries all proposals based on given status. rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; + option (google.api.http).get = "/cosmos/gov/v1/proposals"; } // Vote queries voted information based on proposalID, voterAddr. rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}"; } // Votes queries votes of a given proposal. rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes"; } // Params queries all parameters of the gov module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; + option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}"; } // Deposit queries single deposit information based proposalID, depositAddr. rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}"; } // Deposits queries all deposits of a single proposal. rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits"; } // TallyResult queries the tally of a proposal vote. rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/tally"; } } @@ -68,7 +69,7 @@ message QueryProposalsRequest { option (gogoproto.goproto_getters) = false; // proposal_status defines the status of the proposals. - ProposalStatus proposal_status = 1; + cosmos.gov.v1beta1.ProposalStatus proposal_status = 1; // voter defines the voter address for the proposals. string voter = 2; @@ -104,7 +105,7 @@ message QueryVoteRequest { // QueryVoteResponse is the response type for the Query/Vote RPC method. message QueryVoteResponse { // vote defined the queried vote. - Vote vote = 1 [(gogoproto.nullable) = false]; + cosmos.gov.v1beta1.Vote vote = 1 [(gogoproto.nullable) = false]; } // QueryVotesRequest is the request type for the Query/Votes RPC method. @@ -119,7 +120,7 @@ message QueryVotesRequest { // QueryVotesResponse is the response type for the Query/Votes RPC method. message QueryVotesResponse { // votes defined the queried votes. - repeated Vote votes = 1 [(gogoproto.nullable) = false]; + repeated cosmos.gov.v1beta1.Vote votes = 1 [(gogoproto.nullable) = false]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -135,11 +136,11 @@ message QueryParamsRequest { // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // voting_params defines the parameters related to voting. - VotingParams voting_params = 1 [(gogoproto.nullable) = false]; + cosmos.gov.v1beta1.VotingParams voting_params = 1 [(gogoproto.nullable) = false]; // deposit_params defines the parameters related to deposit. - DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; + cosmos.gov.v1beta1.DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; // tally_params defines the parameters related to tally. - TallyParams tally_params = 3 [(gogoproto.nullable) = false]; + cosmos.gov.v1beta1.TallyParams tally_params = 3 [(gogoproto.nullable) = false]; } // QueryDepositRequest is the request type for the Query/Deposit RPC method. @@ -157,7 +158,7 @@ message QueryDepositRequest { // QueryDepositResponse is the response type for the Query/Deposit RPC method. message QueryDepositResponse { // deposit defines the requested deposit. - Deposit deposit = 1 [(gogoproto.nullable) = false]; + cosmos.gov.v1beta1.Deposit deposit = 1 [(gogoproto.nullable) = false]; } // QueryDepositsRequest is the request type for the Query/Deposits RPC method. @@ -171,7 +172,7 @@ message QueryDepositsRequest { // QueryDepositsResponse is the response type for the Query/Deposits RPC method. message QueryDepositsResponse { - repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; + repeated cosmos.gov.v1beta1.Deposit deposits = 1 [(gogoproto.nullable) = false]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -186,5 +187,5 @@ message QueryTallyResultRequest { // QueryTallyResultResponse is the response type for the Query/Tally RPC method. message QueryTallyResultResponse { // tally defines the requested tally. - TallyResult tally = 1 [(gogoproto.nullable) = false]; + cosmos.gov.v1beta1.TallyResult tally = 1 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1/tx.proto similarity index 77% rename from proto/cosmos/gov/v1beta1/tx.proto rename to proto/cosmos/gov/v1/tx.proto index ecb1cdfef9eb..d05e47202156 100644 --- a/proto/cosmos/gov/v1beta1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -1,7 +1,8 @@ syntax = "proto3"; -package cosmos.gov.v1beta1; +package cosmos.gov.v1; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1/gov.proto"; import "cosmos/gov/v1beta1/gov.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; @@ -9,7 +10,7 @@ import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; -// Msg defines the bank Msg service. +// Msg defines the gov Msg service. service Msg { // SubmitProposal defines a method to create new proposal given a content. rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); @@ -22,6 +23,10 @@ service Msg { // Deposit defines a method to add deposit on a specific proposal. rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + + // Signal is a basic governance proposal message which has no functionality + // but is used to gather signal on a certain intention. + rpc Signal(MsgSignal) returns (MsgSignalResponse); } // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -32,7 +37,7 @@ message MsgSubmitProposal { option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + repeated google.protobuf.Any messages = 1; repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", @@ -55,7 +60,7 @@ message MsgVote { uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; string voter = 2; - VoteOption option = 3; + cosmos.gov.v1beta1.VoteOption option = 3; } // MsgVoteResponse defines the Msg/Vote response type. @@ -70,7 +75,7 @@ message MsgVoteWeighted { uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; string voter = 2; - repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; + repeated cosmos.gov.v1beta1.WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; } // MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. @@ -91,3 +96,18 @@ message MsgDeposit { // MsgDepositResponse defines the Msg/Deposit response type. message MsgDepositResponse {} + +// MsgSignal is functionally a no-op message that can be submitted in a proposal to signal +// an intention for members to vote on. +message MsgSignal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + string title = 1; + string description = 2; +} + +// MsgSignalResponse defined the Msg/Signal response type +message MsgSignalResponse {} \ No newline at end of file diff --git a/proto/cosmos/gov/v1beta1/genesis.proto b/proto/cosmos/gov/v1beta1/genesis.proto index a999500449fa..be9b07e46726 100644 --- a/proto/cosmos/gov/v1beta1/genesis.proto +++ b/proto/cosmos/gov/v1beta1/genesis.proto @@ -5,12 +5,12 @@ package cosmos.gov.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/gov/v1beta1/gov.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; // GenesisState defines the gov module's genesis state. message GenesisState { // starting_proposal_id is the ID of the starting proposal. - uint64 starting_proposal_id = 1 [(gogoproto.moretags) = "yaml:\"starting_proposal_id\""]; + uint64 starting_proposal_id = 1; // deposits defines all the deposits present at genesis. repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; // votes defines all the votes present at genesis. @@ -18,9 +18,9 @@ message GenesisState { // proposals defines all the proposals present at genesis. repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false]; // params defines all the paramaters of related to deposit. - DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_params\""]; + DepositParams deposit_params = 5 [(gogoproto.nullable) = false]; // params defines all the paramaters of related to voting. - VotingParams voting_params = 6 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_params\""]; + VotingParams voting_params = 6 [(gogoproto.nullable) = false]; // params defines all the paramaters of related to tally. - TallyParams tally_params = 7 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"tally_params\""]; + TallyParams tally_params = 7 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index f040772e8e7f..4f6c23821eec 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -3,12 +3,12 @@ package cosmos.gov.v1beta1; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; import "google/protobuf/timestamp.proto"; 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"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = false; option (gogoproto.goproto_getters_all) = false; @@ -33,9 +33,9 @@ enum VoteOption { message WeightedVoteOption { VoteOption option = 1; string weight = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"weight\"" + (gogoproto.nullable) = false ]; } @@ -56,8 +56,8 @@ message Deposit { option (gogoproto.goproto_getters) = false; option (gogoproto.equal) = false; - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string depositor = 2; + uint64 proposal_id = 1; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } @@ -66,24 +66,23 @@ message Deposit { message Proposal { option (gogoproto.equal) = true; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id"]; google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; - ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; + ProposalStatus status = 3; TallyResult final_tally_result = 4 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; + [(gogoproto.nullable) = false]; google.protobuf.Timestamp submit_time = 5 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp deposit_end_time = 6 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_end_time\""]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"total_deposit\"" + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; google.protobuf.Timestamp voting_start_time = 8 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_start_time\""]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp voting_end_time = 9 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; } // ProposalStatus enumerates the valid statuses of a proposal. @@ -113,13 +112,13 @@ enum ProposalStatus { message TallyResult { option (gogoproto.equal) = true; - string yes = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string abstain = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string no = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string yes = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string abstain = 2 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string no = 3 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; string no_with_veto = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"no_with_veto\"" + (gogoproto.nullable) = false ]; } @@ -129,8 +128,8 @@ message Vote { option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = false; - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; + uint64 proposal_id = 1; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // 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. @@ -144,7 +143,6 @@ message DepositParams { repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"min_deposit\"", (gogoproto.jsontag) = "min_deposit,omitempty" ]; @@ -153,8 +151,7 @@ message DepositParams { google.protobuf.Duration max_deposit_period = 2 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "max_deposit_period,omitempty", - (gogoproto.moretags) = "yaml:\"max_deposit_period\"" + (gogoproto.jsontag) = "max_deposit_period,omitempty" ]; } @@ -164,8 +161,7 @@ message VotingParams { google.protobuf.Duration voting_period = 1 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "voting_period,omitempty", - (gogoproto.moretags) = "yaml:\"voting_period\"" + (gogoproto.jsontag) = "voting_period,omitempty" ]; } @@ -191,7 +187,6 @@ message TallyParams { bytes veto_threshold = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, - (gogoproto.jsontag) = "veto_threshold,omitempty", - (gogoproto.moretags) = "yaml:\"veto_threshold\"" + (gogoproto.jsontag) = "veto_threshold,omitempty" ]; } diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto index 9432f0c3f389..ce26479d7c0f 100644 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -34,15 +34,14 @@ message MsgCreateVestingAccount { // MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. message MsgCreateVestingAccountResponse {} - // MsgCreateVestingAccount defines a message that enables creating a vesting // account. message MsgCreatePeriodicVestingAccount { option (gogoproto.equal) = false; - string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; - string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; - int64 start_time = 3 [(gogoproto.moretags) = "yaml:\"start_time\""]; + string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; + string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; + int64 start_time = 3 [(gogoproto.moretags) = "yaml:\"start_time\""]; repeated Period vesting_periods = 4 [(gogoproto.nullable) = false]; } diff --git a/types/module/simulation.go b/types/module/simulation.go index 252cf268f837..370491b44bd3 100644 --- a/types/module/simulation.go +++ b/types/module/simulation.go @@ -17,9 +17,6 @@ type AppModuleSimulation interface { // randomized genesis states GenerateGenesisState(input *SimulationState) - // content functions used to simulate governance proposals - ProposalContents(simState SimulationState) []simulation.WeightedProposalContent - // randomized module parameters for param change proposals RandomizedParams(r *rand.Rand) []simulation.ParamChange @@ -47,17 +44,6 @@ func NewSimulationManager(modules ...AppModuleSimulation) *SimulationManager { } } -// GetProposalContents returns each module's proposal content generator function -// with their default operation weight and key. -func (sm *SimulationManager) GetProposalContents(simState SimulationState) []simulation.WeightedProposalContent { - wContents := make([]simulation.WeightedProposalContent, 0, len(sm.Modules)) - for _, module := range sm.Modules { - wContents = append(wContents, module.ProposalContents(simState)...) - } - - return wContents -} - // RegisterStoreDecoders registers each of the modules' store decoders into a map func (sm *SimulationManager) RegisterStoreDecoders() { for _, module := range sm.Modules { @@ -108,5 +94,4 @@ type SimulationState struct { GenTimestamp time.Time // genesis timestamp UnbondTime time.Duration // staking unbond time stored to use it as the slashing maximum evidence duration ParamChanges []simulation.ParamChange // simulated parameter changes from modules - Contents []simulation.WeightedProposalContent // proposal content generator functions with their default weight and app sim key } diff --git a/types/simulation/types.go b/types/simulation/types.go index 7efb64ba3149..404c63817ab7 100644 --- a/types/simulation/types.go +++ b/types/simulation/types.go @@ -11,23 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" ) -type WeightedProposalContent interface { - AppParamsKey() string // key used to retrieve the value of the weight from the simulation application params - DefaultWeight() int // default weight - ContentSimulatorFn() ContentSimulatorFn // content simulator function -} - -type ContentSimulatorFn func(r *rand.Rand, ctx sdk.Context, accs []Account) Content - -type Content interface { - GetTitle() string - GetDescription() string - ProposalRoute() string - ProposalType() string - ValidateBasic() error - String() string -} - type SimValFn func(r *rand.Rand) string type ParamChange interface { diff --git a/x/auth/keeper/grpc_query_test.go b/x/auth/keeper/grpc_query_test.go index a40402082024..9a741d36d5f1 100644 --- a/x/auth/keeper/grpc_query_test.go +++ b/x/auth/keeper/grpc_query_test.go @@ -1,9 +1,9 @@ package keeper_test import ( - "fmt" - "context" "bytes" + "context" + "fmt" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,6 +11,7 @@ import ( ) const addrStr = "cosmos13c3d4wq2t22dl0dstraf8jc3f902e3fsy9n3wv" + var addrBytes = []byte{0x8e, 0x22, 0xda, 0xb8, 0xa, 0x5a, 0x94, 0xdf, 0xbd, 0xb0, 0x58, 0xfa, 0x93, 0xcb, 0x11, 0x49, 0x5e, 0xac, 0xc5, 0x30} func (suite *KeeperTestSuite) TestGRPCQueryAccounts() { @@ -289,9 +290,9 @@ func (suite *KeeperTestSuite) TestBech32Prefix() { func (suite *KeeperTestSuite) TestAddressBytesToString() { testCases := []struct { - msg string - req *types.AddressBytesToStringRequest - expPass bool + msg string + req *types.AddressBytesToStringRequest + expPass bool }{ { "success", @@ -331,9 +332,9 @@ func (suite *KeeperTestSuite) TestAddressBytesToString() { func (suite *KeeperTestSuite) TestAddressStringToBytes() { testCases := []struct { - msg string - req *types.AddressStringToBytesRequest - expPass bool + msg string + req *types.AddressStringToBytesRequest + expPass bool }{ { "success", @@ -352,10 +353,9 @@ func (suite *KeeperTestSuite) TestAddressStringToBytes() { }, { "address prefix is incorrect", - &types.AddressStringToBytesRequest{AddressString: "regen13c3d4wq2t22dl0dstraf8jc3f902e3fsy9n3wv" }, + &types.AddressStringToBytesRequest{AddressString: "regen13c3d4wq2t22dl0dstraf8jc3f902e3fsy9n3wv"}, false, }, - } for _, tc := range testCases { @@ -375,4 +375,4 @@ func (suite *KeeperTestSuite) TestAddressStringToBytes() { }) } -} \ No newline at end of file +} diff --git a/x/auth/module.go b/x/auth/module.go index dfb125058bd9..100675dc01d9 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -172,11 +172,6 @@ func (am AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState, am.randGenAccountsFn) } -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized auth param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return simulation.ParamChanges(r) diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index f1027fc8b12f..2522282fa20c 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -17,8 +17,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz/client/cli" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" bank "github.com/cosmos/cosmos-sdk/x/bank/types" - govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" - govtestutil "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingcli "github.com/cosmos/cosmos-sdk/x/staking/client/cli" ) @@ -52,12 +50,6 @@ func (s *IntegrationTestSuite) SetupSuite() { _, err = s.network.WaitForHeight(1) s.Require().NoError(err) - // create a proposal with deposit - _, err = govtestutil.MsgSubmitProposal(val.ClientCtx, val.Address.String(), - "Text Proposal 1", "Where is the title!?", govtypes.ProposalTypeText, - fmt.Sprintf("--%s=%s", govcli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, govtypes.DefaultMinDepositTokens).String())) - s.Require().NoError(err) - // Create new account in the keyring. s.grantee[1] = s.createAccount("grantee2") // Send some funds to the new account. diff --git a/x/authz/module/module.go b/x/authz/module/module.go index b1afdc06e12f..e3d1d34aed49 100644 --- a/x/authz/module/module.go +++ b/x/authz/module/module.go @@ -169,12 +169,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents returns all the authz content functions used to -// simulate governance proposals. -func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized authz param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return nil diff --git a/x/bank/module.go b/x/bank/module.go index 62038da8b7b8..a86051a8325a 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -180,11 +180,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized bank param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return simulation.ParamChanges(r) diff --git a/x/capability/module.go b/x/capability/module.go index f8295948d9b7..9a1a89a04478 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -164,11 +164,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents performs a no-op -func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized capability param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return nil diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index ccbf5d8c6dbb..6a65354e0cb5 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -310,9 +310,10 @@ Where proposal.json contains: if err != nil { return err } - content := types.NewCommunityPoolSpendProposal(proposal.Title, proposal.Description, recpAddr, amount) - msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + // TODO: replace content proposals with a community spend message + _ = types.NewCommunityPoolSpendProposal(proposal.Title, proposal.Description, recpAddr, amount) + msg, err := govtypes.NewMsgSubmitProposal([]sdk.Msg{}, deposit, from) if err != nil { return err } diff --git a/x/distribution/module.go b/x/distribution/module.go index 09232331e333..3766a29af6f9 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -182,12 +182,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents returns all the distribution content functions used to -// simulate governance proposals. -func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return simulation.ProposalContents(am.keeper) -} - // RandomizedParams creates randomized distribution param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return simulation.ParamChanges(r) diff --git a/x/distribution/simulation/proposals.go b/x/distribution/simulation/proposals.go deleted file mode 100644 index 719229cb96f3..000000000000 --- a/x/distribution/simulation/proposals.go +++ /dev/null @@ -1,51 +0,0 @@ -package simulation - -import ( - "math/rand" - - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -// OpWeightSubmitCommunitySpendProposal app params key for community spend proposal -const OpWeightSubmitCommunitySpendProposal = "op_weight_submit_community_spend_proposal" - -// ProposalContents defines the module weighted proposals' contents -func ProposalContents(k keeper.Keeper) []simtypes.WeightedProposalContent { - return []simtypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( - OpWeightSubmitCommunitySpendProposal, - simappparams.DefaultWeightCommunitySpendProposal, - SimulateCommunityPoolSpendProposalContent(k), - ), - } -} - -// SimulateCommunityPoolSpendProposalContent generates random community-pool-spend proposal content -func SimulateCommunityPoolSpendProposalContent(k keeper.Keeper) simtypes.ContentSimulatorFn { - return func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) simtypes.Content { - simAccount, _ := simtypes.RandomAcc(r, accs) - - balance := k.GetFeePool(ctx).CommunityPool - if balance.Empty() { - return nil - } - - denomIndex := r.Intn(len(balance)) - amount, err := simtypes.RandPositiveInt(r, balance[denomIndex].Amount.TruncateInt()) - if err != nil { - return nil - } - - return types.NewCommunityPoolSpendProposal( - simtypes.RandStringOfLength(r, 10), - simtypes.RandStringOfLength(r, 100), - simAccount.Address, - sdk.NewCoins(sdk.NewCoin(balance[denomIndex].Denom, amount)), - ) - } -} diff --git a/x/distribution/simulation/proposals_test.go b/x/distribution/simulation/proposals_test.go deleted file mode 100644 index aec70fd832c4..000000000000 --- a/x/distribution/simulation/proposals_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package simulation_test - -import ( - "math/rand" - "testing" - - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - "github.com/cosmos/cosmos-sdk/simapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/distribution/simulation" -) - -func TestProposalContents(t *testing.T) { - app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - // initialize parameters - s := rand.NewSource(1) - r := rand.New(s) - - accounts := simtypes.RandomAccounts(r, 3) - - // execute ProposalContents function - weightedProposalContent := simulation.ProposalContents(app.DistrKeeper) - require.Len(t, weightedProposalContent, 1) - - w0 := weightedProposalContent[0] - - // tests w0 interface: - require.Equal(t, simulation.OpWeightSubmitCommunitySpendProposal, w0.AppParamsKey()) - require.Equal(t, simappparams.DefaultWeightTextProposal, w0.DefaultWeight()) - - amount := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1)), sdk.NewCoin("atoken", sdk.NewInt(2))) - - feePool := app.DistrKeeper.GetFeePool(ctx) - feePool.CommunityPool = sdk.NewDecCoinsFromCoins(amount...) - app.DistrKeeper.SetFeePool(ctx, feePool) - - content := w0.ContentSimulatorFn()(r, ctx, accounts) - - require.Equal(t, "sTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeHVIkPZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhu", content.GetDescription()) - require.Equal(t, "xKGLwQvuyN", content.GetTitle()) - require.Equal(t, "distribution", content.ProposalRoute()) - require.Equal(t, "CommunityPoolSpend", content.ProposalType()) -} diff --git a/x/distribution/types/proposal.go b/x/distribution/types/proposal.go index 1a0d0a886ed7..c5635060ecf0 100644 --- a/x/distribution/types/proposal.go +++ b/x/distribution/types/proposal.go @@ -17,7 +17,6 @@ const ( var _ govtypes.Content = &CommunityPoolSpendProposal{} func init() { - govtypes.RegisterProposalType(ProposalTypeCommunityPoolSpend) govtypes.RegisterProposalTypeCodec(&CommunityPoolSpendProposal{}, "cosmos-sdk/CommunityPoolSpendProposal") } @@ -41,10 +40,6 @@ func (csp *CommunityPoolSpendProposal) ProposalType() string { return ProposalTy // ValidateBasic runs basic stateless validity checks func (csp *CommunityPoolSpendProposal) ValidateBasic() error { - err := govtypes.ValidateAbstract(csp) - if err != nil { - return err - } if !csp.Amount.IsValid() { return ErrInvalidProposalAmount } diff --git a/x/evidence/module.go b/x/evidence/module.go index cb6a358c164a..73264d33782e 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -189,12 +189,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents returns all the evidence content functions used to -// simulate governance proposals. -func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized evidence param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return nil diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index 0c716fec2c45..d9b68ed59050 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -693,9 +693,9 @@ func (s *IntegrationTestSuite) TestTxWithFeeGrant() { // granted fee allowance for an account which is not in state and creating // any tx with it by using --fee-account shouldn't fail + proposal := []sdk.Msg{govtypes.NewMsgVote(grantee, 1, govtypes.OptionYes)} out, err := govtestutil.MsgSubmitProposal(val.ClientCtx, grantee.String(), - "Text Proposal", "No desc", govtypes.ProposalTypeText, - fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), + proposal, fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), ) s.Require().NoError(err) @@ -832,7 +832,7 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { "valid proposal tx", func() (testutil.BufferWriter, error) { return govtestutil.MsgSubmitProposal(val.ClientCtx, grantee.String(), - "Text Proposal", "No desc", govtypes.ProposalTypeText, + []sdk.Msg{govtypes.NewMsgVote(grantee, 1, govtypes.OptionYes)}, fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), ) }, diff --git a/x/feegrant/module/module.go b/x/feegrant/module/module.go index df6089b40fba..594c4fbb1b2e 100644 --- a/x/feegrant/module/module.go +++ b/x/feegrant/module/module.go @@ -190,12 +190,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents returns all the feegrant content functions used to -// simulate governance proposals. -func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized feegrant param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return nil diff --git a/x/genutil/migrations/v040/migrate.go b/x/genutil/migrations/v040/migrate.go index eb9686820981..2e5b52827bac 100644 --- a/x/genutil/migrations/v040/migrate.go +++ b/x/genutil/migrations/v040/migrate.go @@ -18,7 +18,7 @@ import ( v039genutil "github.com/cosmos/cosmos-sdk/x/genutil/migrations/v039" "github.com/cosmos/cosmos-sdk/x/genutil/types" v036gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v036" - v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" + v045gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v045" v039mint "github.com/cosmos/cosmos-sdk/x/mint/migrations/v039" v040mint "github.com/cosmos/cosmos-sdk/x/mint/migrations/v040" v036params "github.com/cosmos/cosmos-sdk/x/params/migrations/v036" @@ -137,7 +137,7 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { // Migrate relative source genesis application state and marshal it into // the respective key. - appState[v040gov.ModuleName] = v040Codec.MustMarshalJSON(v040gov.Migrate(govGenState)) + appState[v036gov.ModuleName] = v040Codec.MustMarshalJSON(v045gov.Migrate(govGenState)) } // Migrate x/mint. diff --git a/x/genutil/migrations/v045/migrate.go b/x/genutil/migrations/v045/migrate.go new file mode 100644 index 000000000000..51615057275c --- /dev/null +++ b/x/genutil/migrations/v045/migrate.go @@ -0,0 +1,25 @@ +package v045 + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/x/genutil/types" + + v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" + v045gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v045" +) + +func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { + // Migrate x/gov proposals + if appState[v043gov.ModuleName] != nil { + // unmarshal relative source genesis application state + var oldGovState v043gov.GenesisState + clientCtx.Codec.MustUnmarshalJSON(appState[v043gov.ModuleName], &oldGovState) + + // delete deprecated x/gov genesis state + delete(appState, v043gov.ModuleName) + + // Migrate relative source genesis application state and marshal it into + // the respective key. + appState[v043gov.ModuleName] = clientCtx.Codec.MustMarshalJSON(v045gov.Migrate(&oldGovState)) + } +} \ No newline at end of file diff --git a/x/gov/abci.go b/x/gov/abci.go index c05c261d2d22..5a4e7928e639 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -35,7 +35,6 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { logger.Info( "proposal did not meet minimum deposit; deleted", "proposal", proposal.ProposalId, - "title", proposal.GetTitle(), "min_deposit", keeper.GetDepositParams(ctx).MinDeposit.String(), "total_deposit", proposal.TotalDeposit.String(), ) @@ -56,13 +55,29 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { } if passes { - handler := keeper.Router().GetRoute(proposal.ProposalRoute()) + var ( + messages []sdk.Msg + err error + idx int + msg sdk.Msg + ) + + // attempt to execute all messages within the passed proposal + // Messages may mutate state thus we use a cached context. If one of + // the handlers fails, no state mutation is written and the error + // message is logged. cacheCtx, writeCache := ctx.CacheContext() + messages, err = proposal.GetMessages() + if err != nil { + for idx, msg = range messages { + handler := keeper.Router().Handler(msg) + _, err = handler(cacheCtx, msg) + if err != nil { + break + } + } + } - // The proposal handler may execute state mutating logic depending - // on the proposal content. If the handler fails, no state mutation - // is written and the error message is logged. - err := handler(cacheCtx, proposal.GetContent()) if err == nil { proposal.Status = types.StatusPassed tagValue = types.AttributeValueProposalPassed @@ -79,7 +94,7 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { } else { proposal.Status = types.StatusFailed tagValue = types.AttributeValueProposalFailed - logMsg = fmt.Sprintf("passed, but failed on execution: %s", err) + logMsg = fmt.Sprintf("passed, but msg %d failed on execution: %s", idx, err) } } else { proposal.Status = types.StatusRejected @@ -98,8 +113,7 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { logger.Info( "proposal tallied", "proposal", proposal.ProposalId, - "title", proposal.GetTitle(), - "result", logMsg, + "results", logMsg, ) ctx.EventManager().EmitEvent( diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index c1f2b121fc5a..688a12020ff3 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -32,8 +32,9 @@ func TestTickExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() + proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} newProposalMsg, err := types.NewMsgSubmitProposal( - types.ContentFromProposalType("test", "test", types.ProposalTypeText), + proposal, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) @@ -85,8 +86,9 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() + proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} newProposalMsg, err := types.NewMsgSubmitProposal( - types.ContentFromProposalType("test", "test", types.ProposalTypeText), + proposal, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) @@ -108,8 +110,9 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() + proposal2 := []sdk.Msg{types.NewMsgVote(addrs[1], 1, types.OptionNo)} newProposalMsg2, err := types.NewMsgSubmitProposal( - types.ContentFromProposalType("test2", "test2", types.ProposalTypeText), + proposal2, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) @@ -165,8 +168,9 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.False(t, activeQueue.Valid()) activeQueue.Close() + proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} newProposalMsg, err := types.NewMsgSubmitProposal( - types.ContentFromProposalType("test2", "test2", types.ProposalTypeText), + proposal, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) @@ -221,7 +225,8 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 5))} - newProposalMsg, err := types.NewMsgSubmitProposal(TestProposal, proposalCoins, addrs[0]) + msgs := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + newProposalMsg, err := types.NewMsgSubmitProposal(msgs, proposalCoins, addrs[0]) require.NoError(t, err) wrapCtx := sdk.WrapSDKContext(ctx) @@ -289,7 +294,8 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - proposal, err := app.GovKeeper.SubmitProposal(ctx, TestProposal) + messages := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + proposal, err := app.GovKeeper.SubmitProposal(ctx, messages) require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))} @@ -339,7 +345,8 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { // Create a proposal where the handler will pass for the test proposal // because the value of contextKeyBadProposal is true. ctx = ctx.WithValue(contextKeyBadProposal, true) - proposal, err := app.GovKeeper.SubmitProposal(ctx, TestProposal) + messages := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + proposal, err := app.GovKeeper.SubmitProposal(ctx, messages) require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))) diff --git a/x/gov/client/cli/parse.go b/x/gov/client/cli/parse.go deleted file mode 100644 index 90066b645abe..000000000000 --- a/x/gov/client/cli/parse.go +++ /dev/null @@ -1,44 +0,0 @@ -package cli - -import ( - "encoding/json" - "fmt" - "io/ioutil" - - "github.com/spf13/pflag" - - govutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils" -) - -func parseSubmitProposalFlags(fs *pflag.FlagSet) (*proposal, error) { - proposal := &proposal{} - proposalFile, _ := fs.GetString(FlagProposal) - - if proposalFile == "" { - proposalType, _ := fs.GetString(FlagProposalType) - - proposal.Title, _ = fs.GetString(FlagTitle) - proposal.Description, _ = fs.GetString(FlagDescription) - proposal.Type = govutils.NormalizeProposalType(proposalType) - proposal.Deposit, _ = fs.GetString(FlagDeposit) - return proposal, nil - } - - for _, flag := range ProposalFlags { - if v, _ := fs.GetString(flag); v != "" { - return nil, fmt.Errorf("--%s flag provided alongside --proposal, which is a noop", flag) - } - } - - contents, err := ioutil.ReadFile(proposalFile) - if err != nil { - return nil, err - } - - err = json.Unmarshal(contents, proposal) - if err != nil { - return nil, err - } - - return proposal, nil -} diff --git a/x/gov/client/cli/parse_test.go b/x/gov/client/cli/parse_test.go deleted file mode 100644 index da6aeea71949..000000000000 --- a/x/gov/client/cli/parse_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package cli - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/testutil" -) - -func TestParseSubmitProposalFlags(t *testing.T) { - okJSON := testutil.WriteToNewTempFile(t, ` -{ - "title": "Test Proposal", - "description": "My awesome proposal", - "type": "Text", - "deposit": "1000test" -} -`) - - badJSON := testutil.WriteToNewTempFile(t, "bad json") - fs := NewCmdSubmitProposal().Flags() - - // nonexistent json - fs.Set(FlagProposal, "fileDoesNotExist") - _, err := parseSubmitProposalFlags(fs) - require.Error(t, err) - - // invalid json - fs.Set(FlagProposal, badJSON.Name()) - _, err = parseSubmitProposalFlags(fs) - require.Error(t, err) - - // ok json - fs.Set(FlagProposal, okJSON.Name()) - proposal1, err := parseSubmitProposalFlags(fs) - require.Nil(t, err, "unexpected error") - require.Equal(t, "Test Proposal", proposal1.Title) - require.Equal(t, "My awesome proposal", proposal1.Description) - require.Equal(t, "Text", proposal1.Type) - require.Equal(t, "1000test", proposal1.Deposit) - - // flags that can't be used with --proposal - for _, incompatibleFlag := range ProposalFlags { - fs.Set(incompatibleFlag, "some value") - _, err := parseSubmitProposalFlags(fs) - require.Error(t, err) - fs.Set(incompatibleFlag, "") - } - - // no --proposal, only flags - fs.Set(FlagProposal, "") - fs.Set(FlagTitle, proposal1.Title) - fs.Set(FlagDescription, proposal1.Description) - fs.Set(FlagProposalType, proposal1.Type) - fs.Set(FlagDeposit, proposal1.Deposit) - proposal2, err := parseSubmitProposalFlags(fs) - - require.Nil(t, err, "unexpected error") - require.Equal(t, proposal1.Title, proposal2.Title) - require.Equal(t, proposal1.Description, proposal2.Description) - require.Equal(t, proposal1.Type, proposal2.Type) - require.Equal(t, proposal1.Deposit, proposal2.Deposit) - - err = okJSON.Close() - require.Nil(t, err, "unexpected error") - err = badJSON.Close() - require.Nil(t, err, "unexpected error") -} diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index c20df19f6927..ea71d35fd8f1 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -12,20 +12,17 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" + authclient "github.com/cosmos/cosmos-sdk/x/auth/client" govutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils" "github.com/cosmos/cosmos-sdk/x/gov/types" ) // Proposal flags const ( - FlagTitle = "title" - FlagDescription = "description" - FlagProposalType = "type" FlagDeposit = "deposit" flagVoter = "voter" flagDepositor = "depositor" flagStatus = "status" - FlagProposal = "proposal" ) type proposal struct { @@ -39,9 +36,6 @@ type proposal struct { // verify that these values are not provided in conjunction with a JSON proposal // file. var ProposalFlags = []string{ - FlagTitle, - FlagDescription, - FlagProposalType, FlagDeposit, } @@ -78,29 +72,16 @@ func NewTxCmd(propCmds []*cobra.Command) *cobra.Command { // NewCmdSubmitProposal implements submitting a proposal transaction command. func NewCmdSubmitProposal() *cobra.Command { cmd := &cobra.Command{ - Use: "submit-proposal", + Use: "submit-proposal [path/to/messages.json]", Short: "Submit a proposal along with an initial deposit", + Args: cobra.ExactArgs(1), Long: strings.TrimSpace( - fmt.Sprintf(`Submit a proposal along with an initial deposit. -Proposal title, description, type and deposit can be given directly or through a proposal JSON file. + fmt.Sprintf(`Submit a proposal with an array of messages along with an initial deposit. Example: -$ %s tx gov submit-proposal --proposal="path/to/proposal.json" --from mykey - -Where proposal.json contains: - -{ - "title": "Test Proposal", - "description": "My awesome proposal", - "type": "Text", - "deposit": "10test" -} - -Which is equivalent to: - -$ %s tx gov submit-proposal --title="Test Proposal" --description="My awesome proposal" --type="Text" --deposit="10test" --from mykey +$ %s tx gov submit-proposal path/to/messages.json --from mykey --deposit="10test" `, - version.AppName, version.AppName, + version.AppName, ), ), RunE: func(cmd *cobra.Command, args []string) error { @@ -109,19 +90,22 @@ $ %s tx gov submit-proposal --title="Test Proposal" --description="My awesome pr return err } - proposal, err := parseSubmitProposalFlags(cmd.Flags()) + proposalMsgs, err := authclient.ReadTxFromFile(clientCtx, args[0]) if err != nil { - return fmt.Errorf("failed to parse proposal: %w", err) + return err } - amount, err := sdk.ParseCoinsNormalized(proposal.Deposit) + depositString, err := cmd.Flags().GetString(FlagDeposit) if err != nil { return err } - content := types.ContentFromProposalType(proposal.Title, proposal.Description, proposal.Type) + deposit, err := sdk.ParseCoinsNormalized(depositString) + if err != nil { + return err + } - msg, err := types.NewMsgSubmitProposal(content, amount, clientCtx.GetFromAddress()) + msg, err := types.NewMsgSubmitProposal(proposalMsgs.GetMsgs(), deposit, clientCtx.GetFromAddress()) if err != nil { return fmt.Errorf("invalid message: %w", err) } @@ -130,11 +114,7 @@ $ %s tx gov submit-proposal --title="Test Proposal" --description="My awesome pr }, } - cmd.Flags().String(FlagTitle, "", "The proposal title") - cmd.Flags().String(FlagDescription, "", "The proposal description") - cmd.Flags().String(FlagProposalType, "", "The proposal Type") cmd.Flags().String(FlagDeposit, "", "The proposal deposit") - cmd.Flags().String(FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") flags.AddTxFlagsToCmd(cmd) return cmd diff --git a/x/gov/client/testutil/deposits.go b/x/gov/client/testutil/deposits.go index 43d6b8a44856..cbbf4edafc0c 100644 --- a/x/gov/client/testutil/deposits.go +++ b/x/gov/client/testutil/deposits.go @@ -72,12 +72,11 @@ func (s *DepositTestSuite) createProposal(val *network.Validator, initialDeposit exactArgs = append(exactArgs, fmt.Sprintf("--%s=%s", cli.FlagDeposit, initialDeposit.String())) } + proposal := []sdk.Msg{types.NewMsgVote(val.Address, 1, types.OptionYes)} _, err := MsgSubmitProposal( val.ClientCtx, val.Address.String(), - fmt.Sprintf("Text Proposal %d", id), - "Where is the title!?", - types.ProposalTypeText, + proposal, exactArgs..., ) diff --git a/x/gov/client/testutil/helpers.go b/x/gov/client/testutil/helpers.go index e16ac0e98e83..9f538df46c4f 100644 --- a/x/gov/client/testutil/helpers.go +++ b/x/gov/client/testutil/helpers.go @@ -18,14 +18,8 @@ var commonArgs = []string{ } // MsgSubmitProposal creates a tx for submit proposal -func MsgSubmitProposal(clientCtx client.Context, from, title, description, proposalType string, extraArgs ...string) (testutil.BufferWriter, error) { - args := append([]string{ - fmt.Sprintf("--%s=%s", govcli.FlagTitle, title), - fmt.Sprintf("--%s=%s", govcli.FlagDescription, description), - fmt.Sprintf("--%s=%s", govcli.FlagProposalType, proposalType), - fmt.Sprintf("--%s=%s", flags.FlagFrom, from), - }, commonArgs...) - +func MsgSubmitProposal(clientCtx client.Context, from string, messages []sdk.Msg, extraArgs ...string) (testutil.BufferWriter, error) { + args := append(commonArgs, fmt.Sprintf("--%s=%s", flags.FlagFrom, from)) args = append(args, extraArgs...) return clitestutil.ExecTestCLICmd(clientCtx, govcli.NewCmdSubmitProposal(), args) diff --git a/x/gov/client/testutil/suite.go b/x/gov/client/testutil/suite.go index ba1db3ff6272..24a9e3f40f9e 100644 --- a/x/gov/client/testutil/suite.go +++ b/x/gov/client/testutil/suite.go @@ -42,9 +42,10 @@ func (s *IntegrationTestSuite) SetupSuite() { val := s.network.Validators[0] + messages := []sdk.Msg{types.NewMsgVote(val.Address, 1, types.OptionYes)} + // create a proposal with deposit - _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), - "Text Proposal 1", "Where is the title!?", types.ProposalTypeText, + _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), messages, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, types.DefaultMinDepositTokens).String())) s.Require().NoError(err) _, err = s.network.WaitForHeight(1) @@ -55,15 +56,13 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(err) // create a proposal without deposit - _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), - "Text Proposal 2", "Where is the title!?", types.ProposalTypeText) + _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), messages) s.Require().NoError(err) _, err = s.network.WaitForHeight(1) s.Require().NoError(err) // create a proposal3 with deposit - _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), - "Text Proposal 3", "Where is the title!?", types.ProposalTypeText, + _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), messages, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, types.DefaultMinDepositTokens).String())) s.Require().NoError(err) _, err = s.network.WaitForHeight(1) @@ -277,19 +276,9 @@ func (s *IntegrationTestSuite) TestCmdTally() { func (s *IntegrationTestSuite) TestNewCmdSubmitProposal() { val := s.network.Validators[0] - invalidProp := `{ - "title": "", - "description": "Where is the title!?", - "type": "Text", - "deposit": "-324foocoin" -}` - invalidPropFile := testutil.WriteToNewTempFile(s.T(), invalidProp) - validProp := fmt.Sprintf(`{ - "title": "Text Proposal", - "description": "Hello, World!", - "type": "Text", - "deposit": "%s" -}`, sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431))) + emptyProp := `[]` + emptyPropFile := testutil.WriteToNewTempFile(s.T(), emptyProp) + validProp := fmt.Sprintf("[{\"type\":\"cosmos-sdk/MsgVote\",\"value\":{\"option\":1,\"proposal_id\":\"1\",\"voter\":\"cosmos1w3jhxap3gempvr\"}}]") validPropFile := testutil.WriteToNewTempFile(s.T(), validProp) testCases := []struct { name string @@ -299,9 +288,9 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitProposal() { respType proto.Message }{ { - "invalid proposal (file)", + "empty proposal", []string{ - fmt.Sprintf("--%s=%s", cli.FlagProposal, invalidPropFile.Name()), + emptyPropFile.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), @@ -309,21 +298,9 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitProposal() { true, 0, nil, }, { - "invalid proposal", + "valid proposal", []string{ - fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), - fmt.Sprintf("--%s=%s", cli.FlagProposalType, types.ProposalTypeText), - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431)).String()), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - }, - true, 0, nil, - }, - { - "valid transaction (file)", - []string{ - fmt.Sprintf("--%s=%s", cli.FlagProposal, validPropFile.Name()), + validPropFile.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), @@ -332,11 +309,9 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitProposal() { false, 0, &sdk.TxResponse{}, }, { - "valid transaction", + "valid proposal 2", []string{ - fmt.Sprintf("--%s='Text Proposal'", cli.FlagTitle), - fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), - fmt.Sprintf("--%s=%s", cli.FlagProposalType, types.ProposalTypeText), + validPropFile.Name(), fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431)).String()), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -370,8 +345,6 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitProposal() { func (s *IntegrationTestSuite) TestCmdGetProposal() { val := s.network.Validators[0] - title := "Text Proposal 1" - testCases := []struct { name string args []string @@ -409,7 +382,6 @@ func (s *IntegrationTestSuite) TestCmdGetProposal() { s.Require().NoError(err) var proposal types.Proposal s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposal), out.String()) - s.Require().Equal(title, proposal.GetTitle()) } }) } diff --git a/x/gov/client/utils/utils.go b/x/gov/client/utils/utils.go index f0bf6ead263a..bc04af5c65f2 100644 --- a/x/gov/client/utils/utils.go +++ b/x/gov/client/utils/utils.go @@ -40,17 +40,6 @@ func NormalizeWeightedVoteOptions(options string) string { return strings.Join(newOptions, ",") } -// NormalizeProposalType - normalize user specified proposal type. -func NormalizeProposalType(proposalType string) string { - switch proposalType { - case "Text", "text": - return types.ProposalTypeText - - default: - return "" - } -} - // NormalizeProposalStatus - normalize user specified proposal status. func NormalizeProposalStatus(status string) string { switch status { diff --git a/x/gov/common_test.go b/x/gov/common_test.go index e0a79835280c..7af9d840ff40 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -8,13 +8,11 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var ( valTokens = sdk.TokensFromConsensusPower(42, sdk.DefaultPowerReduction) - TestProposal = types.NewTextProposal("Test", "description") TestDescription = stakingtypes.NewDescription("T", "E", "S", "T", "Z") TestCommissionRates = stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) ) diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index d289af470c80..59236289abc2 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -32,7 +32,7 @@ func TestImportExportQueues(t *testing.T) { ctx = app.BaseApp.NewContext(false, tmproto.Header{}) // Create two proposals, put the second into the voting period - proposal := TestProposal + proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} proposal1, err := app.GovKeeper.SubmitProposal(ctx, proposal) require.NoError(t, err) proposalID1 := proposal1.ProposalId @@ -144,7 +144,7 @@ func TestEqualProposals(t *testing.T) { app.BeginBlock(abci.RequestBeginBlock{Header: header}) // Submit two proposals - proposal := TestProposal + proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} proposal1, err := app.GovKeeper.SubmitProposal(ctx, proposal) require.NoError(t, err) diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 89da4e06074d..5d256b9e0f21 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -14,7 +14,7 @@ import ( ) var ( - TestProposal = types.NewTextProposal("Test", "description") + TestProposal = []sdk.Msg{types.NewMsgVote(sdk.AccAddress([]byte("addrs")), 1, types.OptionYes)} ) func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress) { diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 0e7d6f251091..4a0aac3588f5 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -3,7 +3,6 @@ package keeper_test import ( gocontext "context" "fmt" - "strconv" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -49,8 +48,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { "valid request", func() { req = &types.QueryProposalRequest{ProposalId: 1} - testProposal := types.NewTextProposal("Proposal", "testing proposal") - submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal) + submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, TestProposal) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -104,9 +102,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { func() { // create 5 test proposals for i := 0; i < 5; i++ { - num := strconv.Itoa(i + 1) - testProposal := types.NewTextProposal("Proposal"+num, "testing proposal "+num) - proposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal) + proposal, err := app.GovKeeper.SubmitProposal(ctx, TestProposal) suite.Require().NotEmpty(proposal) suite.Require().NoError(err) testProposals = append(testProposals, proposal) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 9e639fe5d0fc..b9bbc64bed67 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/middleware" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -33,7 +34,7 @@ type Keeper struct { cdc codec.BinaryCodec // Proposal router - router types.Router + router *middleware.MsgServiceRouter } // NewKeeper returns a governance keeper. It handles: @@ -45,7 +46,8 @@ type Keeper struct { // CONTRACT: the parameter Subspace must have the param key table already initialized func NewKeeper( cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace types.ParamSubspace, - authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, rtr types.Router, + authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, + router *middleware.MsgServiceRouter, ) Keeper { // ensure governance module account is set @@ -53,11 +55,6 @@ func NewKeeper( panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) } - // It is vital to seal the governance proposal router here as to not allow - // further handlers to be registered after the keeper is created since this - // could create invalid or non-deterministic behavior. - rtr.Seal() - return Keeper{ storeKey: key, paramSpace: paramSpace, @@ -65,7 +62,7 @@ func NewKeeper( bankKeeper: bankKeeper, sk: sk, cdc: cdc, - router: rtr, + router: router, } } @@ -86,7 +83,7 @@ func (keeper Keeper) Logger(ctx sdk.Context) log.Logger { } // Router returns the gov Keeper's Router -func (keeper Keeper) Router() types.Router { +func (keeper Keeper) Router() *middleware.MsgServiceRouter { return keeper.router } diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 86e6e9326704..add741413ea1 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -26,7 +26,13 @@ var _ types.MsgServer = msgServer{} func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitProposal) (*types.MsgSubmitProposalResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - proposal, err := k.Keeper.SubmitProposal(ctx, msg.GetContent()) + + proposalMsgs, err := msg.GetMessages() + if err != nil { + return nil, err + } + + proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs) if err != nil { return nil, err } @@ -46,7 +52,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitPro ), ) - submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalType, msg.GetContent().ProposalType())) + submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal) if votingStarted { submitEvent = submitEvent.AppendAttributes( sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalId)), @@ -157,3 +163,15 @@ func (k msgServer) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types return &types.MsgDepositResponse{}, nil } + +func (k msgServer) Signal(goCtx context.Context, msg *types.MsgSignal) (*types.MsgSignalResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeSignalProposal, + sdk.NewAttribute(types.AttributeSignalTitle, msg.Title), + sdk.NewAttribute(types.AttributeSignalDescription, msg.Description), + ), + ) + return &types.MsgSignalResponse{}, nil +} diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 216596932fad..7785c412ed4a 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -10,18 +10,22 @@ import ( ) // SubmitProposal create new proposal given a content -func (keeper Keeper) SubmitProposal(ctx sdk.Context, content types.Content) (types.Proposal, error) { - if !keeper.router.HasRoute(content.ProposalRoute()) { - return types.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, content.ProposalRoute()) - } +func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (types.Proposal, error) { + // Loop through all messages and confirm that each has a handler and the gov module account + // as the only signer + for _, msg := range messages { + signers := msg.GetSigners() + if len(signers) != 1 { + return types.Proposal{}, types.ErrInvalidSigner + } - // Execute the proposal content in a new context branch (with branched store) - // to validate the actual parameter changes before the proposal proceeds - // through the governance process. State is not persisted. - cacheCtx, _ := ctx.CacheContext() - handler := keeper.router.GetRoute(content.ProposalRoute()) - if err := handler(cacheCtx, content); err != nil { - return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalContent, err.Error()) + if !signers[0].Equals(keeper.GetGovernanceAccount(ctx).GetAddress()) { + return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidSigner, signers[0].String()) + } + + if keeper.router.Handler(msg) == nil { + return types.Proposal{}, sdkerrors.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) + } } proposalID, err := keeper.GetProposalID(ctx) @@ -32,7 +36,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, content types.Content) (typ submitTime := ctx.BlockHeader().Time depositPeriod := keeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := types.NewProposal(content, proposalID, submitTime, submitTime.Add(depositPeriod)) + proposal, err := types.NewProposal(messages, proposalID, submitTime, submitTime.Add(depositPeriod)) if err != nil { return types.Proposal{}, err } diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index a40303fceb31..8d31308ae9c0 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "errors" "fmt" - "strings" "time" sdk "github.com/cosmos/cosmos-sdk/types" @@ -44,27 +43,21 @@ func (suite *KeeperTestSuite) TestActivateVotingPeriod() { activeIterator.Close() } -type invalidProposalRoute struct{ types.TextProposal } - -func (invalidProposalRoute) ProposalRoute() string { return "nonexistingroute" } - func (suite *KeeperTestSuite) TestSubmitProposal() { + // Proposal is for the gov module to vote on another proposal :) + govAccount := suite.app.GovKeeper.GetGovernanceAccount(suite.ctx) + voteProposal := []sdk.Msg{types.NewMsgVote(govAccount.GetAddress(), 0, types.OptionYes)} + testCases := []struct { - content types.Content + messages []sdk.Msg expectedErr error }{ - {&types.TextProposal{Title: "title", Description: "description"}, nil}, - // Keeper does not check the validity of title and description, no error - {&types.TextProposal{Title: "", Description: "description"}, nil}, - {&types.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, nil}, - {&types.TextProposal{Title: "title", Description: ""}, nil}, - {&types.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, nil}, - // error only when invalid route - {&invalidProposalRoute{}, types.ErrNoProposalHandlerExists}, + {voteProposal, nil}, + {[]sdk.Msg{}, types.ErrNoProposalMsgs}, } for i, tc := range testCases { - _, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tc.content) + _, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tc.messages) suite.Require().True(errors.Is(tc.expectedErr, err), "tc #%d; got: %v, expected: %v", i, err, tc.expectedErr) } } diff --git a/x/gov/migrations/v040/migrate.go b/x/gov/migrations/v040/migrate.go index 86d3e2b39a24..5d0d7dc61c8e 100644 --- a/x/gov/migrations/v040/migrate.go +++ b/x/gov/migrations/v040/migrate.go @@ -71,7 +71,7 @@ func migrateContent(oldContent v036gov.Content) *codectypes.Any { switch oldContent := oldContent.(type) { case v036gov.TextProposal: { - protoProposal = &v040gov.TextProposal{ + protoProposal = &TextProposal{ Title: oldContent.Title, Description: oldContent.Description, } diff --git a/x/gov/migrations/v040/types.go b/x/gov/migrations/v040/types.go new file mode 100644 index 000000000000..030b81aedbfe --- /dev/null +++ b/x/gov/migrations/v040/types.go @@ -0,0 +1,112 @@ +package v040 + +import ( + "strings" + "time" + + yaml "gopkg.in/yaml.v2" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +type ( + Content interface { + GetTitle() string + GetDescription() string + ProposalRoute() string + ProposalType() string + ValidateBasic() error + String() string + } + + Proposal struct { + ProposalId uint64 + Content Content + Status types.ProposalStatus + FinalTallyResult types.TallyResult + SubmitTime time.Time + DepositEndTime time.Time + TotalDeposit sdk.Coins + VotingStartTime time.Time + VotingEndTime time.Time + } + + Proposals []Proposal + + GenesisState struct { + StartingProposalId uint64 + Deposits types.Deposits + Votes types.Votes + Proposals Proposals + DepositParams types.DepositParams + VotingParams types.VotingParams + TallyParams types.TallyParams + } + + TextProposal struct { + Title string + Description string + } +) + +// Proposal types +const ( + ProposalTypeText string = "Text" + + // Constants pertaining to a Content object + MaxDescriptionLength int = 5000 + MaxTitleLength int = 140 +) + +// Implements Content Interface +var _ Content = &TextProposal{} + +// NewTextProposal creates a text proposal Content +func NewTextProposal(title, description string) Content { + return &TextProposal{title, description} +} + +// GetTitle returns the proposal title +func (tp *TextProposal) GetTitle() string { return tp.Title } + +// GetDescription returns the proposal description +func (tp *TextProposal) GetDescription() string { return tp.Description } + +// ProposalRoute returns the proposal router key +func (tp *TextProposal) ProposalRoute() string { return RouterKey } + +// ProposalType is "Text" +func (tp *TextProposal) ProposalType() string { return ProposalTypeText } + +// ValidateBasic validates the content's title and description of the proposal +func (tp *TextProposal) ValidateBasic() error { return ValidateAbstract(tp) } + +// String implements Stringer interface +func (tp TextProposal) String() string { + out, _ := yaml.Marshal(tp) + return string(out) +} + +// ValidateAbstract validates a proposal's abstract contents returning an error +// if invalid. +func ValidateAbstract(c Content) error { + title := c.GetTitle() + if len(strings.TrimSpace(title)) == 0 { + return sdkerrors.Wrap(types.ErrInvalidProposalContent, "proposal title cannot be blank") + } + if len(title) > MaxTitleLength { + return sdkerrors.Wrapf(types.ErrInvalidProposalContent, "proposal title is longer than max length of %d", MaxTitleLength) + } + + description := c.GetDescription() + if len(description) == 0 { + return sdkerrors.Wrap(types.ErrInvalidProposalContent, "proposal description cannot be blank") + } + if len(description) > MaxDescriptionLength { + return sdkerrors.Wrapf(types.ErrInvalidProposalContent, "proposal description is longer than max length of %d", MaxDescriptionLength) + } + + return nil +} diff --git a/x/gov/migrations/v043/json.go b/x/gov/migrations/v043/json.go index 16de6cdf4743..8f3d47939b0b 100644 --- a/x/gov/migrations/v043/json.go +++ b/x/gov/migrations/v043/json.go @@ -2,6 +2,7 @@ package v043 import ( "github.com/cosmos/cosmos-sdk/x/gov/types" + v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" ) // migrateWeightedVotes migrates the ADR-037 weighted votes. @@ -18,8 +19,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 *v040gov.GenesisState) *GenesisState { + return &v040gov.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..f6f911996d82 100644 --- a/x/gov/migrations/v043/json_test.go +++ b/x/gov/migrations/v043/json_test.go @@ -10,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + 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" ) @@ -23,7 +24,7 @@ func TestMigrateJSON(t *testing.T) { voter, err := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh") require.NoError(t, err) - govGenState := &types.GenesisState{ + govGenState := &v040gov.GenesisState{ Votes: types.Votes{ types.Vote{ProposalId: 1, Voter: voter.String(), Option: types.OptionAbstain}, types.Vote{ProposalId: 2, Voter: voter.String(), Option: types.OptionEmpty}, diff --git a/x/gov/migrations/v043/keys.go b/x/gov/migrations/v043/keys.go deleted file mode 100644 index 8a2528ce5cdf..000000000000 --- a/x/gov/migrations/v043/keys.go +++ /dev/null @@ -1,6 +0,0 @@ -package v043 - -const ( - // ModuleName is the name of the module - ModuleName = "gov" -) diff --git a/x/gov/migrations/v043/types.go b/x/gov/migrations/v043/types.go new file mode 100644 index 000000000000..2e9d670949d2 --- /dev/null +++ b/x/gov/migrations/v043/types.go @@ -0,0 +1,16 @@ +package v043 + +import ( + v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" +) + +const ( + // ModuleName is the name of the module + ModuleName = "gov" +) + +type ( + GenesisState = v040gov.GenesisState + + Proposals = v040gov.Proposals +) diff --git a/x/gov/migrations/v045/migrate.go b/x/gov/migrations/v045/migrate.go new file mode 100644 index 000000000000..70ede8fa91e4 --- /dev/null +++ b/x/gov/migrations/v045/migrate.go @@ -0,0 +1,54 @@ +package v045 + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdktx "github.com/cosmos/cosmos-sdk/types/tx" + v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" + v045gov "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +func Migrate(oldGovState v043gov.GenesisState) *v045gov.GenesisState { + return &v045gov.GenesisState{ + Deposits: oldGovState.Deposits, + Votes: oldGovState.Votes, + Proposals: migrateProposals(oldGovState.Proposals), + DepositParams: oldGovState.DepositParams, + VotingParams: oldGovState.VotingParams, + TallyParams: oldGovState.TallyParams, + } +} + +func migrateProposals(oldProposals v043gov.Proposals) v045gov.Proposals { + newProposals := make(v045gov.Proposals, len(oldProposals)) + for idx, proposal := range oldProposals { + msgs, err := sdktx.SetMsgs(migrateContent(proposal.Content)) + if err != nil { + panic(fmt.Sprintf("failed to marshal proposal msgs: %v", err)) + } + + newProposals[idx] = v045gov.Proposal{ + ProposalId: proposal.ProposalId, + Messages: msgs, + Status: proposal.Status, + FinalTallyResult: proposal.FinalTallyResult, + SubmitTime: proposal.SubmitTime, + DepositEndTime: proposal.DepositEndTime, + VotingStartTime: proposal.VotingStartTime, + VotingEndTime: proposal.VotingEndTime, + } + } + return newProposals +} + +func migrateContent(content v040gov.Content) []sdk.Msg { + switch content.ProposalType() { + case v040gov.ProposalTypeText: + return []sdk.Msg{v045gov.NewMsgSignal(content.GetTitle(), content.GetDescription())} + // TODO: enter the other proposal content types + default: + // NOTE: If a network is using a unique content type that isn't recognisable then it will not be possible to migrate it to the new proposal type. The best thing to do in this situation, rather than silently ignore it, is to convert it to a signal proposal + return []sdk.Msg{v045gov.NewMsgSignal(content.GetTitle(), content.GetDescription())} + } +} diff --git a/x/gov/migrations/v045/migrate_test.go b/x/gov/migrations/v045/migrate_test.go new file mode 100644 index 000000000000..46f1855e397b --- /dev/null +++ b/x/gov/migrations/v045/migrate_test.go @@ -0,0 +1,127 @@ +package v045_test + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/simapp" + v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" + v045gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v045" +) + +func TestMigrate(t *testing.T) { + encodingConfig := simapp.MakeTestEncodingConfig() + clientCtx := client.Context{}. + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithCodec(encodingConfig.Codec) + + govGenState := v040gov.GenesisState{ + Proposals: []v040gov.Proposal{ + { + ProposalId: 5, + Content: v040gov.NewTextProposal("foo_title", "bar_description"), + }, + // TODO: add the other proposal types and assert that they migrate correctly + // { + // Content: v036distr.CommunityPoolSpendProposal{ + // Title: "foo_community", + // Description: "bar_community", + // Recipient: recipient, + // Amount: sdk.NewCoins(sdk.NewCoin("footoken", sdk.NewInt(2))), + // }, + // }, + // { + // Content: v038upgrade.CancelSoftwareUpgradeProposal{ + // Title: "foo_cancel_upgrade", + // Description: "bar_cancel_upgrade", + // }, + // }, + // { + // Content: v038upgrade.SoftwareUpgradeProposal{ + // Title: "foo_software_upgrade", + // Description: "bar_software_upgrade", + // Plan: v038upgrade.Plan{ + // Name: "foo_upgrade_name", + // Height: 123, + // Info: "foo_upgrade_info", + // }, + // }, + // }, + // { + // Content: v036params.ParameterChangeProposal{ + // Title: "foo_param_change", + // Description: "bar_param_change", + // Changes: []v036params.ParamChange{ + // { + // Subspace: "foo_param_change_subspace", + // Key: "foo_param_change_key", + // Subkey: "foo_param_change_subkey", + // Value: "foo_param_change_value", + // }, + // }, + // }, + // }, + }, + } + + migrated := v045gov.Migrate(govGenState) + + bz, err := clientCtx.Codec.MarshalJSON(migrated) + require.NoError(t, err) + + // Indent the JSON bz correctly. + var jsonObj map[string]interface{} + err = json.Unmarshal(bz, &jsonObj) + require.NoError(t, err) + indentedBz, err := json.MarshalIndent(jsonObj, "", "\t") + require.NoError(t, err) + + // Make sure about: + // - SignalProposal has correct JSON. + expected := `{ + "deposit_params": { + "max_deposit_period": "0s", + "min_deposit": [] + }, + "deposits": [], + "proposals": [ + { + "content": { + "@type": "/cosmos.gov.v1beta1.TextProposal", + "description": "bar_text", + "title": "foo_text" + }, + "deposit_end_time": "0001-01-01T00:00:00Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "0" + }, + "proposal_id": "0", + "status": "PROPOSAL_STATUS_UNSPECIFIED", + "submit_time": "0001-01-01T00:00:00Z", + "total_deposit": [], + "voting_end_time": "0001-01-01T00:00:00Z", + "voting_start_time": "0001-01-01T00:00:00Z" + }, + ], + "starting_proposal_id": "0", + "tally_params": { + "quorum": "0", + "threshold": "0", + "veto_threshold": "0" + }, + "votes": [], + "voting_params": { + "voting_period": "0s" + } +}` + + require.Equal(t, expected, string(indentedBz)) +} diff --git a/x/gov/module.go b/x/gov/module.go index 659e5559275c..2c2923884442 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -193,12 +193,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents returns all the gov content functions used to -// simulate governance proposals. -func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return simulation.ProposalContents() -} - // RandomizedParams creates randomized gov param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return simulation.ParamChanges(r) @@ -213,6 +207,6 @@ func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { return simulation.WeightedOperations( simState.AppParams, simState.Cdc, - am.accountKeeper, am.bankKeeper, am.keeper, simState.Contents, + am.accountKeeper, am.bankKeeper, am.keeper, ) } diff --git a/x/gov/simulation/decoder_test.go b/x/gov/simulation/decoder_test.go index 44752440f041..2aa52cd1f322 100644 --- a/x/gov/simulation/decoder_test.go +++ b/x/gov/simulation/decoder_test.go @@ -26,10 +26,10 @@ func TestDecodeStore(t *testing.T) { dec := simulation.NewDecodeStore(cdc) endTime := time.Now().UTC() - content := types.ContentFromProposalType("test", "test", types.ProposalTypeText) - proposalA, err := types.NewProposal(content, 1, endTime, endTime.Add(24*time.Hour)) + proposalMsgs := []sdk.Msg{types.NewMsgVote(delAddr1, 1, types.OptionYes)} + proposalA, err := types.NewProposal(proposalMsgs, 1, endTime, endTime.Add(24*time.Hour)) require.NoError(t, err) - proposalB, err := types.NewProposal(content, 2, endTime, endTime.Add(24*time.Hour)) + proposalB, err := types.NewProposal(proposalMsgs, 2, endTime, endTime.Add(24*time.Hour)) require.NoError(t, err) proposalIDBz := make([]byte, 8) diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 022613277668..c3c0a8106cef 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -28,7 +28,7 @@ const ( // WeightedOperations returns all the operations from the module with their respective weights func WeightedOperations( appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, - bk types.BankKeeper, k keeper.Keeper, wContents []simtypes.WeightedProposalContent, + bk types.BankKeeper, k keeper.Keeper, ) simulation.WeightedOperations { var ( @@ -55,25 +55,7 @@ func WeightedOperations( }, ) - // generate the weighted operations for the proposal contents - var wProposalOps simulation.WeightedOperations - - for _, wContent := range wContents { - wContent := wContent // pin variable - var weight int - appParams.GetOrGenerate(cdc, wContent.AppParamsKey(), &weight, nil, - func(_ *rand.Rand) { weight = wContent.DefaultWeight() }) - - wProposalOps = append( - wProposalOps, - simulation.NewWeightedOperation( - weight, - SimulateMsgSubmitProposal(ak, bk, k, wContent.ContentSimulatorFn()), - ), - ) - } - - wGovOps := simulation.WeightedOperations{ + return simulation.WeightedOperations{ simulation.NewWeightedOperation( weightMsgDeposit, SimulateMsgDeposit(ak, bk, k), @@ -87,15 +69,13 @@ func WeightedOperations( SimulateMsgVoteWeighted(ak, bk, k), ), } - - return append(wProposalOps, wGovOps...) } // SimulateMsgSubmitProposal simulates creating a msg Submit Proposal // voting on the proposal, and subsequently slashing the proposal. It is implemented using // future operations. func SimulateMsgSubmitProposal( - ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, contentSim simtypes.ContentSimulatorFn, + ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, ) simtypes.Operation { // The states are: // column 1: All validators vote @@ -123,11 +103,6 @@ func SimulateMsgSubmitProposal( accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { // 1) submit proposal now - content := contentSim(r, ctx, accs) - if content == nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "content is nil"), nil, nil - } - simAccount, _ := simtypes.RandomAcc(r, accs) deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address) switch { @@ -137,7 +112,8 @@ func SimulateMsgSubmitProposal( return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err } - msg, err := types.NewMsgSubmitProposal(content, deposit, simAccount.Address) + proposal := []sdk.Msg{types.NewMsgVote(simAccount.Address, 1, types.OptionYes)} + msg, err := types.NewMsgSubmitProposal(proposal, deposit, simAccount.Address) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate a submit proposal msg"), nil, err } diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index bce345de0556..fd9fad96e099 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -1,7 +1,6 @@ package simulation_test import ( - "fmt" "math/rand" "testing" "time" @@ -20,39 +19,6 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) -type MockWeightedProposalContent struct { - n int -} - -func (m MockWeightedProposalContent) AppParamsKey() string { - return fmt.Sprintf("AppParamsKey-%d", m.n) -} - -func (m MockWeightedProposalContent) DefaultWeight() int { - return m.n -} - -func (m MockWeightedProposalContent) ContentSimulatorFn() simtypes.ContentSimulatorFn { - return func(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content { - return types.NewTextProposal( - fmt.Sprintf("title-%d: %s", m.n, simtypes.RandStringOfLength(r, 100)), - fmt.Sprintf("description-%d: %s", m.n, simtypes.RandStringOfLength(r, 4000)), - ) - } -} - -// make sure the MockWeightedProposalContent satisfied the WeightedProposalContent interface -var _ simtypes.WeightedProposalContent = MockWeightedProposalContent{} - -func mockWeightedProposalContent(n int) []simtypes.WeightedProposalContent { - wpc := make([]simtypes.WeightedProposalContent, n) - for i := 0; i < n; i++ { - wpc[i] = MockWeightedProposalContent{i} - - } - return wpc - -} // TestWeightedOperations tests the weights of the operations. func TestWeightedOperations(t *testing.T) { @@ -63,7 +29,7 @@ func TestWeightedOperations(t *testing.T) { appParams := make(simtypes.AppParams) weightesOps := simulation.WeightedOperations(appParams, cdc, app.AccountKeeper, - app.BankKeeper, app.GovKeeper, mockWeightedProposalContent(3), + app.BankKeeper, app.GovKeeper, ) // setup 3 accounts @@ -109,7 +75,7 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) // execute operation - op := simulation.SimulateMsgSubmitProposal(app.AccountKeeper, app.BankKeeper, app.GovKeeper, MockWeightedProposalContent{3}.ContentSimulatorFn()) + op := simulation.SimulateMsgSubmitProposal(app.AccountKeeper, app.BankKeeper, app.GovKeeper) operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) @@ -119,9 +85,10 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { require.True(t, operationMsg.OK) require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.Proposer) require.Equal(t, "2686011stake", msg.InitialDeposit.String()) - require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", msg.GetContent().GetTitle()) - require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTW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ELaAUYDBuzsVywnDQfwRLGIWozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUScOXvYthRXpPfKwMhptXaxIxgqBoUqzrWbaoLTVpQoottZyPFfNOoMioXHRuFwMRYUiKvcWPkrayyTLOCFJlAyslDameIuqVAuxErqFPEWIScKpBORIuZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmTPXtpHRGdIbuucfTjOygZsTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeH", msg.GetContent().GetDescription()) require.Equal(t, "gov", msg.Route()) + proposalMsgs, err := msg.GetMessages() + require.NoError(t, err) + require.Equal(t, "abc", proposalMsgs) require.Equal(t, types.TypeMsgSubmitProposal, msg.Type()) } @@ -137,13 +104,11 @@ func TestSimulateMsgDeposit(t *testing.T) { r := rand.New(s) accounts := getTestingAccounts(t, r, app, ctx, 3) - // setup a proposal - content := types.NewTextProposal("Test", "description") - submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := types.NewProposal(content, 1, submitTime, submitTime.Add(depositPeriod)) + proposalMsgs := []sdk.Msg{types.NewMsgVote(accounts[0].Address, 1, types.OptionYes)} + proposal, err := types.NewProposal(proposalMsgs, 1, submitTime, submitTime.Add(depositPeriod)) require.NoError(t, err) app.GovKeeper.SetProposal(ctx, proposal) @@ -179,13 +144,11 @@ func TestSimulateMsgVote(t *testing.T) { r := rand.New(s) accounts := getTestingAccounts(t, r, app, ctx, 3) - // setup a proposal - content := types.NewTextProposal("Test", "description") - submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := types.NewProposal(content, 1, submitTime, submitTime.Add(depositPeriod)) + proposalMsgs := []sdk.Msg{types.NewMsgVote(accounts[0].Address, 1, types.OptionYes)} + proposal, err := types.NewProposal(proposalMsgs, 1, submitTime, submitTime.Add(depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -221,13 +184,11 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { r := rand.New(s) accounts := getTestingAccounts(t, r, app, ctx, 3) - // setup a proposal - content := types.NewTextProposal("Test", "description") - submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := types.NewProposal(content, 1, submitTime, submitTime.Add(depositPeriod)) + proposalMsgs := []sdk.Msg{types.NewMsgVote(accounts[0].Address, 1, types.OptionYes)} + proposal, err := types.NewProposal(proposalMsgs, 1, submitTime, submitTime.Add(depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) diff --git a/x/gov/simulation/proposals.go b/x/gov/simulation/proposals.go deleted file mode 100644 index 322774c984eb..000000000000 --- a/x/gov/simulation/proposals.go +++ /dev/null @@ -1,33 +0,0 @@ -package simulation - -import ( - "math/rand" - - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -// OpWeightSubmitTextProposal app params key for text proposal -const OpWeightSubmitTextProposal = "op_weight_submit_text_proposal" - -// ProposalContents defines the module weighted proposals' contents -func ProposalContents() []simtypes.WeightedProposalContent { - return []simtypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( - OpWeightMsgDeposit, - simappparams.DefaultWeightTextProposal, - SimulateTextProposalContent, - ), - } -} - -// SimulateTextProposalContent returns a random text proposal content. -func SimulateTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content { - return types.NewTextProposal( - simtypes.RandStringOfLength(r, 140), - simtypes.RandStringOfLength(r, 5000), - ) -} diff --git a/x/gov/simulation/proposals_test.go b/x/gov/simulation/proposals_test.go deleted file mode 100644 index dcd6f3c3f08b..000000000000 --- a/x/gov/simulation/proposals_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package simulation_test - -import ( - "math/rand" - "testing" - - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/gov/simulation" -) - -func TestProposalContents(t *testing.T) { - // initialize parameters - s := rand.NewSource(1) - r := rand.New(s) - - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) - accounts := simtypes.RandomAccounts(r, 3) - - // execute ProposalContents function - weightedProposalContent := simulation.ProposalContents() - require.Len(t, weightedProposalContent, 1) - - w0 := weightedProposalContent[0] - - // tests w0 interface: - require.Equal(t, simulation.OpWeightMsgDeposit, w0.AppParamsKey()) - require.Equal(t, simappparams.DefaultWeightTextProposal, w0.DefaultWeight()) - - content := w0.ContentSimulatorFn()(r, ctx, accounts) - - require.Equal(t, "NxImpptHBIFDQfnxaTiOBJUgNzvqHbVcVJYlIFWFlzFqqRTTyFzDUMntPzyRamUFqeJAEaSHIuUHZoTWDjWXsYxYvwXwXZEsjRQKgKMselyUqWXMbHzRNDHnMzhWSirUgVggjiBxtWDfhzPDgrorEoNmDEiDdBldYegphCBTYWrmFFXNjxhtygsGBFHTejaKjMsqNdikEzDalEyWRHfJhKqifCKsedVuuJbQMbmRVuIPDluAWGpngjgBjOxuRFwSadayHNIhVVmNWBbfaTOldclxTTLUMvaBnLfwjHTtsKetEIvgrxLijhKJNablmvqpWIWsmhWQAYNLycREypoASHnyKWrxpoNLBJuyCGysZJgXbQAAmSIbGxMFXuwMVGZgBiZWfPWorAfjBeekCFvljHAtVZaTOsRxbPIioNxLTnWUTzGTvaNhplQQPmMADRRDuUIsiBpnGqPheKmLnopieVseFd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ZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmTPXtpHRGdIbuucfTjOygZsTxPjf", content.GetDescription()) - require.Equal(t, "XhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeHVIkPZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", content.GetTitle()) - require.Equal(t, "gov", content.ProposalRoute()) - require.Equal(t, "Text", content.ProposalType()) -} diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index e59e0ef49c66..05f6416d4b03 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -16,7 +16,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDeposit{}, "cosmos-sdk/MsgDeposit", nil) cdc.RegisterConcrete(&MsgVote{}, "cosmos-sdk/MsgVote", nil) cdc.RegisterConcrete(&MsgVoteWeighted{}, "cosmos-sdk/MsgVoteWeighted", nil) - cdc.RegisterConcrete(&TextProposal{}, "cosmos-sdk/TextProposal", nil) + cdc.RegisterConcrete(&MsgSignal{}, "cosmos-sdk/MsgSignal", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -25,11 +25,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgVote{}, &MsgVoteWeighted{}, &MsgDeposit{}, - ) - registry.RegisterInterface( - "cosmos.gov.v1beta1.Content", - (*Content)(nil), - &TextProposal{}, + &MsgSignal{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/gov/types/content.go b/x/gov/types/content.go index 44cbe6af7547..198729ace951 100644 --- a/x/gov/types/content.go +++ b/x/gov/types/content.go @@ -1,16 +1,7 @@ package types import ( - "strings" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// Constants pertaining to a Content object -const ( - MaxDescriptionLength int = 5000 - MaxTitleLength int = 140 ) // Content defines an interface that a proposal must implement. It contains @@ -31,25 +22,3 @@ type Content interface { // Handler defines a function that handles a proposal after it has passed the // governance process. type Handler func(ctx sdk.Context, content Content) error - -// ValidateAbstract validates a proposal's abstract contents returning an error -// if invalid. -func ValidateAbstract(c Content) error { - title := c.GetTitle() - if len(strings.TrimSpace(title)) == 0 { - return sdkerrors.Wrap(ErrInvalidProposalContent, "proposal title cannot be blank") - } - if len(title) > MaxTitleLength { - return sdkerrors.Wrapf(ErrInvalidProposalContent, "proposal title is longer than max length of %d", MaxTitleLength) - } - - description := c.GetDescription() - if len(description) == 0 { - return sdkerrors.Wrap(ErrInvalidProposalContent, "proposal description cannot be blank") - } - if len(description) > MaxDescriptionLength { - return sdkerrors.Wrapf(ErrInvalidProposalContent, "proposal description is longer than max length of %d", MaxDescriptionLength) - } - - return nil -} diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 96973f1751a2..214666a1d390 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -6,12 +6,18 @@ import ( // x/gov module sentinel errors var ( - ErrUnknownProposal = sdkerrors.Register(ModuleName, 2, "unknown proposal") - ErrInactiveProposal = sdkerrors.Register(ModuleName, 3, "inactive proposal") - ErrAlreadyActiveProposal = sdkerrors.Register(ModuleName, 4, "proposal already active") - ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 5, "invalid proposal content") + ErrUnknownProposal = sdkerrors.Register(ModuleName, 2, "unknown proposal") + ErrInactiveProposal = sdkerrors.Register(ModuleName, 3, "inactive proposal") + ErrAlreadyActiveProposal = sdkerrors.Register(ModuleName, 4, "proposal already active") + // Deprecated + ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 5, "invalid proposal content") + // Deprecated ErrInvalidProposalType = sdkerrors.Register(ModuleName, 6, "invalid proposal type") ErrInvalidVote = sdkerrors.Register(ModuleName, 7, "invalid vote option") ErrInvalidGenesis = sdkerrors.Register(ModuleName, 8, "invalid genesis state") ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 9, "no handler exists for proposal type") + ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 10, "proposal message has no handler") + ErrNoProposalMsgs = sdkerrors.Register(ModuleName, 11, "no messages proposed") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 12, "expected gov account as only signer for proposal message") + ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 13, "signal message is invalid") ) diff --git a/x/gov/types/events.go b/x/gov/types/events.go index 19f8857f3a1c..b34c48ac99af 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -7,6 +7,7 @@ const ( EventTypeProposalVote = "proposal_vote" EventTypeInactiveProposal = "inactive_proposal" EventTypeActiveProposal = "active_proposal" + EventTypeSignalProposal = "signal_proposal" AttributeKeyProposalResult = "proposal_result" AttributeKeyOption = "option" @@ -18,4 +19,6 @@ const ( AttributeValueProposalRejected = "proposal_rejected" // didn't meet vote quorum AttributeValueProposalFailed = "proposal_failed" // error on proposal handler AttributeKeyProposalType = "proposal_type" + AttributeSignalTitle = "signal_title" + AttributeSignalDescription = "signal_description" ) diff --git a/x/gov/types/genesis.pb.go b/x/gov/types/genesis.pb.go index 4df93da3d07b..e1ee2061a6d7 100644 --- a/x/gov/types/genesis.pb.go +++ b/x/gov/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta1/genesis.proto +// source: cosmos/gov/v1/genesis.proto package types @@ -45,7 +45,7 @@ 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_43cd825e0fa7a627, []int{0} + return fileDescriptor_ef7cfd15e3ded621, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -124,40 +124,40 @@ func (m *GenesisState) GetTallyParams() TallyParams { } func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1beta1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1.GenesisState") } -func init() { proto.RegisterFile("cosmos/gov/v1beta1/genesis.proto", fileDescriptor_43cd825e0fa7a627) } +func init() { proto.RegisterFile("cosmos/gov/v1/genesis.proto", fileDescriptor_ef7cfd15e3ded621) } -var fileDescriptor_43cd825e0fa7a627 = []byte{ - // 430 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x63, 0x9a, 0x94, 0xf6, 0x92, 0x20, 0x38, 0x82, 0x64, 0x35, 0xc1, 0x36, 0x9e, 0xb2, - 0x60, 0xab, 0x65, 0x43, 0x62, 0xb1, 0x90, 0x50, 0x07, 0xa4, 0x62, 0x10, 0x03, 0x4b, 0x74, 0x89, - 0x4f, 0x87, 0x85, 0xdd, 0x67, 0xf9, 0x1d, 0x16, 0xf9, 0x16, 0x7c, 0x0e, 0x3e, 0x49, 0xc7, 0x8e, - 0x4c, 0x01, 0x25, 0x13, 0x6b, 0x3f, 0x01, 0xf2, 0xdd, 0x19, 0x1c, 0x61, 0x3a, 0x25, 0x7e, 0xf7, - 0xbf, 0xdf, 0xef, 0xdd, 0xd3, 0x23, 0xde, 0x0a, 0x30, 0x07, 0x0c, 0x05, 0x54, 0x61, 0x75, 0xba, - 0xe4, 0x92, 0x9d, 0x86, 0x82, 0x5f, 0x72, 0x4c, 0x31, 0x28, 0x4a, 0x90, 0x40, 0xa9, 0x4e, 0x04, - 0x02, 0xaa, 0xc0, 0x24, 0x4e, 0x26, 0x02, 0x04, 0xa8, 0xe3, 0xb0, 0xfe, 0xa7, 0x93, 0x27, 0xb3, - 0x2e, 0x16, 0x54, 0xfa, 0xd4, 0xff, 0xd5, 0x27, 0xa3, 0x57, 0x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bf, - 0x1e, 0xbf, 0xd6, 0xcc, 0x8c, 0x66, 0xa2, 0x35, 0x7b, 0x10, 0x3f, 0x1e, 0x55, 0xad, 0x2c, 0x5d, - 0x90, 0x91, 0x64, 0x59, 0xb6, 0x6e, 0x1c, 0x77, 0x95, 0xc3, 0xed, 0x72, 0xbc, 0xab, 0x73, 0x46, - 0x31, 0x35, 0x8a, 0x87, 0x5a, 0xd1, 0x46, 0xf8, 0xf1, 0x50, 0xb6, 0x92, 0xd1, 0xd5, 0xd6, 0xb1, - 0xae, 0xb7, 0x8e, 0xf5, 0x73, 0xeb, 0x58, 0x5f, 0x77, 0x4e, 0xef, 0x7a, 0xe7, 0xf4, 0xbe, 0xef, - 0x9c, 0xde, 0x87, 0xb9, 0x48, 0xe5, 0xc7, 0xcf, 0xcb, 0x60, 0x05, 0x79, 0x68, 0xd6, 0x55, 0xff, - 0x3c, 0xc5, 0xe4, 0x53, 0xf8, 0x45, 0xed, 0xae, 0x5c, 0x17, 0x1c, 0x97, 0x87, 0x6a, 0x6d, 0x9f, - 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x63, 0x67, 0xf6, 0x22, 0x03, 0x00, 0x00, +var fileDescriptor_ef7cfd15e3ded621 = []byte{ + // 426 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0x6d, 0x9a, 0x94, 0x76, 0x13, 0x23, 0xd8, 0x06, 0x6a, 0xc5, 0xc5, 0x8e, 0x7c, 0xf2, + 0x05, 0x5b, 0x2d, 0x17, 0xc4, 0xd1, 0xaa, 0x04, 0xdc, 0x8a, 0x41, 0x1c, 0x7a, 0x20, 0x72, 0x6a, + 0xcb, 0x58, 0xd8, 0x1d, 0xcb, 0xb3, 0xac, 0xc8, 0x5b, 0xf0, 0x1c, 0x3c, 0x49, 0x25, 0x2e, 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00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go deleted file mode 100644 index b13f51469975..000000000000 --- a/x/gov/types/gov.pb.go +++ /dev/null @@ -1,2825 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta1/gov.proto - -package types - -import ( - fmt "fmt" - 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" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/regen-network/cosmos-proto" - _ "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. - OptionEmpty VoteOption = 0 - // VOTE_OPTION_YES defines a yes vote option. - OptionYes VoteOption = 1 - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - OptionAbstain VoteOption = 2 - // VOTE_OPTION_NO defines a no vote option. - OptionNo VoteOption = 3 - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - OptionNoWithVeto 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_6e82113c1a9a4b7c, []int{0} -} - -// ProposalStatus enumerates the valid statuses of a proposal. -type ProposalStatus int32 - -const ( - // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. - StatusNil ProposalStatus = 0 - // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - // period. - StatusDepositPeriod ProposalStatus = 1 - // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - // period. - StatusVotingPeriod ProposalStatus = 2 - // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - // passed. - StatusPassed ProposalStatus = 3 - // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - // been rejected. - StatusRejected ProposalStatus = 4 - // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - // failed. - StatusFailed 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_6e82113c1a9a4b7c, []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.v1beta1.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" yaml:"weight"` -} - -func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } -func (*WeightedVoteOption) ProtoMessage() {} -func (*WeightedVoteOption) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []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 - -// TextProposal defines a standard text proposal whose changes need to be -// manually updated in case of approval. -type TextProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` -} - -func (m *TextProposal) Reset() { *m = TextProposal{} } -func (*TextProposal) ProtoMessage() {} -func (*TextProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{1} -} -func (m *TextProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TextProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TextProposal.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 *TextProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_TextProposal.Merge(m, src) -} -func (m *TextProposal) XXX_Size() int { - return m.Size() -} -func (m *TextProposal) XXX_DiscardUnknown() { - xxx_messageInfo_TextProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_TextProposal proto.InternalMessageInfo - -// 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" yaml:"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"` -} - -func (m *Deposit) Reset() { *m = Deposit{} } -func (*Deposit) ProtoMessage() {} -func (*Deposit) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{2} -} -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 - -// 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"` - Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` - Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.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() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{3} -} -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 - -// 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" yaml:"no_with_veto"` -} - -func (m *TallyResult) Reset() { *m = TallyResult{} } -func (*TallyResult) ProtoMessage() {} -func (*TallyResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{4} -} -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 - -// 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" yaml:"proposal_id"` - 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.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. - Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (*Vote) ProtoMessage() {} -func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{5} -} -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 - -// 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" yaml:"min_deposit"` - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. - MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty" yaml:"max_deposit_period"` -} - -func (m *DepositParams) Reset() { *m = DepositParams{} } -func (*DepositParams) ProtoMessage() {} -func (*DepositParams) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{6} -} -func (m *DepositParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DepositParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DepositParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_DepositParams.Merge(m, src) -} -func (m *DepositParams) XXX_Size() int { - return m.Size() -} -func (m *DepositParams) XXX_DiscardUnknown() { - xxx_messageInfo_DepositParams.DiscardUnknown(m) -} - -var xxx_messageInfo_DepositParams proto.InternalMessageInfo - -// VotingParams defines the params 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" yaml:"voting_period"` -} - -func (m *VotingParams) Reset() { *m = VotingParams{} } -func (*VotingParams) ProtoMessage() {} -func (*VotingParams) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{7} -} -func (m *VotingParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VotingParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VotingParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_VotingParams.Merge(m, src) -} -func (m *VotingParams) XXX_Size() int { - return m.Size() -} -func (m *VotingParams) XXX_DiscardUnknown() { - xxx_messageInfo_VotingParams.DiscardUnknown(m) -} - -var xxx_messageInfo_VotingParams proto.InternalMessageInfo - -// TallyParams defines the params 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"` - // 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"` - // 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" yaml:"veto_threshold"` -} - -func (m *TallyParams) Reset() { *m = TallyParams{} } -func (*TallyParams) ProtoMessage() {} -func (*TallyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{8} -} -func (m *TallyParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TallyParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TallyParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_TallyParams.Merge(m, src) -} -func (m *TallyParams) XXX_Size() int { - return m.Size() -} -func (m *TallyParams) XXX_DiscardUnknown() { - xxx_messageInfo_TallyParams.DiscardUnknown(m) -} - -var xxx_messageInfo_TallyParams proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("cosmos.gov.v1beta1.VoteOption", VoteOption_name, VoteOption_value) - proto.RegisterEnum("cosmos.gov.v1beta1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) - proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1beta1.WeightedVoteOption") - proto.RegisterType((*TextProposal)(nil), "cosmos.gov.v1beta1.TextProposal") - proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1beta1.Deposit") - proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1beta1.Proposal") - proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1beta1.TallyResult") - proto.RegisterType((*Vote)(nil), "cosmos.gov.v1beta1.Vote") - proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1beta1.DepositParams") - proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1beta1.VotingParams") - proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1beta1.TallyParams") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } - -var fileDescriptor_6e82113c1a9a4b7c = []byte{ - // 1454 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x51, 0x68, 0xdb, 0x56, - 0x17, 0xb6, 0x6c, 0xc7, 0x89, 0xaf, 0x9d, 0x44, 0xbd, 0x49, 0x13, 0xc7, 0x7f, 0x7f, 0xc9, 0xbf, - 0xfe, 0x9f, 0x12, 0x4a, 0xeb, 0xb4, 0xf9, 0xc7, 0xc6, 0x52, 0xd8, 0x66, 0xc5, 0xca, 0xea, 0x51, - 0x6c, 0x23, 0xab, 0x0e, 0xed, 0x1e, 0x84, 0x62, 0xdf, 0x3a, 0xda, 0x2c, 0x5d, 0xcf, 0xba, 0x4e, - 0x13, 0xf6, 0xb2, 0xc7, 0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x04, 0xc0, 0xd2, 0x93, 0x97, 0x22, 0xa7, 0x02, 0x6a, 0x71, - 0x01, 0xd0, 0x04, 0x3c, 0x6b, 0x11, 0x1d, 0xd9, 0x75, 0x1a, 0x21, 0x76, 0x61, 0x84, 0xff, 0xb2, - 0x08, 0xcb, 0x34, 0xc2, 0x28, 0x03, 0x0d, 0x33, 0xc7, 0xcc, 0x8a, 0x5d, 0xf7, 0x42, 0x3d, 0xe6, - 0xc0, 0x2c, 0xc1, 0xc4, 0x68, 0xea, 0xec, 0x20, 0x35, 0x7d, 0x51, 0x23, 0xde, 0x61, 0x71, 0x16, - 0x69, 0x9c, 0x21, 0xb4, 0x34, 0x51, 0x83, 0x26, 0x3d, 0xac, 0x3f, 0x62, 0x4d, 0x70, 0x69, 0x0f, - 0x13, 0xd3, 0x6e, 0xb8, 0x3f, 0x6f, 0x9b, 0x09, 0x3b, 0x73, 0x61, 0xd9, 0xff, 0x63, 0xe9, 0xa4, - 0x68, 0x3a, 0x63, 0x14, 0xb4, 0xee, 0x79, 0x6a, 0xaf, 0xb8, 0x66, 0xaf, 0xf0, 0x87, 0x80, 0x99, - 0x06, 0x12, 0xc7, 0x2f, 0x8c, 0x25, 0xb1, 0x58, 0x4b, 0x43, 0xb1, 0x86, 0x15, 0x9e, 0xa5, 0x56, - 0x26, 0xf0, 0x46, 0xd4, 0xdd, 0x2a, 0xd2, 0x61, 0x18, 0x24, 0x82, 0xed, 0xf3, 0x01, 0x88, 0x1c, - 0x20, 0x87, 0x6e, 0x28, 0x39, 0x3b, 0xc1, 0x26, 0x2c, 0xd8, 0x44, 0x75, 0xa1, 0xf0, 0x0e, 0x98, - 0x36, 0x76, 0x1c, 0x62, 0x98, 0x6c, 0x97, 0x4d, 0xcc, 0xe2, 0xc3, 0xe1, 0x7b, 0x20, 0x6c, 0x63, - 0x6f, 0x20, 0x27, 0x27, 0x09, 0xdb, 0x18, 0x36, 0x40, 0xd2, 0xc6, 0xfa, 0x23, 0x93, 0xec, 0xea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63, 0xdf, 0x97, 0x8b, 0x9a, 0xbf, 0xe4, 0x40, 0xb2, 0xea, 0x4d, - 0x22, 0xd3, 0xef, 0x73, 0xc0, 0x26, 0xd3, 0xcf, 0x8d, 0xbb, 0x28, 0xb7, 0xdb, 0x2c, 0xb7, 0xe5, - 0x21, 0xdc, 0x50, 0x5a, 0x8b, 0x43, 0x8b, 0x20, 0x98, 0x51, 0x92, 0xda, 0x58, 0x36, 0xbf, 0xf9, - 0xf3, 0xcf, 0x92, 0x79, 0x00, 0x62, 0x9f, 0x75, 0x70, 0xbb, 0x63, 0x79, 0x59, 0x24, 0x65, 0x79, - 0xb2, 0x8f, 0xa1, 0x93, 0xbe, 0xc8, 0x53, 0xfc, 0x20, 0x1b, 0x95, 0x31, 0xc2, 0x1a, 0x88, 0x93, - 0xdd, 0x36, 0x72, 0x76, 0x71, 0x93, 0xfe, 0x00, 0xc9, 0x89, 0x86, 0x91, 0xd2, 0x2f, 0x9c, 0x51, - 0x04, 0x22, 0x0c, 0x78, 0x61, 0x97, 0x03, 0x73, 0xee, 0x84, 0xea, 0x83, 0x50, 0x11, 0x2f, 0x54, - 0x6d, 0xe2, 0x50, 0xa9, 0x61, 0x9e, 0x21, 0x7d, 0x2f, 0x33, 0x7d, 0x87, 0x3c, 0x24, 0x75, 0xd6, - 0x35, 0x68, 0xfe, 0xfb, 0xb5, 0x3f, 0x38, 0x00, 0x02, 0x5f, 0xa8, 0xd7, 0xc1, 0x72, 0xb5, 0xa4, - 0x29, 0x7a, 0xa9, 0xac, 0x15, 0x4a, 0x45, 0xfd, 0x5e, 0xb1, 0x52, 0x56, 0x36, 0x0b, 0x5b, 0x05, - 0x25, 0xcf, 0x87, 0xd2, 0xf3, 0xdd, 0x5e, 0x26, 0x41, 0x1d, 0x15, 0x37, 0x08, 0x94, 0xc0, 0x7c, - 0xd0, 0xfb, 0xbe, 0x52, 0xe1, 0xb9, 0xf4, 0x6c, 0xb7, 0x97, 0x89, 0x53, 0xaf, 0xfb, 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6f, 0x55, 0xf9, 0x48, 0xd9, 0xd4, 0x94, 0x3c, 0x1f, 0x4d, 0xc3, - 0x6e, 0x2f, 0x33, 0x47, 0xfd, 0x55, 0xf4, 0x09, 0xaa, 0x11, 0x74, 0x2e, 0xff, 0x56, 0xae, 0x70, - 0x57, 0xc9, 0xf3, 0x53, 0x41, 0xfe, 0x2d, 0xc3, 0x6c, 0xa2, 0x3a, 0x95, 0x53, 0x2e, 0x1e, 0xbe, - 0x12, 0x42, 0x2f, 0x5e, 0x09, 0xa1, 0x2f, 0x8e, 0x84, 0xd0, 0xe1, 0x91, 0xc0, 0x3d, 0x3f, 0x12, - 0xb8, 0xdf, 0x8f, 0x04, 0xee, 0xc9, 0xb1, 0x10, 0x7a, 0x7e, 0x2c, 0x84, 0x5e, 0x1c, 0x0b, 0xa1, - 0x07, 0x7f, 0xbf, 0x10, 0xf7, 0xbd, 0x7f, 0xff, 0xbc, 0x7e, 0xde, 0x89, 0x79, 0x3b, 0xe4, 0xff, - 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x14, 0xb4, 0xf2, 0xfe, 0x19, 0x0e, 0x00, 0x00, -} - -func (this *TextProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TextProposal) - if !ok { - that2, ok := that.(TextProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - return true -} -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 !this.Content.Equal(that1.Content) { - 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 -} -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) - 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 - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - 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 *TextProposal) 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 *TextProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TextProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - 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 - 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 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 - } - } - 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 - } - 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 m.Content != nil { - { - size, err := m.Content.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 - { - 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)) - } - 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 - n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxDepositPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintGov(dAtA, i, uint64(n7)) - 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 - n8, err8 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.VotingPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintGov(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *TallyParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TallyParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.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)) - } - 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 = m.Weight.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *TextProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - 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 m.Content != nil { - l = m.Content.Size() - n += 1 + l + sovGov(uint64(l)) - } - 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 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)) - return n -} - -func (m *TallyResult) Size() (n int) { - if m == nil { - return 0 - } - 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)) - 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)) - } - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod) - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *VotingParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod) - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *TallyParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Quorum.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.Threshold.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.VetoThreshold.Size() - 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 - } - if err := m.Weight.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 *TextProposal) 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: TextProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TextProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", 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.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = 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 Content", 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.Content == nil { - m.Content = &types1.Any{} - } - if err := m.Content.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 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 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 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 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 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 - } - if err := m.Yes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 - } - if err := m.Abstain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 - } - if err := m.No.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 - } - if err := m.NoWithVeto.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 *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 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 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 - } - if err := m.Quorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Threshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field 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 - } - if err := m.VetoThreshold.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 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/msgs.go b/x/gov/types/msgs.go index d85964345376..076847397870 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -2,6 +2,7 @@ package types import ( "fmt" + "strings" yaml "gopkg.in/yaml.v2" @@ -10,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdktx "github.com/cosmos/cosmos-sdk/types/tx" ) // Governance message types and routes @@ -18,6 +20,11 @@ const ( TypeMsgVote = "vote" TypeMsgVoteWeighted = "weighted_vote" TypeMsgSubmitProposal = "submit_proposal" + TypeMsgSignal = "signal" + + // Constants pertaining to a Signal message + MaxDescriptionLength int = 5000 + MaxTitleLength int = 140 ) var ( @@ -27,15 +34,16 @@ var ( // NewMsgSubmitProposal creates a new MsgSubmitProposal. //nolint:interfacer -func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sdk.AccAddress) (*MsgSubmitProposal, error) { +func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer sdk.AccAddress) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ InitialDeposit: initialDeposit, Proposer: proposer.String(), } - err := m.SetContent(content) - if err != nil { - return nil, err + + if err := m.SetMessages(messages); err != nil { + return &MsgSubmitProposal{}, err } + return m, nil } @@ -46,12 +54,17 @@ func (m *MsgSubmitProposal) GetProposer() sdk.AccAddress { return proposer } -func (m *MsgSubmitProposal) GetContent() Content { - content, ok := m.Content.GetCachedValue().(Content) - if !ok { - return nil +func (m *MsgSubmitProposal) GetMessages() ([]sdk.Msg, error) { + msgs := make([]sdk.Msg, len(m.Messages)) + for i, msgAny := range m.Messages { + msg, ok := msgAny.GetCachedValue().(sdk.Msg) + if !ok { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "messages contains %T which is not a sdk.Msg", msgAny) + } + msgs[i] = msg } - return content + + return msgs, nil } func (m *MsgSubmitProposal) SetInitialDeposit(coins sdk.Coins) { @@ -62,16 +75,21 @@ func (m *MsgSubmitProposal) SetProposer(address fmt.Stringer) { m.Proposer = address.String() } -func (m *MsgSubmitProposal) SetContent(content Content) error { - msg, ok := content.(proto.Message) - if !ok { - return fmt.Errorf("can't proto marshal %T", msg) - } - any, err := types.NewAnyWithValue(msg) - if err != nil { - return err +func (m *MsgSubmitProposal) SetMessages(messages []sdk.Msg) error { + msgs := make([]*types.Any, len(messages)) + for i, msg := range messages { + m, ok := msg.(proto.Message) + if !ok { + return fmt.Errorf("can't proto marshal %T", msg) + } + any, err := types.NewAnyWithValue(m) + if err != nil { + return err + } + + msgs[i] = any } - m.Content = any + m.Messages = msgs return nil } @@ -93,14 +111,12 @@ func (m MsgSubmitProposal) ValidateBasic() error { return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.InitialDeposit.String()) } - content := m.GetContent() - if content == nil { - return sdkerrors.Wrap(ErrInvalidProposalContent, "missing content") - } - if !IsValidProposalType(content.ProposalType()) { - return sdkerrors.Wrap(ErrInvalidProposalType, content.ProposalType()) + // Empty messages are not allowed + if m.Messages == nil || len(m.Messages) == 0 { + return ErrNoProposalMsgs } - if err := content.ValidateBasic(); err != nil { + + if _, err := m.GetMessages(); err != nil { return err } @@ -127,8 +143,7 @@ func (m MsgSubmitProposal) String() string { // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (m MsgSubmitProposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { - var content Content - return unpacker.UnpackAny(m.Content, &content) + return sdktx.UnpackInterfaces(unpacker, m.Messages) } // NewMsgDeposit creates a new MsgDeposit instance @@ -280,3 +295,51 @@ func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { voter, _ := sdk.AccAddressFromBech32(msg.Voter) return []sdk.AccAddress{voter} } + +// NewMsgVote creates a message to cast a vote on an active proposal +//nolint:interfacer +func NewMsgSignal(title, description string) *MsgSignal { + return &MsgSignal{title, description} +} + +// Route implements Msg +func (msg MsgSignal) Route() string { return RouterKey } + +// Type implements Msg +func (msg MsgSignal) Type() string { return TypeMsgSignal } + +// ValidateBasic implements Msg +func (msg MsgSignal) ValidateBasic() error { + if len(strings.TrimSpace(msg.Title)) == 0 { + return sdkerrors.Wrap(ErrInvalidSignalMsg, "signal title cannot be blank") + } + if len(msg.Title) > MaxTitleLength { + return sdkerrors.Wrap(ErrInvalidSignalMsg, fmt.Sprintf("signal title is longer than max length of %d", MaxTitleLength)) + } + + if len(msg.Description) == 0 { + return sdkerrors.Wrap(ErrInvalidSignalMsg, "signal description cannot be blank") + } + if len(msg.Description) > MaxDescriptionLength { + return sdkerrors.Wrap(ErrInvalidSignalMsg, fmt.Sprintf("signal description is longer than max length of %d", MaxDescriptionLength)) + } + + return nil +} + +// String implements the Stringer interface +func (msg MsgSignal) String() string { + out, _ := yaml.Marshal(msg) + return string(out) +} + +// GetSignBytes implements Msg +func (msg MsgSignal) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements Msg. A signal message has no signers +func (msg MsgSignal) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{} +} diff --git a/x/gov/types/msgs_test.go b/x/gov/types/msgs_test.go index 2a8fd5275895..b503a66d67df 100644 --- a/x/gov/types/msgs_test.go +++ b/x/gov/types/msgs_test.go @@ -27,24 +27,25 @@ func init() { func TestMsgSubmitProposal(t *testing.T) { tests := []struct { title, description string - proposalType string proposerAddr sdk.AccAddress initialDeposit sdk.Coins expectPass bool }{ - {"Test Proposal", "the purpose of this proposal is to test", ProposalTypeText, addrs[0], coinsPos, true}, - {"", "the purpose of this proposal is to test", ProposalTypeText, addrs[0], coinsPos, false}, - {"Test Proposal", "", ProposalTypeText, addrs[0], coinsPos, false}, - {"Test Proposal", "the purpose of this proposal is to test", ProposalTypeText, sdk.AccAddress{}, coinsPos, false}, - {"Test Proposal", "the purpose of this proposal is to test", ProposalTypeText, addrs[0], coinsZero, true}, - {"Test Proposal", "the purpose of this proposal is to test", ProposalTypeText, addrs[0], coinsMulti, true}, - {strings.Repeat("#", MaxTitleLength*2), "the purpose of this proposal is to test", ProposalTypeText, addrs[0], coinsMulti, false}, - {"Test Proposal", strings.Repeat("#", MaxDescriptionLength*2), ProposalTypeText, addrs[0], coinsMulti, false}, + {"Test Proposal", "the purpose of this proposal is to test", addrs[0], coinsPos, true}, + {"", "the purpose of this proposal is to test", addrs[0], coinsPos, false}, + {"Test Proposal", "", addrs[0], coinsPos, false}, + {"Test Proposal", "the purpose of this proposal is to test", sdk.AccAddress{}, coinsPos, false}, + {"Test Proposal", "the purpose of this proposal is to test", addrs[0], coinsZero, true}, + {"Test Proposal", "the purpose of this proposal is to test", addrs[0], coinsMulti, true}, + {strings.Repeat("#", MaxTitleLength*2), "the purpose of this proposal is to test", addrs[0], coinsMulti, false}, + {"Test Proposal", strings.Repeat("#", MaxDescriptionLength*2), addrs[0], coinsMulti, false}, } for i, tc := range tests { + proposal := []sdk.Msg{NewMsgSignal(tc.title, tc.description)} + msg, err := NewMsgSubmitProposal( - ContentFromProposalType(tc.title, tc.description, tc.proposalType), + proposal, tc.initialDeposit, tc.proposerAddr, ) @@ -164,13 +165,14 @@ func TestMsgVoteWeighted(t *testing.T) { // this tests that Amino JSON MsgSubmitProposal.GetSignBytes() still works with Content as Any using the ModuleCdc func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { - msg, err := NewMsgSubmitProposal(NewTextProposal("test", "abcd"), sdk.NewCoins(), sdk.AccAddress{}) + proposal := []sdk.Msg{NewMsgVote(addrs[0], 1, OptionYes)} + msg, err := NewMsgSubmitProposal(proposal, sdk.NewCoins(), sdk.AccAddress{}) require.NoError(t, err) var bz []byte require.NotPanics(t, func() { bz = msg.GetSignBytes() }) require.Equal(t, - `{"type":"cosmos-sdk/MsgSubmitProposal","value":{"content":{"type":"cosmos-sdk/TextProposal","value":{"description":"abcd","title":"test"}},"initial_deposit":[]}}`, + `"{\"type\":\"cosmos-sdk/MsgSubmitProposal\",\"value\":{\"initial_deposit\":[],\"messages\":[{\"type\":\"cosmos-sdk/MsgVote\",\"value\":{\"option\":1,\"proposal_id\":\"1\",\"voter\":\"cosmos1w3jhxap3gempvr\"}}]}}"`, string(bz)) } diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index f7d5d9d4dd93..b19ed27e4c45 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -10,27 +10,32 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdktx "github.com/cosmos/cosmos-sdk/types/tx" ) // DefaultStartingProposalID is 1 const DefaultStartingProposalID uint64 = 1 // NewProposal creates a new Proposal instance -func NewProposal(content Content, id uint64, submitTime, depositEndTime time.Time) (Proposal, error) { - msg, ok := content.(proto.Message) - if !ok { - return Proposal{}, fmt.Errorf("%T does not implement proto.Message", content) - } +func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time) (Proposal, error) { + + msgs := make([]*types.Any, len(messages)) + for i, msg := range messages { + m, ok := msg.(proto.Message) + if !ok { + return Proposal{}, fmt.Errorf("can't proto marshal %T", msg) + } + any, err := types.NewAnyWithValue(m) + if err != nil { + return Proposal{}, err + } - any, err := types.NewAnyWithValue(msg) - if err != nil { - return Proposal{}, err + msgs[i] = any } p := Proposal{ - Content: any, ProposalId: id, + Messages: msgs, Status: StatusDepositPeriod, FinalTallyResult: EmptyTallyResult(), TotalDeposit: sdk.NewCoins(), @@ -47,43 +52,14 @@ func (p Proposal) String() string { return string(out) } -// GetContent returns the proposal Content -func (p Proposal) GetContent() Content { - content, ok := p.Content.GetCachedValue().(Content) - if !ok { - return nil - } - return content -} - -func (p Proposal) ProposalType() string { - content := p.GetContent() - if content == nil { - return "" - } - return content.ProposalType() -} - -func (p Proposal) ProposalRoute() string { - content := p.GetContent() - if content == nil { - return "" - } - return content.ProposalRoute() -} - -func (p Proposal) GetTitle() string { - content := p.GetContent() - if content == nil { - return "" - } - return content.GetTitle() +// GetMessages returns the proposal messages +func (p Proposal) GetMessages() ([]sdk.Msg, error) { + return sdktx.GetMsgs(p.Messages, "sdk.MsgProposal") } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { - var content Content - return unpacker.UnpackAny(p.Content, &content) + return sdktx.UnpackInterfaces(unpacker, p.Messages) } // Proposals is an array of proposal @@ -110,9 +86,8 @@ func (p Proposals) Equal(other Proposals) bool { func (p Proposals) String() string { out := "ID - (Status) [Type] Title\n" for _, prop := range p { - out += fmt.Sprintf("%d - (%s) [%s] %s\n", - prop.ProposalId, prop.Status, - prop.ProposalType(), prop.GetTitle()) + out += fmt.Sprintf("%d - %s\n", + prop.ProposalId, prop.Status) } return strings.TrimSpace(out) } @@ -177,86 +152,3 @@ func (status ProposalStatus) Format(s fmt.State, verb rune) { s.Write([]byte(fmt.Sprintf("%v", byte(status)))) } } - -// Proposal types -const ( - ProposalTypeText string = "Text" -) - -// Implements Content Interface -var _ Content = &TextProposal{} - -// NewTextProposal creates a text proposal Content -func NewTextProposal(title, description string) Content { - return &TextProposal{title, description} -} - -// GetTitle returns the proposal title -func (tp *TextProposal) GetTitle() string { return tp.Title } - -// GetDescription returns the proposal description -func (tp *TextProposal) GetDescription() string { return tp.Description } - -// ProposalRoute returns the proposal router key -func (tp *TextProposal) ProposalRoute() string { return RouterKey } - -// ProposalType is "Text" -func (tp *TextProposal) ProposalType() string { return ProposalTypeText } - -// ValidateBasic validates the content's title and description of the proposal -func (tp *TextProposal) ValidateBasic() error { return ValidateAbstract(tp) } - -// String implements Stringer interface -func (tp TextProposal) String() string { - out, _ := yaml.Marshal(tp) - return string(out) -} - -var validProposalTypes = map[string]struct{}{ - ProposalTypeText: {}, -} - -// RegisterProposalType registers a proposal type. It will panic if the type is -// already registered. -func RegisterProposalType(ty string) { - if _, ok := validProposalTypes[ty]; ok { - panic(fmt.Sprintf("already registered proposal type: %s", ty)) - } - - validProposalTypes[ty] = struct{}{} -} - -// ContentFromProposalType returns a Content object based on the proposal type. -func ContentFromProposalType(title, desc, ty string) Content { - switch ty { - case ProposalTypeText: - return NewTextProposal(title, desc) - - default: - return nil - } -} - -// IsValidProposalType returns a boolean determining if the proposal type is -// valid. -// -// NOTE: Modules with their own proposal types must register them. -func IsValidProposalType(ty string) bool { - _, ok := validProposalTypes[ty] - return ok -} - -// ProposalHandler implements the Handler interface for governance module-based -// proposals (ie. TextProposal ). Since these are -// merely signaling mechanisms at the moment and do not affect state, it -// performs a no-op. -func ProposalHandler(_ sdk.Context, c Content) error { - switch c.ProposalType() { - case ProposalTypeText: - // both proposal types do not change state so this performs a no-op - return nil - - default: - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized gov proposal type: %s", c.ProposalType()) - } -} diff --git a/x/gov/types/query.pb.go b/x/gov/types/query.pb.go index 4ca1f33ae5f4..ac02a32fcdc9 100644 --- a/x/gov/types/query.pb.go +++ b/x/gov/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta1/query.proto +// source: cosmos/gov/v1/query.proto package types @@ -40,7 +40,7 @@ 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_e35c0d133e91c0a2, []int{0} + return fileDescriptor_46a436d1109b50d0, []int{0} } func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -85,7 +85,7 @@ 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_e35c0d133e91c0a2, []int{1} + return fileDescriptor_46a436d1109b50d0, []int{1} } func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -124,7 +124,7 @@ func (m *QueryProposalResponse) GetProposal() Proposal { // 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.v1beta1.ProposalStatus" json:"proposal_status,omitempty"` + ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1.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. @@ -137,7 +137,7 @@ 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_e35c0d133e91c0a2, []int{2} + return fileDescriptor_46a436d1109b50d0, []int{2} } func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -178,7 +178,7 @@ 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_e35c0d133e91c0a2, []int{3} + return fileDescriptor_46a436d1109b50d0, []int{3} } func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -233,7 +233,7 @@ 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_e35c0d133e91c0a2, []int{4} + return fileDescriptor_46a436d1109b50d0, []int{4} } func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -272,7 +272,7 @@ 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_e35c0d133e91c0a2, []int{5} + return fileDescriptor_46a436d1109b50d0, []int{5} } func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -320,7 +320,7 @@ 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_e35c0d133e91c0a2, []int{6} + return fileDescriptor_46a436d1109b50d0, []int{6} } func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -375,7 +375,7 @@ 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_e35c0d133e91c0a2, []int{7} + return fileDescriptor_46a436d1109b50d0, []int{7} } func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -429,7 +429,7 @@ 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_e35c0d133e91c0a2, []int{8} + return fileDescriptor_46a436d1109b50d0, []int{8} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -479,7 +479,7 @@ 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_e35c0d133e91c0a2, []int{9} + return fileDescriptor_46a436d1109b50d0, []int{9} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -541,7 +541,7 @@ 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_e35c0d133e91c0a2, []int{10} + return fileDescriptor_46a436d1109b50d0, []int{10} } func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -580,7 +580,7 @@ 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_e35c0d133e91c0a2, []int{11} + return fileDescriptor_46a436d1109b50d0, []int{11} } func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -628,7 +628,7 @@ 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_e35c0d133e91c0a2, []int{12} + return fileDescriptor_46a436d1109b50d0, []int{12} } func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -682,7 +682,7 @@ 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_e35c0d133e91c0a2, []int{13} + return fileDescriptor_46a436d1109b50d0, []int{13} } func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -735,7 +735,7 @@ 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_e35c0d133e91c0a2, []int{14} + return fileDescriptor_46a436d1109b50d0, []int{14} } func (m *QueryTallyResultRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -781,7 +781,7 @@ func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultRespon func (m *QueryTallyResultResponse) String() string { return proto.CompactTextString(m) } func (*QueryTallyResultResponse) ProtoMessage() {} func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{15} + return fileDescriptor_46a436d1109b50d0, []int{15} } func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -818,89 +818,88 @@ func (m *QueryTallyResultResponse) GetTally() TallyResult { } func init() { - proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1beta1.QueryProposalRequest") - proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1beta1.QueryProposalResponse") - proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1beta1.QueryProposalsRequest") - proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1beta1.QueryProposalsResponse") - proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1beta1.QueryVoteRequest") - proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1beta1.QueryVoteResponse") - proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1beta1.QueryVotesRequest") - proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1beta1.QueryVotesResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1beta1.QueryDepositRequest") - proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1beta1.QueryDepositResponse") - proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1beta1.QueryDepositsRequest") - proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1beta1.QueryDepositsResponse") - proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1beta1.QueryTallyResultRequest") - proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1beta1.QueryTallyResultResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/query.proto", fileDescriptor_e35c0d133e91c0a2) } - -var fileDescriptor_e35c0d133e91c0a2 = []byte{ - // 963 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x41, 0x6f, 0x1b, 0x55, - 0x10, 0xf6, 0x4b, 0x9c, 0xd6, 0x9e, 0xb4, 0x01, 0x86, 0x00, 0xd6, 0x12, 0xec, 0xb0, 0xa2, 0xad, - 0x49, 0xa9, 0x97, 0x24, 0x05, 0xd4, 0x16, 0x50, 0x89, 0x50, 0x5b, 0x54, 0x09, 0x15, 0xa7, 0x02, - 0x89, 0x03, 0xd1, 0xa6, 0x5e, 0x2d, 0x2b, 0x1c, 0xbf, 0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to.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1.QueryProposalRequest") + proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1.QueryProposalResponse") + proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1.QueryProposalsRequest") + proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1.QueryProposalsResponse") + proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1.QueryVoteRequest") + proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1.QueryVoteResponse") + proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1.QueryVotesRequest") + proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1.QueryVotesResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1.QueryParamsResponse") + proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1.QueryDepositRequest") + proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1.QueryDepositResponse") + proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1.QueryDepositsRequest") + proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1.QueryDepositsResponse") + proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1.QueryTallyResultRequest") + proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1.QueryTallyResultResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1/query.proto", fileDescriptor_46a436d1109b50d0) } + +var fileDescriptor_46a436d1109b50d0 = []byte{ + // 956 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0x26, 0x4e, 0x6b, 0xbf, 0x34, 0x01, 0x5e, 0x43, 0x63, 0x96, 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 0xe7, 0x8c, 0xfa, 0x57, 0xff, 0xad, 0xff, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x2c, 0x3d, 0xc6, 0x67, 0x8f, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -943,7 +942,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Proposal", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Proposal", in, out, opts...) if err != nil { return nil, err } @@ -952,7 +951,7 @@ func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, op func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { out := new(QueryProposalsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Proposals", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Proposals", in, out, opts...) if err != nil { return nil, err } @@ -961,7 +960,7 @@ func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { out := new(QueryVoteResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Vote", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Vote", in, out, opts...) if err != nil { return nil, err } @@ -970,7 +969,7 @@ func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...gr func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { out := new(QueryVotesResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Votes", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Votes", in, out, opts...) if err != nil { return nil, err } @@ -979,7 +978,7 @@ func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ... func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -988,7 +987,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { out := new(QueryDepositResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposit", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Deposit", in, out, opts...) if err != nil { return nil, err } @@ -997,7 +996,7 @@ func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { out := new(QueryDepositsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposits", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Deposits", in, out, opts...) if err != nil { return nil, err } @@ -1006,7 +1005,7 @@ func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, op func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/TallyResult", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/TallyResult", in, out, opts...) if err != nil { return nil, err } @@ -1076,7 +1075,7 @@ func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Proposal", + FullMethod: "/cosmos.gov.v1.Query/Proposal", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest)) @@ -1094,7 +1093,7 @@ func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Proposals", + FullMethod: "/cosmos.gov.v1.Query/Proposals", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest)) @@ -1112,7 +1111,7 @@ func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Vote", + FullMethod: "/cosmos.gov.v1.Query/Vote", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest)) @@ -1130,7 +1129,7 @@ func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Votes", + FullMethod: "/cosmos.gov.v1.Query/Votes", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest)) @@ -1148,7 +1147,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Params", + FullMethod: "/cosmos.gov.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -1166,7 +1165,7 @@ func _Query_Deposit_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Deposit", + FullMethod: "/cosmos.gov.v1.Query/Deposit", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) @@ -1184,7 +1183,7 @@ func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Deposits", + FullMethod: "/cosmos.gov.v1.Query/Deposits", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest)) @@ -1202,7 +1201,7 @@ func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/TallyResult", + FullMethod: "/cosmos.gov.v1.Query/TallyResult", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) @@ -1211,7 +1210,7 @@ func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(i } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.gov.v1beta1.Query", + ServiceName: "cosmos.gov.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1248,7 +1247,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/gov/v1beta1/query.proto", + Metadata: "cosmos/gov/v1/query.proto", } func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/gov/types/query.pb.gw.go b/x/gov/types/query.pb.gw.go index 4b6832d41e7b..00b3afcc7313 100644 --- a/x/gov/types/query.pb.gw.go +++ b/x/gov/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/gov/v1beta1/query.proto +// source: cosmos/gov/v1/query.proto /* Package types is a reverse proxy. @@ -896,21 +896,21 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } 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", "v1beta1", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false))) + 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", "v1", "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", "v1beta1", "proposals"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "gov", "v1", "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", "v1beta1", "proposals", "proposal_id", "votes", "voter"}, "", 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", "v1", "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", "v1beta1", "proposals", "proposal_id", "votes"}, "", 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", "v1", "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", "v1beta1", "params", "params_type"}, "", 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", "v1", "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", "v1beta1", "proposals", "proposal_id", "deposits", "depositor"}, "", 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", "v1", "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", "v1beta1", "proposals", "proposal_id", "deposits"}, "", 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", "v1", "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", "v1beta1", "proposals", "proposal_id", "tally"}, "", 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", "v1", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index 4c7bb1f9d060..842ab33de001 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta1/tx.proto +// source: cosmos/gov/v1/tx.proto package types @@ -35,7 +35,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary // proposal Content. type MsgSubmitProposal struct { - Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + 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" yaml:"initial_deposit"` Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` } @@ -43,7 +43,7 @@ type MsgSubmitProposal struct { func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } func (*MsgSubmitProposal) ProtoMessage() {} func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{0} + return fileDescriptor_9ff8f4a63b6fc9a9, []int{0} } func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -81,7 +81,7 @@ func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResp func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) } func (*MsgSubmitProposalResponse) ProtoMessage() {} func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{1} + return fileDescriptor_9ff8f4a63b6fc9a9, []int{1} } func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,13 +121,13 @@ func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { type MsgVote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1.VoteOption" json:"option,omitempty"` } func (m *MsgVote) Reset() { *m = MsgVote{} } func (*MsgVote) ProtoMessage() {} func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{2} + return fileDescriptor_9ff8f4a63b6fc9a9, []int{2} } func (m *MsgVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -164,7 +164,7 @@ 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_3c053992595e3dce, []int{3} + return fileDescriptor_9ff8f4a63b6fc9a9, []int{3} } func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -203,7 +203,7 @@ type MsgVoteWeighted struct { func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } func (*MsgVoteWeighted) ProtoMessage() {} func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{4} + return fileDescriptor_9ff8f4a63b6fc9a9, []int{4} } func (m *MsgVoteWeighted) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,7 +240,7 @@ 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_3c053992595e3dce, []int{5} + return fileDescriptor_9ff8f4a63b6fc9a9, []int{5} } func (m *MsgVoteWeightedResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -279,7 +279,7 @@ type MsgDeposit struct { func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } func (*MsgDeposit) ProtoMessage() {} func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{6} + return fileDescriptor_9ff8f4a63b6fc9a9, []int{6} } func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -316,7 +316,7 @@ 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_3c053992595e3dce, []int{7} + return fileDescriptor_9ff8f4a63b6fc9a9, []int{7} } func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -345,62 +345,143 @@ func (m *MsgDepositResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo +// MsgSignal is functionally a no-op message that can be submitted in a proposal to signal +// an intention for members to vote on. +type MsgSignal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (m *MsgSignal) Reset() { *m = MsgSignal{} } +func (*MsgSignal) ProtoMessage() {} +func (*MsgSignal) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{8} +} +func (m *MsgSignal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSignal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSignal.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 *MsgSignal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSignal.Merge(m, src) +} +func (m *MsgSignal) XXX_Size() int { + return m.Size() +} +func (m *MsgSignal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSignal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSignal proto.InternalMessageInfo + +// MsgSignalResponse defined the Msg/Signal response type +type MsgSignalResponse struct { +} + +func (m *MsgSignalResponse) Reset() { *m = MsgSignalResponse{} } +func (m *MsgSignalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSignalResponse) ProtoMessage() {} +func (*MsgSignalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{9} +} +func (m *MsgSignalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSignalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSignalResponse.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 *MsgSignalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSignalResponse.Merge(m, src) +} +func (m *MsgSignalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSignalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSignalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSignalResponse proto.InternalMessageInfo + func init() { - proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1beta1.MsgSubmitProposal") - proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta1.MsgSubmitProposalResponse") - proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta1.MsgVote") - proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta1.MsgVoteResponse") - proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1beta1.MsgVoteWeighted") - proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1beta1.MsgVoteWeightedResponse") - proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta1.MsgDeposit") - proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta1.MsgDepositResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) } - -var fileDescriptor_3c053992595e3dce = []byte{ - // 659 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x3f, 0x6f, 0xd3, 0x5e, - 0x14, 0xb5, 0x93, 0xfe, 0x9a, 0x5f, 0x5f, 0x50, 0x4b, 0x9f, 0xa2, 0x92, 0xb8, 0x95, 0x1d, 0x19, - 0xb5, 0x8a, 0x84, 0x6a, 0xd3, 0x20, 0x81, 0x54, 0x26, 0x52, 0x54, 0x01, 0x52, 0x04, 0x18, 0x09, - 0x24, 0x96, 0xe2, 0x24, 0xae, 0x6b, 0x91, 0xf8, 0x5a, 0x79, 0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47, 0x2b, 0xae, 0xe3, 0x3e, 0xcb, 0x72, 0x44, 0x76, 0x4a, - 0x63, 0x66, 0xd1, 0x8c, 0x28, 0x59, 0xb6, 0xc3, 0xfc, 0xa8, 0x26, 0xb1, 0x27, 0x5e, 0xe0, 0x6f, - 0x51, 0xaf, 0x85, 0x6f, 0xa4, 0xd9, 0x99, 0xfb, 0xe7, 0xfa, 0xd7, 0x51, 0x8e, 0x57, 0x44, 0x8a, - 0x59, 0x36, 0x44, 0x4b, 0x69, 0x06, 0xe4, 0xd3, 0x8f, 0x8c, 0xd4, 0x26, 0xe2, 0x89, 0x72, 0x24, - 0x39, 0xc5, 0x4f, 0x09, 0x5d, 0x3a, 0x51, 0x7b, 0xe2, 0xeb, 0x87, 0x8a, 0x50, 0x9d, 0xf8, 0x72, - 0x80, 0xce, 0xeb, 0x86, 0x16, 0xd0, 0x94, 0x18, 0x68, 0x90, 0x2e, 0x8f, 0x02, 0xb8, 0x89, 0x26, - 0xdd, 0x0e, 0xf4, 0x42, 0x2a, 0x8c, 0x8e, 0xd9, 0x96, 0xab, 0xb1, 0xb7, 0xbf, 0xda, 0x09, 0x21, - 0x9d, 0xd2, 0x86, 0x02, 0xc2, 0x47, 0x56, 0x65, 0x07, 0xaa, 0xbf, 0x32, 0x28, 0x5b, 0x27, 0x3e, - 0xde, 0x44, 0xd3, 0x27, 0xde, 0x0d, 0x8b, 0x69, 0xfd, 0x1f, 0xd9, 0x18, 0x6d, 0xf9, 0x4c, 0x69, - 0xc9, 0x62, 0xdd, 0x41, 0x13, 0x6c, 0x19, 0xe6, 0x4f, 0xa1, 0xc5, 0xa0, 0x76, 0x79, 0x0c, 0x98, - 0x28, 0x3d, 0x43, 0x17, 0xfe, 0x98, 0xc7, 0x71, 0x24, 0x99, 0xa4, 0x5d, 0x39, 0x43, 0x52, 0xf2, - 0x84, 0x87, 0x28, 0x27, 0x27, 0x43, 0x3f, 0x85, 0x27, 0x70, 0x6d, 0x69, 0x3c, 0x2e, 0x25, 0x6b, - 0xb5, 0xdd, 0x7d, 0x5d, 0xdd, 0xdb, 0xd7, 0xd5, 0x6f, 0xfb, 0xba, 0xfa, 0xe6, 0x40, 0x57, 0xf6, - 0x0e, 0x74, 0xe5, 0xf3, 0x81, 0xae, 0x3c, 0x1d, 0x7f, 0xc5, 0xdb, 0xec, 0x13, 0xc1, 0x2e, 0xba, - 0x31, 0xc9, 0xde, 0xcd, 0xd7, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x96, 0x26, 0x77, 0x3f, 0x8e, + proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1.MsgSubmitProposal") + proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitProposalResponse") + proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1.MsgVote") + proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1.MsgVoteResponse") + proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1.MsgVoteWeighted") + proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1.MsgVoteWeightedResponse") + proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1.MsgDeposit") + proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1.MsgDepositResponse") + proto.RegisterType((*MsgSignal)(nil), "cosmos.gov.v1.MsgSignal") + proto.RegisterType((*MsgSignalResponse)(nil), "cosmos.gov.v1.MsgSignalResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } + +var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ + // 707 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x3f, 0x6f, 0xd3, 0x4e, + 0x18, 0xb6, 0x9b, 0xfe, 0xd2, 0xe6, 0xfa, 0xa3, 0xa5, 0x26, 0x4a, 0x1d, 0x0b, 0xd9, 0xae, 0x25, + 0x50, 0x16, 0xec, 0xa6, 0x0c, 0x48, 0x1d, 0x90, 0x1a, 0x2a, 0x10, 0x48, 0x11, 0xc8, 0x88, 0x22, + 0x21, 0xa4, 0xca, 0x49, 0x8e, 0xeb, 0x89, 0xc4, 0x67, 0xe5, 0x2e, 0x51, 0xb3, 0x31, 0x30, 0x20, + 0x06, 0xc4, 0xc8, 0xd8, 0x19, 0xb1, 0xf2, 0x1d, 0x3a, 0x76, 0x64, 0x40, 0x01, 0xb5, 0x0b, 0x30, + 0xf6, 0x13, 0x20, 0xdf, 0x9d, 0x9d, 0x36, 0x71, 0x83, 0x40, 0x9d, 0x92, 0xf7, 0xcf, 0xf3, 0xf8, + 0x7d, 0xde, 0x7b, 0xce, 0x06, 0xa5, 0x26, 0xa1, 0x1d, 0x42, 0x3d, 0x44, 0xfa, 0x5e, 0xbf, 0xea, + 0xb1, 0x3d, 0x37, 0xea, 0x12, 0x46, 0xb4, 0x4b, 0x22, 0xef, 0x22, 0xd2, 0x77, 0xfb, 0x55, 0xc3, + 0x94, 0x6d, 0x8d, 0x80, 0x42, 0xaf, 0x5f, 0x6d, 0x40, 0x16, 0x54, 0xbd, 0x26, 0xc1, 0xa1, 0x68, + 0x37, 0x56, 0xce, 0xd2, 0xc4, 0x28, 0x51, 0x28, 0x8b, 0xc2, 0x0e, 0x8f, 0x3c, 0x49, 0x2a, 0x4a, + 0x45, 0x44, 0x10, 0x11, 0xf9, 0xf8, 0x5f, 0x02, 0x40, 0x84, 0xa0, 0x36, 0xf4, 0x78, 0xd4, 0xe8, + 0xbd, 0xf0, 0x82, 0x70, 0x20, 0x4a, 0xce, 0xeb, 0x19, 0xb0, 0x5c, 0xa7, 0xe8, 0x71, 0xaf, 0xd1, + 0xc1, 0xec, 0x51, 0x97, 0x44, 0x84, 0x06, 0x6d, 0x6d, 0x0d, 0xcc, 0x77, 0x20, 0xa5, 0x01, 0x82, + 0x54, 0x57, 0xed, 0x5c, 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61, 0xb0, 0xab, 0xcf, 0x70, 0x8d, + 0x22, 0xd0, 0xaa, 0x20, 0x4f, 0x22, 0x86, 0x49, 0xc8, 0xa5, 0x2f, 0x8e, 0xce, 0x40, 0x58, 0xcf, + 0x8d, 0x47, 0x78, 0xc8, 0x1b, 0x7c, 0xd9, 0x98, 0xb1, 0x93, 0x65, 0xb0, 0x24, 0xa7, 0x4d, 0x36, + 0xe1, 0x7c, 0x56, 0xd3, 0xdc, 0x53, 0x88, 0xd1, 0x2e, 0x83, 0x2d, 0xed, 0x56, 0x96, 0x92, 0xd2, + 0x3f, 0x8f, 0xbe, 0x09, 0xe6, 0xc4, 0x44, 0x54, 0xcf, 0x71, 0xff, 0xac, 0x8e, 0xcd, 0x9e, 0x3c, + 0x78, 0xa4, 0xa1, 0x36, 0x1b, 0xfb, 0xc8, 0x4f, 0x70, 0x19, 0x52, 0xca, 0x60, 0x65, 0x6c, 0xec, + 0x54, 0xd2, 0x4f, 0x15, 0x80, 0x3a, 0x45, 0x89, 0x6d, 0x2e, 0xea, 0x5c, 0xae, 0x82, 0x82, 0xb4, + 0x31, 0x49, 0x04, 0x8e, 0x12, 0x5a, 0x13, 0xe4, 0x83, 0x0e, 0xe9, 0x85, 0x4c, 0x6a, 0x9c, 0x72, + 0x47, 0xd6, 0x62, 0x6d, 0x7f, 0x75, 0x13, 0x24, 0x75, 0xc6, 0x1a, 0x8a, 0x40, 0x1b, 0x49, 0x4d, + 0x37, 0xf0, 0x04, 0x14, 0x62, 0xef, 0x63, 0x14, 0x06, 0xed, 0xf8, 0x50, 0x18, 0x66, 0x6d, 0xc8, + 0x95, 0x17, 0x7c, 0x11, 0x68, 0x36, 0x58, 0x68, 0x41, 0xda, 0xec, 0x62, 0x61, 0x2a, 0xa1, 0xe7, + 0x74, 0x2a, 0xe3, 0x61, 0x57, 0xc4, 0x8b, 0x85, 0xd3, 0x26, 0xcf, 0x5a, 0x7f, 0x9b, 0x03, 0xb9, + 0x3a, 0x45, 0xda, 0x73, 0xb0, 0x38, 0xf6, 0xca, 0xb1, 0xc7, 0x8e, 0x79, 0xe2, 0x3a, 0x1a, 0x95, + 0x3f, 0x75, 0xa4, 0x17, 0xf6, 0x36, 0x98, 0xe5, 0x97, 0xac, 0x34, 0x89, 0x88, 0xf3, 0x86, 0x99, + 0x9d, 0x4f, 0xf1, 0xdb, 0xe0, 0xff, 0x33, 0x16, 0x3f, 0xa7, 0x3f, 0xa9, 0x1b, 0xd7, 0xa7, 0xd7, + 0x53, 0xde, 0x7b, 0x60, 0x2e, 0xf1, 0x59, 0x79, 0x12, 0x22, 0x4b, 0xc6, 0xea, 0xb9, 0xa5, 0x94, + 0x68, 0x0b, 0xe4, 0xe5, 0x79, 0xe9, 0x19, 0x4b, 0xe1, 0x15, 0xc3, 0x3e, 0xaf, 0x92, 0xb0, 0xd4, + 0x6a, 0x07, 0x47, 0xa6, 0x7a, 0x78, 0x64, 0xaa, 0xdf, 0x8f, 0x4c, 0xf5, 0xfd, 0xb1, 0xa9, 0x1c, + 0x1e, 0x9b, 0xca, 0x97, 0x63, 0x53, 0x79, 0x36, 0xdd, 0x6c, 0x7b, 0xfc, 0x93, 0xc4, 0x2d, 0xd7, + 0xc8, 0xf3, 0xef, 0xc1, 0xcd, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfb, 0xfc, 0xdc, 0x4c, 0xf4, 0x06, 0x00, 0x00, } @@ -424,6 +505,9 @@ type MsgClient interface { 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) + // Signal is a basic governance proposal message which has no functionality + // but is used to gather signal on a certain intention. + Signal(ctx context.Context, in *MsgSignal, opts ...grpc.CallOption) (*MsgSignalResponse, error) } type msgClient struct { @@ -436,7 +520,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/SubmitProposal", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/SubmitProposal", in, out, opts...) if err != nil { return nil, err } @@ -445,7 +529,7 @@ func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, o func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Vote", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Vote", in, out, opts...) if err != nil { return nil, err } @@ -454,7 +538,7 @@ func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOpti func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { out := new(MsgVoteWeightedResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/VoteWeighted", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/VoteWeighted", in, out, opts...) if err != nil { return nil, err } @@ -463,7 +547,16 @@ func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { out := new(MsgDepositResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Deposit", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Signal(ctx context.Context, in *MsgSignal, opts ...grpc.CallOption) (*MsgSignalResponse, error) { + out := new(MsgSignalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Signal", in, out, opts...) if err != nil { return nil, err } @@ -480,6 +573,9 @@ type MsgServer interface { VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) // Deposit defines a method to add deposit on a specific proposal. Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) + // Signal is a basic governance proposal message which has no functionality + // but is used to gather signal on a certain intention. + Signal(context.Context, *MsgSignal) (*MsgSignalResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -498,6 +594,9 @@ func (*UnimplementedMsgServer) VoteWeighted(ctx context.Context, req *MsgVoteWei func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") } +func (*UnimplementedMsgServer) Signal(ctx context.Context, req *MsgSignal) (*MsgSignalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Signal not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -513,7 +612,7 @@ func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Msg/SubmitProposal", + FullMethod: "/cosmos.gov.v1.Msg/SubmitProposal", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal)) @@ -531,7 +630,7 @@ func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Msg/Vote", + FullMethod: "/cosmos.gov.v1.Msg/Vote", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Vote(ctx, req.(*MsgVote)) @@ -549,7 +648,7 @@ func _Msg_VoteWeighted_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Msg/VoteWeighted", + FullMethod: "/cosmos.gov.v1.Msg/VoteWeighted", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).VoteWeighted(ctx, req.(*MsgVoteWeighted)) @@ -567,7 +666,7 @@ func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Msg/Deposit", + FullMethod: "/cosmos.gov.v1.Msg/Deposit", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) @@ -575,8 +674,26 @@ func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +func _Msg_Signal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSignal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Signal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/Signal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Signal(ctx, req.(*MsgSignal)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.gov.v1beta1.Msg", + ServiceName: "cosmos.gov.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -595,9 +712,13 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "Deposit", Handler: _Msg_Deposit_Handler, }, + { + MethodName: "Signal", + Handler: _Msg_Signal_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/gov/v1beta1/tx.proto", + Metadata: "cosmos/gov/v1/tx.proto", } func (m *MsgSubmitProposal) Marshal() (dAtA []byte, err error) { @@ -641,17 +762,19 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x12 } } - if m.Content != nil { - { - size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + 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 -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -891,6 +1014,66 @@ func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSignal) 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 *MsgSignal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSignal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSignalResponse) 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 *MsgSignalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSignalResponse) 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 @@ -908,9 +1091,11 @@ func (m *MsgSubmitProposal) Size() (n int) { } var l int _ = l - if m.Content != nil { - l = m.Content.Size() - n += 1 + l + sovTx(uint64(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 { @@ -1027,6 +1212,32 @@ func (m *MsgDepositResponse) Size() (n int) { return n } +func (m *MsgSignal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSignalResponse) 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 } @@ -1064,7 +1275,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1091,10 +1302,8 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Content == nil { - m.Content = &types.Any{} - } - if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + 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 @@ -1794,6 +2003,170 @@ func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSignal) 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: MsgSignal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSignal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", 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.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = 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 *MsgSignalResponse) 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: MsgSignalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSignalResponse: 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 diff --git a/x/mint/module.go b/x/mint/module.go index e923790dc0fb..78cc20165b2f 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -164,11 +164,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized mint param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return simulation.ParamChanges(r) diff --git a/x/nft/genesis.pb.go b/x/nft/genesis.pb.go index 3212c3a14d2d..d9102acd9de2 100644 --- a/x/nft/genesis.pb.go +++ b/x/nft/genesis.pb.go @@ -78,8 +78,10 @@ func (m *GenesisState) GetEntries() []*Entry { // Entry Defines all nft owned by a person type Entry struct { + // owner is the owner address of the following nft Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Nfts []*NFT `protobuf:"bytes,2,rep,name=nfts,proto3" json:"nfts,omitempty"` + // nfts is a group of nfts of the same owner + Nfts []*NFT `protobuf:"bytes,2,rep,name=nfts,proto3" json:"nfts,omitempty"` } func (m *Entry) Reset() { *m = Entry{} } diff --git a/x/nft/nft.pb.go b/x/nft/nft.pb.go index 53a89503df59..468cb1e58c3a 100644 --- a/x/nft/nft.pb.go +++ b/x/nft/nft.pb.go @@ -25,11 +25,18 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Class defines the class of the nft type. type Class struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + // id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // name defines the human-readable name of the NFT classification + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // symbol is an abbreviated name for nft classification + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + // description is a brief description of nft classification Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - Uri string `protobuf:"bytes,5,opt,name=uri,proto3" json:"uri,omitempty"` + // uri is a URI may point to a JSON file that conforms to the nft classification Metadata JSON Schema. + Uri string `protobuf:"bytes,5,opt,name=uri,proto3" json:"uri,omitempty"` + // uri_hash is a hash of the document pointed to uri + UriHash string `protobuf:"bytes,6,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` } func (m *Class) Reset() { *m = Class{} } @@ -100,12 +107,25 @@ func (m *Class) GetUri() string { return "" } -// NFT defines the nft. +func (m *Class) GetUriHash() string { + if m != nil { + return m.UriHash + } + return "" +} + +// NFT defines the NFT. type NFT struct { - ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Uri string `protobuf:"bytes,3,opt,name=uri,proto3" json:"uri,omitempty"` - Data *types.Any `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` + // class_id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // id defines the unique identification of NFT + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // uri defines NFT's metadata storage address outside the chain + Uri string `protobuf:"bytes,3,opt,name=uri,proto3" json:"uri,omitempty"` + // uri_hash is a hash of the document pointed to uri + UriHash string `protobuf:"bytes,4,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` + // data is the metadata of the NFT + Data *types.Any `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` } func (m *NFT) Reset() { *m = NFT{} } @@ -162,6 +182,13 @@ func (m *NFT) GetUri() string { return "" } +func (m *NFT) GetUriHash() string { + if m != nil { + return m.UriHash + } + return "" +} + func (m *NFT) GetData() *types.Any { if m != nil { return m.Data @@ -177,25 +204,27 @@ func init() { func init() { proto.RegisterFile("cosmos/nft/v1beta1/nft.proto", fileDescriptor_eb8ebf8e8053172c) } var fileDescriptor_eb8ebf8e8053172c = []byte{ - // 285 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff,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, 0xbf, 0x17, 0xe3, 0x46, 0xee, 0xb4, 0xd1, 0x98, 0xe1, 0x4d, 0x19, 0x28, 0x82, 0xbe, 0xe0, - 0x86, 0x63, 0x18, 0x80, 0x68, 0x71, 0x71, 0x4c, 0x87, 0x33, 0xe9, 0xdf, 0x99, 0xf4, 0xba, 0x6c, - 0xd6, 0xd6, 0x71, 0x73, 0xf5, 0xd5, 0x12, 0xb0, 0x6b, 0x09, 0xf8, 0x69, 0x09, 0xf8, 0xec, 0x88, - 0xb3, 0xeb, 0x88, 0xf3, 0xdd, 0x11, 0xe7, 0x29, 0xcc, 0xa4, 0x79, 0xa9, 0x63, 0x9a, 0xa8, 0x82, - 0x8d, 0x8f, 0x1d, 0xca, 0xb9, 0x16, 0xaf, 0xec, 0xa3, 0xff, 0x6c, 0x3c, 0xb7, 0x89, 0x97, 0xbf, - 0x01, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xc1, 0xa5, 0xbb, 0x7a, 0x01, 0x00, 0x00, + // 312 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x51, 0xc1, 0x4b, 0xfb, 0x30, + 0x18, 0x5d, 0xda, 0x6e, 0xfb, 0xfd, 0x32, 0x10, 0x09, 0x22, 0x99, 0x48, 0x18, 0x3b, 0xed, 0x62, + 0xc2, 0xf4, 0xea, 0x45, 0x05, 0xd1, 0x8b, 0x87, 0xe1, 0xc9, 0xcb, 0x48, 0x9b, 0x6e, 0x0d, 0xb6, + 0xcd, 0x68, 0x52, 0xb1, 0x7f, 0x81, 0x57, 0xf1, 0xaf, 0xf2, 0xb8, 0xa3, 0x47, 0x69, 0xff, 0x11, + 0x49, 0x5a, 0x87, 0x82, 0xa7, 0xef, 0x7d, 0xef, 0x3d, 0x1e, 0x8f, 0xef, 0x83, 0xc7, 0x91, 0xd2, + 0x99, 0xd2, 0x2c, 0x5f, 0x19, 0xf6, 0x34, 0x0f,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f4, 0x3e, + 0x1a, 0xd2, 0x7b, 0x98, 0xae, 0xa5, 0x49, 0xca, 0x90, 0x46, 0x2a, 0x63, 0xdd, 0x43, 0xda, 0x71, + 0xa2, 0xc5, 0x23, 0x7b, 0xb6, 0x1f, 0x09, 0x07, 0x2e, 0xf1, 0xec, 0x2b, 0x00, 0x00, 0xff, 0xff, + 0x2e, 0x0d, 0x3c, 0x9b, 0xb2, 0x01, 0x00, 0x00, } func (m *Class) Marshal() (dAtA []byte, err error) { @@ -218,6 +247,13 @@ func (m *Class) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintNft(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x32 + } if len(m.Uri) > 0 { i -= len(m.Uri) copy(dAtA[i:], m.Uri) @@ -288,6 +324,13 @@ func (m *NFT) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x52 } + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintNft(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x22 + } if len(m.Uri) > 0 { i -= len(m.Uri) copy(dAtA[i:], m.Uri) @@ -349,6 +392,10 @@ func (m *Class) Size() (n int) { if l > 0 { n += 1 + l + sovNft(uint64(l)) } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovNft(uint64(l)) + } return n } @@ -370,6 +417,10 @@ func (m *NFT) Size() (n int) { if l > 0 { n += 1 + l + sovNft(uint64(l)) } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovNft(uint64(l)) + } if m.Data != nil { l = m.Data.Size() n += 1 + l + sovNft(uint64(l)) @@ -572,6 +623,38 @@ func (m *Class) Unmarshal(dAtA []byte) error { } m.Uri = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNft + } + 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 ErrInvalidLengthNft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipNft(dAtA[iNdEx:]) @@ -718,6 +801,38 @@ func (m *NFT) Unmarshal(dAtA []byte) error { } m.Uri = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNft + } + 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 ErrInvalidLengthNft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) diff --git a/x/nft/query.pb.go b/x/nft/query.pb.go index 6d70ce94c688..6622888491a2 100644 --- a/x/nft/query.pb.go +++ b/x/nft/query.pb.go @@ -801,7 +801,7 @@ type QueryClient interface { Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error) - // Supply queries the number of nft based on the class, same as totalSupply of ERC721 + // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) // NFTsOfClass queries all NFTs of a given class or optional owner, similar to tokenByIndex in ERC721Enumerable NFTsOfClass(ctx context.Context, in *QueryNFTsOfClassRequest, opts ...grpc.CallOption) (*QueryNFTsOfClassResponse, error) @@ -890,7 +890,7 @@ type QueryServer interface { Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 Owner(context.Context, *QueryOwnerRequest) (*QueryOwnerResponse, error) - // Supply queries the number of nft based on the class, same as totalSupply of ERC721 + // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) // NFTsOfClass queries all NFTs of a given class or optional owner, similar to tokenByIndex in ERC721Enumerable NFTsOfClass(context.Context, *QueryNFTsOfClassRequest) (*QueryNFTsOfClassResponse, error) diff --git a/x/nft/tx.pb.go b/x/nft/tx.pb.go index de57a71e124f..f2a78068a90e 100644 --- a/x/nft/tx.pb.go +++ b/x/nft/tx.pb.go @@ -29,9 +29,13 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgSend represents a message to send a nft from one account to another account. type MsgSend struct { - ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + // class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // id defines the unique identification of nft + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // sender is the address of the owner of nft + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + // receiver is the receiver address of nft Receiver string `protobuf:"bytes,4,opt,name=receiver,proto3" json:"receiver,omitempty"` } diff --git a/x/params/client/cli/tx.go b/x/params/client/cli/tx.go index 9c263a2c2b27..991d34af0072 100644 --- a/x/params/client/cli/tx.go +++ b/x/params/client/cli/tx.go @@ -67,7 +67,8 @@ Where proposal.json contains: } from := clientCtx.GetFromAddress() - content := paramproposal.NewParameterChangeProposal( + // TODO: remove content and create a parameter change proposal instead + _ = paramproposal.NewParameterChangeProposal( proposal.Title, proposal.Description, proposal.Changes.ToParamChanges(), ) @@ -76,7 +77,7 @@ Where proposal.json contains: return err } - msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + msg, err := govtypes.NewMsgSubmitProposal([]sdk.Msg{}, deposit, from) if err != nil { return err } diff --git a/x/params/module.go b/x/params/module.go index e27eaf44a2ef..518976319009 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -19,7 +19,6 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/params/client/cli" "github.com/cosmos/cosmos-sdk/x/params/keeper" - "github.com/cosmos/cosmos-sdk/x/params/simulation" "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" ) @@ -118,12 +117,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } -// ProposalContents returns all the params content functions used to -// simulate governance proposals. -func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return simulation.ProposalContents(simState.ParamChanges) -} - // RandomizedParams creates randomized distribution param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return nil diff --git a/x/params/simulation/operations.go b/x/params/simulation/operations.go deleted file mode 100644 index 6e7619b7032b..000000000000 --- a/x/params/simulation/operations.go +++ /dev/null @@ -1,53 +0,0 @@ -package simulation - -import ( - "fmt" - "math/rand" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/params/types/proposal" -) - -func min(a int, b int) int { - if a <= b { - return a - } - return b -} - -// SimulateParamChangeProposalContent returns random parameter change content. -// It will generate a ParameterChangeProposal object with anywhere between 1 and -// the total amount of defined parameters changes, all of which have random valid values. -func SimulateParamChangeProposalContent(paramChangePool []simulation.ParamChange) simulation.ContentSimulatorFn { - numProposals := 0 - // Bound the maximum number of simultaneous parameter changes - maxSimultaneousParamChanges := min(len(paramChangePool), 1000) - if maxSimultaneousParamChanges == 0 { - panic("param changes array is empty") - } - - return func(r *rand.Rand, _ sdk.Context, _ []simulation.Account) simulation.Content { - numChanges := simulation.RandIntBetween(r, 1, maxSimultaneousParamChanges) - paramChanges := make([]proposal.ParamChange, numChanges) - - // perm here takes at most len(paramChangePool) calls to random - paramChoices := r.Perm(len(paramChangePool)) - - for i := 0; i < numChanges; i++ { - spc := paramChangePool[paramChoices[i]] - // add a new distinct parameter to the set of changes - paramChanges[i] = proposal.NewParamChange(spc.Subspace(), spc.Key(), spc.SimValue()(r)) - } - - title := fmt.Sprintf("title from SimulateParamChangeProposalContent-%d", numProposals) - desc := fmt.Sprintf("desc from SimulateParamChangeProposalContent-%d. Random short desc: %s", - numProposals, simulation.RandStringOfLength(r, 20)) - numProposals++ - return proposal.NewParameterChangeProposal( - title, // title - desc, // description - paramChanges, // set of changes - ) - } -} diff --git a/x/params/simulation/operations_test.go b/x/params/simulation/operations_test.go deleted file mode 100644 index 5ed1ba8a50fc..000000000000 --- a/x/params/simulation/operations_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package simulation_test - -import ( - "fmt" - "math/rand" - "testing" - - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/params/simulation" - "github.com/cosmos/cosmos-sdk/x/params/types/proposal" -) - -type MockParamChange struct { - n int -} - -func (pc MockParamChange) Subspace() string { - return fmt.Sprintf("test-Subspace%d", pc.n) -} - -func (pc MockParamChange) Key() string { - return fmt.Sprintf("test-Key%d", pc.n) -} - -func (pc MockParamChange) ComposedKey() string { - return fmt.Sprintf("test-ComposedKey%d", pc.n) -} - -func (pc MockParamChange) SimValue() simtypes.SimValFn { - return func(r *rand.Rand) string { - return fmt.Sprintf("test-value %d%d ", pc.n, int64(simtypes.RandIntBetween(r, 10, 1000))) - } -} - -// make sure that the MockParamChange satisfied the ParamChange interface -var _ simtypes.ParamChange = MockParamChange{} - -func TestSimulateParamChangeProposalContent(t *testing.T) { - s := rand.NewSource(1) - r := rand.New(s) - - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) - accounts := simtypes.RandomAccounts(r, 3) - paramChangePool := []simtypes.ParamChange{MockParamChange{1}, MockParamChange{2}, MockParamChange{3}} - - // execute operation - op := simulation.SimulateParamChangeProposalContent(paramChangePool) - content := op(r, ctx, accounts) - - require.Equal(t, "desc from SimulateParamChangeProposalContent-0. Random short desc: IivHSlcxgdXhhuTSkuxK", content.GetDescription()) - require.Equal(t, "title from SimulateParamChangeProposalContent-0", content.GetTitle()) - require.Equal(t, "params", content.ProposalRoute()) - require.Equal(t, "ParameterChange", content.ProposalType()) - - pcp, ok := content.(*proposal.ParameterChangeProposal) - require.True(t, ok) - - require.Equal(t, "test-Key2", pcp.Changes[0].GetKey()) - require.Equal(t, "test-value 2791 ", pcp.Changes[0].GetValue()) - require.Equal(t, "test-Subspace2", pcp.Changes[0].GetSubspace()) -} diff --git a/x/params/simulation/proposals.go b/x/params/simulation/proposals.go deleted file mode 100644 index 165193735fbd..000000000000 --- a/x/params/simulation/proposals.go +++ /dev/null @@ -1,21 +0,0 @@ -package simulation - -import ( - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -// OpWeightSubmitParamChangeProposal app params key for param change proposal -const OpWeightSubmitParamChangeProposal = "op_weight_submit_param_change_proposal" - -// ProposalContents defines the module weighted proposals' contents -func ProposalContents(paramChanges []simtypes.ParamChange) []simtypes.WeightedProposalContent { - return []simtypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( - OpWeightSubmitParamChangeProposal, - simappparams.DefaultWeightParamChangeProposal, - SimulateParamChangeProposalContent(paramChanges), - ), - } -} diff --git a/x/params/simulation/proposals_test.go b/x/params/simulation/proposals_test.go deleted file mode 100644 index 2902cb08aa44..000000000000 --- a/x/params/simulation/proposals_test.go +++ /dev/null @@ -1,51 +0,0 @@ -package simulation_test - -import ( - "math/rand" - "testing" - - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/params/simulation" - "github.com/cosmos/cosmos-sdk/x/params/types/proposal" -) - -func TestProposalContents(t *testing.T) { - // initialize parameters - s := rand.NewSource(1) - r := rand.New(s) - - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) - accounts := simtypes.RandomAccounts(r, 3) - - paramChangePool := []simtypes.ParamChange{MockParamChange{1}, MockParamChange{2}, MockParamChange{3}} - - // execute ProposalContents function - weightedProposalContent := simulation.ProposalContents(paramChangePool) - require.Len(t, weightedProposalContent, 1) - - w0 := weightedProposalContent[0] - - // tests w0 interface: - require.Equal(t, simulation.OpWeightSubmitParamChangeProposal, w0.AppParamsKey()) - require.Equal(t, simappparams.DefaultWeightParamChangeProposal, w0.DefaultWeight()) - - content := w0.ContentSimulatorFn()(r, ctx, accounts) - - require.Equal(t, "desc from SimulateParamChangeProposalContent-0. Random short desc: IivHSlcxgdXhhuTSkuxK", content.GetDescription()) - require.Equal(t, "title from SimulateParamChangeProposalContent-0", content.GetTitle()) - require.Equal(t, "params", content.ProposalRoute()) - require.Equal(t, "ParameterChange", content.ProposalType()) - - pcp, ok := content.(*proposal.ParameterChangeProposal) - require.True(t, ok) - - require.Len(t, pcp.Changes, 1) - require.Equal(t, "test-Key2", pcp.Changes[0].GetKey()) - require.Equal(t, "test-value 2791 ", pcp.Changes[0].GetValue()) - require.Equal(t, "test-Subspace2", pcp.Changes[0].GetSubspace()) -} diff --git a/x/params/types/proposal/proposal.go b/x/params/types/proposal/proposal.go index 3a2f97a77247..435c0c8bb7a6 100644 --- a/x/params/types/proposal/proposal.go +++ b/x/params/types/proposal/proposal.go @@ -18,7 +18,6 @@ const ( var _ govtypes.Content = &ParameterChangeProposal{} func init() { - govtypes.RegisterProposalType(ProposalTypeChange) govtypes.RegisterProposalTypeCodec(&ParameterChangeProposal{}, "cosmos-sdk/ParameterChangeProposal") } @@ -40,11 +39,6 @@ func (pcp *ParameterChangeProposal) ProposalType() string { return ProposalTypeC // ValidateBasic validates the parameter change proposal func (pcp *ParameterChangeProposal) ValidateBasic() error { - err := govtypes.ValidateAbstract(pcp) - if err != nil { - return err - } - return ValidateChanges(pcp.Changes) } diff --git a/x/simulation/params.go b/x/simulation/params.go index 51dfb6439f10..aa7f8c87c076 100644 --- a/x/simulation/params.go +++ b/x/simulation/params.go @@ -122,32 +122,6 @@ func (spc ParamChange) ComposedKey() string { return spc.Subspace() + "/" + spc.Key() } -// Proposal Contents - -// WeightedProposalContent defines a common struct for proposal contents defined by -// external modules (i.e outside gov) -type WeightedProposalContent struct { - appParamsKey string // key used to retrieve the value of the weight from the simulation application params - defaultWeight int // default weight - contentSimulatorFn simulation.ContentSimulatorFn // content simulator function -} - -func NewWeightedProposalContent(appParamsKey string, defaultWeight int, contentSimulatorFn simulation.ContentSimulatorFn) simulation.WeightedProposalContent { - return &WeightedProposalContent{appParamsKey: appParamsKey, defaultWeight: defaultWeight, contentSimulatorFn: contentSimulatorFn} -} - -func (w WeightedProposalContent) AppParamsKey() string { - return w.appParamsKey -} - -func (w WeightedProposalContent) DefaultWeight() int { - return w.defaultWeight -} - -func (w WeightedProposalContent) ContentSimulatorFn() simulation.ContentSimulatorFn { - return w.contentSimulatorFn -} - // Param change proposals // randomConsensusParams returns random simulation consensus parameters, it extracts the Evidence from the Staking genesis state. diff --git a/x/simulation/params_test.go b/x/simulation/params_test.go index d0b538c26e4d..664f51e77f49 100644 --- a/x/simulation/params_test.go +++ b/x/simulation/params_test.go @@ -6,10 +6,6 @@ import ( "testing" "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) func TestParamChange(t *testing.T) { @@ -25,30 +21,3 @@ func TestParamChange(t *testing.T) { require.Equal(t, f(nil), pChange.SimValue()(nil)) require.Equal(t, fmt.Sprintf("%s/%s", subspace, key), pChange.ComposedKey()) } - -func TestNewWeightedProposalContent(t *testing.T) { - key := "theKey" - weight := 1 - content := &testContent{} - f := func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) simtypes.Content { - return content - } - - pContent := NewWeightedProposalContent(key, weight, f) - - require.Equal(t, key, pContent.AppParamsKey()) - require.Equal(t, weight, pContent.DefaultWeight()) - - ctx := sdk.NewContext(nil, tmproto.Header{}, true, nil) - require.Equal(t, content, pContent.ContentSimulatorFn()(nil, ctx, nil)) -} - -type testContent struct { -} - -func (t testContent) GetTitle() string { return "" } -func (t testContent) GetDescription() string { return "" } -func (t testContent) ProposalRoute() string { return "" } -func (t testContent) ProposalType() string { return "" } -func (t testContent) ValidateBasic() error { return nil } -func (t testContent) String() string { return "" } diff --git a/x/slashing/module.go b/x/slashing/module.go index 68c3c2919cdd..e801815640dc 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -180,11 +180,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized slashing param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return simulation.ParamChanges(r) diff --git a/x/staking/module.go b/x/staking/module.go index aa395b80ca17..abd884548bba 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -180,11 +180,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized staking param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return simulation.ParamChanges(r) diff --git a/x/upgrade/client/cli/tx.go b/x/upgrade/client/cli/tx.go index 3d793cbab693..f1a19ac30cab 100644 --- a/x/upgrade/client/cli/tx.go +++ b/x/upgrade/client/cli/tx.go @@ -40,11 +40,7 @@ func NewCmdSubmitUpgradeProposal() *cobra.Command { if err != nil { return err } - name := args[0] - content, err := parseArgsToContent(cmd, name) - if err != nil { - return err - } + // TODO: replace Content with an upgrade message that gets attached to the proposal from := clientCtx.GetFromAddress() @@ -57,7 +53,7 @@ func NewCmdSubmitUpgradeProposal() *cobra.Command { return err } - msg, err := gov.NewMsgSubmitProposal(content, deposit, from) + msg, err := gov.NewMsgSubmitProposal([]sdk.Msg{}, deposit, from) if err != nil { return err } @@ -66,8 +62,6 @@ func NewCmdSubmitUpgradeProposal() *cobra.Command { }, } - cmd.Flags().String(cli.FlagTitle, "", "title of proposal") - cmd.Flags().String(cli.FlagDescription, "", "description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal") cmd.Flags().Int64(FlagUpgradeHeight, 0, "The height at which the upgrade must happen") cmd.Flags().String(FlagUpgradeInfo, "", "Optional info for the planned upgrade such as commit hash, etc.") @@ -99,19 +93,8 @@ func NewCmdSubmitCancelUpgradeProposal() *cobra.Command { return err } - title, err := cmd.Flags().GetString(cli.FlagTitle) - if err != nil { - return err - } - - description, err := cmd.Flags().GetString(cli.FlagDescription) - if err != nil { - return err - } - - content := types.NewCancelSoftwareUpgradeProposal(title, description) - - msg, err := gov.NewMsgSubmitProposal(content, deposit, from) + // TODO: replace cancel upgrade content with a message + msg, err := gov.NewMsgSubmitProposal([]sdk.Msg{}, deposit, from) if err != nil { return err } @@ -120,37 +103,8 @@ func NewCmdSubmitCancelUpgradeProposal() *cobra.Command { }, } - cmd.Flags().String(cli.FlagTitle, "", "title of proposal") - cmd.Flags().String(cli.FlagDescription, "", "description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "deposit of proposal") - cmd.MarkFlagRequired(cli.FlagTitle) - cmd.MarkFlagRequired(cli.FlagDescription) return cmd } -func parseArgsToContent(cmd *cobra.Command, name string) (gov.Content, error) { - title, err := cmd.Flags().GetString(cli.FlagTitle) - if err != nil { - return nil, err - } - - description, err := cmd.Flags().GetString(cli.FlagDescription) - if err != nil { - return nil, err - } - - height, err := cmd.Flags().GetInt64(FlagUpgradeHeight) - if err != nil { - return nil, err - } - - info, err := cmd.Flags().GetString(FlagUpgradeInfo) - if err != nil { - return nil, err - } - - plan := types.Plan{Name: name, Height: height, Info: info} - content := types.NewSoftwareUpgradeProposal(title, description, plan) - return content, nil -} diff --git a/x/upgrade/types/proposal.go b/x/upgrade/types/proposal.go index 38b2295556de..3c33f1d5efbf 100644 --- a/x/upgrade/types/proposal.go +++ b/x/upgrade/types/proposal.go @@ -19,9 +19,7 @@ func NewSoftwareUpgradeProposal(title, description string, plan Plan) gov.Conten var _ gov.Content = &SoftwareUpgradeProposal{} func init() { - gov.RegisterProposalType(ProposalTypeSoftwareUpgrade) gov.RegisterProposalTypeCodec(&SoftwareUpgradeProposal{}, "cosmos-sdk/SoftwareUpgradeProposal") - gov.RegisterProposalType(ProposalTypeCancelSoftwareUpgrade) gov.RegisterProposalTypeCodec(&CancelSoftwareUpgradeProposal{}, "cosmos-sdk/CancelSoftwareUpgradeProposal") } @@ -33,7 +31,7 @@ func (sup *SoftwareUpgradeProposal) ValidateBasic() error { if err := sup.Plan.ValidateBasic(); err != nil { return err } - return gov.ValidateAbstract(sup) + return nil } func (sup SoftwareUpgradeProposal) String() string { @@ -57,7 +55,7 @@ func (csup *CancelSoftwareUpgradeProposal) ProposalType() string { return ProposalTypeCancelSoftwareUpgrade } func (csup *CancelSoftwareUpgradeProposal) ValidateBasic() error { - return gov.ValidateAbstract(csup) + return nil } func (csup CancelSoftwareUpgradeProposal) String() string { From df8cd000fc49d3929f44ae1cbdaf8400d40549b8 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 6 Oct 2021 12:16:49 +0200 Subject: [PATCH 02/28] format proto --- docs/core/proto-docs.md | 188 ++++++++++++++---- proto/cosmos/auth/v1beta1/auth.proto | 21 +- proto/cosmos/authz/v1beta1/tx.proto | 5 +- proto/cosmos/bank/v1beta1/query.proto | 3 +- proto/cosmos/base/v1beta1/coin.proto | 6 +- .../capability/v1beta1/capability.proto | 2 +- proto/cosmos/crisis/v1beta1/genesis.proto | 3 +- proto/cosmos/crypto/hd/v1/hd.proto | 27 +-- proto/cosmos/crypto/keyring/v1/record.proto | 18 +- proto/cosmos/crypto/multisig/keys.proto | 3 +- .../distribution/v1beta1/distribution.proto | 39 ++-- .../cosmos/distribution/v1beta1/genesis.proto | 33 +-- proto/cosmos/genutil/v1beta1/genesis.proto | 5 +- proto/cosmos/gov/v1/tx.proto | 22 +- proto/cosmos/gov/v1beta1/gov.proto | 56 +++--- proto/cosmos/mint/v1beta1/mint.proto | 16 +- proto/cosmos/slashing/v1beta1/genesis.proto | 12 +- proto/cosmos/slashing/v1beta1/slashing.proto | 26 +-- proto/cosmos/staking/v1beta1/genesis.proto | 14 +- proto/cosmos/staking/v1beta1/query.proto | 2 +- proto/cosmos/staking/v1beta1/staking.proto | 71 ++++--- proto/cosmos/staking/v1beta1/tx.proto | 14 +- proto/cosmos/upgrade/v1beta1/upgrade.proto | 3 +- proto/cosmos/vesting/v1beta1/tx.proto | 6 +- proto/cosmos/vesting/v1beta1/vesting.proto | 20 +- 25 files changed, 342 insertions(+), 273 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 6ec09dec3d93..32a44bb75b78 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -356,18 +356,22 @@ - [cosmos/genutil/v1beta1/genesis.proto](#cosmos/genutil/v1beta1/genesis.proto) - [GenesisState](#cosmos.genutil.v1beta1.GenesisState) +- [cosmos/gov/v1beta1/gov.proto](#cosmos/gov/v1beta1/gov.proto) + - [Deposit](#cosmos.gov.v1beta1.Deposit) + - [DepositParams](#cosmos.gov.v1beta1.DepositParams) + - [Proposal](#cosmos.gov.v1beta1.Proposal) + - [TallyParams](#cosmos.gov.v1beta1.TallyParams) + - [TallyResult](#cosmos.gov.v1beta1.TallyResult) + - [TextProposal](#cosmos.gov.v1beta1.TextProposal) + - [Vote](#cosmos.gov.v1beta1.Vote) + - [VotingParams](#cosmos.gov.v1beta1.VotingParams) + - [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) + + - [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) + - [VoteOption](#cosmos.gov.v1beta1.VoteOption) + - [cosmos/gov/v1/gov.proto](#cosmos/gov/v1/gov.proto) - - [Deposit](#cosmos.gov.v1.Deposit) - - [DepositParams](#cosmos.gov.v1.DepositParams) - [Proposal](#cosmos.gov.v1.Proposal) - - [TallyParams](#cosmos.gov.v1.TallyParams) - - [TallyResult](#cosmos.gov.v1.TallyResult) - - [Vote](#cosmos.gov.v1.Vote) - - [VotingParams](#cosmos.gov.v1.VotingParams) - - [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) - - - [ProposalStatus](#cosmos.gov.v1.ProposalStatus) - - [VoteOption](#cosmos.gov.v1.VoteOption) - [cosmos/gov/v1/genesis.proto](#cosmos/gov/v1/genesis.proto) - [GenesisState](#cosmos.gov.v1.GenesisState) @@ -406,6 +410,9 @@ - [Msg](#cosmos.gov.v1.Msg) +- [cosmos/gov/v1beta1/genesis.proto](#cosmos/gov/v1beta1/genesis.proto) + - [GenesisState](#cosmos.gov.v1beta1.GenesisState) + - [cosmos/group/v1beta1/types.proto](#cosmos/group/v1beta1/types.proto) - [GroupAccountInfo](#cosmos.group.v1beta1.GroupAccountInfo) - [GroupInfo](#cosmos.group.v1beta1.GroupInfo) @@ -5288,14 +5295,14 @@ GenesisState defines the raw genesis transaction in JSON. - +

Top

-## cosmos/gov/v1/gov.proto +## cosmos/gov/v1beta1/gov.proto - + ### Deposit Deposit defines an amount deposited by an account address to an active @@ -5313,7 +5320,7 @@ proposal. - + ### DepositParams DepositParams defines the params for deposits on governance proposals. @@ -5329,7 +5336,7 @@ DepositParams defines the params for deposits on governance proposals. - + ### Proposal Proposal defines the core field members of a governance proposal. @@ -5338,9 +5345,9 @@ Proposal defines the core field members of a governance proposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | -| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | -| `status` | [ProposalStatus](#cosmos.gov.v1.ProposalStatus) | | | -| `final_tally_result` | [TallyResult](#cosmos.gov.v1.TallyResult) | | | +| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | +| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | | `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | | `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | | `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | @@ -5352,7 +5359,7 @@ Proposal defines the core field members of a governance proposal. - + ### TallyParams TallyParams defines the params for tallying votes on governance proposals. @@ -5369,7 +5376,7 @@ TallyParams defines the params for tallying votes on governance proposals. - + ### TallyResult TallyResult defines a standard tally for a governance proposal. @@ -5387,7 +5394,24 @@ TallyResult defines a standard tally for a governance proposal. - + + +### TextProposal +TextProposal defines a standard text proposal whose changes need to be +manually updated in case of approval. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | + + + + + + + ### Vote Vote defines a vote on a governance proposal. @@ -5398,15 +5422,15 @@ A Vote consists of a proposal ID, the voter, and the vote option. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | **Deprecated.** 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. | -| `options` | [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) | repeated | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** 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. | +| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | - + ### VotingParams VotingParams defines the params for voting on governance proposals. @@ -5421,7 +5445,7 @@ VotingParams defines the params for voting on governance proposals. - + ### WeightedVoteOption WeightedVoteOption defines a unit of vote for vote split. @@ -5429,7 +5453,7 @@ WeightedVoteOption defines a unit of vote for vote split. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | | `weight` | [string](#string) | | | @@ -5439,7 +5463,7 @@ WeightedVoteOption defines a unit of vote for vote split. - + ### ProposalStatus ProposalStatus enumerates the valid statuses of a proposal. @@ -5455,7 +5479,7 @@ ProposalStatus enumerates the valid statuses of a proposal. - + ### VoteOption VoteOption enumerates the valid vote options for a given governance proposal. @@ -5477,6 +5501,45 @@ VoteOption enumerates the valid vote options for a given governance proposal. + +

Top

+ +## cosmos/gov/v1/gov.proto + + + + + +### Proposal +Proposal defines the core field members of a governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `status` | [cosmos.gov.v1beta1.ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | +| `final_tally_result` | [cosmos.gov.v1beta1.TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | +| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | + + + + + + + + + + + + + + +

Top

@@ -5493,12 +5556,12 @@ GenesisState defines the gov module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | -| `deposits` | [Deposit](#cosmos.gov.v1.Deposit) | repeated | deposits defines all the deposits present at genesis. | -| `votes` | [Vote](#cosmos.gov.v1.Vote) | repeated | votes defines all the votes present at genesis. | +| `deposits` | [cosmos.gov.v1beta1.Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | +| `votes` | [cosmos.gov.v1beta1.Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | | `proposals` | [Proposal](#cosmos.gov.v1.Proposal) | repeated | proposals defines all the proposals present at genesis. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1.DepositParams) | | params defines all the paramaters of related to deposit. | -| `voting_params` | [VotingParams](#cosmos.gov.v1.VotingParams) | | params defines all the paramaters of related to voting. | -| `tally_params` | [TallyParams](#cosmos.gov.v1.TallyParams) | | params defines all the paramaters of related to tally. | +| `deposit_params` | [cosmos.gov.v1beta1.DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | +| `voting_params` | [cosmos.gov.v1beta1.VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | +| `tally_params` | [cosmos.gov.v1beta1.TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | @@ -5545,7 +5608,7 @@ QueryDepositResponse is the response type for the Query/Deposit RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposit` | [Deposit](#cosmos.gov.v1.Deposit) | | deposit defines the requested deposit. | +| `deposit` | [cosmos.gov.v1beta1.Deposit](#cosmos.gov.v1beta1.Deposit) | | deposit defines the requested deposit. | @@ -5576,7 +5639,7 @@ QueryDepositsResponse is the response type for the Query/Deposits RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposits` | [Deposit](#cosmos.gov.v1.Deposit) | repeated | | +| `deposits` | [cosmos.gov.v1beta1.Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -5607,9 +5670,9 @@ QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `voting_params` | [VotingParams](#cosmos.gov.v1.VotingParams) | | voting_params defines the parameters related to voting. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1.DepositParams) | | deposit_params defines the parameters related to deposit. | -| `tally_params` | [TallyParams](#cosmos.gov.v1.TallyParams) | | tally_params defines the parameters related to tally. | +| `voting_params` | [cosmos.gov.v1beta1.VotingParams](#cosmos.gov.v1beta1.VotingParams) | | voting_params defines the parameters related to voting. | +| `deposit_params` | [cosmos.gov.v1beta1.DepositParams](#cosmos.gov.v1beta1.DepositParams) | | deposit_params defines the parameters related to deposit. | +| `tally_params` | [cosmos.gov.v1beta1.TallyParams](#cosmos.gov.v1beta1.TallyParams) | | tally_params defines the parameters related to tally. | @@ -5654,7 +5717,7 @@ QueryProposalsRequest is the request type for the Query/Proposals RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_status` | [ProposalStatus](#cosmos.gov.v1.ProposalStatus) | | proposal_status defines the status of the proposals. | +| `proposal_status` | [cosmos.gov.v1beta1.ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | proposal_status defines the status of the proposals. | | `voter` | [string](#string) | | voter defines the voter address for the proposals. | | `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | @@ -5704,7 +5767,7 @@ QueryTallyResultResponse is the response type for the Query/Tally RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `tally` | [TallyResult](#cosmos.gov.v1.TallyResult) | | tally defines the requested tally. | +| `tally` | [cosmos.gov.v1beta1.TallyResult](#cosmos.gov.v1beta1.TallyResult) | | tally defines the requested tally. | @@ -5735,7 +5798,7 @@ QueryVoteResponse is the response type for the Query/Vote RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `vote` | [Vote](#cosmos.gov.v1.Vote) | | vote defined the queried vote. | +| `vote` | [cosmos.gov.v1beta1.Vote](#cosmos.gov.v1beta1.Vote) | | vote defined the queried vote. | @@ -5766,7 +5829,7 @@ QueryVotesResponse is the response type for the Query/Votes RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `votes` | [Vote](#cosmos.gov.v1.Vote) | repeated | votes defined the queried votes. | +| `votes` | [cosmos.gov.v1beta1.Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defined the queried votes. | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -5904,7 +5967,7 @@ MsgVote defines a message to cast a vote. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | | +| `option` | [cosmos.gov.v1beta1.VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | @@ -5931,7 +5994,7 @@ MsgVoteWeighted defines a message to cast a vote. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `options` | [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) | repeated | | +| `options` | [cosmos.gov.v1beta1.WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | @@ -5971,6 +6034,43 @@ Msg defines the gov Msg service. + +

Top

+ +## cosmos/gov/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState defines the gov module's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | +| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | +| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | +| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | proposals defines all the proposals present at genesis. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | +| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | +| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | + + + + + + + + + + + + + + +

Top

diff --git a/proto/cosmos/auth/v1beta1/auth.proto b/proto/cosmos/auth/v1beta1/auth.proto index a9e1e7e83d4a..963c6f15198d 100644 --- a/proto/cosmos/auth/v1beta1/auth.proto +++ b/proto/cosmos/auth/v1beta1/auth.proto @@ -17,11 +17,10 @@ message BaseAccount { option (cosmos_proto.implements_interface) = "AccountI"; - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any pub_key = 2 - [(gogoproto.jsontag) = "public_key,omitempty"]; - uint64 account_number = 3; - uint64 sequence = 4; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty"]; + uint64 account_number = 3; + uint64 sequence = 4; } // ModuleAccount defines an account for modules that holds coins on a pool. @@ -40,11 +39,9 @@ message Params { option (gogoproto.equal) = true; option (gogoproto.goproto_stringer) = false; - uint64 max_memo_characters = 1; - uint64 tx_sig_limit = 2; - uint64 tx_size_cost_per_byte = 3; - uint64 sig_verify_cost_ed25519 = 4 - [(gogoproto.customname) = "SigVerifyCostED25519"]; - uint64 sig_verify_cost_secp256k1 = 5 - [(gogoproto.customname) = "SigVerifyCostSecp256k1"]; + uint64 max_memo_characters = 1; + uint64 tx_sig_limit = 2; + uint64 tx_size_cost_per_byte = 3; + uint64 sig_verify_cost_ed25519 = 4 [(gogoproto.customname) = "SigVerifyCostED25519"]; + uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1"]; } diff --git a/proto/cosmos/authz/v1beta1/tx.proto b/proto/cosmos/authz/v1beta1/tx.proto index 65c0e45caeed..a881c13b4582 100644 --- a/proto/cosmos/authz/v1beta1/tx.proto +++ b/proto/cosmos/authz/v1beta1/tx.proto @@ -60,8 +60,9 @@ message MsgGrantResponse {} // MsgRevoke revokes any authorization with the provided sdk.Msg type on the // granter's account with that has been granted to the grantee. message MsgRevoke { - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + ; string msg_type_url = 3; } diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index f42c93a758ef..ccbeba36d758 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -182,7 +182,8 @@ message QueryDenomOwnersRequest { // balance of the denominated token. message DenomOwner { // address defines the address that owns a particular denomination. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + ; // balance is the balance of the denominated coin for an account. cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; diff --git a/proto/cosmos/base/v1beta1/coin.proto b/proto/cosmos/base/v1beta1/coin.proto index 79dadf66252f..69e67e099543 100644 --- a/proto/cosmos/base/v1beta1/coin.proto +++ b/proto/cosmos/base/v1beta1/coin.proto @@ -16,7 +16,8 @@ message Coin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; + string amount = 2 + [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; } // DecCoin defines a token with a denomination and a decimal amount. @@ -27,7 +28,8 @@ message DecCoin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string amount = 2 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; } // IntProto defines a Protobuf wrapper around an Int object. diff --git a/proto/cosmos/capability/v1beta1/capability.proto b/proto/cosmos/capability/v1beta1/capability.proto index 5212b7bef5fa..c433566d3282 100644 --- a/proto/cosmos/capability/v1beta1/capability.proto +++ b/proto/cosmos/capability/v1beta1/capability.proto @@ -9,7 +9,7 @@ import "gogoproto/gogo.proto"; // provided to a Capability must be globally unique. message Capability { option (gogoproto.goproto_stringer) = false; - + uint64 index = 1; } diff --git a/proto/cosmos/crisis/v1beta1/genesis.proto b/proto/cosmos/crisis/v1beta1/genesis.proto index 245c71462db3..5c2916046d50 100644 --- a/proto/cosmos/crisis/v1beta1/genesis.proto +++ b/proto/cosmos/crisis/v1beta1/genesis.proto @@ -10,6 +10,5 @@ import "cosmos/base/v1beta1/coin.proto"; message GenesisState { // constant_fee is the fee used to verify the invariant in the crisis // module. - cosmos.base.v1beta1.Coin constant_fee = 3 - [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/crypto/hd/v1/hd.proto b/proto/cosmos/crypto/hd/v1/hd.proto index eaf6ad40a9e7..e4a95afcba9f 100644 --- a/proto/cosmos/crypto/hd/v1/hd.proto +++ b/proto/cosmos/crypto/hd/v1/hd.proto @@ -3,20 +3,21 @@ package cosmos.crypto.hd.v1; import "gogoproto/gogo.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; +option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; option (gogoproto.goproto_getters_all) = false; // BIP44Params is used as path field in ledger item in Record. -message BIP44Params { - option (gogoproto.goproto_stringer) = false; - // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation - uint32 purpose = 1; - // coin_type is a constant that improves privacy - uint32 coin_type = 2; - // account splits the key space into independent user identities - uint32 account = 3; - // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal chain. - bool change = 4; - // address_index is used as child index in BIP32 derivation - uint32 address_index = 5; +message BIP44Params { + option (gogoproto.goproto_stringer) = false; + // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation + uint32 purpose = 1; + // coin_type is a constant that improves privacy + uint32 coin_type = 2; + // account splits the key space into independent user identities + uint32 account = 3; + // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + // chain. + bool change = 4; + // address_index is used as child index in BIP32 derivation + uint32 address_index = 5; } diff --git a/proto/cosmos/crypto/keyring/v1/record.proto b/proto/cosmos/crypto/keyring/v1/record.proto index 757a8ab14084..9b2d3c96439f 100644 --- a/proto/cosmos/crypto/keyring/v1/record.proto +++ b/proto/cosmos/crypto/keyring/v1/record.proto @@ -5,14 +5,14 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos/crypto/hd/v1/hd.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; option (gogoproto.goproto_getters_all) = false; // Record is used for representing a key in the keyring. message Record { // name represents a name of Record string name = 1; - // pub_key represents a public key in any format + // pub_key represents a public key in any format google.protobuf.Any pub_key = 2; // Record contains one of the following items @@ -20,21 +20,21 @@ message Record { // local stores the public information about a locally stored key Local local = 3; // ledger stores the public information about a Ledger key - Ledger ledger = 4; + Ledger ledger = 4; // Multi does not store any information. - Multi multi = 5; - // Offline does not store any information. - Offline offline = 6; + Multi multi = 5; + // Offline does not store any information. + Offline offline = 6; } // Item is a keyring item stored in a keyring backend. // Local item message Local { - google.protobuf.Any priv_key = 1; - string priv_key_type = 2; + google.protobuf.Any priv_key = 1; + string priv_key_type = 2; } - // Ledger item + // Ledger item message Ledger { hd.v1.BIP44Params path = 1; } diff --git a/proto/cosmos/crypto/multisig/keys.proto b/proto/cosmos/crypto/multisig/keys.proto index ea3248bc8996..7a11fe3369b3 100644 --- a/proto/cosmos/crypto/multisig/keys.proto +++ b/proto/cosmos/crypto/multisig/keys.proto @@ -13,6 +13,5 @@ message LegacyAminoPubKey { option (gogoproto.goproto_getters) = false; uint32 threshold = 1; - repeated google.protobuf.Any public_keys = 2 - [(gogoproto.customname) = "PubKeys"]; + repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys"]; } diff --git a/proto/cosmos/distribution/v1beta1/distribution.proto b/proto/cosmos/distribution/v1beta1/distribution.proto index c5aa94fc4f03..ad12bd6049fa 100644 --- a/proto/cosmos/distribution/v1beta1/distribution.proto +++ b/proto/cosmos/distribution/v1beta1/distribution.proto @@ -12,17 +12,17 @@ import "cosmos_proto/cosmos.proto"; message Params { option (gogoproto.goproto_stringer) = false; string community_tax = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; string base_proposer_reward = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; string bonus_proposer_reward = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -42,10 +42,8 @@ message Params { // read that record) // + one per validator for the zeroeth period, set on initialization message ValidatorHistoricalRewards { - repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; + repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; uint32 reference_count = 2; } @@ -68,10 +66,8 @@ message ValidatorAccumulatedCommission { // ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards // for a validator inexpensive to track, allows simple sanity checks. message ValidatorOutstandingRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; } // ValidatorSlashEvent represents a validator slash event. @@ -80,22 +76,23 @@ message ValidatorOutstandingRewards { // for delegations which are withdrawn after a slash has occurred. message ValidatorSlashEvent { uint64 validator_period = 1; - string fraction = 2 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string fraction = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } // ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. message ValidatorSlashEvents { option (gogoproto.goproto_stringer) = false; - repeated ValidatorSlashEvent validator_slash_events = 1 - [(gogoproto.nullable) = false]; + repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false]; } // FeePool is the global fee pool for distribution. message FeePool { - repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" - ]; + repeated cosmos.base.v1beta1.DecCoin community_pool = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; } // CommunityPoolSpendProposal details a proposal for use of community funds, @@ -122,7 +119,7 @@ message CommunityPoolSpendProposal { message DelegatorStartingInfo { uint64 previous_period = 1; string stake = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -135,9 +132,7 @@ message DelegationDelegatorReward { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = true; - string validator_address = 1 [ - (cosmos_proto.scalar) = "cosmos.AddressString" - ]; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; repeated cosmos.base.v1beta1.DecCoin reward = 2 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; diff --git a/proto/cosmos/distribution/v1beta1/genesis.proto b/proto/cosmos/distribution/v1beta1/genesis.proto index 488d89e9f5ff..4662e8df42be 100644 --- a/proto/cosmos/distribution/v1beta1/genesis.proto +++ b/proto/cosmos/distribution/v1beta1/genesis.proto @@ -32,10 +32,8 @@ message ValidatorOutstandingRewardsRecord { string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // outstanding_rewards represents the oustanding rewards of a validator. - repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; + repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; } // ValidatorAccumulatedCommissionRecord is used for import / export via genesis @@ -48,8 +46,7 @@ message ValidatorAccumulatedCommissionRecord { string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // accumulated is the accumulated commission of a validator. - ValidatorAccumulatedCommission accumulated = 2 - [(gogoproto.nullable) = false]; + ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false]; } // ValidatorHistoricalRewardsRecord is used for import / export via genesis @@ -92,8 +89,7 @@ message DelegatorStartingInfoRecord { string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // starting_info defines the starting info of a delegator. - DelegatorStartingInfo starting_info = 3 - [(gogoproto.nullable) = false]; + DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false]; } // ValidatorSlashEventRecord is used for import / export via genesis json. @@ -123,33 +119,26 @@ message GenesisState { FeePool fee_pool = 2 [(gogoproto.nullable) = false]; // fee_pool defines the delegator withdraw infos at genesis. - repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 - [(gogoproto.nullable) = false]; + repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 [(gogoproto.nullable) = false]; // fee_pool defines the previous proposer at genesis. string previous_proposer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // fee_pool defines the outstanding rewards of all validators at genesis. - repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 - [(gogoproto.nullable) = false]; + repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 [(gogoproto.nullable) = false]; // fee_pool defines the accumulated commisions of all validators at genesis. - repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 - [(gogoproto.nullable) = false]; + repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 [(gogoproto.nullable) = false]; // fee_pool defines the historical rewards of all validators at genesis. - repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 - [(gogoproto.nullable) = false]; + repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 [(gogoproto.nullable) = false]; // fee_pool defines the current rewards of all validators at genesis. - repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 - [(gogoproto.nullable) = false]; + repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 [(gogoproto.nullable) = false]; // fee_pool defines the delegator starting infos at genesis. - repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 - [(gogoproto.nullable) = false]; + repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 [(gogoproto.nullable) = false]; // fee_pool defines the validator slash events at genesis. - repeated ValidatorSlashEventRecord validator_slash_events = 10 - [(gogoproto.nullable) = false]; + repeated ValidatorSlashEventRecord validator_slash_events = 10 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/genutil/v1beta1/genesis.proto b/proto/cosmos/genutil/v1beta1/genesis.proto index 6727b98ac889..958d15feb9cd 100644 --- a/proto/cosmos/genutil/v1beta1/genesis.proto +++ b/proto/cosmos/genutil/v1beta1/genesis.proto @@ -8,8 +8,5 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; // GenesisState defines the raw genesis transaction in JSON. message GenesisState { // gen_txs defines the genesis transactions. - repeated bytes gen_txs = 1 [ - (gogoproto.casttype) = "encoding/json.RawMessage", - (gogoproto.jsontag) = "gentxs" - ]; + repeated bytes gen_txs = 1 [(gogoproto.casttype) = "encoding/json.RawMessage", (gogoproto.jsontag) = "gentxs"]; } diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 7b501b5399d2..12bb422c4d9e 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -38,10 +38,8 @@ message MsgSubmitProposal { option (gogoproto.goproto_getters) = false; repeated google.protobuf.Any messages = 1; - repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } @@ -57,9 +55,9 @@ message MsgVote { option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - cosmos.gov.v1beta1.VoteOption option = 3; + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + cosmos.gov.v1beta1.VoteOption option = 3; } // MsgVoteResponse defines the Msg/Vote response type. @@ -72,9 +70,9 @@ message MsgVoteWeighted { option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - repeated cosmos.gov.v1beta1.WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + repeated cosmos.gov.v1beta1.WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; } // MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. @@ -87,8 +85,8 @@ message MsgDeposit { option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; - string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 4f6c23821eec..2bbca8a901be 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -33,7 +33,7 @@ enum VoteOption { message WeightedVoteOption { VoteOption option = 1; string weight = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -66,23 +66,16 @@ message Deposit { message Proposal { option (gogoproto.equal) = true; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "id"]; - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; - ProposalStatus status = 3; - TallyResult final_tally_result = 4 - [(gogoproto.nullable) = false]; - google.protobuf.Timestamp submit_time = 5 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp deposit_end_time = 6 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - google.protobuf.Timestamp voting_start_time = 8 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp voting_end_time = 9 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id"]; + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; + ProposalStatus status = 3; + TallyResult final_tally_result = 4 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin total_deposit = 7 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; } // ProposalStatus enumerates the valid statuses of a proposal. @@ -112,11 +105,23 @@ enum ProposalStatus { message TallyResult { option (gogoproto.equal) = true; - string yes = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string abstain = 2 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string no = 3 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string yes = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string abstain = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string no = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; string no_with_veto = 4 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -158,11 +163,8 @@ message DepositParams { // VotingParams defines the params for voting on governance proposals. message VotingParams { // Length of the voting period. - google.protobuf.Duration voting_period = 1 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "voting_period,omitempty" - ]; + google.protobuf.Duration voting_period = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "voting_period,omitempty"]; } // TallyParams defines the params for tallying votes on governance proposals. diff --git a/proto/cosmos/mint/v1beta1/mint.proto b/proto/cosmos/mint/v1beta1/mint.proto index f12959083663..9cfe2b76076f 100644 --- a/proto/cosmos/mint/v1beta1/mint.proto +++ b/proto/cosmos/mint/v1beta1/mint.proto @@ -10,13 +10,13 @@ import "cosmos_proto/cosmos.proto"; message Minter { // current annual inflation rate string inflation = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false ]; // current annual expected provisions string annual_provisions = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -30,25 +30,25 @@ message Params { string mint_denom = 1; // maximum annual change in inflation rate string inflation_rate_change = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // maximum inflation rate string inflation_max = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // minimum inflation rate string inflation_min = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // goal of percent bonded atoms string goal_bonded = 5 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; diff --git a/proto/cosmos/slashing/v1beta1/genesis.proto b/proto/cosmos/slashing/v1beta1/genesis.proto index 6477e8a7093c..312d56aa2fbf 100644 --- a/proto/cosmos/slashing/v1beta1/genesis.proto +++ b/proto/cosmos/slashing/v1beta1/genesis.proto @@ -14,13 +14,11 @@ message GenesisState { // signing_infos represents a map between validator addresses and their // signing infos. - repeated SigningInfo signing_infos = 2 - [(gogoproto.nullable) = false]; + repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false]; // missed_blocks represents a map between validator addresses and their // missed blocks. - repeated ValidatorMissedBlocks missed_blocks = 3 - [(gogoproto.nullable) = false]; + repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false]; } // SigningInfo stores validator signing info of corresponding address. @@ -28,8 +26,7 @@ message SigningInfo { // address is the validator address. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_signing_info represents the signing info of this validator. - ValidatorSigningInfo validator_signing_info = 2 - [(gogoproto.nullable) = false]; + ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false]; } // ValidatorMissedBlocks contains array of missed blocks of corresponding @@ -38,8 +35,7 @@ message ValidatorMissedBlocks { // address is the validator address. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // missed_blocks is an array of missed blocks by the validator. - repeated MissedBlock missed_blocks = 2 - [(gogoproto.nullable) = false]; + repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false]; } // MissedBlock contains height and missed status as boolean. diff --git a/proto/cosmos/slashing/v1beta1/slashing.proto b/proto/cosmos/slashing/v1beta1/slashing.proto index 5a8f3b2659be..0aa9f61ffe58 100644 --- a/proto/cosmos/slashing/v1beta1/slashing.proto +++ b/proto/cosmos/slashing/v1beta1/slashing.proto @@ -23,8 +23,7 @@ message ValidatorSigningInfo { // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. int64 index_offset = 3; // Timestamp until which the validator is jailed due to liveness downtime. - google.protobuf.Timestamp jailed_until = 4 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp jailed_until = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; // Whether or not a validator has been tombstoned (killed out of validator set). It is set // once the validator commits an equivocation or for any other configured misbehiavor. bool tombstoned = 5; @@ -36,20 +35,11 @@ message ValidatorSigningInfo { // Params represents the parameters used for by the slashing module. message Params { int64 signed_blocks_window = 1; - bytes min_signed_per_window = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - google.protobuf.Duration downtime_jail_duration = 3 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true - ]; - bytes slash_fraction_double_sign = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - bytes slash_fraction_downtime = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + bytes min_signed_per_window = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + google.protobuf.Duration downtime_jail_duration = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + bytes slash_fraction_double_sign = 4 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes slash_fraction_downtime = 5 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; } diff --git a/proto/cosmos/staking/v1beta1/genesis.proto b/proto/cosmos/staking/v1beta1/genesis.proto index 7f2c2e77c4d6..bf3c298e39a6 100644 --- a/proto/cosmos/staking/v1beta1/genesis.proto +++ b/proto/cosmos/staking/v1beta1/genesis.proto @@ -14,15 +14,12 @@ message GenesisState { // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. - bytes last_total_power = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; + bytes last_total_power = 2 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; // last_validator_powers is a special index that provides a historical list // of the last-block's bonded validators. - repeated LastValidatorPower last_validator_powers = 3 - [(gogoproto.nullable) = false]; + repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false]; // delegations defines the validator set at genesis. repeated Validator validators = 4 [(gogoproto.nullable) = false]; @@ -31,8 +28,7 @@ message GenesisState { repeated Delegation delegations = 5 [(gogoproto.nullable) = false]; // unbonding_delegations defines the unbonding delegations active at genesis. - repeated UnbondingDelegation unbonding_delegations = 6 - [(gogoproto.nullable) = false]; + repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false]; // redelegations defines the redelegations active at genesis. repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false]; @@ -46,7 +42,7 @@ message LastValidatorPower { option (gogoproto.goproto_getters) = false; // address is the address of the validator. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // power defines the power of the validator. int64 power = 2; diff --git a/proto/cosmos/staking/v1beta1/query.proto b/proto/cosmos/staking/v1beta1/query.proto index c0716402f9b6..02469232ba06 100644 --- a/proto/cosmos/staking/v1beta1/query.proto +++ b/proto/cosmos/staking/v1beta1/query.proto @@ -114,7 +114,7 @@ message QueryValidatorsResponse { // QueryValidatorRequest is response type for the Query/Validator RPC method message QueryValidatorRequest { // validator_addr defines the validator address to query for. - string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryValidatorResponse is response type for the Query/Validator RPC method diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index d5205de93653..19d912519a06 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -28,16 +28,20 @@ message CommissionRates { option (gogoproto.goproto_stringer) = false; // rate is the commission rate charged to delegators, as a fraction. - string rate = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string rate = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. string max_rate = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. string max_change_rate = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -51,8 +55,7 @@ message Commission { // commission_rates defines the initial commission rates to be used for creating a validator. CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // update_time is the last time the commission rate was changed. - google.protobuf.Timestamp update_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp update_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // Description defines a validator description. @@ -88,17 +91,20 @@ message Validator { // operator_address defines the address of the validator's operator; bech encoded in JSON. string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - google.protobuf.Any consensus_pubkey = 2 - [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; // jailed defined whether the validator has been jailed from bonded status or not. bool jailed = 3; // status is the validator status (bonded/unbonding/unbonded). BondStatus status = 4; // tokens define the delegated tokens (incl. self-delegation). - string tokens = 5 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string tokens = 5 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // delegator_shares defines total shares issued to a validator's delegators. string delegator_shares = 6 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -107,13 +113,12 @@ message Validator { // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. int64 unbonding_height = 8; // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - google.protobuf.Timestamp unbonding_time = 9 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp unbonding_time = 9 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // commission defines the commission parameters. Commission commission = 10 [(gogoproto.nullable) = false]; // min_self_delegation is the validator's self declared minimum self delegation. string min_self_delegation = 11 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -190,7 +195,11 @@ message Delegation { // validator_address is the bech32-encoded address of the validator. string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // shares define the delegation shares received. - string shares = 3 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string shares = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } // UnbondingDelegation stores all of a single delegator's unbonding bonds @@ -216,16 +225,19 @@ message UnbondingDelegationEntry { // creation_height is the height which the unbonding took place. int64 creation_height = 1; // completion_time is the unix time for unbonding completion. - google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // initial_balance defines the tokens initially scheduled to receive at completion. string initial_balance = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; // balance defines the tokens to receive at completion. - string balance = 4 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; } // RedelegationEntry defines a redelegation object with relevant metadata. @@ -236,17 +248,19 @@ message RedelegationEntry { // creation_height defines the height which the redelegation took place. int64 creation_height = 1; // completion_time defines the unix time for redelegation completion. - google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // initial_balance defines the initial balance when redelegation started. string initial_balance = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; // shares_dst is the amount of destination-validator shares created by redelegation. - string shares_dst = 4 - [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string shares_dst = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } // Redelegation contains the list of a particular delegator's redelegating bonds @@ -272,8 +286,7 @@ message Params { option (gogoproto.goproto_stringer) = false; // unbonding_time is the time duration of unbonding. - google.protobuf.Duration unbonding_time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration unbonding_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // max_validators is the maximum number of validators. uint32 max_validators = 2; // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). @@ -302,7 +315,11 @@ message RedelegationEntryResponse { option (gogoproto.equal) = true; RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false]; - string balance = 4 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; } // RedelegationResponse is equivalent to a Redelegation except that its entries @@ -321,13 +338,13 @@ message Pool { option (gogoproto.description) = true; option (gogoproto.equal) = true; string not_bonded_tokens = 1 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.jsontag) = "not_bonded_tokens", (gogoproto.nullable) = false ]; string bonded_tokens = 2 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.jsontag) = "bonded_tokens", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index a97ce7adbc46..b0fddf4ee2b7 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -40,7 +40,7 @@ message MsgCreateValidator { Description description = 1 [(gogoproto.nullable) = false]; CommissionRates commission = 2 [(gogoproto.nullable) = false]; string min_self_delegation = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -65,14 +65,10 @@ message MsgEditValidator { // it's not mandatory to update. If not updated, the deserialized rate will be // zero with no way to distinguish if an update was intended. // REF: #2373 - string commission_rate = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" - ]; - string min_self_delegation = 4 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" - ]; + string commission_rate = 3 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + string min_self_delegation = 4 + [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; } // MsgEditValidatorResponse defines the Msg/EditValidator response type. diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index 067124a2340e..98ca0eaa2742 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -38,8 +38,7 @@ message Plan { // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. // If this field is not empty, an error will be thrown. - google.protobuf.Any upgraded_client_state = 5 - [deprecated = true]; + google.protobuf.Any upgraded_client_state = 5 [deprecated = true]; } // SoftwareUpgradeProposal is a gov Content type for initiating a software diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto index 27bdec8e6bb5..5042fd01bdaf 100644 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -40,9 +40,9 @@ message MsgCreateVestingAccountResponse {} message MsgCreatePeriodicVestingAccount { option (gogoproto.equal) = false; - string from_address = 1; - string to_address = 2; - int64 start_time = 3; + string from_address = 1; + string to_address = 2; + int64 start_time = 3; repeated Period vesting_periods = 4 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/vesting/v1beta1/vesting.proto b/proto/cosmos/vesting/v1beta1/vesting.proto index f24069e54719..9362faa03fda 100644 --- a/proto/cosmos/vesting/v1beta1/vesting.proto +++ b/proto/cosmos/vesting/v1beta1/vesting.proto @@ -14,18 +14,12 @@ message BaseVestingAccount { option (gogoproto.goproto_stringer) = false; cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; - repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin original_vesting = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin delegated_free = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; int64 end_time = 5; } @@ -66,7 +60,7 @@ message PeriodicVestingAccount { BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; int64 start_time = 2; - repeated Period vesting_periods = 3 [(gogoproto.nullable) = false]; + repeated Period vesting_periods = 3 [(gogoproto.nullable) = false]; } // PermanentLockedAccount implements the VestingAccount interface. It does From 18a68e31e4ed0dcfa30b2bc312411c1632d68997 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 7 Oct 2021 10:39:39 +0200 Subject: [PATCH 03/28] generate v1beta1 folder --- crypto/hd/hd.pb.go | 3 +- go.mod | 3 +- go.sum | 2 - proto/cosmos/gov/v1beta1/gov.proto | 3 +- x/gov/types/genesis.pb.go | 82 +- x/gov/types/gov.pb.go | 745 ++++++++ x/gov/types/query.pb.go | 221 +-- x/gov/types/query.pb.gw.go | 28 +- x/gov/types/tx.pb.go | 136 +- x/gov/types/v1beta1/genesis.pb.go | 667 +++++++ x/gov/types/v1beta1/gov.pb.go | 2819 ++++++++++++++++++++++++++++ 11 files changed, 4489 insertions(+), 220 deletions(-) create mode 100644 x/gov/types/gov.pb.go create mode 100644 x/gov/types/v1beta1/genesis.pb.go create mode 100644 x/gov/types/v1beta1/gov.pb.go diff --git a/crypto/hd/hd.pb.go b/crypto/hd/hd.pb.go index cbf26a3bae22..bc262474aa25 100644 --- a/crypto/hd/hd.pb.go +++ b/crypto/hd/hd.pb.go @@ -31,7 +31,8 @@ type BIP44Params struct { CoinType uint32 `protobuf:"varint,2,opt,name=coin_type,json=coinType,proto3" json:"coin_type,omitempty"` // account splits the key space into independent user identities Account uint32 `protobuf:"varint,3,opt,name=account,proto3" json:"account,omitempty"` - // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal chain. + // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + // chain. Change bool `protobuf:"varint,4,opt,name=change,proto3" json:"change,omitempty"` // address_index is used as child index in BIP32 derivation AddressIndex uint32 `protobuf:"varint,5,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"` diff --git a/go.mod b/go.mod index 1824c6014eec..042c0e2f9cec 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/confio/ics23/go v0.6.6 github.com/cosmos/btcutil v1.0.4 github.com/cosmos/cosmos-proto v0.0.0-20210914142853-23ed61ac79ce - github.com/cosmos/cosmos-sdk/db v0.0.0-20210831080937-2c31451a55b5 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/iavl v0.17.1 github.com/cosmos/ledger-cosmos-go v0.11.1 @@ -54,6 +53,7 @@ require ( google.golang.org/grpc v1.41.0 google.golang.org/protobuf v1.27.1 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect + gopkg.in/yaml.v2 v2.4.0 sigs.k8s.io/yaml v1.3.0 ) @@ -118,7 +118,6 @@ require ( golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect golang.org/x/text v0.3.6 // indirect gopkg.in/ini.v1 v1.63.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect nhooyr.io/websocket v1.8.6 // indirect ) diff --git a/go.sum b/go.sum index c4afe2770c28..e30cd20db62f 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,6 @@ github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= github.com/cosmos/cosmos-proto v0.0.0-20210914142853-23ed61ac79ce h1:nin7WtIMETZ8LezEYa5e9/iqyEgQka1x0cQYqgUeTGM= github.com/cosmos/cosmos-proto v0.0.0-20210914142853-23ed61ac79ce/go.mod h1:g2Q3cd94kOBVRAv7ahdtO27yUc4cpNuHGnI40qanl1k= -github.com/cosmos/cosmos-sdk/db v0.0.0-20210831080937-2c31451a55b5 h1:GdtDczrd06rDuZ02iprBUfo0JkeauWHBQSDqoDYShf4= -github.com/cosmos/cosmos-sdk/db v0.0.0-20210831080937-2c31451a55b5/go.mod h1:eAiR2sIGn3oIrcDiEUIqmH8UvPdIvN67Ui0XeKuTDnI= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 2bbca8a901be..1301bad0a93d 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -8,7 +8,8 @@ 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/v1beta1"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = false; option (gogoproto.goproto_getters_all) = false; diff --git a/x/gov/types/genesis.pb.go b/x/gov/types/genesis.pb.go index fab76aac0483..c8c16624f7c9 100644 --- a/x/gov/types/genesis.pb.go +++ b/x/gov/types/genesis.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -26,7 +27,7 @@ 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"` + StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty" yaml:"starting_proposal_id"` // deposits defines all the deposits present at genesis. Deposits Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"` // votes defines all the votes present at genesis. @@ -34,11 +35,11 @@ type GenesisState struct { // proposals defines all the proposals present at genesis. Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` // params defines all the paramaters of related to deposit. - DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` + DepositParams v1beta1.DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params" yaml:"deposit_params"` // params defines all the paramaters of related to voting. - VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` + VotingParams v1beta1.VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params" yaml:"voting_params"` // params defines all the paramaters of related to tally. - TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` + TallyParams v1beta1.TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params" yaml:"tally_params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -102,25 +103,25 @@ func (m *GenesisState) GetProposals() Proposals { return nil } -func (m *GenesisState) GetDepositParams() DepositParams { +func (m *GenesisState) GetDepositParams() v1beta1.DepositParams { if m != nil { return m.DepositParams } - return DepositParams{} + return v1beta1.DepositParams{} } -func (m *GenesisState) GetVotingParams() VotingParams { +func (m *GenesisState) GetVotingParams() v1beta1.VotingParams { if m != nil { return m.VotingParams } - return VotingParams{} + return v1beta1.VotingParams{} } -func (m *GenesisState) GetTallyParams() TallyParams { +func (m *GenesisState) GetTallyParams() v1beta1.TallyParams { if m != nil { return m.TallyParams } - return TallyParams{} + return v1beta1.TallyParams{} } func init() { @@ -129,33 +130,36 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/genesis.proto", fileDescriptor_ef7cfd15e3ded621) } -var fileDescriptor_43cd825e0fa7a627 = []byte{ - // 389 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x6e, 0xda, 0x40, - 0x14, 0x45, 0xed, 0x62, 0x28, 0x0c, 0x50, 0xb5, 0x23, 0x16, 0x16, 0x45, 0xc6, 0xed, 0xca, 0x9b, - 0xda, 0x85, 0xae, 0xbb, 0xb1, 0x2a, 0xb5, 0xa8, 0x6a, 0x85, 0xdc, 0x2a, 0x8b, 0x6c, 0x90, 0xc1, - 0x23, 0xc7, 0x0a, 0xf0, 0x2c, 0xbf, 0x89, 0x15, 0x76, 0xf9, 0x84, 0x7c, 0x47, 0xbe, 0x84, 0x25, - 0xcb, 0xac, 0x92, 0x08, 0x7e, 0x24, 0xf2, 0x8c, 0x9d, 0x38, 0x8a, 0x93, 0x95, 0x3d, 0xf7, 0xde, - 0x39, 0xba, 0xf3, 0xf4, 0x88, 0xb9,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a, 0xe5, 0x79, - 0x53, 0x11, 0x74, 0xb5, 0x0c, 0xec, 0x75, 0x83, 0xb2, 0x48, 0x7f, 0x93, 0x6e, 0x0a, 0x72, 0xb0, - 0x12, 0xd7, 0x10, 0x38, 0xf3, 0x85, 0x57, 0x66, 0x53, 0x2e, 0xd3, 0x3a, 0x69, 0x49, 0xa3, 0xbf, - 0x48, 0x87, 0xfb, 0xcb, 0xe5, 0xa6, 0x60, 0xbd, 0x15, 0xac, 0x61, 0x15, 0xeb, 0x7f, 0x96, 0x7b, - 0x82, 0x6a, 0xf3, 0x92, 0xe4, 0x6e, 0xf7, 0x86, 0xba, 0xdb, 0x1b, 0xea, 0xdd, 0xde, 0x50, 0x2f, - 0x0f, 0x86, 0xb2, 0x3b, 0x18, 0xca, 0xf5, 0xc1, 0x50, 0x8e, 0xad, 0x30, 0xe2, 0x27, 0x67, 0x73, - 0x7b, 0x01, 0x2b, 0x27, 0xdf, 0x22, 0xf9, 0xf9, 0x82, 0xc1, 0xa9, 0x73, 0x2e, 0x56, 0x8a, 0x6f, - 0x62, 0x86, 0xf3, 0x86, 0xd8, 0xa6, 0x6f, 0xf7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x3b, 0x1a, - 0xbf, 0xb9, 0x02, 0x00, 0x00, +var fileDescriptor_ef7cfd15e3ded621 = []byte{ + // 437 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x6e, 0xd3, 0x30, + 0x18, 0xc7, 0x1b, 0xd6, 0x8e, 0xcd, 0x6d, 0x11, 0x98, 0xa2, 0x45, 0xcb, 0x48, 0x42, 0x4e, 0xb9, + 0x90, 0xa8, 0xe3, 0x86, 0xc4, 0x25, 0x42, 0x82, 0xdd, 0x46, 0x40, 0x1c, 0xb8, 0x44, 0x6e, 0x63, + 0x99, 0x88, 0x64, 0x8e, 0xf2, 0x99, 0x88, 0xb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xe2, 0x50, 0xbe, 0xd8, 0x67, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xef, 0x6e, 0xbd, + 0x9f, 0x2c, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -388,7 +392,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, v1beta1.Deposit{}) if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -422,7 +426,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, v1beta1.Vote{}) if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go new file mode 100644 index 000000000000..65fe52997e85 --- /dev/null +++ b/x/gov/types/gov.pb.go @@ -0,0 +1,745 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1/gov.proto + +package types + +import ( + fmt "fmt" + 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" + v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + _ "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/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 + +// 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 []*types.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` + Status v1beta1.ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty" yaml:"proposal_status"` + FinalTallyResult v1beta1.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() {} +func (*Proposal) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{0} +} +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 init() { + proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1.Proposal") +} + +func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } + +var fileDescriptor_e05cb1c0d030febb = []byte{ + // 580 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x31, 0x73, 0xd3, 0x30, + 0x18, 0x86, 0xed, 0xb6, 0x84, 0x54, 0x21, 0xa5, 0x98, 0x5c, 0xeb, 0xe4, 0x38, 0x39, 0x18, 0x86, + 0x2c, 0xd8, 0x24, 0x30, 0x75, 0xc3, 0xc0, 0x1d, 0x2c, 0x1c, 0xe7, 0xf6, 0x18, 0x60, 0xf0, 0xc9, + 0xb1, 0x62, 0x74, 0xd8, 0x96, 0x2f, 0x52, 0x72, 0x64, 0x63, 0x64, 0xec, 0x4f, 0x60, 0xe6, 0x97, + 0x64, 0xec, 0xd8, 0x29, 0xa5, 0xc9, 0xc2, 0xc1, 0x96, 0x5f, 0xc0, 0x59, 0x52, 0x42, 0xd3, 0x70, + 0x64, 0xb2, 0xf2, 0xe9, 0xfd, 0xbe, 0xe7, 0xd5, 0x2b, 0x05, 0x1c, 0x76, 0x29, 0x4b, 0x29, 0x73, + 0x63, 0x3a, 0x74, 0x87, 0xed, 0xe2, 0xe3, 0xe4, 0x7d, 0xca, 0xa9, 0x51, 0x95, 0x1b, 0x4e, 0x51, + 0x19, 0xb6, 0x1b, 0x50, 0xe9, 0x42, 0xc4, 0xb0, 0x3b,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x23, 0xe4, 0xb9, 0x6f, 0xcb, 0xfa, 0x71, 0x51, 0x16, 0x07, 0xef, + 0x01, 0x55, 0xfa, 0x1b, 0xf1, 0xee, 0x46, 0x96, 0xad, 0x58, 0x07, 0x2b, 0xac, 0xd5, 0x84, 0xab, + 0xb2, 0xaa, 0x02, 0x3e, 0xda, 0xf9, 0xf9, 0xcd, 0xd2, 0xbd, 0x37, 0xe3, 0x4b, 0xa8, 0x9d, 0x5f, + 0x42, 0xed, 0xcb, 0x14, 0x6a, 0xe3, 0x29, 0xd4, 0xcf, 0xa6, 0x50, 0xff, 0x31, 0x85, 0xfa, 0xe9, + 0x0c, 0x6a, 0x67, 0x33, 0xa8, 0x9d, 0xcf, 0xa0, 0xf6, 0xfe, 0xff, 0xc9, 0x7d, 0x16, 0xff, 0x64, + 0x91, 0x5f, 0x58, 0x12, 0xe6, 0x9e, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0x73, 0x8f, 0x71, 0x29, + 0x7e, 0x04, 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 +} +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 + 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 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 + } + } + 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 + } + 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 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 *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)) + } + 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 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)) + 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 *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, &types.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 |= v1beta1.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 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 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 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, types1.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 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 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 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/query.pb.go b/x/gov/types/query.pb.go index c7c4ab5b4b9d..d4f51eb7b85a 100644 --- a/x/gov/types/query.pb.go +++ b/x/gov/types/query.pb.go @@ -8,6 +8,7 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" query "github.com/cosmos/cosmos-sdk/types/query" + v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -125,7 +126,7 @@ func (m *QueryProposalResponse) GetProposal() Proposal { // 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.v1.ProposalStatus" json:"proposal_status,omitempty"` + ProposalStatus v1beta1.ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1beta1.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. @@ -266,7 +267,7 @@ var xxx_messageInfo_QueryVoteRequest proto.InternalMessageInfo // 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 v1beta1.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"` } func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} } @@ -302,11 +303,11 @@ func (m *QueryVoteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo -func (m *QueryVoteResponse) GetVote() Vote { +func (m *QueryVoteResponse) GetVote() v1beta1.Vote { if m != nil { return m.Vote } - return Vote{} + return v1beta1.Vote{} } // QueryVotesRequest is the request type for the Query/Votes RPC method. @@ -367,7 +368,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 []v1beta1.Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -405,7 +406,7 @@ func (m *QueryVotesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryVotesResponse proto.InternalMessageInfo -func (m *QueryVotesResponse) GetVotes() []Vote { +func (m *QueryVotesResponse) GetVotes() []v1beta1.Vote { if m != nil { return m.Votes } @@ -469,11 +470,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 v1beta1.VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` // deposit_params defines the parameters related to deposit. - DepositParams DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` + DepositParams v1beta1.DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` // tally_params defines the parameters related to tally. - TallyParams TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` + TallyParams v1beta1.TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -509,25 +510,25 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetVotingParams() VotingParams { +func (m *QueryParamsResponse) GetVotingParams() v1beta1.VotingParams { if m != nil { return m.VotingParams } - return VotingParams{} + return v1beta1.VotingParams{} } -func (m *QueryParamsResponse) GetDepositParams() DepositParams { +func (m *QueryParamsResponse) GetDepositParams() v1beta1.DepositParams { if m != nil { return m.DepositParams } - return DepositParams{} + return v1beta1.DepositParams{} } -func (m *QueryParamsResponse) GetTallyParams() TallyParams { +func (m *QueryParamsResponse) GetTallyParams() v1beta1.TallyParams { if m != nil { return m.TallyParams } - return TallyParams{} + return v1beta1.TallyParams{} } // QueryDepositRequest is the request type for the Query/Deposit RPC method. @@ -574,7 +575,7 @@ var xxx_messageInfo_QueryDepositRequest proto.InternalMessageInfo // 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 v1beta1.Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit"` } func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } @@ -610,11 +611,11 @@ func (m *QueryDepositResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo -func (m *QueryDepositResponse) GetDeposit() Deposit { +func (m *QueryDepositResponse) GetDeposit() v1beta1.Deposit { if m != nil { return m.Deposit } - return Deposit{} + return v1beta1.Deposit{} } // QueryDepositsRequest is the request type for the Query/Deposits RPC method. @@ -674,7 +675,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 []v1beta1.Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -712,7 +713,7 @@ func (m *QueryDepositsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDepositsResponse proto.InternalMessageInfo -func (m *QueryDepositsResponse) GetDeposits() []Deposit { +func (m *QueryDepositsResponse) GetDeposits() []v1beta1.Deposit { if m != nil { return m.Deposits } @@ -775,7 +776,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 v1beta1.TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally"` } func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultResponse{} } @@ -811,99 +812,99 @@ func (m *QueryTallyResultResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryTallyResultResponse proto.InternalMessageInfo -func (m *QueryTallyResultResponse) GetTally() TallyResult { +func (m *QueryTallyResultResponse) GetTally() v1beta1.TallyResult { if m != nil { return m.Tally } - return TallyResult{} + return v1beta1.TallyResult{} } func init() { - proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1beta1.QueryProposalRequest") - proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1beta1.QueryProposalResponse") - proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1beta1.QueryProposalsRequest") - proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1beta1.QueryProposalsResponse") - proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1beta1.QueryVoteRequest") - proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1beta1.QueryVoteResponse") - proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1beta1.QueryVotesRequest") - proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1beta1.QueryVotesResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1beta1.QueryDepositRequest") - proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1beta1.QueryDepositResponse") - proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1beta1.QueryDepositsRequest") - proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1beta1.QueryDepositsResponse") - proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1beta1.QueryTallyResultRequest") - proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1beta1.QueryTallyResultResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/query.proto", fileDescriptor_e35c0d133e91c0a2) } - -var fileDescriptor_e35c0d133e91c0a2 = []byte{ - // 994 bytes of a gzipped FileDescriptorProto + proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1.QueryProposalRequest") + proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1.QueryProposalResponse") + proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1.QueryProposalsRequest") + proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1.QueryProposalsResponse") + proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1.QueryVoteRequest") + proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1.QueryVoteResponse") + proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1.QueryVotesRequest") + proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1.QueryVotesResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1.QueryParamsResponse") + proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1.QueryDepositRequest") + proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1.QueryDepositResponse") + proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1.QueryDepositsRequest") + proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1.QueryDepositsResponse") + proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1.QueryTallyResultRequest") + proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1.QueryTallyResultResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1/query.proto", fileDescriptor_46a436d1109b50d0) } + +var fileDescriptor_46a436d1109b50d0 = []byte{ + // 999 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x24, 0x4e, 0x6b, 0xbf, 0xb4, 0x01, 0x1e, 0x01, 0x8c, 0x29, 0x76, 0x58, 0xd1, 0xd6, - 0xa4, 0xc4, 0x4b, 0x92, 0x52, 0xd4, 0x16, 0x50, 0x6b, 0xa1, 0xb6, 0xa8, 0x12, 0x2a, 0x4e, 0x05, - 0x12, 0x97, 0x68, 0x53, 0xaf, 0x96, 0x15, 0x8e, 0x67, 0xeb, 0x19, 0x5b, 0x8d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9a, 0xe8, 0x1c, 0x53, 0x1c, 0xfe, 0x64, 0xc0, 0x42, 0xe2, + 0x8a, 0xe3, 0x5a, 0x56, 0xba, 0xc7, 0x7d, 0xc7, 0x3c, 0x3b, 0x13, 0xf7, 0x84, 0xf3, 0x23, 0xcd, + 0x65, 0x6b, 0xeb, 0xe1, 0x61, 0xcd, 0x78, 0x74, 0x58, 0x33, 0xfe, 0x3e, 0xac, 0x19, 0x3f, 0x1e, + 0xd5, 0x0a, 0x8f, 0x8e, 0x6a, 0x85, 0x3f, 0x8e, 0x6a, 0x85, 0x2f, 0xd6, 0xfd, 0x40, 0x7c, 0xd9, + 0xdf, 0xb5, 0x6f, 0xb2, 0x3d, 0xcd, 0xa8, 0xfe, 0x9c, 0xe3, 0xed, 0xaf, 0x9c, 0xdb, 0x92, 0x3e, + 0x9a, 0x02, 0xbe, 0x7b, 0x42, 0xfe, 0xfe, 0x78, 0xfb, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, + 0x18, 0x79, 0x2e, 0x5d, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2329,7 +2330,7 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProposalStatus |= ProposalStatus(b&0x7F) << shift + m.ProposalStatus |= v1beta1.ProposalStatus(b&0x7F) << shift if b < 0x80 { break } @@ -2922,7 +2923,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, v1beta1.Vote{}) if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3562,7 +3563,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, v1beta1.Deposit{}) if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/gov/types/query.pb.gw.go b/x/gov/types/query.pb.gw.go index 00b3afcc7313..aa1d8a5916ac 100644 --- a/x/gov/types/query.pb.gw.go +++ b/x/gov/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join 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 @@ -528,12 +530,14 @@ func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Ma // 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. +// Note that using this registration option will cause many gRPC library features 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() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -541,6 +545,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -554,6 +559,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -561,6 +568,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -574,6 +582,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -581,6 +591,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -594,6 +605,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -601,6 +614,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -614,6 +628,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -621,6 +637,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -634,6 +651,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -641,6 +660,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -654,6 +674,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -661,6 +683,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -674,6 +697,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -681,6 +706,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index 73da67a8ce55..bf3989fc0e3f 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -10,6 +10,7 @@ import ( 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" + v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -35,7 +36,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary // proposal Content. type MsgSubmitProposal struct { - Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + 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"` } @@ -119,9 +120,9 @@ 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"` - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1.VoteOption" json:"option,omitempty"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + Option v1beta1.VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` } func (m *MsgVote) Reset() { *m = MsgVote{} } @@ -195,9 +196,9 @@ var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo // MsgVoteWeighted defines a message to cast a vote. 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"` + 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 []v1beta1.WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options"` } func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } @@ -422,61 +423,68 @@ func (m *MsgSignalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSignalResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1beta1.MsgSubmitProposal") - proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta1.MsgSubmitProposalResponse") - proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta1.MsgVote") - proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta1.MsgVoteResponse") - proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1beta1.MsgVoteWeighted") - proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1beta1.MsgVoteWeightedResponse") - proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta1.MsgDeposit") - proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta1.MsgDepositResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) } - -var fileDescriptor_3c053992595e3dce = []byte{ - // 648 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xb6, 0x93, 0xd2, 0xd0, 0x17, 0xd4, 0x52, 0x2b, 0x12, 0x49, 0x8a, 0xec, 0x28, 0x88, 0x2a, - 0x12, 0x8a, 0xdd, 0x06, 0xd4, 0x01, 0xa6, 0xba, 0x08, 0xc1, 0x10, 0x01, 0xae, 0x04, 0x12, 0x4b, - 0x49, 0xe2, 0xeb, 0xd5, 0xa2, 0xf1, 0xb3, 0x72, 0x97, 0xa8, 0xdd, 0x18, 0x99, 0x10, 0x23, 0x63, - 0x67, 0xe6, 0xb2, 0xf1, 0x07, 0x54, 0x4c, 0x15, 0x13, 0x03, 0x2a, 0xa8, 0x5d, 0x10, 0x82, 0xff, - 0x01, 0xc5, 0x77, 0xe7, 0x42, 0xeb, 0xa6, 0xe5, 0xc7, 0x94, 0xd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, 0x00, 0x00, 0xff, 0xff, - 0x8a, 0xac, 0xbf, 0x61, 0x81, 0x06, 0x00, 0x00, + proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1.MsgSubmitProposal") + proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitProposalResponse") + proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1.MsgVote") + proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1.MsgVoteResponse") + proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1.MsgVoteWeighted") + proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1.MsgVoteWeightedResponse") + proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1.MsgDeposit") + proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1.MsgDepositResponse") + proto.RegisterType((*MsgSignal)(nil), "cosmos.gov.v1.MsgSignal") + proto.RegisterType((*MsgSignalResponse)(nil), "cosmos.gov.v1.MsgSignalResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } + +var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ + // 734 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xc1, 0x6b, 0x13, 0x4f, + 0x14, 0xde, 0x6d, 0xfa, 0x4b, 0x9b, 0xe9, 0xcf, 0xd6, 0x8e, 0xa1, 0xdd, 0x04, 0xd9, 0xc4, 0x80, + 0x25, 0x97, 0xee, 0x36, 0x55, 0x2a, 0xf4, 0x20, 0x34, 0x96, 0x8a, 0x87, 0xa0, 0x6c, 0xb1, 0x82, + 0x08, 0x65, 0x93, 0x1d, 0xa7, 0x83, 0xc9, 0xce, 0xb2, 0x33, 0x09, 0xcd, 0x4d, 0xf0, 0x22, 0x9e, + 0x3c, 0x7a, 0xec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be, 0xad, 0xb1, 0x67, 0x58, 0xac, 0xfe, 0x2e, 0x23, 0x79, 0xa8, 0xb7, + 0xc1, 0xa4, 0x78, 0x72, 0x0b, 0xe3, 0x8c, 0x28, 0x5e, 0x34, 0xd3, 0xe3, 0x09, 0x7f, 0x07, 0xfc, + 0x3f, 0xe2, 0xf5, 0x73, 0xf2, 0x63, 0xbc, 0xb8, 0x74, 0x31, 0x9e, 0xd4, 0xbd, 0x0b, 0xa6, 0x62, + 0xaf, 0x15, 0xc6, 0x29, 0x0a, 0x2a, 0x5e, 0x3b, 0x17, 0x4a, 0x0a, 0x6d, 0x82, 0xac, 0xba, 0x2f, + 0x23, 0x65, 0x29, 0x02, 0x29, 0x96, 0xcf, 0x43, 0xe2, 0x2a, 0xf5, 0xfa, 0xe1, 0x89, 0xa9, 0x1f, + 0x9d, 0x98, 0xfa, 0xd7, 0x13, 0x53, 0x7f, 0x7d, 0x6a, 0x6a, 0x47, 0xa7, 0xa6, 0xf6, 0xe9, 0xd4, + 0xd4, 0x1e, 0x5f, 0x6c, 0xb6, 0x7d, 0xf1, 0x39, 0x12, 0x96, 0x6b, 0x66, 0xc5, 0x67, 0xe0, 0xc6, + 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x69, 0x9a, 0x0c, 0x09, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1551,7 +1559,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Option |= VoteOption(b&0x7F) << shift + m.Option |= v1beta1.VoteOption(b&0x7F) << shift if b < 0x80 { break } @@ -1736,7 +1744,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, v1beta1.WeightedVoteOption{}) if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/gov/types/v1beta1/genesis.pb.go b/x/gov/types/v1beta1/genesis.pb.go new file mode 100644 index 000000000000..0efefab9c4cf --- /dev/null +++ b/x/gov/types/v1beta1/genesis.pb.go @@ -0,0 +1,667 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1beta1/genesis.proto + +package v1beta1 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + 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 Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"` + // votes defines all the votes present at genesis. + Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` + // proposals defines all the proposals present at genesis. + Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` + // params defines all the paramaters of related to deposit. + DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` + // params defines all the paramaters of related to voting. + VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` + // params defines all the paramaters of related to tally. + TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` +} + +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_43cd825e0fa7a627, []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() Deposits { + if m != nil { + return m.Deposits + } + return nil +} + +func (m *GenesisState) GetVotes() Votes { + if m != nil { + return m.Votes + } + return nil +} + +func (m *GenesisState) GetProposals() Proposals { + if m != nil { + return m.Proposals + } + return nil +} + +func (m *GenesisState) GetDepositParams() DepositParams { + if m != nil { + return m.DepositParams + } + return DepositParams{} +} + +func (m *GenesisState) GetVotingParams() VotingParams { + if m != nil { + return m.VotingParams + } + return VotingParams{} +} + +func (m *GenesisState) GetTallyParams() TallyParams { + if m != nil { + return m.TallyParams + } + return TallyParams{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1beta1.GenesisState") +} + +func init() { proto.RegisterFile("cosmos/gov/v1beta1/genesis.proto", fileDescriptor_43cd825e0fa7a627) } + +var fileDescriptor_43cd825e0fa7a627 = []byte{ + // 391 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1,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f5, 0xf5, 0x3e, 0x00, 0x00, 0xff, 0xff, 0x9c, + 0xc0, 0x6c, 0xbd, 0xc1, 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 + { + 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 + { + 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 + { + 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)) + } + } + 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)) + 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 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 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 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/v1beta1/gov.pb.go b/x/gov/types/v1beta1/gov.pb.go new file mode 100644 index 000000000000..26da7c72e53f --- /dev/null +++ b/x/gov/types/v1beta1/gov.pb.go @@ -0,0 +1,2819 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1beta1/gov.proto + +package v1beta1 + +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" + 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. + OptionEmpty VoteOption = 0 + // VOTE_OPTION_YES defines a yes vote option. + OptionYes VoteOption = 1 + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + OptionAbstain VoteOption = 2 + // VOTE_OPTION_NO defines a no vote option. + OptionNo VoteOption = 3 + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + OptionNoWithVeto 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_6e82113c1a9a4b7c, []int{0} +} + +// ProposalStatus enumerates the valid statuses of a proposal. +type ProposalStatus int32 + +const ( + // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + StatusNil ProposalStatus = 0 + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + StatusDepositPeriod ProposalStatus = 1 + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + StatusVotingPeriod ProposalStatus = 2 + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + StatusPassed ProposalStatus = 3 + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + StatusRejected ProposalStatus = 4 + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + StatusFailed 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_6e82113c1a9a4b7c, []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.v1beta1.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"` +} + +func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } +func (*WeightedVoteOption) ProtoMessage() {} +func (*WeightedVoteOption) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []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 + +// TextProposal defines a standard text proposal whose changes need to be +// manually updated in case of approval. +type TextProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (m *TextProposal) Reset() { *m = TextProposal{} } +func (*TextProposal) ProtoMessage() {} +func (*TextProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{1} +} +func (m *TextProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TextProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TextProposal.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 *TextProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_TextProposal.Merge(m, src) +} +func (m *TextProposal) XXX_Size() int { + return m.Size() +} +func (m *TextProposal) XXX_DiscardUnknown() { + xxx_messageInfo_TextProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_TextProposal proto.InternalMessageInfo + +// 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"` +} + +func (m *Deposit) Reset() { *m = Deposit{} } +func (*Deposit) ProtoMessage() {} +func (*Deposit) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{2} +} +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 + +// 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"` + Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"` + FinalTallyResult TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"` + SubmitTime time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time"` + DepositEndTime time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"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"` + VotingStartTime time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time"` + VotingEndTime time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time"` +} + +func (m *Proposal) Reset() { *m = Proposal{} } +func (*Proposal) ProtoMessage() {} +func (*Proposal) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{3} +} +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 + +// 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"` +} + +func (m *TallyResult) Reset() { *m = TallyResult{} } +func (*TallyResult) ProtoMessage() {} +func (*TallyResult) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{4} +} +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 + +// 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.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. + Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` +} + +func (m *Vote) Reset() { *m = Vote{} } +func (*Vote) ProtoMessage() {} +func (*Vote) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{5} +} +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 + +// 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"` + // 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 (*DepositParams) ProtoMessage() {} +func (*DepositParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{6} +} +func (m *DepositParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DepositParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DepositParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_DepositParams.Merge(m, src) +} +func (m *DepositParams) XXX_Size() int { + return m.Size() +} +func (m *DepositParams) XXX_DiscardUnknown() { + xxx_messageInfo_DepositParams.DiscardUnknown(m) +} + +var xxx_messageInfo_DepositParams proto.InternalMessageInfo + +// VotingParams defines the params 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 (*VotingParams) ProtoMessage() {} +func (*VotingParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{7} +} +func (m *VotingParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VotingParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VotingParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_VotingParams.Merge(m, src) +} +func (m *VotingParams) XXX_Size() int { + return m.Size() +} +func (m *VotingParams) XXX_DiscardUnknown() { + xxx_messageInfo_VotingParams.DiscardUnknown(m) +} + +var xxx_messageInfo_VotingParams proto.InternalMessageInfo + +// TallyParams defines the params 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"` + // 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"` + // 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"` +} + +func (m *TallyParams) Reset() { *m = TallyParams{} } +func (*TallyParams) ProtoMessage() {} +func (*TallyParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{8} +} +func (m *TallyParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TallyParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TallyParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_TallyParams.Merge(m, src) +} +func (m *TallyParams) XXX_Size() int { + return m.Size() +} +func (m *TallyParams) XXX_DiscardUnknown() { + xxx_messageInfo_TallyParams.DiscardUnknown(m) +} + +var xxx_messageInfo_TallyParams proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("cosmos.gov.v1beta1.VoteOption", VoteOption_name, VoteOption_value) + proto.RegisterEnum("cosmos.gov.v1beta1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) + proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1beta1.WeightedVoteOption") + proto.RegisterType((*TextProposal)(nil), "cosmos.gov.v1beta1.TextProposal") + proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1beta1.Deposit") + proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1beta1.Proposal") + proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1beta1.TallyResult") + proto.RegisterType((*Vote)(nil), "cosmos.gov.v1beta1.Vote") + proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1beta1.DepositParams") + proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1beta1.VotingParams") + proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1beta1.TallyParams") +} + +func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } + +var fileDescriptor_6e82113c1a9a4b7c = []byte{ + // 1356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57,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, 0x8b, 0xa7, 0xb3, 0xd4, 0x7c, 0xf6, 0x3a, 0x1b, 0x79, 0xf9, 0x3a, 0x1b, 0xf9, + 0xfa, 0x20, 0x1b, 0x79, 0x76, 0x90, 0x95, 0x9e, 0x1f, 0x64, 0xa5, 0xdf, 0x0e, 0xb2, 0xd2, 0xa3, + 0x37, 0xd9, 0xc8, 0xf3, 0x37, 0xd9, 0xc8, 0xcb, 0x37, 0xd9, 0xc8, 0xdd, 0x6b, 0x7f, 0x5b, 0xb0, + 0xbb, 0xec, 0x9b, 0x87, 0x95, 0x6d, 0xf0, 0x19, 0xb3, 0x95, 0x60, 0x93, 0xe1, 0xe3, 0xbf, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x14, 0x1f, 0x45, 0x67, 0x16, 0x0d, 0x00, 0x00, +} + +func (this *TextProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TextProposal) + if !ok { + that2, ok := that.(TextProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + return true +} +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 !this.Content.Equal(that1.Content) { + 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 +} +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) + 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 + { + size := m.Weight.Size() + i -= size + if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + 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 *TextProposal) 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 *TextProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TextProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + 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 + 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 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 + } + } + 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 + } + 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 m.Content != nil { + { + size, err := m.Content.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 + { + 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)) + } + 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 + n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxDepositPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintGov(dAtA, i, uint64(n7)) + 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 + n8, err8 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.VotingPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintGov(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *TallyParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TallyParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.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)) + } + 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 = m.Weight.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *TextProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + 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 m.Content != nil { + l = m.Content.Size() + n += 1 + l + sovGov(uint64(l)) + } + 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 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)) + return n +} + +func (m *TallyResult) Size() (n int) { + if m == nil { + return 0 + } + 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)) + 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)) + } + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod) + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *VotingParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod) + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *TallyParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Quorum.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.Threshold.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.VetoThreshold.Size() + 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 + } + if err := m.Weight.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 *TextProposal) 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: TextProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TextProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", 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.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = 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 Content", 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.Content == nil { + m.Content = &types1.Any{} + } + if err := m.Content.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 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 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 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 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 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 + } + if err := m.Yes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 + } + if err := m.Abstain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 + } + if err := m.No.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 + } + if err := m.NoWithVeto.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 *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 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 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 + } + if err := m.Quorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Threshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field 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 + } + if err := m.VetoThreshold.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 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") +) From a4435c4a89b877272f3e39b00e412ce8e0251f6f Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 8 Oct 2021 10:43:56 +0200 Subject: [PATCH 04/28] add v1 and v1beta1 gov types and clean up migrations --- client/grpc_query_test.go | 1 + client/keys/add_ledger_test.go | 3 +- client/query_test.go | 1 + cosmovisor/process_test.go | 1 + cosmovisor/upgrade_test.go | 1 + crypto/keys/secp256k1/secp256k1_cgo.go | 1 + crypto/keys/secp256k1/secp256k1_cgo_test.go | 1 + crypto/keys/secp256k1/secp256k1_nocgo.go | 1 + crypto/keys/secp256k1/secp256k1_nocgo_test.go | 1 + crypto/ledger/ledger_mock.go | 1 + crypto/ledger/ledger_notavail.go | 2 + crypto/ledger/ledger_real.go | 1 + docs/core/proto-docs.md | 368 ++- go.mod | 2 +- proto/cosmos/gov/v1/genesis.proto | 15 +- proto/cosmos/gov/v1/gov.proto | 164 +- proto/cosmos/gov/v1/query.proto | 19 +- proto/cosmos/gov/v1/tx.proto | 13 +- server/grpc/server_test.go | 1 + simapp/app.go | 9 +- simapp/params/amino.go | 1 + simapp/utils.go | 1 - testutil/network/network_test.go | 1 + types/module/module_test.go | 4 +- types/module/simulation.go | 18 +- x/auth/client/testutil/cli_test.go | 1 + x/auth/migrations/legacytx/stdsign.go | 1 - x/auth/vesting/client/testutil/cli_test.go | 1 + x/authz/client/testutil/cli_test.go | 1 + x/bank/client/testutil/cli_test.go | 1 + x/crisis/client/testsuite/cli_test.go | 1 + x/distribution/client/testutil/cli_test.go | 1 + x/distribution/handler.go | 2 +- x/distribution/types/codec.go | 2 +- x/distribution/types/proposal.go | 6 +- x/evidence/client/testutil/cli_test.go | 1 + x/feegrant/client/testutil/cli_test.go | 1 + x/genutil/client/testutil/cli_test.go | 1 + x/genutil/migrations/v040/migrate.go | 4 +- x/genutil/migrations/v043/migrate.go | 12 +- x/genutil/migrations/v045/migrate.go | 17 +- x/gov/abci_test.go | 2 +- x/gov/client/cli/tx.go | 8 +- x/gov/migrations/v040/migrate.go | 54 +- x/gov/migrations/v040/types.go | 112 - x/gov/migrations/v043/json.go | 11 +- x/gov/migrations/v043/json_test.go | 17 +- x/gov/migrations/v043/store.go | 9 +- x/gov/migrations/v043/types.go | 16 - x/gov/migrations/v045/migrate.go | 78 +- x/gov/migrations/v045/migrate_test.go | 103 +- x/gov/simulation/operations_test.go | 1 - x/gov/types/codec.go | 1 - x/gov/types/errors.go | 6 +- x/gov/types/genesis.pb.go | 80 +- x/gov/types/gov.pb.go | 2108 ++++++++++++++++- x/gov/types/proposal.go | 42 +- x/gov/types/proposals_test.go | 7 +- x/gov/types/query.pb.go | 178 +- x/gov/types/query.pb.gw.go | 28 +- x/gov/types/router.go | 72 - x/gov/types/tx.pb.go | 111 +- x/gov/types/{ => v1beta1}/content.go | 13 +- x/gov/types/v1beta1/deposit.go | 47 + x/gov/types/v1beta1/errors.go | 12 + x/gov/types/v1beta1/params.go | 36 + x/gov/types/v1beta1/proposal.go | 148 ++ x/gov/types/v1beta1/proposals_test.go | 24 + x/gov/types/v1beta1/tally.go | 36 + x/gov/types/v1beta1/vote.go | 123 + x/gov/types/vote.go | 11 +- x/mint/client/testutil/cli_test.go | 1 + x/params/client/testutil/cli_test.go | 1 + x/params/proposal_handler.go | 2 +- x/params/types/proposal/codec.go | 2 +- x/params/types/proposal/proposal.go | 6 +- x/slashing/client/testutil/cli_test.go | 1 + x/staking/client/testutil/cli_test.go | 1 + x/staking/module_test.go | 2 +- x/upgrade/client/cli/tx.go | 1 - x/upgrade/client/testutil/cli_test.go | 1 + x/upgrade/handler.go | 2 +- x/upgrade/types/codec.go | 2 +- x/upgrade/types/proposal.go | 7 +- 84 files changed, 3302 insertions(+), 905 deletions(-) delete mode 100644 x/gov/migrations/v040/types.go delete mode 100644 x/gov/migrations/v043/types.go delete mode 100644 x/gov/types/router.go rename x/gov/types/{ => v1beta1}/content.go (77%) create mode 100644 x/gov/types/v1beta1/deposit.go create mode 100644 x/gov/types/v1beta1/errors.go create mode 100644 x/gov/types/v1beta1/params.go create mode 100644 x/gov/types/v1beta1/proposal.go create mode 100644 x/gov/types/v1beta1/proposals_test.go create mode 100644 x/gov/types/v1beta1/tally.go create mode 100644 x/gov/types/v1beta1/vote.go diff --git a/client/grpc_query_test.go b/client/grpc_query_test.go index b63937ac2337..faff1ad5dc64 100644 --- a/client/grpc_query_test.go +++ b/client/grpc_query_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package client_test diff --git a/client/keys/add_ledger_test.go b/client/keys/add_ledger_test.go index 2b106615bcd4..6157e5cc15ae 100644 --- a/client/keys/add_ledger_test.go +++ b/client/keys/add_ledger_test.go @@ -1,4 +1,5 @@ -//+build ledger test_ledger_mock +//go:build ledger || test_ledger_mock +// +build ledger test_ledger_mock package keys diff --git a/client/query_test.go b/client/query_test.go index 14cc25ba9d97..7e22d3f34452 100644 --- a/client/query_test.go +++ b/client/query_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package client_test diff --git a/cosmovisor/process_test.go b/cosmovisor/process_test.go index f86ea1eb0b60..d340383841b9 100644 --- a/cosmovisor/process_test.go +++ b/cosmovisor/process_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package cosmovisor_test diff --git a/cosmovisor/upgrade_test.go b/cosmovisor/upgrade_test.go index e33ccad788ca..4eed4d5742b1 100644 --- a/cosmovisor/upgrade_test.go +++ b/cosmovisor/upgrade_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package cosmovisor_test diff --git a/crypto/keys/secp256k1/secp256k1_cgo.go b/crypto/keys/secp256k1/secp256k1_cgo.go index 42088483d3f9..1d104364617d 100644 --- a/crypto/keys/secp256k1/secp256k1_cgo.go +++ b/crypto/keys/secp256k1/secp256k1_cgo.go @@ -1,3 +1,4 @@ +//go:build libsecp256k1 // +build libsecp256k1 package secp256k1 diff --git a/crypto/keys/secp256k1/secp256k1_cgo_test.go b/crypto/keys/secp256k1/secp256k1_cgo_test.go index bfaa76caf9db..20ae3e12780c 100644 --- a/crypto/keys/secp256k1/secp256k1_cgo_test.go +++ b/crypto/keys/secp256k1/secp256k1_cgo_test.go @@ -1,3 +1,4 @@ +//go:build libsecp256k1 // +build libsecp256k1 package secp256k1 diff --git a/crypto/keys/secp256k1/secp256k1_nocgo.go b/crypto/keys/secp256k1/secp256k1_nocgo.go index 2d605447f421..26735b44229b 100644 --- a/crypto/keys/secp256k1/secp256k1_nocgo.go +++ b/crypto/keys/secp256k1/secp256k1_nocgo.go @@ -1,3 +1,4 @@ +//go:build !libsecp256k1 // +build !libsecp256k1 package secp256k1 diff --git a/crypto/keys/secp256k1/secp256k1_nocgo_test.go b/crypto/keys/secp256k1/secp256k1_nocgo_test.go index 4c2c856e13cc..878a06bfe6a9 100644 --- a/crypto/keys/secp256k1/secp256k1_nocgo_test.go +++ b/crypto/keys/secp256k1/secp256k1_nocgo_test.go @@ -1,3 +1,4 @@ +//go:build !libsecp256k1 // +build !libsecp256k1 package secp256k1 diff --git a/crypto/ledger/ledger_mock.go b/crypto/ledger/ledger_mock.go index 93068474710d..1574b07e22fe 100644 --- a/crypto/ledger/ledger_mock.go +++ b/crypto/ledger/ledger_mock.go @@ -1,3 +1,4 @@ +//go:build ledger && test_ledger_mock // +build ledger,test_ledger_mock package ledger diff --git a/crypto/ledger/ledger_notavail.go b/crypto/ledger/ledger_notavail.go index 66d16adcc023..578c33d4369c 100644 --- a/crypto/ledger/ledger_notavail.go +++ b/crypto/ledger/ledger_notavail.go @@ -1,4 +1,6 @@ +//go:build !cgo || !ledger // +build !cgo !ledger + // test_ledger_mock package ledger diff --git a/crypto/ledger/ledger_real.go b/crypto/ledger/ledger_real.go index 07f8a8e3ed6a..48c87aff7683 100644 --- a/crypto/ledger/ledger_real.go +++ b/crypto/ledger/ledger_real.go @@ -1,3 +1,4 @@ +//go:build cgo && ledger && !test_ledger_mock // +build cgo,ledger,!test_ledger_mock package ledger diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 32a44bb75b78..9f37ae4ddccd 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -356,22 +356,18 @@ - [cosmos/genutil/v1beta1/genesis.proto](#cosmos/genutil/v1beta1/genesis.proto) - [GenesisState](#cosmos.genutil.v1beta1.GenesisState) -- [cosmos/gov/v1beta1/gov.proto](#cosmos/gov/v1beta1/gov.proto) - - [Deposit](#cosmos.gov.v1beta1.Deposit) - - [DepositParams](#cosmos.gov.v1beta1.DepositParams) - - [Proposal](#cosmos.gov.v1beta1.Proposal) - - [TallyParams](#cosmos.gov.v1beta1.TallyParams) - - [TallyResult](#cosmos.gov.v1beta1.TallyResult) - - [TextProposal](#cosmos.gov.v1beta1.TextProposal) - - [Vote](#cosmos.gov.v1beta1.Vote) - - [VotingParams](#cosmos.gov.v1beta1.VotingParams) - - [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) - - - [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) - - [VoteOption](#cosmos.gov.v1beta1.VoteOption) - - [cosmos/gov/v1/gov.proto](#cosmos/gov/v1/gov.proto) + - [Deposit](#cosmos.gov.v1.Deposit) + - [DepositParams](#cosmos.gov.v1.DepositParams) - [Proposal](#cosmos.gov.v1.Proposal) + - [TallyParams](#cosmos.gov.v1.TallyParams) + - [TallyResult](#cosmos.gov.v1.TallyResult) + - [Vote](#cosmos.gov.v1.Vote) + - [VotingParams](#cosmos.gov.v1.VotingParams) + - [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) + + - [ProposalStatus](#cosmos.gov.v1.ProposalStatus) + - [VoteOption](#cosmos.gov.v1.VoteOption) - [cosmos/gov/v1/genesis.proto](#cosmos/gov/v1/genesis.proto) - [GenesisState](#cosmos.gov.v1.GenesisState) @@ -410,6 +406,20 @@ - [Msg](#cosmos.gov.v1.Msg) +- [cosmos/gov/v1beta1/gov.proto](#cosmos/gov/v1beta1/gov.proto) + - [Deposit](#cosmos.gov.v1beta1.Deposit) + - [DepositParams](#cosmos.gov.v1beta1.DepositParams) + - [Proposal](#cosmos.gov.v1beta1.Proposal) + - [TallyParams](#cosmos.gov.v1beta1.TallyParams) + - [TallyResult](#cosmos.gov.v1beta1.TallyResult) + - [TextProposal](#cosmos.gov.v1beta1.TextProposal) + - [Vote](#cosmos.gov.v1beta1.Vote) + - [VotingParams](#cosmos.gov.v1beta1.VotingParams) + - [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) + + - [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) + - [VoteOption](#cosmos.gov.v1beta1.VoteOption) + - [cosmos/gov/v1beta1/genesis.proto](#cosmos/gov/v1beta1/genesis.proto) - [GenesisState](#cosmos.gov.v1beta1.GenesisState) @@ -5295,14 +5305,14 @@ GenesisState defines the raw genesis transaction in JSON. - +

Top

-## cosmos/gov/v1beta1/gov.proto +## cosmos/gov/v1/gov.proto - + ### Deposit Deposit defines an amount deposited by an account address to an active @@ -5320,7 +5330,7 @@ proposal. - + ### DepositParams DepositParams defines the params for deposits on governance proposals. @@ -5336,7 +5346,7 @@ DepositParams defines the params for deposits on governance proposals. - + ### Proposal Proposal defines the core field members of a governance proposal. @@ -5345,9 +5355,9 @@ Proposal defines the core field members of a governance proposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | -| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | -| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `status` | [ProposalStatus](#cosmos.gov.v1.ProposalStatus) | | | +| `final_tally_result` | [TallyResult](#cosmos.gov.v1.TallyResult) | | | | `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | | `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | | `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | @@ -5359,7 +5369,7 @@ Proposal defines the core field members of a governance proposal. - + ### TallyParams TallyParams defines the params for tallying votes on governance proposals. @@ -5376,7 +5386,7 @@ TallyParams defines the params for tallying votes on governance proposals. - + ### TallyResult TallyResult defines a standard tally for a governance proposal. @@ -5394,24 +5404,7 @@ TallyResult defines a standard tally for a governance proposal. - - -### TextProposal -TextProposal defines a standard text proposal whose changes need to be -manually updated in case of approval. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | - - - - - - - + ### Vote Vote defines a vote on a governance proposal. @@ -5422,15 +5415,15 @@ A Vote consists of a proposal ID, the voter, and the vote option. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** 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. | -| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | +| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | **Deprecated.** 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. | +| `options` | [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) | repeated | | - + ### VotingParams VotingParams defines the params for voting on governance proposals. @@ -5445,7 +5438,7 @@ VotingParams defines the params for voting on governance proposals. - + ### WeightedVoteOption WeightedVoteOption defines a unit of vote for vote split. @@ -5453,7 +5446,7 @@ WeightedVoteOption defines a unit of vote for vote split. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | +| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | | | `weight` | [string](#string) | | | @@ -5463,7 +5456,7 @@ WeightedVoteOption defines a unit of vote for vote split. - + ### ProposalStatus ProposalStatus enumerates the valid statuses of a proposal. @@ -5479,7 +5472,7 @@ ProposalStatus enumerates the valid statuses of a proposal. - + ### VoteOption VoteOption enumerates the valid vote options for a given governance proposal. @@ -5501,45 +5494,6 @@ VoteOption enumerates the valid vote options for a given governance proposal. - -

Top

- -## cosmos/gov/v1/gov.proto - - - - - -### Proposal -Proposal defines the core field members of a governance proposal. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | -| `status` | [cosmos.gov.v1beta1.ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | -| `final_tally_result` | [cosmos.gov.v1beta1.TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | -| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - - - - - - - - - - - - - - -

Top

@@ -5556,12 +5510,12 @@ GenesisState defines the gov module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | -| `deposits` | [cosmos.gov.v1beta1.Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | -| `votes` | [cosmos.gov.v1beta1.Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | +| `deposits` | [Deposit](#cosmos.gov.v1.Deposit) | repeated | deposits defines all the deposits present at genesis. | +| `votes` | [Vote](#cosmos.gov.v1.Vote) | repeated | votes defines all the votes present at genesis. | | `proposals` | [Proposal](#cosmos.gov.v1.Proposal) | repeated | proposals defines all the proposals present at genesis. | -| `deposit_params` | [cosmos.gov.v1beta1.DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | -| `voting_params` | [cosmos.gov.v1beta1.VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | -| `tally_params` | [cosmos.gov.v1beta1.TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1.DepositParams) | | params defines all the paramaters of related to deposit. | +| `voting_params` | [VotingParams](#cosmos.gov.v1.VotingParams) | | params defines all the paramaters of related to voting. | +| `tally_params` | [TallyParams](#cosmos.gov.v1.TallyParams) | | params defines all the paramaters of related to tally. | @@ -5608,7 +5562,7 @@ QueryDepositResponse is the response type for the Query/Deposit RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposit` | [cosmos.gov.v1beta1.Deposit](#cosmos.gov.v1beta1.Deposit) | | deposit defines the requested deposit. | +| `deposit` | [Deposit](#cosmos.gov.v1.Deposit) | | deposit defines the requested deposit. | @@ -5639,7 +5593,7 @@ QueryDepositsResponse is the response type for the Query/Deposits RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposits` | [cosmos.gov.v1beta1.Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | | +| `deposits` | [Deposit](#cosmos.gov.v1.Deposit) | repeated | | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -5670,9 +5624,9 @@ QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `voting_params` | [cosmos.gov.v1beta1.VotingParams](#cosmos.gov.v1beta1.VotingParams) | | voting_params defines the parameters related to voting. | -| `deposit_params` | [cosmos.gov.v1beta1.DepositParams](#cosmos.gov.v1beta1.DepositParams) | | deposit_params defines the parameters related to deposit. | -| `tally_params` | [cosmos.gov.v1beta1.TallyParams](#cosmos.gov.v1beta1.TallyParams) | | tally_params defines the parameters related to tally. | +| `voting_params` | [VotingParams](#cosmos.gov.v1.VotingParams) | | voting_params defines the parameters related to voting. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1.DepositParams) | | deposit_params defines the parameters related to deposit. | +| `tally_params` | [TallyParams](#cosmos.gov.v1.TallyParams) | | tally_params defines the parameters related to tally. | @@ -5717,7 +5671,7 @@ QueryProposalsRequest is the request type for the Query/Proposals RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_status` | [cosmos.gov.v1beta1.ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | proposal_status defines the status of the proposals. | +| `proposal_status` | [ProposalStatus](#cosmos.gov.v1.ProposalStatus) | | proposal_status defines the status of the proposals. | | `voter` | [string](#string) | | voter defines the voter address for the proposals. | | `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | @@ -5767,7 +5721,7 @@ QueryTallyResultResponse is the response type for the Query/Tally RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `tally` | [cosmos.gov.v1beta1.TallyResult](#cosmos.gov.v1beta1.TallyResult) | | tally defines the requested tally. | +| `tally` | [TallyResult](#cosmos.gov.v1.TallyResult) | | tally defines the requested tally. | @@ -5798,7 +5752,7 @@ QueryVoteResponse is the response type for the Query/Vote RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `vote` | [cosmos.gov.v1beta1.Vote](#cosmos.gov.v1beta1.Vote) | | vote defined the queried vote. | +| `vote` | [Vote](#cosmos.gov.v1.Vote) | | vote defined the queried vote. | @@ -5829,7 +5783,7 @@ QueryVotesResponse is the response type for the Query/Votes RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `votes` | [cosmos.gov.v1beta1.Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defined the queried votes. | +| `votes` | [Vote](#cosmos.gov.v1.Vote) | repeated | votes defined the queried votes. | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -5967,7 +5921,7 @@ MsgVote defines a message to cast a vote. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [cosmos.gov.v1beta1.VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | +| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | | @@ -5994,7 +5948,7 @@ MsgVoteWeighted defines a message to cast a vote. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `options` | [cosmos.gov.v1beta1.WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | +| `options` | [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) | repeated | | @@ -6034,6 +5988,212 @@ Msg defines the gov Msg service. + +

Top

+ +## cosmos/gov/v1beta1/gov.proto + + + + + +### Deposit +Deposit defines an amount deposited by an account address to an active +proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `depositor` | [string](#string) | | | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | + + + + + + + + +### DepositParams +DepositParams defines the params for deposits on governance proposals. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `min_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum deposit for a proposal to enter voting period. | +| `max_deposit_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. | + + + + + + + + +### Proposal +Proposal defines the core field members of a governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | +| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | +| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | + + + + + + + + +### TallyParams +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. | + + + + + + + + +### TallyResult +TallyResult defines a standard tally for a governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `yes` | [string](#string) | | | +| `abstain` | [string](#string) | | | +| `no` | [string](#string) | | | +| `no_with_veto` | [string](#string) | | | + + + + + + + + +### TextProposal +TextProposal defines a standard text proposal whose changes need to be +manually updated in case of approval. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | + + + + + + + + +### Vote +Vote defines a vote on a governance proposal. +A Vote consists of a proposal ID, the voter, and the vote option. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `voter` | [string](#string) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** 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. | +| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | + + + + + + + + +### VotingParams +VotingParams defines the params for voting on governance proposals. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `voting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Length of the voting period. | + + + + + + + + +### WeightedVoteOption +WeightedVoteOption defines a unit of vote for vote split. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | +| `weight` | [string](#string) | | | + + + + + + + + + + +### ProposalStatus +ProposalStatus enumerates the valid statuses of a proposal. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| PROPOSAL_STATUS_UNSPECIFIED | 0 | PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. | +| PROPOSAL_STATUS_DEPOSIT_PERIOD | 1 | PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period. | +| PROPOSAL_STATUS_VOTING_PERIOD | 2 | PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period. | +| PROPOSAL_STATUS_PASSED | 3 | PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed. | +| PROPOSAL_STATUS_REJECTED | 4 | PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected. | +| PROPOSAL_STATUS_FAILED | 5 | PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. | + + + + + +### VoteOption +VoteOption enumerates the valid vote options for a given governance proposal. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| VOTE_OPTION_UNSPECIFIED | 0 | VOTE_OPTION_UNSPECIFIED defines a no-op vote option. | +| VOTE_OPTION_YES | 1 | VOTE_OPTION_YES defines a yes vote option. | +| VOTE_OPTION_ABSTAIN | 2 | VOTE_OPTION_ABSTAIN defines an abstain vote option. | +| VOTE_OPTION_NO | 3 | VOTE_OPTION_NO defines a no vote option. | +| VOTE_OPTION_NO_WITH_VETO | 4 | VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. | + + + + + + + + + +

Top

diff --git a/go.mod b/go.mod index 042c0e2f9cec..bf4158d87107 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,6 @@ require ( google.golang.org/grpc v1.41.0 google.golang.org/protobuf v1.27.1 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect - gopkg.in/yaml.v2 v2.4.0 sigs.k8s.io/yaml v1.3.0 ) @@ -118,6 +117,7 @@ require ( golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect golang.org/x/text v0.3.6 // indirect gopkg.in/ini.v1 v1.63.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect nhooyr.io/websocket v1.8.6 // indirect ) diff --git a/proto/cosmos/gov/v1/genesis.proto b/proto/cosmos/gov/v1/genesis.proto index bb14d3f018cc..44f4bffc1a03 100644 --- a/proto/cosmos/gov/v1/genesis.proto +++ b/proto/cosmos/gov/v1/genesis.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package cosmos.gov.v1; import "gogoproto/gogo.proto"; -import "cosmos/gov/v1beta1/gov.proto"; import "cosmos/gov/v1/gov.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; @@ -13,19 +12,15 @@ message GenesisState { // starting_proposal_id is the ID of the starting proposal. uint64 starting_proposal_id = 1 [(gogoproto.moretags) = "yaml:\"starting_proposal_id\""]; // deposits defines all the deposits present at genesis. - repeated cosmos.gov.v1beta1.Deposit deposits = 2 - [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; + repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; // votes defines all the votes present at genesis. - repeated cosmos.gov.v1beta1.Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false]; + repeated Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false]; // proposals defines all the proposals present at genesis. repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false]; // params defines all the paramaters of related to deposit. - cosmos.gov.v1beta1.DepositParams deposit_params = 5 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_params\""]; + DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_params\""]; // params defines all the paramaters of related to voting. - cosmos.gov.v1beta1.VotingParams voting_params = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_params\""]; + VotingParams voting_params = 6 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_params\""]; // params defines all the paramaters of related to tally. - cosmos.gov.v1beta1.TallyParams tally_params = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"tally_params\""]; + TallyParams tally_params = 7 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"tally_params\""]; } diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 32561e651710..a28fb1778a38 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -5,21 +5,60 @@ import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/any.proto"; -import "cosmos/gov/v1beta1/gov.proto"; +import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = false; option (gogoproto.goproto_getters_all) = false; +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; +} + +// WeightedVoteOption defines a unit of vote for vote split. +message WeightedVoteOption { + VoteOption option = 1; + string weight = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + uint64 proposal_id = 1; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + // Proposal defines the core field members of a governance proposal. message Proposal { option (gogoproto.equal) = true; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; - repeated google.protobuf.Any messages = 2; - cosmos.gov.v1beta1.ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; - cosmos.gov.v1beta1.TallyResult final_tally_result = 4 + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; + repeated google.protobuf.Any messages = 2; + ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; + TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; @@ -35,3 +74,118 @@ message Proposal { google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""]; } + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + option (gogoproto.equal) = true; + + string yes = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string abstain = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string no = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string no_with_veto = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + uint64 proposal_id = 1; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // 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. + VoteOption option = 3 [deprecated = true]; + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; +} + +// 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 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.jsontag) = "min_deposit,omitempty" + ]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "max_deposit_period,omitempty" + ]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + // Length of the voting period. + google.protobuf.Duration voting_period = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "voting_period,omitempty"]; +} + +// TallyParams defines the params for tallying votes on governance proposals. +message TallyParams { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + bytes quorum = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "quorum,omitempty" + ]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + bytes threshold = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "threshold,omitempty" + ]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + bytes veto_threshold = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "veto_threshold,omitempty" + ]; +} diff --git a/proto/cosmos/gov/v1/query.proto b/proto/cosmos/gov/v1/query.proto index c64f06fb6f03..050cb6b90192 100644 --- a/proto/cosmos/gov/v1/query.proto +++ b/proto/cosmos/gov/v1/query.proto @@ -5,7 +5,6 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/gov/v1/gov.proto"; -import "cosmos/gov/v1beta1/gov.proto"; import "cosmos_proto/cosmos.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; @@ -70,7 +69,7 @@ message QueryProposalsRequest { option (gogoproto.goproto_getters) = false; // proposal_status defines the status of the proposals. - cosmos.gov.v1beta1.ProposalStatus proposal_status = 1; + ProposalStatus proposal_status = 1; // voter defines the voter address for the proposals. string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -106,7 +105,7 @@ message QueryVoteRequest { // QueryVoteResponse is the response type for the Query/Vote RPC method. message QueryVoteResponse { // vote defined the queried vote. - cosmos.gov.v1beta1.Vote vote = 1 [(gogoproto.nullable) = false]; + Vote vote = 1 [(gogoproto.nullable) = false]; } // QueryVotesRequest is the request type for the Query/Votes RPC method. @@ -121,7 +120,7 @@ message QueryVotesRequest { // QueryVotesResponse is the response type for the Query/Votes RPC method. message QueryVotesResponse { // votes defined the queried votes. - repeated cosmos.gov.v1beta1.Vote votes = 1 [(gogoproto.nullable) = false]; + repeated Vote votes = 1 [(gogoproto.nullable) = false]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -137,11 +136,11 @@ message QueryParamsRequest { // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // voting_params defines the parameters related to voting. - cosmos.gov.v1beta1.VotingParams voting_params = 1 [(gogoproto.nullable) = false]; + VotingParams voting_params = 1 [(gogoproto.nullable) = false]; // deposit_params defines the parameters related to deposit. - cosmos.gov.v1beta1.DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; + DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; // tally_params defines the parameters related to tally. - cosmos.gov.v1beta1.TallyParams tally_params = 3 [(gogoproto.nullable) = false]; + TallyParams tally_params = 3 [(gogoproto.nullable) = false]; } // QueryDepositRequest is the request type for the Query/Deposit RPC method. @@ -159,7 +158,7 @@ message QueryDepositRequest { // QueryDepositResponse is the response type for the Query/Deposit RPC method. message QueryDepositResponse { // deposit defines the requested deposit. - cosmos.gov.v1beta1.Deposit deposit = 1 [(gogoproto.nullable) = false]; + Deposit deposit = 1 [(gogoproto.nullable) = false]; } // QueryDepositsRequest is the request type for the Query/Deposits RPC method. @@ -173,7 +172,7 @@ message QueryDepositsRequest { // QueryDepositsResponse is the response type for the Query/Deposits RPC method. message QueryDepositsResponse { - repeated cosmos.gov.v1beta1.Deposit deposits = 1 [(gogoproto.nullable) = false]; + repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -188,5 +187,5 @@ message QueryTallyResultRequest { // QueryTallyResultResponse is the response type for the Query/Tally RPC method. message QueryTallyResultResponse { // tally defines the requested tally. - cosmos.gov.v1beta1.TallyResult tally = 1 [(gogoproto.nullable) = false]; + TallyResult tally = 1 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 12bb422c4d9e..df3f18f70b34 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -3,7 +3,6 @@ package cosmos.gov.v1; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/gov/v1/gov.proto"; -import "cosmos/gov/v1beta1/gov.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -55,9 +54,9 @@ message MsgVote { option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - cosmos.gov.v1beta1.VoteOption option = 3; + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + VoteOption option = 3; } // MsgVoteResponse defines the Msg/Vote response type. @@ -70,9 +69,9 @@ message MsgVoteWeighted { option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - repeated cosmos.gov.v1beta1.WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; } // MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. diff --git a/server/grpc/server_test.go b/server/grpc/server_test.go index 8ea293a9169c..8e34d0ff71e5 100644 --- a/server/grpc/server_test.go +++ b/server/grpc/server_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package grpc_test diff --git a/simapp/app.go b/simapp/app.go index ebddd0b62046..0102e10e72ad 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -72,7 +72,6 @@ import ( paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -274,15 +273,9 @@ func NewSimApp( app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.msgSvcRouter) - // register the proposal types - govRouter := govtypes.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, govRouter, + &stakingKeeper, app.msgSvcRouter, ) app.GovKeeper = *govKeeper.SetHooks( diff --git a/simapp/params/amino.go b/simapp/params/amino.go index cdf86d0ea2e0..d603987dd5f5 100644 --- a/simapp/params/amino.go +++ b/simapp/params/amino.go @@ -1,3 +1,4 @@ +//go:build test_amino // +build test_amino package params diff --git a/simapp/utils.go b/simapp/utils.go index a1614198b3dd..1fd0ca5645e3 100644 --- a/simapp/utils.go +++ b/simapp/utils.go @@ -68,7 +68,6 @@ func SimulationOperations(app App, cdc codec.JSONCodec, config simtypes.Config) } simState.ParamChanges = app.SimulationManager().GenerateParamChanges(config.Seed) - simState.Contents = app.SimulationManager().GetProposalContents(simState) return app.SimulationManager().WeightedOperations(simState) } diff --git a/testutil/network/network_test.go b/testutil/network/network_test.go index e13c8c454d28..7dbf18351822 100644 --- a/testutil/network/network_test.go +++ b/testutil/network/network_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package network_test diff --git a/types/module/module_test.go b/types/module/module_test.go index 4dbb4a73c5b6..0cc0dd9e24d8 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -5,17 +5,17 @@ import ( "errors" "testing" - "github.com/gorilla/mux" "github.com/golang/mock/gomock" + "github.com/gorilla/mux" "github.com/spf13/cobra" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/tests/mocks" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" diff --git a/types/module/simulation.go b/types/module/simulation.go index 370491b44bd3..c5a4ad8f08a5 100644 --- a/types/module/simulation.go +++ b/types/module/simulation.go @@ -85,13 +85,13 @@ func (sm *SimulationManager) WeightedOperations(simState SimulationState) []simu // GenesisState generator function type SimulationState struct { AppParams simulation.AppParams - Cdc codec.JSONCodec // application codec - Rand *rand.Rand // random number - GenState map[string]json.RawMessage // genesis state - Accounts []simulation.Account // simulation accounts - InitialStake int64 // initial coins per account - NumBonded int64 // number of initially bonded accounts - GenTimestamp time.Time // genesis timestamp - UnbondTime time.Duration // staking unbond time stored to use it as the slashing maximum evidence duration - ParamChanges []simulation.ParamChange // simulated parameter changes from modules + Cdc codec.JSONCodec // application codec + Rand *rand.Rand // random number + GenState map[string]json.RawMessage // genesis state + Accounts []simulation.Account // simulation accounts + InitialStake int64 // initial coins per account + NumBonded int64 // number of initially bonded accounts + GenTimestamp time.Time // genesis timestamp + UnbondTime time.Duration // staking unbond time stored to use it as the slashing maximum evidence duration + ParamChanges []simulation.ParamChange // simulated parameter changes from modules } diff --git a/x/auth/client/testutil/cli_test.go b/x/auth/client/testutil/cli_test.go index 0a7a5cc25871..f23e88847c30 100644 --- a/x/auth/client/testutil/cli_test.go +++ b/x/auth/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/auth/migrations/legacytx/stdsign.go b/x/auth/migrations/legacytx/stdsign.go index d22e3786d9f0..70ec7841c52a 100644 --- a/x/auth/migrations/legacytx/stdsign.go +++ b/x/auth/migrations/legacytx/stdsign.go @@ -106,7 +106,6 @@ func (ss StdSignature) MarshalYAML() (interface{}, error) { pk = ss.PubKey.String() } - bz, err := yaml.Marshal(struct { PubKey string `json:"pub_key"` Signature string `json:"signature"` diff --git a/x/auth/vesting/client/testutil/cli_test.go b/x/auth/vesting/client/testutil/cli_test.go index dd36a6af2d3e..1035ca750264 100644 --- a/x/auth/vesting/client/testutil/cli_test.go +++ b/x/auth/vesting/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/authz/client/testutil/cli_test.go b/x/authz/client/testutil/cli_test.go index 3c083e694726..5b3ef61c5a45 100644 --- a/x/authz/client/testutil/cli_test.go +++ b/x/authz/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/bank/client/testutil/cli_test.go b/x/bank/client/testutil/cli_test.go index dd36a6af2d3e..1035ca750264 100644 --- a/x/bank/client/testutil/cli_test.go +++ b/x/bank/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/crisis/client/testsuite/cli_test.go b/x/crisis/client/testsuite/cli_test.go index 3c083e694726..5b3ef61c5a45 100644 --- a/x/crisis/client/testsuite/cli_test.go +++ b/x/crisis/client/testsuite/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/distribution/client/testutil/cli_test.go b/x/distribution/client/testutil/cli_test.go index 742c1eb68086..389bbbf78a05 100644 --- a/x/distribution/client/testutil/cli_test.go +++ b/x/distribution/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/distribution/handler.go b/x/distribution/handler.go index f356aee32845..a8aa8eb3e58f 100644 --- a/x/distribution/handler.go +++ b/x/distribution/handler.go @@ -5,7 +5,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/distribution/keeper" "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func NewCommunityPoolSpendProposalHandler(k keeper.Keeper) govtypes.Handler { diff --git a/x/distribution/types/codec.go b/x/distribution/types/codec.go index 73aca45060e6..0e1d1df42be3 100644 --- a/x/distribution/types/codec.go +++ b/x/distribution/types/codec.go @@ -6,7 +6,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // RegisterLegacyAminoCodec registers the necessary x/distribution interfaces and concrete types diff --git a/x/distribution/types/proposal.go b/x/distribution/types/proposal.go index c5635060ecf0..e6474ad2d93d 100644 --- a/x/distribution/types/proposal.go +++ b/x/distribution/types/proposal.go @@ -5,7 +5,7 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) const ( @@ -16,10 +16,6 @@ const ( // Assert CommunityPoolSpendProposal implements govtypes.Content at compile-time var _ govtypes.Content = &CommunityPoolSpendProposal{} -func init() { - govtypes.RegisterProposalTypeCodec(&CommunityPoolSpendProposal{}, "cosmos-sdk/CommunityPoolSpendProposal") -} - // NewCommunityPoolSpendProposal creates a new community pool spned proposal. //nolint:interfacer func NewCommunityPoolSpendProposal(title, description string, recipient sdk.AccAddress, amount sdk.Coins) *CommunityPoolSpendProposal { diff --git a/x/evidence/client/testutil/cli_test.go b/x/evidence/client/testutil/cli_test.go index dd36a6af2d3e..1035ca750264 100644 --- a/x/evidence/client/testutil/cli_test.go +++ b/x/evidence/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/feegrant/client/testutil/cli_test.go b/x/feegrant/client/testutil/cli_test.go index bdbfb78d0bd1..9814e9573b3f 100644 --- a/x/feegrant/client/testutil/cli_test.go +++ b/x/feegrant/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/genutil/client/testutil/cli_test.go b/x/genutil/client/testutil/cli_test.go index dd36a6af2d3e..1035ca750264 100644 --- a/x/genutil/client/testutil/cli_test.go +++ b/x/genutil/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/genutil/migrations/v040/migrate.go b/x/genutil/migrations/v040/migrate.go index 2e5b52827bac..3e032fe6c981 100644 --- a/x/genutil/migrations/v040/migrate.go +++ b/x/genutil/migrations/v040/migrate.go @@ -18,7 +18,7 @@ import ( v039genutil "github.com/cosmos/cosmos-sdk/x/genutil/migrations/v039" "github.com/cosmos/cosmos-sdk/x/genutil/types" v036gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v036" - v045gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v045" + v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" v039mint "github.com/cosmos/cosmos-sdk/x/mint/migrations/v039" v040mint "github.com/cosmos/cosmos-sdk/x/mint/migrations/v040" v036params "github.com/cosmos/cosmos-sdk/x/params/migrations/v036" @@ -137,7 +137,7 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { // Migrate relative source genesis application state and marshal it into // the respective key. - appState[v036gov.ModuleName] = v040Codec.MustMarshalJSON(v045gov.Migrate(govGenState)) + appState[v036gov.ModuleName] = v040Codec.MustMarshalJSON(v040gov.Migrate(govGenState)) } // Migrate x/mint. diff --git a/x/genutil/migrations/v043/migrate.go b/x/genutil/migrations/v043/migrate.go index 20669b826852..f583479dfb71 100644 --- a/x/genutil/migrations/v043/migrate.go +++ b/x/genutil/migrations/v043/migrate.go @@ -6,25 +6,25 @@ import ( v043bank "github.com/cosmos/cosmos-sdk/x/bank/migrations/v043" bank "github.com/cosmos/cosmos-sdk/x/bank/types" "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" + oldGov "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // Migrate migrates exported state from v0.40 to a v0.43 genesis state. func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { // Migrate x/gov. - if appState[v040gov.ModuleName] != nil { + if appState[gov.ModuleName] != nil { // unmarshal relative source genesis application state - var oldGovState gov.GenesisState - clientCtx.Codec.MustUnmarshalJSON(appState[v040gov.ModuleName], &oldGovState) + var oldGovState oldGov.GenesisState + clientCtx.Codec.MustUnmarshalJSON(appState[gov.ModuleName], &oldGovState) // delete deprecated x/gov genesis state - delete(appState, v040gov.ModuleName) + delete(appState, gov.ModuleName) // Migrate relative source genesis application state and marshal it into // the respective key. - appState[v043gov.ModuleName] = clientCtx.Codec.MustMarshalJSON(v043gov.MigrateJSON(&oldGovState)) + appState[gov.ModuleName] = clientCtx.Codec.MustMarshalJSON(v043gov.MigrateJSON(&oldGovState)) } if appState[v040bank.ModuleName] != nil { diff --git a/x/genutil/migrations/v045/migrate.go b/x/genutil/migrations/v045/migrate.go index 51615057275c..7334a1dfb217 100644 --- a/x/genutil/migrations/v045/migrate.go +++ b/x/genutil/migrations/v045/migrate.go @@ -4,22 +4,25 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/x/genutil/types" - v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" v045gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v045" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { // Migrate x/gov proposals - if appState[v043gov.ModuleName] != nil { + if appState[v1.ModuleName] != nil { // unmarshal relative source genesis application state - var oldGovState v043gov.GenesisState - clientCtx.Codec.MustUnmarshalJSON(appState[v043gov.ModuleName], &oldGovState) + var oldGovState v1beta1.GenesisState + clientCtx.Codec.MustUnmarshalJSON(appState[v1.ModuleName], &oldGovState) // delete deprecated x/gov genesis state - delete(appState, v043gov.ModuleName) + delete(appState, types.ModuleName) // Migrate relative source genesis application state and marshal it into // the respective key. - appState[v043gov.ModuleName] = clientCtx.Codec.MustMarshalJSON(v045gov.Migrate(&oldGovState)) + appState[v1.ModuleName] = clientCtx.Codec.MustMarshalJSON(v045gov.Migrate(oldGovState)) } -} \ No newline at end of file + + return appState +} diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index a5df659a3826..cbf17f273175 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -294,7 +294,7 @@ func TestProposalPassedEndblocker(t *testing.T) { initialModuleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) messages := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} - proposal, err := app.GovKeeper.SubmitProposal(ctx, messages) + proposal, err := app.GovKeeper.SubmitProposal(ctx, messages) require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))} diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index ea71d35fd8f1..056370f15d4f 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -19,10 +19,10 @@ import ( // Proposal flags const ( - FlagDeposit = "deposit" - flagVoter = "voter" - flagDepositor = "depositor" - flagStatus = "status" + FlagDeposit = "deposit" + flagVoter = "voter" + flagDepositor = "depositor" + flagStatus = "status" ) type proposal struct { diff --git a/x/gov/migrations/v040/migrate.go b/x/gov/migrations/v040/migrate.go index 5d0d7dc61c8e..24e6368ab249 100644 --- a/x/gov/migrations/v040/migrate.go +++ b/x/gov/migrations/v040/migrate.go @@ -10,55 +10,55 @@ import ( v040distr "github.com/cosmos/cosmos-sdk/x/distribution/types" v034gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v034" v036gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v036" - v040gov "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" v036params "github.com/cosmos/cosmos-sdk/x/params/migrations/v036" v040params "github.com/cosmos/cosmos-sdk/x/params/types/proposal" v038upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/migrations/v038" v040upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -func migrateVoteOption(oldVoteOption v034gov.VoteOption) v040gov.VoteOption { +func migrateVoteOption(oldVoteOption v034gov.VoteOption) v1beta1.VoteOption { switch oldVoteOption { case v034gov.OptionEmpty: - return v040gov.OptionEmpty + return v1beta1.OptionEmpty case v034gov.OptionYes: - return v040gov.OptionYes + return v1beta1.OptionYes case v034gov.OptionAbstain: - return v040gov.OptionAbstain + return v1beta1.OptionAbstain case v034gov.OptionNo: - return v040gov.OptionNo + return v1beta1.OptionNo case v034gov.OptionNoWithVeto: - return v040gov.OptionNoWithVeto + return v1beta1.OptionNoWithVeto default: panic(fmt.Errorf("'%s' is not a valid vote option", oldVoteOption)) } } -func migrateProposalStatus(oldProposalStatus v034gov.ProposalStatus) v040gov.ProposalStatus { +func migrateProposalStatus(oldProposalStatus v034gov.ProposalStatus) v1beta1.ProposalStatus { switch oldProposalStatus { case v034gov.StatusNil: - return v040gov.StatusNil + return v1beta1.StatusNil case v034gov.StatusDepositPeriod: - return v040gov.StatusDepositPeriod + return v1beta1.StatusDepositPeriod case v034gov.StatusVotingPeriod: - return v040gov.StatusVotingPeriod + return v1beta1.StatusVotingPeriod case v034gov.StatusPassed: - return v040gov.StatusPassed + return v1beta1.StatusPassed case v034gov.StatusRejected: - return v040gov.StatusRejected + return v1beta1.StatusRejected case v034gov.StatusFailed: - return v040gov.StatusFailed + return v1beta1.StatusFailed default: panic(fmt.Errorf("'%s' is not a valid proposal status", oldProposalStatus)) @@ -71,7 +71,7 @@ func migrateContent(oldContent v036gov.Content) *codectypes.Any { switch oldContent := oldContent.(type) { case v036gov.TextProposal: { - protoProposal = &TextProposal{ + protoProposal = &v1beta1.TextProposal{ Title: oldContent.Title, Description: oldContent.Description, } @@ -148,32 +148,32 @@ func migrateContent(oldContent v036gov.Content) *codectypes.Any { // - Migrate proposal content to Any. // - Convert addresses from bytes to bech32 strings. // - Re-encode in v0.40 GenesisState. -func Migrate(oldGovState v036gov.GenesisState) *v040gov.GenesisState { - newDeposits := make([]v040gov.Deposit, len(oldGovState.Deposits)) +func Migrate(oldGovState v036gov.GenesisState) *v1beta1.GenesisState { + newDeposits := make([]v1beta1.Deposit, len(oldGovState.Deposits)) for i, oldDeposit := range oldGovState.Deposits { - newDeposits[i] = v040gov.Deposit{ + newDeposits[i] = v1beta1.Deposit{ ProposalId: oldDeposit.ProposalID, Depositor: oldDeposit.Depositor.String(), Amount: oldDeposit.Amount, } } - newVotes := make([]v040gov.Vote, len(oldGovState.Votes)) + newVotes := make([]v1beta1.Vote, len(oldGovState.Votes)) for i, oldVote := range oldGovState.Votes { - newVotes[i] = v040gov.Vote{ + newVotes[i] = v1beta1.Vote{ ProposalId: oldVote.ProposalID, Voter: oldVote.Voter.String(), Option: migrateVoteOption(oldVote.Option), } } - newProposals := make([]v040gov.Proposal, len(oldGovState.Proposals)) + newProposals := make([]v1beta1.Proposal, len(oldGovState.Proposals)) for i, oldProposal := range oldGovState.Proposals { - newProposals[i] = v040gov.Proposal{ + newProposals[i] = v1beta1.Proposal{ ProposalId: oldProposal.ProposalID, Content: migrateContent(oldProposal.Content), Status: migrateProposalStatus(oldProposal.Status), - FinalTallyResult: v040gov.TallyResult{ + FinalTallyResult: v1beta1.TallyResult{ Yes: oldProposal.FinalTallyResult.Yes, Abstain: oldProposal.FinalTallyResult.Abstain, No: oldProposal.FinalTallyResult.No, @@ -187,19 +187,19 @@ func Migrate(oldGovState v036gov.GenesisState) *v040gov.GenesisState { } } - return &v040gov.GenesisState{ + return &v1beta1.GenesisState{ StartingProposalId: oldGovState.StartingProposalID, Deposits: newDeposits, Votes: newVotes, Proposals: newProposals, - DepositParams: v040gov.DepositParams{ + DepositParams: v1beta1.DepositParams{ MinDeposit: oldGovState.DepositParams.MinDeposit, MaxDepositPeriod: oldGovState.DepositParams.MaxDepositPeriod, }, - VotingParams: v040gov.VotingParams{ + VotingParams: v1beta1.VotingParams{ VotingPeriod: oldGovState.VotingParams.VotingPeriod, }, - TallyParams: v040gov.TallyParams{ + TallyParams: v1beta1.TallyParams{ Quorum: oldGovState.TallyParams.Quorum, Threshold: oldGovState.TallyParams.Threshold, VetoThreshold: oldGovState.TallyParams.Veto, diff --git a/x/gov/migrations/v040/types.go b/x/gov/migrations/v040/types.go deleted file mode 100644 index 030b81aedbfe..000000000000 --- a/x/gov/migrations/v040/types.go +++ /dev/null @@ -1,112 +0,0 @@ -package v040 - -import ( - "strings" - "time" - - yaml "gopkg.in/yaml.v2" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -type ( - Content interface { - GetTitle() string - GetDescription() string - ProposalRoute() string - ProposalType() string - ValidateBasic() error - String() string - } - - Proposal struct { - ProposalId uint64 - Content Content - Status types.ProposalStatus - FinalTallyResult types.TallyResult - SubmitTime time.Time - DepositEndTime time.Time - TotalDeposit sdk.Coins - VotingStartTime time.Time - VotingEndTime time.Time - } - - Proposals []Proposal - - GenesisState struct { - StartingProposalId uint64 - Deposits types.Deposits - Votes types.Votes - Proposals Proposals - DepositParams types.DepositParams - VotingParams types.VotingParams - TallyParams types.TallyParams - } - - TextProposal struct { - Title string - Description string - } -) - -// Proposal types -const ( - ProposalTypeText string = "Text" - - // Constants pertaining to a Content object - MaxDescriptionLength int = 5000 - MaxTitleLength int = 140 -) - -// Implements Content Interface -var _ Content = &TextProposal{} - -// NewTextProposal creates a text proposal Content -func NewTextProposal(title, description string) Content { - return &TextProposal{title, description} -} - -// GetTitle returns the proposal title -func (tp *TextProposal) GetTitle() string { return tp.Title } - -// GetDescription returns the proposal description -func (tp *TextProposal) GetDescription() string { return tp.Description } - -// ProposalRoute returns the proposal router key -func (tp *TextProposal) ProposalRoute() string { return RouterKey } - -// ProposalType is "Text" -func (tp *TextProposal) ProposalType() string { return ProposalTypeText } - -// ValidateBasic validates the content's title and description of the proposal -func (tp *TextProposal) ValidateBasic() error { return ValidateAbstract(tp) } - -// String implements Stringer interface -func (tp TextProposal) String() string { - out, _ := yaml.Marshal(tp) - return string(out) -} - -// ValidateAbstract validates a proposal's abstract contents returning an error -// if invalid. -func ValidateAbstract(c Content) error { - title := c.GetTitle() - if len(strings.TrimSpace(title)) == 0 { - return sdkerrors.Wrap(types.ErrInvalidProposalContent, "proposal title cannot be blank") - } - if len(title) > MaxTitleLength { - return sdkerrors.Wrapf(types.ErrInvalidProposalContent, "proposal title is longer than max length of %d", MaxTitleLength) - } - - description := c.GetDescription() - if len(description) == 0 { - return sdkerrors.Wrap(types.ErrInvalidProposalContent, "proposal description cannot be blank") - } - if len(description) > MaxDescriptionLength { - return sdkerrors.Wrapf(types.ErrInvalidProposalContent, "proposal description is longer than max length of %d", MaxDescriptionLength) - } - - return nil -} diff --git a/x/gov/migrations/v043/json.go b/x/gov/migrations/v043/json.go index 8f3d47939b0b..f5eca24d9a39 100644 --- a/x/gov/migrations/v043/json.go +++ b/x/gov/migrations/v043/json.go @@ -1,13 +1,12 @@ package v043 import ( - "github.com/cosmos/cosmos-sdk/x/gov/types" - v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" + "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) } @@ -19,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 *v040gov.GenesisState) *GenesisState { - return &v040gov.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 f6f911996d82..abe85162429e 100644 --- a/x/gov/migrations/v043/json_test.go +++ b/x/gov/migrations/v043/json_test.go @@ -10,9 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - 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 TestMigrateJSON(t *testing.T) { @@ -24,13 +23,13 @@ func TestMigrateJSON(t *testing.T) { voter, err := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh") require.NoError(t, err) - govGenState := &v040gov.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/types.go b/x/gov/migrations/v043/types.go deleted file mode 100644 index 2e9d670949d2..000000000000 --- a/x/gov/migrations/v043/types.go +++ /dev/null @@ -1,16 +0,0 @@ -package v043 - -import ( - v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" -) - -const ( - // ModuleName is the name of the module - ModuleName = "gov" -) - -type ( - GenesisState = v040gov.GenesisState - - Proposals = v040gov.Proposals -) diff --git a/x/gov/migrations/v045/migrate.go b/x/gov/migrations/v045/migrate.go index 70ede8fa91e4..d4b4c6ba2e19 100644 --- a/x/gov/migrations/v045/migrate.go +++ b/x/gov/migrations/v045/migrate.go @@ -5,34 +5,39 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdktx "github.com/cosmos/cosmos-sdk/types/tx" - v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" - v045gov "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -func Migrate(oldGovState v043gov.GenesisState) *v045gov.GenesisState { - return &v045gov.GenesisState{ - Deposits: oldGovState.Deposits, - Votes: oldGovState.Votes, +func Migrate(oldGovState v1beta1.GenesisState) *types.GenesisState { + return &types.GenesisState{ + Deposits: migrateDeposits(oldGovState.Deposits), + Votes: migrateVotes(oldGovState.Votes), Proposals: migrateProposals(oldGovState.Proposals), - DepositParams: oldGovState.DepositParams, - VotingParams: oldGovState.VotingParams, - TallyParams: oldGovState.TallyParams, + DepositParams: types.DepositParams(oldGovState.DepositParams), + VotingParams: types.VotingParams(oldGovState.VotingParams), + TallyParams: types.TallyParams(oldGovState.TallyParams), } } -func migrateProposals(oldProposals v043gov.Proposals) v045gov.Proposals { - newProposals := make(v045gov.Proposals, len(oldProposals)) +func migrateProposals(oldProposals v1beta1.Proposals) types.Proposals { + newProposals := make(types.Proposals, len(oldProposals)) for idx, proposal := range oldProposals { - msgs, err := sdktx.SetMsgs(migrateContent(proposal.Content)) + content := proposal.GetContent() + if content == nil { + continue + } + + msgs, err := sdktx.SetMsgs(migrateContent(content)) if err != nil { panic(fmt.Sprintf("failed to marshal proposal msgs: %v", err)) } - newProposals[idx] = v045gov.Proposal{ + newProposals[idx] = types.Proposal{ ProposalId: proposal.ProposalId, Messages: msgs, - Status: proposal.Status, - FinalTallyResult: proposal.FinalTallyResult, + Status: types.ProposalStatus(proposal.Status), + FinalTallyResult: types.TallyResult(proposal.FinalTallyResult), SubmitTime: proposal.SubmitTime, DepositEndTime: proposal.DepositEndTime, VotingStartTime: proposal.VotingStartTime, @@ -42,13 +47,48 @@ func migrateProposals(oldProposals v043gov.Proposals) v045gov.Proposals { return newProposals } -func migrateContent(content v040gov.Content) []sdk.Msg { +func migrateContent(content v1beta1.Content) []sdk.Msg { switch content.ProposalType() { - case v040gov.ProposalTypeText: - return []sdk.Msg{v045gov.NewMsgSignal(content.GetTitle(), content.GetDescription())} + case v1beta1.ProposalTypeText: + return []sdk.Msg{types.NewMsgSignal(content.GetTitle(), content.GetDescription())} // TODO: enter the other proposal content types default: // NOTE: If a network is using a unique content type that isn't recognisable then it will not be possible to migrate it to the new proposal type. The best thing to do in this situation, rather than silently ignore it, is to convert it to a signal proposal - return []sdk.Msg{v045gov.NewMsgSignal(content.GetTitle(), content.GetDescription())} + return []sdk.Msg{types.NewMsgSignal(content.GetTitle(), content.GetDescription())} + } +} + +func migrateVotes(oldVotes v1beta1.Votes) types.Votes { + votes := make(types.Votes, len(oldVotes)) + for idx, oldVote := range oldVotes { + votes[idx] = migrateVote(oldVote) + } + return votes +} + +func migrateDeposits(oldDeposits v1beta1.Deposits) types.Deposits { + deposits := make(types.Deposits, len(oldDeposits)) + for idx, oldDeposit := range oldDeposits { + deposits[idx] = types.Deposit(oldDeposit) + } + return deposits +} + +func migrateVote(oldVote v1beta1.Vote) types.Vote { + return types.Vote{ + ProposalId: oldVote.ProposalId, + Voter: oldVote.Voter, + Options: migrateWeightedVoteOptions(oldVote.Options), + } +} + +func migrateWeightedVoteOptions(oldOptions v1beta1.WeightedVoteOptions) types.WeightedVoteOptions { + options := make(types.WeightedVoteOptions, len(oldOptions)) + for idx, oldOption := range oldOptions { + options[idx] = types.WeightedVoteOption{ + Option: types.VoteOption(oldOption.Option), + Weight: oldOption.Weight, + } } + return options } diff --git a/x/gov/migrations/v045/migrate_test.go b/x/gov/migrations/v045/migrate_test.go index 46f1855e397b..f0334fafbf1e 100644 --- a/x/gov/migrations/v045/migrate_test.go +++ b/x/gov/migrations/v045/migrate_test.go @@ -3,13 +3,14 @@ package v045_test import ( "encoding/json" "testing" + "time" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/simapp" - v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" v045gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v045" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func TestMigrate(t *testing.T) { @@ -20,53 +21,59 @@ func TestMigrate(t *testing.T) { WithLegacyAmino(encodingConfig.Amino). WithCodec(encodingConfig.Codec) - govGenState := v040gov.GenesisState{ - Proposals: []v040gov.Proposal{ - { - ProposalId: 5, - Content: v040gov.NewTextProposal("foo_title", "bar_description"), - }, - // TODO: add the other proposal types and assert that they migrate correctly - // { - // Content: v036distr.CommunityPoolSpendProposal{ - // Title: "foo_community", - // Description: "bar_community", - // Recipient: recipient, - // Amount: sdk.NewCoins(sdk.NewCoin("footoken", sdk.NewInt(2))), - // }, - // }, - // { - // Content: v038upgrade.CancelSoftwareUpgradeProposal{ - // Title: "foo_cancel_upgrade", - // Description: "bar_cancel_upgrade", - // }, - // }, - // { - // Content: v038upgrade.SoftwareUpgradeProposal{ - // Title: "foo_software_upgrade", - // Description: "bar_software_upgrade", - // Plan: v038upgrade.Plan{ - // Name: "foo_upgrade_name", - // Height: 123, - // Info: "foo_upgrade_info", - // }, - // }, - // }, - // { - // Content: v036params.ParameterChangeProposal{ - // Title: "foo_param_change", - // Description: "bar_param_change", - // Changes: []v036params.ParamChange{ - // { - // Subspace: "foo_param_change_subspace", - // Key: "foo_param_change_key", - // Subkey: "foo_param_change_subkey", - // Value: "foo_param_change_value", - // }, - // }, - // }, - // }, - }, + var err error + proposals := make(v1beta1.Proposals, 1) + proposals[0], err = v1beta1.NewProposal( + v1beta1.NewTextProposal("foo_title", "bar_description"), + 5, + time.Date(2019, 1, 1, 1, 0, 0, 0, time.UTC), + time.Date(2020, 1, 1, 1, 0, 0, 0, time.UTC), + ) + require.NoError(t, err) + + // TODO: add the other proposal types and assert that they migrate correctly + // { + // Content: v036distr.CommunityPoolSpendProposal{ + // Title: "foo_community", + // Description: "bar_community", + // Recipient: recipient, + // Amount: sdk.NewCoins(sdk.NewCoin("footoken", sdk.NewInt(2))), + // }, + // }, + // { + // Content: v038upgrade.CancelSoftwareUpgradeProposal{ + // Title: "foo_cancel_upgrade", + // Description: "bar_cancel_upgrade", + // }, + // }, + // { + // Content: v038upgrade.SoftwareUpgradeProposal{ + // Title: "foo_software_upgrade", + // Description: "bar_software_upgrade", + // Plan: v038upgrade.Plan{ + // Name: "foo_upgrade_name", + // Height: 123, + // Info: "foo_upgrade_info", + // }, + // }, + // }, + // { + // Content: v036params.ParameterChangeProposal{ + // Title: "foo_param_change", + // Description: "bar_param_change", + // Changes: []v036params.ParamChange{ + // { + // Subspace: "foo_param_change_subspace", + // Key: "foo_param_change_key", + // Subkey: "foo_param_change_subkey", + // Value: "foo_param_change_value", + // }, + // }, + // }, + // }, + + govGenState := v1beta1.GenesisState{ + Proposals: proposals, } migrated := v045gov.Migrate(govGenState) diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index fd9fad96e099..65549e4fe96c 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -19,7 +19,6 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) - // TestWeightedOperations tests the weights of the operations. func TestWeightedOperations(t *testing.T) { app, ctx := createTestApp(t, false) diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index 05f6416d4b03..471fd3645b88 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -11,7 +11,6 @@ import ( // RegisterLegacyAminoCodec registers all the necessary types and interfaces for the // governance module. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterInterface((*Content)(nil), nil) cdc.RegisterConcrete(&MsgSubmitProposal{}, "cosmos-sdk/MsgSubmitProposal", nil) cdc.RegisterConcrete(&MsgDeposit{}, "cosmos-sdk/MsgDeposit", nil) cdc.RegisterConcrete(&MsgVote{}, "cosmos-sdk/MsgVote", nil) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 214666a1d390..4a70e1335975 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -9,10 +9,8 @@ var ( ErrUnknownProposal = sdkerrors.Register(ModuleName, 2, "unknown proposal") ErrInactiveProposal = sdkerrors.Register(ModuleName, 3, "inactive proposal") ErrAlreadyActiveProposal = sdkerrors.Register(ModuleName, 4, "proposal already active") - // Deprecated - ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 5, "invalid proposal content") - // Deprecated - ErrInvalidProposalType = sdkerrors.Register(ModuleName, 6, "invalid proposal type") + // Errors 5 & 6 are reserved as legacy errors + // See x/gov/types/v1beta1/errors.go ErrInvalidVote = sdkerrors.Register(ModuleName, 7, "invalid vote option") ErrInvalidGenesis = sdkerrors.Register(ModuleName, 8, "invalid genesis state") ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 9, "no handler exists for proposal type") diff --git a/x/gov/types/genesis.pb.go b/x/gov/types/genesis.pb.go index c8c16624f7c9..e1ee2061a6d7 100644 --- a/x/gov/types/genesis.pb.go +++ b/x/gov/types/genesis.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -35,11 +34,11 @@ type GenesisState struct { // proposals defines all the proposals present at genesis. Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` // params defines all the paramaters of related to deposit. - DepositParams v1beta1.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" yaml:"deposit_params"` // params defines all the paramaters of related to voting. - VotingParams v1beta1.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" yaml:"voting_params"` // params defines all the paramaters of related to tally. - TallyParams v1beta1.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" yaml:"tally_params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -103,25 +102,25 @@ func (m *GenesisState) GetProposals() Proposals { return nil } -func (m *GenesisState) GetDepositParams() v1beta1.DepositParams { +func (m *GenesisState) GetDepositParams() DepositParams { if m != nil { return m.DepositParams } - return v1beta1.DepositParams{} + return DepositParams{} } -func (m *GenesisState) GetVotingParams() v1beta1.VotingParams { +func (m *GenesisState) GetVotingParams() VotingParams { if m != nil { return m.VotingParams } - return v1beta1.VotingParams{} + return VotingParams{} } -func (m *GenesisState) GetTallyParams() v1beta1.TallyParams { +func (m *GenesisState) GetTallyParams() TallyParams { if m != nil { return m.TallyParams } - return v1beta1.TallyParams{} + return TallyParams{} } func init() { @@ -131,35 +130,34 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/genesis.proto", fileDescriptor_ef7cfd15e3ded621) } var fileDescriptor_ef7cfd15e3ded621 = []byte{ - // 437 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x6e, 0xd3, 0x30, - 0x18, 0xc7, 0x1b, 0xd6, 0x8e, 0xcd, 0x6d, 0x11, 0x98, 0xa2, 0x45, 0xcb, 0x48, 0x42, 0x4e, 0xb9, - 0x90, 0xa8, 0xe3, 0x86, 0xc4, 0x25, 0x42, 0x82, 0xdd, 0x46, 0x40, 0x1c, 0xb8, 0x44, 0x6e, 0x63, - 0x99, 0x88, 0x64, 0x8e, 0xf2, 0x99, 0x88, 0xbe, 0x05, 0xcf, 0xc1, 0x93, 0xec, 0xb8, 0x23, 0xa7, - 0x82, 0x5a, 0x9e, 0xa0, 0x4f, 0x80, 0x62, 0x3b, 0x90, 0xa0, 0xb2, 0x53, 0x9c, 0xef, 0xfb, 0xfb, - 0xf7, 0xfb, 0x6c, 0x19, 0x59, 0x4b, 0x0e, 0x05, 0x87, 0x90, 0xf1, 0x3a, 0xac, 0xe7, 0x21, 0xa3, - 0x57, 0x14, 0x32, 0x08, 0xca, 0x8a, 0x0b, 0x8e, 0xa7, 0xaa, 0x19, 0x30, 0x5e, 0x07, 0xf5, 0xfc, - 0x74, 0xc6, 0x38, 0xe3, 0xb2, 0x13, 0x36, 0x2b, 0x15, 0x3a, 0x3d, 0xeb, 0x11, 0x16, 0x54, 0x90, - 0x79, 0xb3, 0xd6, 0xdd, 0x93, 0x7f, 0xf8, 0x6d, 0xc3, 0xfb, 0x35, 0x44, 0x93, 0x57, 0xca, 0xf6, - 0x56, 0x10, 0x41, 0xf1, 0x1b, 0x34, 0x03, 0x41, 0x2a, 0x91, 0x5d, 0xb1, 0xa4, 0xac, 0x78, 0xc9, - 0x81, 0xe4, 0x49, 0x96, 0x9a, 0x86, 0x6b, 0xf8, 0xc3, 0xc8, 0xd9, 0xad, 0x1d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7d, 0x8e, 0x77, 0x4d, 0x4e, 0x2b, 0x2c, 0xad, 0x78, 0xa8, 0x14, 0x5d, 0x84, 0x17, 0x8f, - 0x45, 0x27, 0x19, 0x5d, 0x6f, 0x6c, 0xe3, 0x66, 0x63, 0x1b, 0x3f, 0x37, 0xb6, 0xf1, 0x75, 0x6b, - 0x0f, 0x6e, 0xb6, 0xf6, 0xe0, 0xfb, 0xd6, 0x1e, 0x7c, 0xf0, 0x59, 0x26, 0x3e, 0x7e, 0x5e, 0x04, - 0x4b, 0x5e, 0x84, 0xfa, 0x91, 0xaa, 0xcf, 0x53, 0x48, 0x3f, 0x85, 0x5f, 0xe4, 0x8b, 0x15, 0xab, - 0x92, 0xc2, 0xe2, 0x50, 0xbe, 0xd8, 0x67, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xef, 0x6e, 0xbd, - 0x9f, 0x2c, 0x03, 0x00, 0x00, + // 426 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0x6d, 0x9a, 0x94, 0x76, 0x13, 0x23, 0xd8, 0x06, 0x6a, 0xc5, 0xc5, 0x8e, 0x7c, 0xf2, + 0x05, 0x5b, 0x2d, 0x17, 0xc4, 0xd1, 0xaa, 0x04, 0xdc, 0x8a, 0x41, 0x1c, 0x7a, 0x20, 0x72, 0x6a, + 0xcb, 0x58, 0xd8, 0x1d, 0xcb, 0xb3, 0xac, 0xc8, 0x5b, 0xf0, 0x1c, 0x3c, 0x49, 0x25, 0x2e, 0x3d, + 0x72, 0x0a, 0x28, 0x79, 0x83, 0x3e, 0x01, 0xf2, 0xee, 0x1a, 0x1c, 0x93, 0x53, 0xe2, 0x99, 0xff, + 0xff, 0xfe, 0xd9, 0xd1, 0x10, 0xeb, 0x0a, 0xb0, 0x04, 0x0c, 0x32, 0xe0, 0x01, 0x3f, 0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0x70, 0xa6, 0x7b, 0xa3, 0xb3, 0x93, 0xdd, 0xef, 0xb9, 0x10, 0x9a, 0xf0, 0x69, + 0xc3, 0xbc, 0x5b, 0x39, 0x8f, 0xe5, 0xe2, 0xb6, 0x09, 0x6e, 0x64, 0x24, 0x5d, 0x35, 0xfd, 0x48, + 0x0c, 0x0e, 0x72, 0xb1, 0x32, 0x62, 0x5f, 0x44, 0x58, 0xff, 0xbf, 0xb7, 0xd9, 0xb2, 0x4c, 0x38, + 0x51, 0x09, 0x13, 0x99, 0xb0, 0xe5, 0x77, 0xa3, 0x31, 0xef, 0x68, 0xe9, 0x25, 0x19, 0xb3, 0xb8, + 0x28, 0x96, 0x2d, 0xfe, 0xbe, 0xc0, 0x4f, 0x7b, 0xf8, 0xf7, 0x8d, 0x44, 0xd1, 0x2d, 0x45, 0x3f, + 0x92, 0xf4, 0xae, 0xdb, 0x8d, 0x46, 0xac, 0xa3, 0x0c, 0x6f, 0xd6, 0xb6, 0x7e, 0xbb, 0xb6, 0xf5, + 0xdf, 0x6b, 0x5b, 0xff, 0xb6, 0xb1, 0xb5, 0xdb, 0x8d, 0xad, 0xfd, 0xdc, 0xd8, 0xda, 0xa5, 0x97, + 0xe5, 0xec, 0xd3, 0x97, 0x85, 0x7f, 0x05, 0x65, 0xa0, 0x6e, 0x51, 0xfe, 0x3c, 0xc3, 0xe4, 0x73, + 0xf0, 0x55, 0x1c, 0x26, 0x5b, 0x56, 0x29, 0x2e, 0xf6, 0xc5, 0x61, 0x3e, 0xff, 0x13, 0x00, 0x00, + 0xff, 0xff, 0x1b, 0x9c, 0x82, 0xe7, 0xf5, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -392,7 +390,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Deposits = append(m.Deposits, v1beta1.Deposit{}) + m.Deposits = append(m.Deposits, Deposit{}) if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -426,7 +424,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Votes = append(m.Votes, v1beta1.Vote{}) + m.Votes = append(m.Votes, Vote{}) if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index 65fe52997e85..f52e74c5c080 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -5,13 +5,14 @@ package types import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" + _ "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" - types1 "github.com/cosmos/cosmos-sdk/types" - v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + 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" @@ -31,12 +32,179 @@ var _ = time.Kitchen // 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. + OptionEmpty VoteOption = 0 + // VOTE_OPTION_YES defines a yes vote option. + OptionYes VoteOption = 1 + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + OptionAbstain VoteOption = 2 + // VOTE_OPTION_NO defines a no vote option. + OptionNo VoteOption = 3 + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + OptionNoWithVeto 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_e05cb1c0d030febb, []int{0} +} + +// ProposalStatus enumerates the valid statuses of a proposal. +type ProposalStatus int32 + +const ( + // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + StatusNil ProposalStatus = 0 + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + StatusDepositPeriod ProposalStatus = 1 + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + StatusVotingPeriod ProposalStatus = 2 + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + StatusPassed ProposalStatus = 3 + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + StatusRejected ProposalStatus = 4 + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + StatusFailed 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_e05cb1c0d030febb, []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.v1.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"` +} + +func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } +func (*WeightedVoteOption) ProtoMessage() {} +func (*WeightedVoteOption) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []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 + +// 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"` +} + +func (m *Deposit) Reset() { *m = Deposit{} } +func (*Deposit) ProtoMessage() {} +func (*Deposit) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []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 + // 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 []*types.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` - Status v1beta1.ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty" yaml:"proposal_status"` - FinalTallyResult v1beta1.TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result" yaml:"final_tally_result"` + 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.v1.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"` @@ -47,7 +215,7 @@ type Proposal struct { func (m *Proposal) Reset() { *m = Proposal{} } func (*Proposal) ProtoMessage() {} func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{0} + return fileDescriptor_e05cb1c0d030febb, []int{2} } func (m *Proposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,51 +244,317 @@ func (m *Proposal) XXX_DiscardUnknown() { var xxx_messageInfo_Proposal proto.InternalMessageInfo +// 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"` +} + +func (m *TallyResult) Reset() { *m = TallyResult{} } +func (*TallyResult) ProtoMessage() {} +func (*TallyResult) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []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 + +// 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.v1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. + Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` +} + +func (m *Vote) Reset() { *m = Vote{} } +func (*Vote) ProtoMessage() {} +func (*Vote) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []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 + +// 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"` + // 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 (*DepositParams) ProtoMessage() {} +func (*DepositParams) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []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 + +// 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 (*VotingParams) ProtoMessage() {} +func (*VotingParams) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []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 + +// 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"` + // 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"` + // 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"` +} + +func (m *TallyParams) Reset() { *m = TallyParams{} } +func (*TallyParams) ProtoMessage() {} +func (*TallyParams) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []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 init() { + proto.RegisterEnum("cosmos.gov.v1.VoteOption", VoteOption_name, VoteOption_value) + proto.RegisterEnum("cosmos.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) + proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1.WeightedVoteOption") + proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1.Deposit") proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1.Proposal") + proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1.TallyResult") + proto.RegisterType((*Vote)(nil), "cosmos.gov.v1.Vote") + proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1.DepositParams") + proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1.VotingParams") + proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1.TallyParams") } func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 580 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x31, 0x73, 0xd3, 0x30, - 0x18, 0x86, 0xed, 0xb6, 0x84, 0x54, 0x21, 0xa5, 0x98, 0x5c, 0xeb, 0xe4, 0x38, 0x39, 0x18, 0x86, - 0x2c, 0xd8, 0x24, 0x30, 0x75, 0xc3, 0xc0, 0x1d, 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0, 0x36, 0xcc, 0x9b, 0xe2, 0x26, 0xeb, 0x8b, 0xd4, 0x8a, 0xf7, - 0xba, 0x8c, 0xed, 0x39, 0x25, 0x99, 0xf7, 0x4a, 0x71, 0x6a, 0x92, 0xb3, 0xd2, 0x6d, 0x7f, 0xbf, - 0xb0, 0x5a, 0x31, 0xe1, 0x1f, 0x07, 0xa1, 0xd3, 0xa5, 0xa9, 0xab, 0x9e, 0xa0, 0xfc, 0x3c, 0x62, - 0xd1, 0x27, 0x97, 0x8f, 0x72, 0xcc, 0xc4, 0x20, 0xe6, 0xdf, 0x12, 0xbd, 0x2f, 0x64, 0xab, 0x91, - 0x80, 0x3b, 0x43, 0xca, 0x49, 0x16, 0x17, 0xd7, 0xdb, 0x57, 0xc1, 0x96, 0x37, 0x1e, 0xfb, 0xa1, - 0xb2, 0x63, 0x4a, 0x3b, 0x6b, 0x23, 0xe4, 0xb9, 0x6f, 0xcb, 0xfa, 0x71, 0x51, 0x16, 0x07, 0xef, - 0x01, 0x55, 0xfa, 0x1b, 0xf1, 0xee, 0x46, 0x96, 0xad, 0x58, 0x07, 0x2b, 0xac, 0xd5, 0x84, 0xab, - 0xb2, 0xaa, 0x02, 0x3e, 0xda, 0xf9, 0xf9, 0xcd, 0xd2, 0xbd, 0x37, 0xe3, 0x4b, 0xa8, 0x9d, 0x5f, - 0x42, 0xed, 0xcb, 0x14, 0x6a, 0xe3, 0x29, 0xd4, 0xcf, 0xa6, 0x50, 0xff, 0x31, 0x85, 0xfa, 0xe9, - 0x0c, 0x6a, 0x67, 0x33, 0xa8, 0x9d, 0xcf, 0xa0, 0xf6, 0xfe, 0xff, 0xc9, 0x7d, 0x16, 0xff, 0x64, - 0x91, 0x5f, 0x58, 0x12, 0xe6, 0x9e, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0x73, 0x8f, 0x71, 0x29, - 0x7e, 0x04, 0x00, 0x00, + // 1382 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00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43, 0x2b, 0xf1, 0x69, 0x11, 0x0e, 0x86, 0xca, 0x32, 0xc5, 0xeb, 0xe8, 0x3b, 0xd4, 0x24, + 0xe8, 0x9d, 0xfa, 0x97, 0x8a, 0xe5, 0xab, 0x5a, 0x89, 0x3f, 0x36, 0xa9, 0x7f, 0xc9, 0x72, 0xda, + 0xc8, 0xa6, 0xe5, 0x54, 0x2b, 0x4f, 0x5e, 0x4a, 0x89, 0xe7, 0x2f, 0xa5, 0xc4, 0xf7, 0xfb, 0x52, + 0xe2, 0xc9, 0xbe, 0xc4, 0x3d, 0xdd, 0x97, 0xb8, 0x3f, 0xf6, 0x25, 0xee, 0xc1, 0x2b, 0x29, 0xf1, + 0xf4, 0x95, 0x94, 0x78, 0xfe, 0x4a, 0x4a, 0xdc, 0xfc, 0xe7, 0xf9, 0x75, 0x2f, 0xfc, 0x97, 0x29, + 0x3c, 0xb6, 0x3b, 0x99, 0x70, 0x22, 0x7c, 0xfc, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x66, 0xbe, + 0x9b, 0x99, 0x4d, 0x0d, 0x00, 0x00, } func (this *Proposal) Equal(that interface{}) bool { @@ -181,7 +615,40 @@ func (this *Proposal) Equal(that interface{}) bool { } return true } -func (m *Proposal) Marshal() (dAtA []byte, err error) { +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) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -191,36 +658,58 @@ func (m *Proposal) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Proposal) MarshalTo(dAtA []byte) (int, error) { +func (m *WeightedVoteOption) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WeightedVoteOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = 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 + { + size := m.Weight.Size() + i -= size + if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) } - 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 + dAtA[i] = 0x12 + if m.Option != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x8 } - 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-- { + 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.TotalDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -228,20 +717,85 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGov(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x1a } } - 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 + 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 } - 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 + 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 + 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 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 + } + } + 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)) @@ -284,6 +838,252 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + { + 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)) + } + 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 + 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 + 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 + { + 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)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintGov(dAtA []byte, offset int, v uint64) int { offset -= sovGov(v) base := offset @@ -295,14 +1095,50 @@ func encodeVarintGov(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Proposal) Size() (n int) { +func (m *WeightedVoteOption) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(uint64(m.ProposalId)) + if m.Option != 0 { + n += 1 + sovGov(uint64(m.Option)) + } + l = m.Weight.Size() + 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 { @@ -325,20 +1161,850 @@ func (m *Proposal) Size() (n int) { 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)) - return n -} + 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)) + return n +} + +func (m *TallyResult) Size() (n int) { + if m == nil { + return 0 + } + 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)) + 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)) + } + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod) + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *VotingParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod) + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *TallyParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Quorum.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.Threshold.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.VetoThreshold.Size() + 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 + } + if err := m.Weight.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 *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 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 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 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 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 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 + } + if err := m.Yes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 + } + if err := m.Abstain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 + } + if err := m.No.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 + } + if err := m.NoWithVeto.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 + } + } -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)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *Proposal) Unmarshal(dAtA []byte) error { +func (m *Vote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -361,10 +2027,10 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Proposal: wiretype end group for non-group") + return fmt.Errorf("proto: Vote: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -388,9 +2054,9 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGov @@ -400,31 +2066,29 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGov } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGov } 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 - } + m.Voter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) } - m.Status = 0 + m.Option = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGov @@ -434,14 +2098,14 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= v1beta1.ProposalStatus(b&0x7F) << shift + m.Option |= VoteOption(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalTallyResult", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -468,13 +2132,64 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.FinalTallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Options = append(m.Options, WeightedVoteOption{}) + if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + 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 SubmitTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MinDeposit", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -501,13 +2216,14 @@ 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 { + 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 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositEndTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxDepositPeriod", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -534,13 +2250,63 @@ 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 err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + 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 TotalDeposit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -567,16 +2333,65 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TotalDeposit = append(m.TotalDeposit, types1.Coin{}) - if err := m.TotalDeposit[len(m.TotalDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 8: + 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 VotingStartTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGov @@ -586,30 +2401,30 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthGov } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthGov } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.VotingStartTime, dAtA[iNdEx:postIndex]); err != nil { + if err := m.Quorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 9: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingEndTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGov @@ -619,22 +2434,55 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthGov } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthGov } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.VotingEndTime, dAtA[iNdEx:postIndex]); err != nil { + if err := m.Threshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field 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 + } + if err := m.VetoThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index c39e0735e5f6..0f106b69d6bc 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -5,7 +5,6 @@ import ( "strings" "time" - "github.com/gogo/protobuf/proto" "sigs.k8s.io/yaml" "github.com/cosmos/cosmos-sdk/codec/types" @@ -19,18 +18,9 @@ const DefaultStartingProposalID uint64 = 1 // NewProposal creates a new Proposal instance func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time) (Proposal, error) { - msgs := make([]*types.Any, len(messages)) - for i, msg := range messages { - m, ok := msg.(proto.Message) - if !ok { - return Proposal{}, fmt.Errorf("can't proto marshal %T", msg) - } - any, err := types.NewAnyWithValue(m) - if err != nil { - return Proposal{}, err - } - - msgs[i] = any + msgs, err := sdktx.SetMsgs(messages) + if err != nil { + return Proposal{}, err } p := Proposal{ @@ -117,19 +107,6 @@ func ProposalStatusFromString(str string) (ProposalStatus, error) { return ProposalStatus(num), nil } -// ValidProposalStatus returns true if the proposal status is valid and false -// otherwise. -func ValidProposalStatus(status ProposalStatus) bool { - if status == StatusDepositPeriod || - status == StatusVotingPeriod || - status == StatusPassed || - status == StatusRejected || - status == StatusFailed { - return true - } - return false -} - // Marshal needed for protobuf compatibility func (status ProposalStatus) Marshal() ([]byte, error) { return []byte{byte(status)}, nil @@ -152,3 +129,16 @@ func (status ProposalStatus) Format(s fmt.State, verb rune) { s.Write([]byte(fmt.Sprintf("%v", byte(status)))) } } + +// ValidProposalStatus returns true if the proposal status is valid and false +// otherwise. +func ValidProposalStatus(status ProposalStatus) bool { + if status == StatusDepositPeriod || + status == StatusVotingPeriod || + status == StatusPassed || + status == StatusRejected || + status == StatusFailed { + return true + } + return false +} diff --git a/x/gov/types/proposals_test.go b/x/gov/types/proposals_test.go index 7f6a2b23bfae..ca670e91e9ab 100644 --- a/x/gov/types/proposals_test.go +++ b/x/gov/types/proposals_test.go @@ -1,16 +1,17 @@ -package types +package types_test import ( "fmt" "testing" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/stretchr/testify/require" ) func TestProposalStatus_Format(t *testing.T) { - statusDepositPeriod, _ := ProposalStatusFromString("PROPOSAL_STATUS_DEPOSIT_PERIOD") + statusDepositPeriod, _ := types.ProposalStatusFromString("PROPOSAL_STATUS_DEPOSIT_PERIOD") tests := []struct { - pt ProposalStatus + pt types.ProposalStatus sprintFArgs string expectedStringOutput string }{ diff --git a/x/gov/types/query.pb.go b/x/gov/types/query.pb.go index d4f51eb7b85a..7f17e5546d50 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" - v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -126,7 +125,7 @@ func (m *QueryProposalResponse) GetProposal() Proposal { // QueryProposalsRequest is the request type for the Query/Proposals RPC method. type QueryProposalsRequest struct { // proposal_status defines the status of the proposals. - ProposalStatus v1beta1.ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"proposal_status,omitempty"` + ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1.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. @@ -267,7 +266,7 @@ var xxx_messageInfo_QueryVoteRequest proto.InternalMessageInfo // QueryVoteResponse is the response type for the Query/Vote RPC method. type QueryVoteResponse struct { // vote defined the queried vote. - Vote v1beta1.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"` + Vote Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"` } func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} } @@ -303,11 +302,11 @@ func (m *QueryVoteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo -func (m *QueryVoteResponse) GetVote() v1beta1.Vote { +func (m *QueryVoteResponse) GetVote() Vote { if m != nil { return m.Vote } - return v1beta1.Vote{} + return Vote{} } // QueryVotesRequest is the request type for the Query/Votes RPC method. @@ -368,7 +367,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 []v1beta1.Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"` + Votes []Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -406,7 +405,7 @@ func (m *QueryVotesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryVotesResponse proto.InternalMessageInfo -func (m *QueryVotesResponse) GetVotes() []v1beta1.Vote { +func (m *QueryVotesResponse) GetVotes() []Vote { if m != nil { return m.Votes } @@ -470,11 +469,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 v1beta1.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"` // deposit_params defines the parameters related to deposit. - DepositParams v1beta1.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"` // tally_params defines the parameters related to tally. - TallyParams v1beta1.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"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -510,25 +509,25 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetVotingParams() v1beta1.VotingParams { +func (m *QueryParamsResponse) GetVotingParams() VotingParams { if m != nil { return m.VotingParams } - return v1beta1.VotingParams{} + return VotingParams{} } -func (m *QueryParamsResponse) GetDepositParams() v1beta1.DepositParams { +func (m *QueryParamsResponse) GetDepositParams() DepositParams { if m != nil { return m.DepositParams } - return v1beta1.DepositParams{} + return DepositParams{} } -func (m *QueryParamsResponse) GetTallyParams() v1beta1.TallyParams { +func (m *QueryParamsResponse) GetTallyParams() TallyParams { if m != nil { return m.TallyParams } - return v1beta1.TallyParams{} + return TallyParams{} } // QueryDepositRequest is the request type for the Query/Deposit RPC method. @@ -575,7 +574,7 @@ var xxx_messageInfo_QueryDepositRequest proto.InternalMessageInfo // QueryDepositResponse is the response type for the Query/Deposit RPC method. type QueryDepositResponse struct { // deposit defines the requested deposit. - Deposit v1beta1.Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit"` + Deposit Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit"` } func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } @@ -611,11 +610,11 @@ func (m *QueryDepositResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo -func (m *QueryDepositResponse) GetDeposit() v1beta1.Deposit { +func (m *QueryDepositResponse) GetDeposit() Deposit { if m != nil { return m.Deposit } - return v1beta1.Deposit{} + return Deposit{} } // QueryDepositsRequest is the request type for the Query/Deposits RPC method. @@ -675,7 +674,7 @@ func (m *QueryDepositsRequest) GetPagination() *query.PageRequest { // QueryDepositsResponse is the response type for the Query/Deposits RPC method. type QueryDepositsResponse struct { - Deposits []v1beta1.Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits"` + Deposits []Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -713,7 +712,7 @@ func (m *QueryDepositsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDepositsResponse proto.InternalMessageInfo -func (m *QueryDepositsResponse) GetDeposits() []v1beta1.Deposit { +func (m *QueryDepositsResponse) GetDeposits() []Deposit { if m != nil { return m.Deposits } @@ -776,7 +775,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 v1beta1.TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally"` + Tally TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally"` } func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultResponse{} } @@ -812,11 +811,11 @@ func (m *QueryTallyResultResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryTallyResultResponse proto.InternalMessageInfo -func (m *QueryTallyResultResponse) GetTally() v1beta1.TallyResult { +func (m *QueryTallyResultResponse) GetTally() TallyResult { if m != nil { return m.Tally } - return v1beta1.TallyResult{} + return TallyResult{} } func init() { @@ -841,70 +840,69 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/query.proto", fileDescriptor_46a436d1109b50d0) } var fileDescriptor_46a436d1109b50d0 = []byte{ - // 999 bytes of a gzipped FileDescriptorProto + // 989 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x3a, 0x4e, 0x6b, 0xbf, 0x34, 0x01, 0x1e, 0x81, 0x98, 0x05, 0xd9, 0xee, 0x86, 0xa6, - 0x11, 0xd0, 0x5d, 0x39, 0x84, 0x56, 0xb4, 0xf4, 0x40, 0x40, 0x2d, 0xa8, 0x12, 0x2a, 0x4e, 0x05, - 0x12, 0x97, 0x68, 0x53, 0xaf, 0x96, 0x15, 0x8e, 0x67, 0xeb, 0x19, 0x5b, 0x0d, 0xa9, 0x85, 0x54, - 0x09, 0xc1, 0x09, 0x21, 0x15, 0x89, 0x5b, 0xe9, 0x8f, 0xe0, 0x47, 0xf4, 0x58, 0xc1, 0x05, 0x71, - 0x40, 0x28, 0xe1, 0xc0, 0x8f, 0xe0, 0x80, 0x76, 0xe6, 0xcd, 0x7a, 0xd7, 0x5d, 0xdb, 0x9b, 0xaa, - 0xea, 0x29, 0xf6, 0xcc, 0xf7, 0xbe, 0xf7, 0xbd, 0x37, 0x6f, 0xbe, 0x89, 0xe1, 0x95, 0x9b, 0x8c, - 0xef, 0x31,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, 0x79, 0x7f, 0xdb, 0xb9, 0xc3, 0x77, 0x0c, 0xa3, 0xfe, 0x67, 0x55, + 0xb4, 0xbf, 0x60, 0xf7, 0x14, 0x7d, 0x34, 0x05, 0x62, 0xfb, 0x8c, 0xfa, 0x93, 0xe2, 0xad, 0xff, + 0x03, 0x00, 0x00, 0xff, 0xff, 0xab, 0xeb, 0x81, 0xa1, 0x12, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2330,7 +2328,7 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProposalStatus |= v1beta1.ProposalStatus(b&0x7F) << shift + m.ProposalStatus |= ProposalStatus(b&0x7F) << shift if b < 0x80 { break } @@ -2923,7 +2921,7 @@ func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Votes = append(m.Votes, v1beta1.Vote{}) + m.Votes = append(m.Votes, Vote{}) if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3563,7 +3561,7 @@ func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Deposits = append(m.Deposits, v1beta1.Deposit{}) + m.Deposits = append(m.Deposits, Deposit{}) if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/gov/types/query.pb.gw.go b/x/gov/types/query.pb.gw.go index aa1d8a5916ac..00b3afcc7313 100644 --- a/x/gov/types/query.pb.gw.go +++ b/x/gov/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join 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 @@ -530,14 +528,12 @@ func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Ma // 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 to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -545,7 +541,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -559,8 +554,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -568,7 +561,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -582,8 +574,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -591,7 +581,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -605,8 +594,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -614,7 +601,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -628,8 +614,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -637,7 +621,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -651,8 +634,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -660,7 +641,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -674,8 +654,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -683,7 +661,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -697,8 +674,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -706,7 +681,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/x/gov/types/router.go b/x/gov/types/router.go deleted file mode 100644 index bc4d51251d56..000000000000 --- a/x/gov/types/router.go +++ /dev/null @@ -1,72 +0,0 @@ -package types - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _ Router = (*router)(nil) - -// Router implements a governance Handler router. -// -// TODO: Use generic router (ref #3976). -type Router interface { - AddRoute(r string, h Handler) (rtr Router) - HasRoute(r string) bool - GetRoute(path string) (h Handler) - Seal() -} - -type router struct { - routes map[string]Handler - sealed bool -} - -// NewRouter creates a new Router interface instance -func NewRouter() Router { - return &router{ - routes: make(map[string]Handler), - } -} - -// Seal seals the router which prohibits any subsequent route handlers to be -// added. Seal will panic if called more than once. -func (rtr *router) Seal() { - if rtr.sealed { - panic("router already sealed") - } - rtr.sealed = true -} - -// AddRoute adds a governance handler for a given path. It returns the Router -// so AddRoute calls can be linked. It will panic if the router is sealed. -func (rtr *router) AddRoute(path string, h Handler) Router { - if rtr.sealed { - panic("router sealed; cannot add route handler") - } - - if !sdk.IsAlphaNumeric(path) { - panic("route expressions can only contain alphanumeric characters") - } - if rtr.HasRoute(path) { - panic(fmt.Sprintf("route %s has already been initialized", path)) - } - - rtr.routes[path] = h - return rtr -} - -// HasRoute returns true if the router has a path registered or false otherwise. -func (rtr *router) HasRoute(path string) bool { - return rtr.routes[path] != nil -} - -// GetRoute returns a Handler for a given path. -func (rtr *router) GetRoute(path string) Handler { - if !rtr.HasRoute(path) { - panic(fmt.Sprintf("route \"%s\" does not exist", path)) - } - - return rtr.routes[path] -} diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index bf3989fc0e3f..d96d1e30ad16 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -10,7 +10,6 @@ import ( 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" - v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -120,9 +119,9 @@ 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"` - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Option v1beta1.VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1.VoteOption" json:"option,omitempty"` } func (m *MsgVote) Reset() { *m = MsgVote{} } @@ -196,9 +195,9 @@ var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo // MsgVoteWeighted defines a message to cast a vote. 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 []v1beta1.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" 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"` } func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } @@ -438,53 +437,53 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 734 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xc1, 0x6b, 0x13, 0x4f, - 0x14, 0xde, 0x6d, 0xfa, 0x4b, 0x9b, 0xe9, 0xcf, 0xd6, 0x8e, 0xa1, 0xdd, 0x04, 0xd9, 0xc4, 0x80, - 0x25, 0x97, 0xee, 0x36, 0x55, 0x2a, 0xf4, 0x20, 0x34, 0x96, 0x8a, 0x87, 0xa0, 0x6c, 0xb1, 0x82, - 0x08, 0x65, 0x93, 0x1d, 0xa7, 0x83, 0xc9, 0xce, 0xb2, 0x33, 0x09, 0xcd, 0x4d, 0xf0, 0x22, 0x9e, - 0x3c, 0x7a, 0xec, 0xd9, 0x9b, 0xe0, 0xc9, 0xbf, 0xa0, 0xc7, 0xe2, 0xc9, 0x83, 0x54, 0x69, 0x2f, - 0x22, 0x78, 0xf1, 0x2f, 0x90, 0x9d, 0x99, 0xdd, 0x24, 0xcd, 0xb6, 0xa2, 0x78, 0x6a, 0xe7, 0x7d, - 0xef, 0x7b, 0xef, 0x7d, 0x6f, 0xbe, 0xc9, 0x82, 0x85, 0x16, 0x65, 0x1d, 0xca, 0x6c, 0x4c, 0x7b, - 0x76, 0xaf, 0x66, 0xf3, 0x7d, 0x2b, 0x08, 0x29, 0xa7, 0xf0, 0x92, 0x8c, 0x5b, 0x98, 0xf6, 0xac, - 0x5e, 0xad, 0x68, 0xaa, 0xb4, 0xa6, 0xcb, 0x90, 0xdd, 0xab, 0x35, 0x11, 0x77, 0x6b, 0x76, 0x8b, - 0x12, 0x5f, 0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 0x13, 0x53, 0x7f, 0x7d, 0x6a, 0x6a, 0x47, 0xa7, 0xa6, 0xf6, 0xe9, 0xd4, - 0xd4, 0x1e, 0x5f, 0x6c, 0xb6, 0x7d, 0xf1, 0x39, 0x12, 0x96, 0x6b, 0x66, 0xc5, 0x67, 0xe0, 0xc6, - 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x69, 0x9a, 0x0c, 0x09, 0x07, 0x00, 0x00, + // 724 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x41, 0x6b, 0x13, 0x4d, + 0x18, 0xde, 0x6d, 0xfa, 0xa5, 0xcd, 0xf4, 0xfb, 0xda, 0xaf, 0x63, 0x68, 0x37, 0x39, 0x6c, 0xb6, + 0x01, 0x25, 0x97, 0xee, 0x36, 0x55, 0x14, 0x7a, 0x10, 0x1a, 0x8b, 0xe2, 0x21, 0x28, 0x5b, 0xac, + 0x20, 0x42, 0xd9, 0x64, 0xc7, 0xe9, 0x60, 0xb2, 0xb3, 0xec, 0x4c, 0x42, 0x73, 0x13, 0xbc, 0x88, + 0x27, 0x8f, 0x1e, 0x7b, 0x16, 0x8f, 0xfa, 0x1f, 0x7a, 0x2c, 0x9e, 0x3c, 0x48, 0x95, 0xf6, 0x22, + 0x82, 0x17, 0x7f, 0x81, 0xec, 0xcc, 0xec, 0x26, 0x4d, 0xb6, 0x15, 0xc5, 0x53, 0x32, 0xef, 0xfb, + 0x3e, 0xcf, 0xfb, 0x3e, 0x33, 0xcf, 0xcc, 0x82, 0xa5, 0x36, 0x65, 0x5d, 0xca, 0x1c, 0x4c, 0xfb, + 0x4e, 0xbf, 0xee, 0xf0, 0x7d, 0x3b, 0x8c, 0x28, 0xa7, 0xf0, 0x3f, 0x19, 0xb7, 0x31, 0xed, 0xdb, + 0xfd, 0x7a, 0xd9, 0x54, 0x65, 0x2d, 0x8f, 0x21, 0xa7, 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4c, 0xfd, 0xd5, 0xa9, 0xa9, + 0x1d, 0x9d, 0x9a, 0xda, 0xc7, 0x53, 0x53, 0x7b, 0x74, 0xb1, 0xd9, 0xf6, 0xc5, 0xf7, 0x47, 0x58, + 0xae, 0x95, 0x17, 0x8f, 0xff, 0xd5, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x4c, 0xc9, 0x42, + 0xe1, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1559,7 +1558,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Option |= v1beta1.VoteOption(b&0x7F) << shift + m.Option |= VoteOption(b&0x7F) << shift if b < 0x80 { break } @@ -1744,7 +1743,7 @@ func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Options = append(m.Options, v1beta1.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/content.go b/x/gov/types/v1beta1/content.go similarity index 77% rename from x/gov/types/content.go rename to x/gov/types/v1beta1/content.go index 198729ace951..9bdeec13322b 100644 --- a/x/gov/types/content.go +++ b/x/gov/types/v1beta1/content.go @@ -1,15 +1,18 @@ -package types +package v1beta1 -import ( - sdk "github.com/cosmos/cosmos-sdk/types" +import sdk "github.com/cosmos/cosmos-sdk/types" + +// Copied over from /x/gov/types/keys.go to avoid circular imports +const ( + ModuleName = "gov" + + RouterKey = ModuleName ) // Content defines an interface that a proposal must implement. It contains // information such as the title and description along with the type and routing // information for the appropriate handler to process the proposal. Content can // have additional fields, which will handled by a proposal's Handler. -// TODO Try to unify this interface with types/module/simulation -// https://github.com/cosmos/cosmos-sdk/issues/5853 type Content interface { GetTitle() string GetDescription() string diff --git a/x/gov/types/v1beta1/deposit.go b/x/gov/types/v1beta1/deposit.go new file mode 100644 index 000000000000..fb3dbc2bdbfc --- /dev/null +++ b/x/gov/types/v1beta1/deposit.go @@ -0,0 +1,47 @@ +package v1beta1 + +import ( + "fmt" + + "sigs.k8s.io/yaml" +) + +// Deposits is a collection of Deposit objects +type Deposits []Deposit + +// Equal returns true if two slices (order-dependant) of deposits are equal. +func (d Deposits) Equal(other Deposits) bool { + if len(d) != len(other) { + return false + } + + for i, deposit := range d { + if deposit.String() != other[i].String() { + return false + } + } + + return true +} + +func (d Deposits) String() string { + if len(d) == 0 { + return "[]" + } + out := fmt.Sprintf("Deposits for Proposal %d:", d[0].ProposalId) + for _, dep := range d { + out += fmt.Sprintf("\n %s: %s", dep.Depositor, dep.Amount) + } + return out +} + +// Returns a string representation of the deposit +func (d Deposit) String() string { + out, _ := yaml.Marshal(d) + return string(out) +} + +// Empty returns whether a deposit is empty. +func (d Deposit) Empty() bool { + return d.String() == Deposit{}.String() +} diff --git a/x/gov/types/v1beta1/errors.go b/x/gov/types/v1beta1/errors.go new file mode 100644 index 000000000000..b9fe6ec51028 --- /dev/null +++ b/x/gov/types/v1beta1/errors.go @@ -0,0 +1,12 @@ +package v1beta1 + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var ( + // Deprecated + ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 5, "invalid proposal content") + // Deprecated + ErrInvalidProposalType = sdkerrors.Register(ModuleName, 6, "invalid proposal type") +) diff --git a/x/gov/types/v1beta1/params.go b/x/gov/types/v1beta1/params.go new file mode 100644 index 000000000000..2b19fe9198e0 --- /dev/null +++ b/x/gov/types/v1beta1/params.go @@ -0,0 +1,36 @@ +package v1beta1 + +import "sigs.k8s.io/yaml" + +// 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 +} + +// Equal checks equality of TallyParams +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) +} + +// 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) +} diff --git a/x/gov/types/v1beta1/proposal.go b/x/gov/types/v1beta1/proposal.go new file mode 100644 index 000000000000..03d08f47c492 --- /dev/null +++ b/x/gov/types/v1beta1/proposal.go @@ -0,0 +1,148 @@ +package v1beta1 + +import ( + "fmt" + "strings" + "time" + + "github.com/gogo/protobuf/proto" + "sigs.k8s.io/yaml" + + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +func NewProposal(content Content, id uint64, submitTime, depositEndTime time.Time) (Proposal, error) { + msg, ok := content.(proto.Message) + if !ok { + return Proposal{}, fmt.Errorf("%T does not implement proto.Message", content) + } + + any, err := types.NewAnyWithValue(msg) + if err != nil { + return Proposal{}, err + } + + p := Proposal{ + Content: any, + ProposalId: id, + Status: StatusDepositPeriod, + FinalTallyResult: EmptyTallyResult(), + TotalDeposit: sdk.NewCoins(), + SubmitTime: submitTime, + DepositEndTime: depositEndTime, + } + + return p, nil +} + +// String implements stringer interface +func (p Proposal) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} + +// GetContent returns the proposal Content +func (p Proposal) GetContent() Content { + content, ok := p.Content.GetCachedValue().(Content) + if !ok { + return nil + } + return content +} + +// Proposals is an array of proposal +type Proposals []Proposal + +// ProposalStatusFromString turns a string into a ProposalStatus +func ProposalStatusFromString(str string) (ProposalStatus, error) { + num, ok := ProposalStatus_value[str] + if !ok { + return StatusNil, fmt.Errorf("'%s' is not a valid proposal status", str) + } + return ProposalStatus(num), nil +} + +// Marshal needed for protobuf compatibility +func (status ProposalStatus) Marshal() ([]byte, error) { + return []byte{byte(status)}, nil +} + +// Unmarshal needed for protobuf compatibility +func (status *ProposalStatus) Unmarshal(data []byte) error { + *status = ProposalStatus(data[0]) + return nil +} + +// Format implements the fmt.Formatter interface. +// nolint: errcheck +func (status ProposalStatus) Format(s fmt.State, verb rune) { + switch verb { + case 's': + s.Write([]byte(status.String())) + default: + // TODO: Do this conversion more directly + s.Write([]byte(fmt.Sprintf("%v", byte(status)))) + } +} + +// Proposal types +const ( + ProposalTypeText string = "Text" + + // Constants pertaining to a Content object + MaxDescriptionLength int = 5000 + MaxTitleLength int = 140 +) + +// Implements Content Interface +var _ Content = &TextProposal{} + +// NewTextProposal creates a text proposal Content +func NewTextProposal(title, description string) Content { + return &TextProposal{title, description} +} + +// GetTitle returns the proposal title +func (tp *TextProposal) GetTitle() string { return tp.Title } + +// GetDescription returns the proposal description +func (tp *TextProposal) GetDescription() string { return tp.Description } + +// ProposalRoute returns the proposal router key +func (tp *TextProposal) ProposalRoute() string { return RouterKey } + +// ProposalType is "Text" +func (tp *TextProposal) ProposalType() string { return ProposalTypeText } + +// ValidateBasic validates the content's title and description of the proposal +func (tp *TextProposal) ValidateBasic() error { return ValidateAbstract(tp) } + +// String implements Stringer interface +func (tp TextProposal) String() string { + out, _ := yaml.Marshal(tp) + return string(out) +} + +// ValidateAbstract validates a proposal's abstract contents returning an error +// if invalid. +func ValidateAbstract(c Content) error { + title := c.GetTitle() + if len(strings.TrimSpace(title)) == 0 { + return sdkerrors.Wrap(ErrInvalidProposalContent, "proposal title cannot be blank") + } + if len(title) > MaxTitleLength { + return sdkerrors.Wrapf(ErrInvalidProposalContent, "proposal title is longer than max length of %d", MaxTitleLength) + } + + description := c.GetDescription() + if len(description) == 0 { + return sdkerrors.Wrap(ErrInvalidProposalContent, "proposal description cannot be blank") + } + if len(description) > MaxDescriptionLength { + return sdkerrors.Wrapf(ErrInvalidProposalContent, "proposal description is longer than max length of %d", MaxDescriptionLength) + } + + return nil +} diff --git a/x/gov/types/v1beta1/proposals_test.go b/x/gov/types/v1beta1/proposals_test.go new file mode 100644 index 000000000000..fd328b3ca471 --- /dev/null +++ b/x/gov/types/v1beta1/proposals_test.go @@ -0,0 +1,24 @@ +package v1beta1 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestProposalStatus_Format(t *testing.T) { + statusDepositPeriod, _ := ProposalStatusFromString("PROPOSAL_STATUS_DEPOSIT_PERIOD") + tests := []struct { + pt ProposalStatus + sprintFArgs string + expectedStringOutput string + }{ + {statusDepositPeriod, "%s", "PROPOSAL_STATUS_DEPOSIT_PERIOD"}, + {statusDepositPeriod, "%v", "1"}, + } + for _, tt := range tests { + got := fmt.Sprintf(tt.sprintFArgs, tt.pt) + require.Equal(t, tt.expectedStringOutput, got) + } +} diff --git a/x/gov/types/v1beta1/tally.go b/x/gov/types/v1beta1/tally.go new file mode 100644 index 000000000000..b9ee76ef44e4 --- /dev/null +++ b/x/gov/types/v1beta1/tally.go @@ -0,0 +1,36 @@ +package v1beta1 + +import ( + "sigs.k8s.io/yaml" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// 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, + } +} + +// EmptyTallyResult returns an empty TallyResult. +func EmptyTallyResult() TallyResult { + return NewTallyResult(sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroInt()) +} + +// Equals returns if two proposals 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) +} diff --git a/x/gov/types/v1beta1/vote.go b/x/gov/types/v1beta1/vote.go new file mode 100644 index 000000000000..3790bc549369 --- /dev/null +++ b/x/gov/types/v1beta1/vote.go @@ -0,0 +1,123 @@ +package v1beta1 + +import ( + "fmt" + "strings" + + "sigs.k8s.io/yaml" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// 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 the string representation of the 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() +} + +// Votes is an array of vote +type Votes []Vote + +// NewNonSplitVoteOption creates a single option vote with weight 1 +func NewNonSplitVoteOption(option VoteOption) WeightedVoteOptions { + return WeightedVoteOptions{{option, sdk.NewDec(1)}} +} + +func (v WeightedVoteOption) String() string { + out, _ := yaml.Marshal(v) + return string(out) +} + +// WeightedVoteOptions describes array of WeightedVoteOptions +type WeightedVoteOptions []WeightedVoteOption + +func (v WeightedVoteOptions) String() (out string) { + for _, opt := range v { + out += opt.String() + "\n" + } + + 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) { + option, ok := VoteOption_value[str] + if !ok { + return OptionEmpty, fmt.Errorf("'%s' is not a valid vote option, available options: yes/no/no_with_veto/abstain", str) + } + return VoteOption(option), nil +} + +// WeightedVoteOptionsFromString returns weighted vote options from string. It returns an error +// if the string is invalid. +func WeightedVoteOptionsFromString(str string) (WeightedVoteOptions, error) { + options := WeightedVoteOptions{} + for _, option := range strings.Split(str, ",") { + fields := strings.Split(option, "=") + option, err := VoteOptionFromString(fields[0]) + if err != nil { + return options, err + } + if len(fields) < 2 { + return options, fmt.Errorf("weight field does not exist for %s option", fields[0]) + } + weight, err := sdk.NewDecFromStr(fields[1]) + if err != nil { + return options, err + } + options = append(options, WeightedVoteOption{option, weight}) + } + return options, nil +} + +// ValidVoteOption returns true if the vote option is valid and false otherwise. +func ValidVoteOption(option VoteOption) bool { + if option == OptionYes || + option == OptionAbstain || + option == OptionNo || + option == OptionNoWithVeto { + return true + } + return false +} + +// Marshal needed for protobuf compatibility. +func (vo VoteOption) Marshal() ([]byte, error) { + return []byte{byte(vo)}, nil +} + +// Unmarshal needed for protobuf compatibility. +func (vo *VoteOption) Unmarshal(data []byte) error { + *vo = VoteOption(data[0]) + return nil +} + +// Format implements the fmt.Formatter interface. +func (vo VoteOption) Format(s fmt.State, verb rune) { + switch verb { + case 's': + s.Write([]byte(vo.String())) + default: + s.Write([]byte(fmt.Sprintf("%v", byte(vo)))) + } +} diff --git a/x/gov/types/vote.go b/x/gov/types/vote.go index cfe448fc7925..d68eea8a4fc8 100644 --- a/x/gov/types/vote.go +++ b/x/gov/types/vote.go @@ -16,11 +16,17 @@ func NewVote(proposalID uint64, voter sdk.AccAddress, options WeightedVoteOption 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() +} + // Votes is a collection of Vote objects type Votes []Vote @@ -50,11 +56,6 @@ func (v Votes) String() string { return out } -// Empty returns whether a vote is empty. -func (v Vote) Empty() bool { - return v.String() == Vote{}.String() -} - // NewNonSplitVoteOption creates a single option vote with weight 1 func NewNonSplitVoteOption(option VoteOption) WeightedVoteOptions { return WeightedVoteOptions{{option, sdk.NewDec(1)}} diff --git a/x/mint/client/testutil/cli_test.go b/x/mint/client/testutil/cli_test.go index dd36a6af2d3e..1035ca750264 100644 --- a/x/mint/client/testutil/cli_test.go +++ b/x/mint/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/params/client/testutil/cli_test.go b/x/params/client/testutil/cli_test.go index dd36a6af2d3e..1035ca750264 100644 --- a/x/params/client/testutil/cli_test.go +++ b/x/params/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/params/proposal_handler.go b/x/params/proposal_handler.go index 173cc292df49..a5c0166e4358 100644 --- a/x/params/proposal_handler.go +++ b/x/params/proposal_handler.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/params/keeper" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" ) diff --git a/x/params/types/proposal/codec.go b/x/params/types/proposal/codec.go index d638caccaf65..028c0686e3eb 100644 --- a/x/params/types/proposal/codec.go +++ b/x/params/types/proposal/codec.go @@ -3,7 +3,7 @@ package proposal import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // RegisterLegacyAminoCodec registers all necessary param module types with a given LegacyAmino codec. diff --git a/x/params/types/proposal/proposal.go b/x/params/types/proposal/proposal.go index 97d46dbe645f..f13c5fce1fd6 100644 --- a/x/params/types/proposal/proposal.go +++ b/x/params/types/proposal/proposal.go @@ -6,7 +6,7 @@ import ( "sigs.k8s.io/yaml" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) const ( @@ -17,10 +17,6 @@ const ( // Assert ParameterChangeProposal implements govtypes.Content at compile-time var _ govtypes.Content = &ParameterChangeProposal{} -func init() { - govtypes.RegisterProposalTypeCodec(&ParameterChangeProposal{}, "cosmos-sdk/ParameterChangeProposal") -} - func NewParameterChangeProposal(title, description string, changes []ParamChange) *ParameterChangeProposal { return &ParameterChangeProposal{title, description, changes} } diff --git a/x/slashing/client/testutil/cli_test.go b/x/slashing/client/testutil/cli_test.go index dd36a6af2d3e..1035ca750264 100644 --- a/x/slashing/client/testutil/cli_test.go +++ b/x/slashing/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/staking/client/testutil/cli_test.go b/x/staking/client/testutil/cli_test.go index 0a7a5cc25871..f23e88847c30 100644 --- a/x/staking/client/testutil/cli_test.go +++ b/x/staking/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/staking/module_test.go b/x/staking/module_test.go index 8784893634b6..3f1e5d916883 100644 --- a/x/staking/module_test.go +++ b/x/staking/module_test.go @@ -23,7 +23,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { genesisState := simapp.GenesisStateWithSingleValidator(t, app) stateBytes, err := tmjson.Marshal(genesisState) require.NoError(t, err) - + app.InitChain( abcitypes.RequestInitChain{ AppStateBytes: stateBytes, diff --git a/x/upgrade/client/cli/tx.go b/x/upgrade/client/cli/tx.go index f1a19ac30cab..38b0ec358a24 100644 --- a/x/upgrade/client/cli/tx.go +++ b/x/upgrade/client/cli/tx.go @@ -107,4 +107,3 @@ func NewCmdSubmitCancelUpgradeProposal() *cobra.Command { return cmd } - diff --git a/x/upgrade/client/testutil/cli_test.go b/x/upgrade/client/testutil/cli_test.go index 3c083e694726..5b3ef61c5a45 100644 --- a/x/upgrade/client/testutil/cli_test.go +++ b/x/upgrade/client/testutil/cli_test.go @@ -1,3 +1,4 @@ +//go:build norace // +build norace package testutil diff --git a/x/upgrade/handler.go b/x/upgrade/handler.go index 413217dc7206..355952ff1e21 100644 --- a/x/upgrade/handler.go +++ b/x/upgrade/handler.go @@ -3,7 +3,7 @@ package upgrade import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) diff --git a/x/upgrade/types/codec.go b/x/upgrade/types/codec.go index 59703f57a8f9..5ef751d16f3f 100644 --- a/x/upgrade/types/codec.go +++ b/x/upgrade/types/codec.go @@ -3,7 +3,7 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec diff --git a/x/upgrade/types/proposal.go b/x/upgrade/types/proposal.go index 3c33f1d5efbf..da351d48c628 100644 --- a/x/upgrade/types/proposal.go +++ b/x/upgrade/types/proposal.go @@ -3,7 +3,7 @@ package types import ( "fmt" - gov "github.com/cosmos/cosmos-sdk/x/gov/types" + gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) const ( @@ -18,11 +18,6 @@ func NewSoftwareUpgradeProposal(title, description string, plan Plan) gov.Conten // Implements Proposal Interface var _ gov.Content = &SoftwareUpgradeProposal{} -func init() { - gov.RegisterProposalTypeCodec(&SoftwareUpgradeProposal{}, "cosmos-sdk/SoftwareUpgradeProposal") - gov.RegisterProposalTypeCodec(&CancelSoftwareUpgradeProposal{}, "cosmos-sdk/CancelSoftwareUpgradeProposal") -} - func (sup *SoftwareUpgradeProposal) GetTitle() string { return sup.Title } func (sup *SoftwareUpgradeProposal) GetDescription() string { return sup.Description } func (sup *SoftwareUpgradeProposal) ProposalRoute() string { return RouterKey } From 4c2f135ecc88d2c7991b7b04683aae103236b748 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 8 Oct 2021 15:10:27 +0200 Subject: [PATCH 05/28] fix tests --- simapp/params/weights.go | 4 +--- x/gov/abci_test.go | 19 ++++++++++------- x/gov/genesis_test.go | 6 ++++-- x/gov/keeper/common_test.go | 8 ++++--- x/gov/keeper/deposit_test.go | 2 +- x/gov/keeper/grpc_query_test.go | 21 ++++++++++++------- x/gov/keeper/hooks_test.go | 2 +- x/gov/keeper/keeper_test.go | 4 ++-- x/gov/keeper/proposal_test.go | 8 +++---- x/gov/keeper/querier_test.go | 2 +- x/gov/keeper/tally_test.go | 30 +++++++++++++-------------- x/gov/keeper/vote_test.go | 2 +- x/gov/migrations/v045/migrate_test.go | 22 +++++++++++--------- x/gov/simulation/operations.go | 27 +++++++++++++++++------- x/gov/simulation/operations_test.go | 8 +++---- x/gov/types/errors.go | 7 ++++--- x/gov/types/msgs.go | 21 +++++++++---------- x/gov/types/msgs_test.go | 3 +-- x/gov/types/v1beta1/codec.go | 18 ++++++++++++++++ x/params/proposal_handler_test.go | 3 ++- x/upgrade/abci_test.go | 2 +- x/upgrade/types/proposal_test.go | 6 ++++-- 22 files changed, 136 insertions(+), 89 deletions(-) create mode 100644 x/gov/types/v1beta1/codec.go diff --git a/simapp/params/weights.go b/simapp/params/weights.go index 746e304de2be..02d83a3034c7 100644 --- a/simapp/params/weights.go +++ b/simapp/params/weights.go @@ -18,9 +18,7 @@ const ( DefaultWeightMsgUndelegate int = 100 DefaultWeightMsgBeginRedelegate int = 100 - DefaultWeightCommunitySpendProposal int = 5 - DefaultWeightTextProposal int = 5 - DefaultWeightParamChangeProposal int = 5 + DefaultWeightMsgSignalProposal int = 5 // feegrant DefaultWeightGrantAllowance int = 100 diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index cbf17f273175..0fd3da20208a 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -32,7 +32,8 @@ func TestTickExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress() + proposal := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} newProposalMsg, err := types.NewMsgSubmitProposal( proposal, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, @@ -85,7 +86,8 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress() + proposal := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} newProposalMsg, err := types.NewMsgSubmitProposal( proposal, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, @@ -109,7 +111,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - proposal2 := []sdk.Msg{types.NewMsgVote(addrs[1], 1, types.OptionNo)} + proposal2 := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionNo)} newProposalMsg2, err := types.NewMsgSubmitProposal( proposal2, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, @@ -167,7 +169,8 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.False(t, activeQueue.Valid()) activeQueue.Close() - proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress() + proposal := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} newProposalMsg, err := types.NewMsgSubmitProposal( proposal, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, @@ -224,7 +227,8 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 5))} - msgs := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress() + msgs := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} newProposalMsg, err := types.NewMsgSubmitProposal(msgs, proposalCoins, addrs[0]) require.NoError(t, err) @@ -293,7 +297,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - messages := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + messages := []sdk.Msg{types.NewMsgVote(macc.GetAddress(), 1, types.OptionYes)} proposal, err := app.GovKeeper.SubmitProposal(ctx, messages) require.NoError(t, err) @@ -344,7 +348,8 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { // Create a proposal where the handler will pass for the test proposal // because the value of contextKeyBadProposal is true. ctx = ctx.WithValue(contextKeyBadProposal, true) - messages := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress() + messages := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} proposal, err := app.GovKeeper.SubmitProposal(ctx, messages) require.NoError(t, err) diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 48a6438a27dd..f15a7ffc81f7 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -35,7 +35,8 @@ func TestImportExportQueues(t *testing.T) { ctx = app.BaseApp.NewContext(false, tmproto.Header{}) // Create two proposals, put the second into the voting period - proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress() + proposal := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} proposal1, err := app.GovKeeper.SubmitProposal(ctx, proposal) require.NoError(t, err) proposalID1 := proposal1.ProposalId @@ -151,7 +152,8 @@ func TestEqualProposals(t *testing.T) { app.BeginBlock(abci.RequestBeginBlock{Header: header}) // Submit two proposals - proposal := []sdk.Msg{types.NewMsgVote(addrs[0], 1, types.OptionYes)} + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress() + proposal := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} proposal1, err := app.GovKeeper.SubmitProposal(ctx, proposal) require.NoError(t, err) diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 5d256b9e0f21..65b9154c6307 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -7,15 +7,17 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) -var ( - TestProposal = []sdk.Msg{types.NewMsgVote(sdk.AccAddress([]byte("addrs")), 1, types.OptionYes)} -) +func createTestProposalMsgs(ctx sdk.Context, gov keeper.Keeper) []sdk.Msg { + govAcc := gov.GetGovernanceAccount(ctx).GetAddress() + return []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} +} func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 218cbd85158f..46fc8f30d1c8 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -17,7 +17,7 @@ func TestDeposits(t *testing.T) { TestAddrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(10000000)) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 4a0aac3588f5..3289ca8758b5 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -48,7 +48,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { "valid request", func() { req = &types.QueryProposalRequest{ProposalId: 1} - submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, TestProposal) + msgs := createTestProposalMsgs(ctx, app.GovKeeper) + submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, msgs) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -102,7 +103,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { func() { // create 5 test proposals for i := 0; i < 5; i++ { - proposal, err := app.GovKeeper.SubmitProposal(ctx, TestProposal) + msgs := createTestProposalMsgs(ctx, app.GovKeeper) + proposal, err := app.GovKeeper.SubmitProposal(ctx, msgs) suite.Require().NotEmpty(proposal) suite.Require().NoError(err) testProposals = append(testProposals, proposal) @@ -270,7 +272,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + msgs := createTestProposalMsgs(ctx, app.GovKeeper) + proposal, err = app.GovKeeper.SubmitProposal(ctx, msgs) suite.Require().NoError(err) req = &types.QueryVoteRequest{ @@ -375,7 +378,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + msgs := createTestProposalMsgs(ctx, app.GovKeeper) + proposal, err = app.GovKeeper.SubmitProposal(ctx, msgs) suite.Require().NoError(err) req = &types.QueryVotesRequest{ @@ -566,7 +570,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + msgs := createTestProposalMsgs(ctx, app.GovKeeper) + proposal, err = app.GovKeeper.SubmitProposal(ctx, msgs) suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -655,7 +660,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + msgs := createTestProposalMsgs(ctx, app.GovKeeper) + proposal, err = app.GovKeeper.SubmitProposal(ctx, msgs) suite.Require().NoError(err) req = &types.QueryDepositsRequest{ @@ -747,7 +753,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { "create a proposal and get tally", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + msgs := createTestProposalMsgs(ctx, app.GovKeeper) + proposal, err = app.GovKeeper.SubmitProposal(ctx, msgs) suite.Require().NoError(err) suite.Require().NotNil(proposal) diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index 2e38b386bb26..c55595f75003 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -62,7 +62,7 @@ func TestHooks(t *testing.T) { require.False(t, govHooksReceiver.AfterProposalFailedMinDepositValid) require.False(t, govHooksReceiver.AfterProposalVotingPeriodEndedValid) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) _, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalSubmissionValid) diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index e4e0b2cd97fc..16b329599901 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -40,7 +40,7 @@ func TestIncrementProposalNumber(t *testing.T) { app := simapp.Setup(t, false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) _, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) _, err = app.GovKeeper.SubmitProposal(ctx, tp) @@ -62,7 +62,7 @@ func TestProposalQueues(t *testing.T) { ctx := app.BaseApp.NewContext(false, tmproto.Header{}) // create test proposals - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 8d31308ae9c0..99d6ff638e1d 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -10,7 +10,7 @@ import ( ) func (suite *KeeperTestSuite) TestGetSetProposal() { - tp := TestProposal + tp := createTestProposalMsgs(suite.ctx, suite.app.GovKeeper) proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp) suite.Require().NoError(err) proposalID := proposal.ProposalId @@ -22,7 +22,7 @@ func (suite *KeeperTestSuite) TestGetSetProposal() { } func (suite *KeeperTestSuite) TestActivateVotingPeriod() { - tp := TestProposal + tp := createTestProposalMsgs(suite.ctx, suite.app.GovKeeper) proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp) suite.Require().NoError(err) @@ -53,7 +53,6 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { expectedErr error }{ {voteProposal, nil}, - {[]sdk.Msg{}, types.ErrNoProposalMsgs}, } for i, tc := range testCases { @@ -70,7 +69,8 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { for _, s := range status { for i := 0; i < 50; i++ { - p, err := types.NewProposal(TestProposal, proposalID, time.Now(), time.Now()) + msgs := createTestProposalMsgs(suite.ctx, suite.app.GovKeeper) + p, err := types.NewProposal(msgs, proposalID, time.Now(), time.Now()) suite.Require().NoError(err) p.Status = s diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 8f658a218164..668e453d8684 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -155,7 +155,7 @@ func TestQueries(t *testing.T) { oneCoins := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1)) consCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) depositParams, _, _ := getQueriedParams(t, ctx, legacyQuerierCdc, querier) diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 3ddec4613d37..602586acbae7 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -19,7 +19,7 @@ func TestTallyNoOneVotes(t *testing.T) { createValidators(t, ctx, app, []int64{5, 5, 5}) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -43,7 +43,7 @@ func TestTallyNoQuorum(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(10000000)) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -65,7 +65,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { ctx := app.BaseApp.NewContext(false, tmproto.Header{}) addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) @@ -92,7 +92,7 @@ func TestTallyOnlyValidators51No(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -116,7 +116,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -141,7 +141,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -167,7 +167,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -193,7 +193,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -220,7 +220,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 7}) valAccAddr1, valAccAddr2 := valAccAddrs[0], valAccAddrs[1] - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -254,7 +254,7 @@ func TestTallyDelgatorOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -290,7 +290,7 @@ func TestTallyDelgatorInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -329,7 +329,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -371,7 +371,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -414,7 +414,7 @@ func TestTallyJailedValidator(t *testing.T) { require.NoError(t, err) app.StakingKeeper.Jail(ctx, sdk.ConsAddress(consAddr.Bytes())) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId @@ -447,7 +447,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { _, err := app.StakingKeeper.Delegate(ctx, addrs[0], delTokens, stakingtypes.Unbonded, val2, true) require.NoError(t, err) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 2db792fb5873..3e4802c08320 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -17,7 +17,7 @@ func TestVotes(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) - tp := TestProposal + tp := createTestProposalMsgs(ctx, app.GovKeeper) proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId diff --git a/x/gov/migrations/v045/migrate_test.go b/x/gov/migrations/v045/migrate_test.go index f0334fafbf1e..3712c32bfcad 100644 --- a/x/gov/migrations/v045/migrate_test.go +++ b/x/gov/migrations/v045/migrate_test.go @@ -98,25 +98,27 @@ func TestMigrate(t *testing.T) { "deposits": [], "proposals": [ { - "content": { - "@type": "/cosmos.gov.v1beta1.TextProposal", - "description": "bar_text", - "title": "foo_text" - }, - "deposit_end_time": "0001-01-01T00:00:00Z", + "deposit_end_time": "2020-01-01T01:00:00Z", "final_tally_result": { "abstain": "0", "no": "0", "no_with_veto": "0", "yes": "0" }, - "proposal_id": "0", - "status": "PROPOSAL_STATUS_UNSPECIFIED", - "submit_time": "0001-01-01T00:00:00Z", + "messages": [ + { + "@type": "/cosmos.gov.v1.MsgSignal", + "description": "bar_description", + "title": "foo_title" + } + ], + "proposal_id": "5", + "status": "PROPOSAL_STATUS_DEPOSIT_PERIOD", + "submit_time": "2019-01-01T01:00:00Z", "total_deposit": [], "voting_end_time": "0001-01-01T00:00:00Z", "voting_start_time": "0001-01-01T00:00:00Z" - }, + } ], "starting_proposal_id": "0", "tally_params": { diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index c3c0a8106cef..73410d9d52f3 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -20,9 +20,10 @@ var initialProposalID = uint64(100000000000000) // Simulation operation weights constants const ( - OpWeightMsgDeposit = "op_weight_msg_deposit" - OpWeightMsgVote = "op_weight_msg_vote" - OpWeightMsgVoteWeighted = "op_weight_msg_weighted_vote" + OpWeightMsgSubmitProposal = "op_weight_msg_submit_proposal" + OpWeightMsgDeposit = "op_weight_msg_deposit" + OpWeightMsgVote = "op_weight_msg_vote" + OpWeightMsgVoteWeighted = "op_weight_msg_weighted_vote" ) // WeightedOperations returns all the operations from the module with their respective weights @@ -32,9 +33,16 @@ func WeightedOperations( ) simulation.WeightedOperations { var ( - weightMsgDeposit int - weightMsgVote int - weightMsgVoteWeighted int + weightMsgSubmitProposal int + weightMsgDeposit int + weightMsgVote int + weightMsgVoteWeighted int + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgSubmitProposal, &weightMsgSubmitProposal, nil, + func(_ *rand.Rand) { + weightMsgSubmitProposal = simappparams.DefaultWeightMsgSignalProposal + }, ) appParams.GetOrGenerate(cdc, OpWeightMsgDeposit, &weightMsgDeposit, nil, @@ -56,6 +64,10 @@ func WeightedOperations( ) return simulation.WeightedOperations{ + simulation.NewWeightedOperation( + weightMsgSubmitProposal, + SimulateMsgSubmitProposal(ak, bk, k), + ), simulation.NewWeightedOperation( weightMsgDeposit, SimulateMsgDeposit(ak, bk, k), @@ -112,7 +124,8 @@ func SimulateMsgSubmitProposal( return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err } - proposal := []sdk.Msg{types.NewMsgVote(simAccount.Address, 1, types.OptionYes)} + govAcc := k.GetGovernanceAccount(ctx).GetAddress() + proposal := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} msg, err := types.NewMsgSubmitProposal(proposal, deposit, simAccount.Address) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate a submit proposal msg"), nil, err diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 65549e4fe96c..84bbb1db7bd5 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -41,9 +41,7 @@ func TestWeightedOperations(t *testing.T) { opMsgRoute string opMsgName string }{ - {0, types.ModuleName, "submit_proposal"}, - {1, types.ModuleName, "submit_proposal"}, - {2, types.ModuleName, "submit_proposal"}, + {simappparams.DefaultWeightMsgSignalProposal, types.ModuleName, types.TypeMsgSubmitProposal}, {simappparams.DefaultWeightMsgDeposit, types.ModuleName, types.TypeMsgDeposit}, {simappparams.DefaultWeightMsgVote, types.ModuleName, types.TypeMsgVote}, {simappparams.DefaultWeightMsgVoteWeighted, types.ModuleName, types.TypeMsgVoteWeighted}, @@ -82,8 +80,8 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) - require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.Proposer) - require.Equal(t, "2686011stake", msg.InitialDeposit.String()) + require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Proposer) + require.Equal(t, "560969stake", msg.InitialDeposit.String()) require.Equal(t, "gov", msg.Route()) proposalMsgs, err := msg.GetMessages() require.NoError(t, err) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 4a70e1335975..9f86b4383175 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -14,8 +14,9 @@ var ( ErrInvalidVote = sdkerrors.Register(ModuleName, 7, "invalid vote option") ErrInvalidGenesis = sdkerrors.Register(ModuleName, 8, "invalid genesis state") ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 9, "no handler exists for proposal type") - ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 10, "proposal message has no handler") + ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 10, "proposal message not recognized by router") ErrNoProposalMsgs = sdkerrors.Register(ModuleName, 11, "no messages proposed") - ErrInvalidSigner = sdkerrors.Register(ModuleName, 12, "expected gov account as only signer for proposal message") - ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 13, "signal message is invalid") + ErrInvalidProposalMsg = sdkerrors.Register(ModuleName, 12, "invalid proposal message") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 13, "expected gov account as only signer for proposal message") + ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 14, "signal message is invalid") ) diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index 987d5b28b07a..1fd510990812 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -55,16 +55,7 @@ func (m *MsgSubmitProposal) GetProposer() sdk.AccAddress { } func (m *MsgSubmitProposal) GetMessages() ([]sdk.Msg, error) { - msgs := make([]sdk.Msg, len(m.Messages)) - for i, msgAny := range m.Messages { - msg, ok := msgAny.GetCachedValue().(sdk.Msg) - if !ok { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "messages contains %T which is not a sdk.Msg", msgAny) - } - msgs[i] = msg - } - - return msgs, nil + return sdktx.GetMsgs(m.Messages, "sdk.MsgProposal") } func (m *MsgSubmitProposal) SetInitialDeposit(coins sdk.Coins) { @@ -116,10 +107,18 @@ func (m MsgSubmitProposal) ValidateBasic() error { return ErrNoProposalMsgs } - if _, err := m.GetMessages(); err != nil { + msgs, err := m.GetMessages() + if err != nil { return err } + for idx, msg := range msgs { + if err := msg.ValidateBasic(); err != nil { + return sdkerrors.Wrap(ErrInvalidProposalMsg, + fmt.Sprintf("msg: %d, err: %s", idx, err.Error())) + } + } + return nil } diff --git a/x/gov/types/msgs_test.go b/x/gov/types/msgs_test.go index b503a66d67df..05503df2e641 100644 --- a/x/gov/types/msgs_test.go +++ b/x/gov/types/msgs_test.go @@ -172,7 +172,6 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { require.NotPanics(t, func() { bz = msg.GetSignBytes() }) - require.Equal(t, - `"{\"type\":\"cosmos-sdk/MsgSubmitProposal\",\"value\":{\"initial_deposit\":[],\"messages\":[{\"type\":\"cosmos-sdk/MsgVote\",\"value\":{\"option\":1,\"proposal_id\":\"1\",\"voter\":\"cosmos1w3jhxap3gempvr\"}}]}}"`, + require.Equal(t, "{\"type\":\"cosmos-sdk/MsgSubmitProposal\",\"value\":{\"initial_deposit\":[],\"messages\":[{\"type\":\"cosmos-sdk/MsgVote\",\"value\":{\"option\":1,\"proposal_id\":\"1\",\"voter\":\"cosmos1w3jhxap3gempvr\"}}]}}", string(bz)) } diff --git a/x/gov/types/v1beta1/codec.go b/x/gov/types/v1beta1/codec.go new file mode 100644 index 000000000000..05dd5e703434 --- /dev/null +++ b/x/gov/types/v1beta1/codec.go @@ -0,0 +1,18 @@ +package v1beta1 + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" +) + +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterInterface((*Content)(nil), nil) +} + +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterInterface( + "cosmos.gov.v1beta1.Content", + (*Content)(nil), + &TextProposal{}, + ) +} diff --git a/x/params/proposal_handler_test.go b/x/params/proposal_handler_test.go index 39f72fb6d603..94ad6f3c1736 100644 --- a/x/params/proposal_handler_test.go +++ b/x/params/proposal_handler_test.go @@ -10,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + oldgovtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/params" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -20,7 +21,7 @@ type HandlerTestSuite struct { app *simapp.SimApp ctx sdk.Context - govHandler govtypes.Handler + govHandler oldgovtypes.Handler } func (suite *HandlerTestSuite) SetupTest() { diff --git a/x/upgrade/abci_test.go b/x/upgrade/abci_test.go index 16206447ac53..915f5c36cafe 100644 --- a/x/upgrade/abci_test.go +++ b/x/upgrade/abci_test.go @@ -17,7 +17,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/upgrade" "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" "github.com/cosmos/cosmos-sdk/x/upgrade/types" diff --git a/x/upgrade/types/proposal_test.go b/x/upgrade/types/proposal_test.go index 716e201091bd..be762077246d 100644 --- a/x/upgrade/types/proposal_test.go +++ b/x/upgrade/types/proposal_test.go @@ -9,16 +9,17 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" gov "github.com/cosmos/cosmos-sdk/x/gov/types" + oldgov "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) type ProposalWrapper struct { - Prop gov.Content + Prop oldgov.Content } func TestContentAccessors(t *testing.T) { cases := map[string]struct { - p gov.Content + p oldgov.Content title string desc string typ string @@ -45,6 +46,7 @@ func TestContentAccessors(t *testing.T) { } cdc := codec.NewLegacyAmino() + oldgov.RegisterLegacyAminoCodec(cdc) gov.RegisterLegacyAminoCodec(cdc) types.RegisterLegacyAminoCodec(cdc) From de251e8f0810a55968ea0c91154b72f09cd4b3db Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 8 Oct 2021 18:08:08 +0200 Subject: [PATCH 06/28] fix some more tests --- client/docs/swagger-ui/swagger.yaml | 36 +++++++++++++-------------- x/authz/client/cli/tx.go | 2 +- x/authz/client/testutil/tx.go | 4 +-- x/feegrant/client/cli/tx.go | 2 +- x/feegrant/client/testutil/suite.go | 4 +-- x/gov/client/testutil/deposits.go | 1 + x/gov/client/testutil/helpers.go | 12 +++++++-- x/gov/client/testutil/suite.go | 6 ++--- x/gov/migrations/v040/migrate_test.go | 3 +++ x/gov/simulation/operations_test.go | 19 ++++++++++++-- x/gov/types/v1beta1/codec.go | 3 ++- 11 files changed, 60 insertions(+), 32 deletions(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 7f51b93de897..830efbc7e3b1 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -25056,7 +25056,7 @@ definitions: description: >- QueryEvidenceResponse is the response type for the Query/Evidence RPC method. - cosmos.gov.v1beta1.Deposit: + cosmos.gov.v1.Deposit: type: object properties: proposal_id: @@ -25081,7 +25081,7 @@ definitions: description: |- Deposit defines an amount deposited by an account address to an active proposal. - cosmos.gov.v1beta1.DepositParams: + cosmos.gov.v1.DepositParams: type: object properties: min_deposit: @@ -25106,7 +25106,7 @@ definitions: value: 2 months. description: DepositParams defines the params for deposits on governance proposals. - cosmos.gov.v1beta1.Proposal: + cosmos.gov.v1.Proposal: type: object properties: proposal_id: @@ -25334,7 +25334,7 @@ definitions: type: string format: date-time description: Proposal defines the core field members of a governance proposal. - cosmos.gov.v1beta1.ProposalStatus: + cosmos.gov.v1.ProposalStatus: type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -25358,7 +25358,7 @@ definitions: been rejected. - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. - cosmos.gov.v1beta1.QueryDepositResponse: + cosmos.gov.v1.QueryDepositResponse: type: object properties: deposit: @@ -25392,7 +25392,7 @@ definitions: description: >- QueryDepositResponse is the response type for the Query/Deposit RPC method. - cosmos.gov.v1beta1.QueryDepositsResponse: + cosmos.gov.v1.QueryDepositsResponse: type: object properties: deposits: @@ -25448,7 +25448,7 @@ definitions: description: >- QueryDepositsResponse is the response type for the Query/Deposits RPC method. - cosmos.gov.v1beta1.QueryParamsResponse: + cosmos.gov.v1.QueryParamsResponse: type: object properties: voting_params: @@ -25511,7 +25511,7 @@ definitions: be vetoed. Default value: 1/3. description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.gov.v1beta1.QueryProposalResponse: + cosmos.gov.v1.QueryProposalResponse: type: object properties: proposal: @@ -25754,7 +25754,7 @@ definitions: description: >- QueryProposalResponse is the response type for the Query/Proposal RPC method. - cosmos.gov.v1beta1.QueryProposalsResponse: + cosmos.gov.v1.QueryProposalsResponse: type: object properties: proposals: @@ -26021,7 +26021,7 @@ definitions: description: |- QueryProposalsResponse is the response type for the Query/Proposals RPC method. - cosmos.gov.v1beta1.QueryTallyResultResponse: + cosmos.gov.v1.QueryTallyResultResponse: type: object properties: tally: @@ -26039,7 +26039,7 @@ definitions: description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. - cosmos.gov.v1beta1.QueryVoteResponse: + cosmos.gov.v1.QueryVoteResponse: type: object properties: vote: @@ -26097,7 +26097,7 @@ definitions: Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. description: QueryVoteResponse is the response type for the Query/Vote RPC method. - cosmos.gov.v1beta1.QueryVotesResponse: + cosmos.gov.v1.QueryVotesResponse: type: object properties: votes: @@ -26176,7 +26176,7 @@ definitions: was set, its value is undefined otherwise description: QueryVotesResponse is the response type for the Query/Votes RPC method. - cosmos.gov.v1beta1.TallyParams: + cosmos.gov.v1.TallyParams: type: object properties: quorum: @@ -26198,7 +26198,7 @@ definitions: Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. description: TallyParams defines the params for tallying votes on governance proposals. - cosmos.gov.v1beta1.TallyResult: + cosmos.gov.v1.TallyResult: type: object properties: 'yes': @@ -26210,7 +26210,7 @@ definitions: no_with_veto: type: string description: TallyResult defines a standard tally for a governance proposal. - cosmos.gov.v1beta1.Vote: + cosmos.gov.v1.Vote: type: object properties: proposal_id: @@ -26264,7 +26264,7 @@ definitions: description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. - cosmos.gov.v1beta1.VoteOption: + cosmos.gov.v1.VoteOption: type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -26282,14 +26282,14 @@ definitions: - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - cosmos.gov.v1beta1.VotingParams: + cosmos.gov.v1.VotingParams: type: object properties: voting_period: type: string description: Length of the voting period. description: VotingParams defines the params for voting on governance proposals. - cosmos.gov.v1beta1.WeightedVoteOption: + cosmos.gov.v1.WeightedVoteOption: type: object properties: option: diff --git a/x/authz/client/cli/tx.go b/x/authz/client/cli/tx.go index c3157684d24c..7d4125cbb2ec 100644 --- a/x/authz/client/cli/tx.go +++ b/x/authz/client/cli/tx.go @@ -60,7 +60,7 @@ func NewCmdGrantAuthorization() *cobra.Command { Examples: $ %s tx %s grant cosmos1skjw.. send %s --spend-limit=1000stake --from=cosmos1skl.. - $ %s tx %s grant cosmos1skjw.. generic --msg-type=/cosmos.gov.v1beta1.MsgVote --from=cosmos1sk.. + $ %s tx %s grant cosmos1skjw.. generic --msg-type=/cosmos.gov.v1.MsgVote --from=cosmos1sk.. `, version.AppName, authz.ModuleName, bank.SendAuthorization{}.MsgTypeURL(), version.AppName, authz.ModuleName), ), Args: cobra.ExactArgs(2), diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index 2e02ea51bcea..5903e2986f24 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -498,7 +498,7 @@ func (s *IntegrationTestSuite) TestExecAuthorizationWithExpiration() { ) s.Require().NoError(err) // msg vote - voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1beta1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) + voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) // waiting for authorization to expires @@ -539,7 +539,7 @@ func (s *IntegrationTestSuite) TestNewExecGenericAuthorized() { s.Require().NoError(err) // msg vote - voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1beta1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) + voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) testCases := []struct { diff --git a/x/feegrant/client/cli/tx.go b/x/feegrant/client/cli/tx.go index 66022abfa90a..9be1bb821b96 100644 --- a/x/feegrant/client/cli/tx.go +++ b/x/feegrant/client/cli/tx.go @@ -57,7 +57,7 @@ Examples: %s tx %s grant cosmos1skjw... cosmos1skjw... --spend-limit 100stake --expiration 2022-01-30T15:04:05Z or %s tx %s grant cosmos1skjw... cosmos1skjw... --spend-limit 100stake --period 3600 --period-limit 10stake --expiration 36000 or %s tx %s grant cosmos1skjw... cosmos1skjw... --spend-limit 100stake --expiration 2022-01-30T15:04:05Z - --allowed-messages "/cosmos.gov.v1beta1.MsgSubmitProposal,/cosmos.gov.v1beta1.MsgVote" + --allowed-messages "/cosmos.gov.v1.MsgSubmitProposal,/cosmos.gov.v1.MsgVote" `, version.AppName, feegrant.ModuleName, version.AppName, feegrant.ModuleName, version.AppName, feegrant.ModuleName, ), ), diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index 8beff4140ff3..8651c00f12c0 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -696,7 +696,7 @@ func (s *IntegrationTestSuite) TestTxWithFeeGrant() { // granted fee allowance for an account which is not in state and creating // any tx with it by using --fee-account shouldn't fail proposal := []sdk.Msg{govtypes.NewMsgVote(grantee, 1, govtypes.OptionYes)} - out, err := govtestutil.MsgSubmitProposal(val.ClientCtx, grantee.String(), + out, err := govtestutil.MsgSubmitProposal(s.T(), val.ClientCtx, grantee.String(), proposal, fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), ) @@ -835,7 +835,7 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { { "valid proposal tx", func() (testutil.BufferWriter, error) { - return govtestutil.MsgSubmitProposal(val.ClientCtx, grantee.String(), + return govtestutil.MsgSubmitProposal(s.T(), val.ClientCtx, grantee.String(), []sdk.Msg{govtypes.NewMsgVote(grantee, 1, govtypes.OptionYes)}, fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), ) diff --git a/x/gov/client/testutil/deposits.go b/x/gov/client/testutil/deposits.go index 6127747f61c3..3dddd8680ea2 100644 --- a/x/gov/client/testutil/deposits.go +++ b/x/gov/client/testutil/deposits.go @@ -75,6 +75,7 @@ func (s *DepositTestSuite) createProposal(val *network.Validator, initialDeposit proposal := []sdk.Msg{types.NewMsgVote(val.Address, 1, types.OptionYes)} _, err := MsgSubmitProposal( + s.T(), val.ClientCtx, val.Address.String(), proposal, diff --git a/x/gov/client/testutil/helpers.go b/x/gov/client/testutil/helpers.go index 9f538df46c4f..21ac71d8ac1d 100644 --- a/x/gov/client/testutil/helpers.go +++ b/x/gov/client/testutil/helpers.go @@ -1,7 +1,9 @@ package testutil import ( + "encoding/json" "fmt" + "testing" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -18,8 +20,14 @@ var commonArgs = []string{ } // MsgSubmitProposal creates a tx for submit proposal -func MsgSubmitProposal(clientCtx client.Context, from string, messages []sdk.Msg, extraArgs ...string) (testutil.BufferWriter, error) { - args := append(commonArgs, fmt.Sprintf("--%s=%s", flags.FlagFrom, from)) +func MsgSubmitProposal(t *testing.T, clientCtx client.Context, from string, messages []sdk.Msg, extraArgs ...string) (testutil.BufferWriter, error) { + bz, err := json.Marshal(messages) + if err != nil { + return nil, err + } + msgFile := testutil.WriteToNewTempFile(t, string(bz)) + args := append(commonArgs, msgFile.Name()) + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagFrom, from)) args = append(args, extraArgs...) return clitestutil.ExecTestCLICmd(clientCtx, govcli.NewCmdSubmitProposal(), args) diff --git a/x/gov/client/testutil/suite.go b/x/gov/client/testutil/suite.go index 24a9e3f40f9e..518ac787c6e9 100644 --- a/x/gov/client/testutil/suite.go +++ b/x/gov/client/testutil/suite.go @@ -45,7 +45,7 @@ func (s *IntegrationTestSuite) SetupSuite() { messages := []sdk.Msg{types.NewMsgVote(val.Address, 1, types.OptionYes)} // create a proposal with deposit - _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), messages, + _, err = MsgSubmitProposal(s.T(), val.ClientCtx, val.Address.String(), messages, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, types.DefaultMinDepositTokens).String())) s.Require().NoError(err) _, err = s.network.WaitForHeight(1) @@ -56,13 +56,13 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(err) // create a proposal without deposit - _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), messages) + _, err = MsgSubmitProposal(s.T(), val.ClientCtx, val.Address.String(), messages) s.Require().NoError(err) _, err = s.network.WaitForHeight(1) s.Require().NoError(err) // create a proposal3 with deposit - _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), messages, + _, err = MsgSubmitProposal(s.T(), val.ClientCtx, val.Address.String(), messages, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, types.DefaultMinDepositTokens).String())) s.Require().NoError(err) _, err = s.network.WaitForHeight(1) diff --git a/x/gov/migrations/v040/migrate_test.go b/x/gov/migrations/v040/migrate_test.go index 6aeace7b1444..d5784681dacd 100644 --- a/x/gov/migrations/v040/migrate_test.go +++ b/x/gov/migrations/v040/migrate_test.go @@ -14,10 +14,13 @@ import ( v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" v036params "github.com/cosmos/cosmos-sdk/x/params/migrations/v036" v038upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/migrations/v038" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func TestMigrate(t *testing.T) { encodingConfig := simapp.MakeTestEncodingConfig() + v1beta1.RegisterLegacyAminoCodec(encodingConfig.Amino) + v1beta1.RegisterInterfaces(encodingConfig.InterfaceRegistry) clientCtx := client.Context{}. WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 84bbb1db7bd5..9e7a75eac5b7 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -9,6 +9,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,6 +20,16 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + types.RegisterLegacyAminoCodec(amino) + amino.RegisterInterface((*sdk.Msg)(nil), nil) +} + // TestWeightedOperations tests the weights of the operations. func TestWeightedOperations(t *testing.T) { app, ctx := createTestApp(t, false) @@ -77,7 +88,11 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { require.NoError(t, err) var msg types.MsgSubmitProposal - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + require.NoError(t, err) + + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress() + expectedProposalMsgs := []sdk.Msg{types.NewMsgVote(govAcc, 1, types.OptionYes)} require.True(t, operationMsg.OK) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Proposer) @@ -85,7 +100,7 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { require.Equal(t, "gov", msg.Route()) proposalMsgs, err := msg.GetMessages() require.NoError(t, err) - require.Equal(t, "abc", proposalMsgs) + require.Equal(t, expectedProposalMsgs, proposalMsgs) require.Equal(t, types.TypeMsgSubmitProposal, msg.Type()) } diff --git a/x/gov/types/v1beta1/codec.go b/x/gov/types/v1beta1/codec.go index 05dd5e703434..f78c8d75efa4 100644 --- a/x/gov/types/v1beta1/codec.go +++ b/x/gov/types/v1beta1/codec.go @@ -5,8 +5,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" ) -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterInterface((*Content)(nil), nil) + cdc.RegisterConcrete(&TextProposal{}, "cosmos-sdk/TextProposal", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { From a375e712446879636e20375a12a7f11b24d31aed Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 12 Oct 2021 16:16:53 +0200 Subject: [PATCH 07/28] fix gov cli test helper --- x/gov/client/testutil/deposits.go | 2 +- x/gov/client/testutil/helpers.go | 10 +++++++--- x/gov/migrations/v040/migrate_test.go | 2 +- x/gov/simulation/operations_test.go | 2 +- x/gov/types/v1beta1/codec.go | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/x/gov/client/testutil/deposits.go b/x/gov/client/testutil/deposits.go index 3dddd8680ea2..390d5482a160 100644 --- a/x/gov/client/testutil/deposits.go +++ b/x/gov/client/testutil/deposits.go @@ -75,7 +75,7 @@ func (s *DepositTestSuite) createProposal(val *network.Validator, initialDeposit proposal := []sdk.Msg{types.NewMsgVote(val.Address, 1, types.OptionYes)} _, err := MsgSubmitProposal( - s.T(), + s.T(), val.ClientCtx, val.Address.String(), proposal, diff --git a/x/gov/client/testutil/helpers.go b/x/gov/client/testutil/helpers.go index 21ac71d8ac1d..491f1e9b0a7b 100644 --- a/x/gov/client/testutil/helpers.go +++ b/x/gov/client/testutil/helpers.go @@ -1,7 +1,6 @@ package testutil import ( - "encoding/json" "fmt" "testing" @@ -21,10 +20,15 @@ var commonArgs = []string{ // MsgSubmitProposal creates a tx for submit proposal func MsgSubmitProposal(t *testing.T, clientCtx client.Context, from string, messages []sdk.Msg, extraArgs ...string) (testutil.BufferWriter, error) { - bz, err := json.Marshal(messages) + txBuilder := clientCtx.TxConfig.NewTxBuilder() + if err := txBuilder.SetMsgs(messages...); err != nil { + return nil, err + } + bz, err := clientCtx.TxConfig.TxJSONEncoder()(txBuilder.GetTx()) if err != nil { - return nil, err + return nil, err } + msgFile := testutil.WriteToNewTempFile(t, string(bz)) args := append(commonArgs, msgFile.Name()) args = append(args, fmt.Sprintf("--%s=%s", flags.FlagFrom, from)) diff --git a/x/gov/migrations/v040/migrate_test.go b/x/gov/migrations/v040/migrate_test.go index d5784681dacd..6c267a30b9bb 100644 --- a/x/gov/migrations/v040/migrate_test.go +++ b/x/gov/migrations/v040/migrate_test.go @@ -12,9 +12,9 @@ import ( v036distr "github.com/cosmos/cosmos-sdk/x/distribution/migrations/v036" v036gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v036" v040gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v040" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" v036params "github.com/cosmos/cosmos-sdk/x/params/migrations/v036" v038upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/migrations/v038" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func TestMigrate(t *testing.T) { diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 9e7a75eac5b7..299d5e0bca29 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -21,7 +21,7 @@ import ( ) var ( - amino = codec.NewLegacyAmino() + amino = codec.NewLegacyAmino() ModuleCdc = codec.NewAminoCodec(amino) ) diff --git a/x/gov/types/v1beta1/codec.go b/x/gov/types/v1beta1/codec.go index f78c8d75efa4..f7941e385c4b 100644 --- a/x/gov/types/v1beta1/codec.go +++ b/x/gov/types/v1beta1/codec.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" ) -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterInterface((*Content)(nil), nil) cdc.RegisterConcrete(&TextProposal{}, "cosmos-sdk/TextProposal", nil) } From 04a651ff18795ff340e6254f809a11332ba2798b Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 15 Oct 2021 16:16:18 +0200 Subject: [PATCH 08/28] attempt to fix some more tests --- simapp/params/weights.go | 2 +- x/gov/client/testutil/deposits.go | 8 +++-- x/gov/client/testutil/grpc.go | 52 +++++++++++++++---------------- x/gov/client/testutil/suite.go | 13 ++++++-- 4 files changed, 43 insertions(+), 32 deletions(-) diff --git a/simapp/params/weights.go b/simapp/params/weights.go index 02d83a3034c7..62fbb556f954 100644 --- a/simapp/params/weights.go +++ b/simapp/params/weights.go @@ -18,7 +18,7 @@ const ( DefaultWeightMsgUndelegate int = 100 DefaultWeightMsgBeginRedelegate int = 100 - DefaultWeightMsgSignalProposal int = 5 + DefaultWeightMsgSignalProposal int = 5 // feegrant DefaultWeightGrantAllowance int = 100 diff --git a/x/gov/client/testutil/deposits.go b/x/gov/client/testutil/deposits.go index 390d5482a160..230205fa214c 100644 --- a/x/gov/client/testutil/deposits.go +++ b/x/gov/client/testutil/deposits.go @@ -10,6 +10,7 @@ import ( clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -73,8 +74,11 @@ func (s *DepositTestSuite) createProposal(val *network.Validator, initialDeposit exactArgs = append(exactArgs, fmt.Sprintf("--%s=%s", cli.FlagDeposit, initialDeposit.String())) } - proposal := []sdk.Msg{types.NewMsgVote(val.Address, 1, types.OptionYes)} - _, err := MsgSubmitProposal( + govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(types.ModuleName)) + s.Require().NoError(err) + + proposal := []sdk.Msg{types.NewMsgVote(govAcc.GetAddress(), 1, types.OptionYes)} + _, err = MsgSubmitProposal( s.T(), val.ClientCtx, val.Address.String(), diff --git a/x/gov/client/testutil/grpc.go b/x/gov/client/testutil/grpc.go index 3b5312f3f3cd..090b27753df4 100644 --- a/x/gov/client/testutil/grpc.go +++ b/x/gov/client/testutil/grpc.go @@ -22,17 +22,17 @@ func (s *IntegrationTestSuite) TestGetProposalGRPC() { }{ { "empty proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, ""), true, }, { "get non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s", val.APIAddress, "10"), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, "10"), true, }, { "get proposal with id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, "1"), false, }, } @@ -68,7 +68,7 @@ func (s *IntegrationTestSuite) TestGetProposalsGRPC() { }{ { "get proposals with height 1", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals", val.APIAddress), + fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.APIAddress), map[string]string{ grpctypes.GRPCBlockHeightHeader: "1", }, @@ -77,14 +77,14 @@ func (s *IntegrationTestSuite) TestGetProposalsGRPC() { }, { "valid request", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals", val.APIAddress), + fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.APIAddress), map[string]string{}, 3, false, }, { "valid request with filter by status", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals?proposal_status=1", val.APIAddress), + fmt.Sprintf("%s/cosmos/gov/v1/proposals?proposal_status=1", val.APIAddress), map[string]string{}, 1, false, @@ -123,31 +123,31 @@ func (s *IntegrationTestSuite) TestGetProposalVoteGRPC() { }{ { "empty proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "", voterAddressBech32), true, types.NewNonSplitVoteOption(types.OptionYes), }, { "get non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "10", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "10", voterAddressBech32), true, types.NewNonSplitVoteOption(types.OptionYes), }, { "get proposal with wrong voter address", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "1", "wrongVoterAddress"), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "1", "wrongVoterAddress"), true, types.NewNonSplitVoteOption(types.OptionYes), }, { "get proposal with id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "1", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "1", voterAddressBech32), false, types.NewNonSplitVoteOption(types.OptionYes), }, { "get proposal with id for split vote", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "3", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "3", voterAddressBech32), false, types.WeightedVoteOptions{ types.WeightedVoteOption{Option: types.OptionYes, Weight: sdk.NewDecWithPrec(60, 2)}, @@ -192,12 +192,12 @@ func (s *IntegrationTestSuite) TestGetProposalVotesGRPC() { }{ { "votes with empty proposal id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes", val.APIAddress, ""), true, }, { "get votes with valid id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes", val.APIAddress, "1"), false, }, } @@ -231,22 +231,22 @@ func (s *IntegrationTestSuite) TestGetProposalDepositGRPC() { }{ { "get deposit with empty proposal id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits/%s", val.APIAddress, "", val.Address.String()), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, "", val.Address.String()), true, }, { "get deposit of non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits/%s", val.APIAddress, "10", val.Address.String()), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, "10", val.Address.String()), true, }, { "get deposit with wrong depositer address", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits/%s", val.APIAddress, "1", "wrongDepositerAddress"), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, "1", "wrongDepositerAddress"), true, }, { "get deposit valid request", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits/%s", val.APIAddress, "1", val.Address.String()), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, "1", val.Address.String()), false, }, } @@ -280,12 +280,12 @@ func (s *IntegrationTestSuite) TestGetProposalDepositsGRPC() { }{ { "get deposits with empty proposal id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits", val.APIAddress, ""), true, }, { "valid request", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits", val.APIAddress, "1"), false, }, } @@ -320,17 +320,17 @@ func (s *IntegrationTestSuite) TestGetTallyGRPC() { }{ { "get tally with no proposal id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/tally", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/tally", val.APIAddress, ""), true, }, { "get tally with non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/tally", val.APIAddress, "10"), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/tally", val.APIAddress, "10"), true, }, { "get tally valid request", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/tally", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/tally", val.APIAddress, "1"), false, }, } @@ -366,12 +366,12 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { }{ { "request params with empty params type", - fmt.Sprintf("%s/cosmos/gov/v1beta1/params/%s", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, ""), true, nil, nil, }, { "get deposit params", - fmt.Sprintf("%s/cosmos/gov/v1beta1/params/%s", val.APIAddress, types.ParamDeposit), + fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, types.ParamDeposit), false, &types.QueryParamsResponse{}, &types.QueryParamsResponse{ @@ -380,7 +380,7 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { }, { "get vote params", - fmt.Sprintf("%s/cosmos/gov/v1beta1/params/%s", val.APIAddress, types.ParamVoting), + fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, types.ParamVoting), false, &types.QueryParamsResponse{}, &types.QueryParamsResponse{ @@ -389,7 +389,7 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { }, { "get tally params", - fmt.Sprintf("%s/cosmos/gov/v1beta1/params/%s", val.APIAddress, types.ParamTallying), + fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, types.ParamTallying), false, &types.QueryParamsResponse{}, &types.QueryParamsResponse{ diff --git a/x/gov/client/testutil/suite.go b/x/gov/client/testutil/suite.go index 518ac787c6e9..d807052915bd 100644 --- a/x/gov/client/testutil/suite.go +++ b/x/gov/client/testutil/suite.go @@ -15,6 +15,7 @@ import ( clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -42,7 +43,10 @@ func (s *IntegrationTestSuite) SetupSuite() { val := s.network.Validators[0] - messages := []sdk.Msg{types.NewMsgVote(val.Address, 1, types.OptionYes)} + govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(types.ModuleName)) + s.Require().NoError(err) + + messages := []sdk.Msg{types.NewMsgVote(govAcc.GetAddress(), 1, types.OptionYes)} // create a proposal with deposit _, err = MsgSubmitProposal(s.T(), val.ClientCtx, val.Address.String(), messages, @@ -278,8 +282,11 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitProposal() { val := s.network.Validators[0] emptyProp := `[]` emptyPropFile := testutil.WriteToNewTempFile(s.T(), emptyProp) - validProp := fmt.Sprintf("[{\"type\":\"cosmos-sdk/MsgVote\",\"value\":{\"option\":1,\"proposal_id\":\"1\",\"voter\":\"cosmos1w3jhxap3gempvr\"}}]") - validPropFile := testutil.WriteToNewTempFile(s.T(), validProp) + govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(types.ModuleName)) + s.Require().NoError(err) + validProp, err := MsgVote(val.ClientCtx, govAcc.GetAddress().String(), "1", "yes", "--generate-only") + s.Require().NoError(err) + validPropFile := testutil.WriteToNewTempFile(s.T(), validProp.String()) testCases := []struct { name string args []string From c63d4f54a6315429e2bdbad0648e05d637c9d070 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 26 Oct 2021 16:38:40 +0200 Subject: [PATCH 09/28] fix gov cli test --- x/gov/client/testutil/suite.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x/gov/client/testutil/suite.go b/x/gov/client/testutil/suite.go index d807052915bd..0d17ef00047c 100644 --- a/x/gov/client/testutil/suite.go +++ b/x/gov/client/testutil/suite.go @@ -284,9 +284,11 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitProposal() { emptyPropFile := testutil.WriteToNewTempFile(s.T(), emptyProp) govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(types.ModuleName)) s.Require().NoError(err) - validProp, err := MsgVote(val.ClientCtx, govAcc.GetAddress().String(), "1", "yes", "--generate-only") - s.Require().NoError(err) - validPropFile := testutil.WriteToNewTempFile(s.T(), validProp.String()) + validProp := fmt.Sprintf( + `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"%s","to_address":"%s","amount":[{"denom":"%s","amount":"10"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, + govAcc.GetAddress().String(), val.Address.String(), s.cfg.BondDenom, + ) + validPropFile := testutil.WriteToNewTempFile(s.T(), validProp) testCases := []struct { name string args []string From 0a69e0365e199c0602c34e863fe7ec0483f5fc49 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Mon, 1 Nov 2021 14:15:43 +0100 Subject: [PATCH 10/28] merge with master --- x/gov/types/v1beta1/gov.pb.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x/gov/types/v1beta1/gov.pb.go b/x/gov/types/v1beta1/gov.pb.go index 26da7c72e53f..019673127f7e 100644 --- a/x/gov/types/v1beta1/gov.pb.go +++ b/x/gov/types/v1beta1/gov.pb.go @@ -122,6 +122,8 @@ func (ProposalStatus) EnumDescriptor() ([]byte, []int) { } // WeightedVoteOption defines a unit of vote for vote split. +// +// Since: cosmos-sdk 0.43 type WeightedVoteOption struct { Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta1.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"` @@ -331,7 +333,8 @@ 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.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. + // Since: cosmos-sdk 0.43 Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` } From 3a45e1f797029a1c51d9841dfa57bfd2bb357c17 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Mon, 1 Nov 2021 14:23:25 +0100 Subject: [PATCH 11/28] revert unnecessary changes --- client/grpc_query_test.go | 1 - client/query_test.go | 1 - cosmovisor/process_test.go | 1 - crypto/hd/hd.pb.go | 3 +-- crypto/keys/internal/ecdsa/privkey_internal_test.go | 2 +- crypto/keys/secp256k1/secp256k1_cgo.go | 1 - crypto/keys/secp256k1/secp256k1_cgo_test.go | 1 - crypto/keys/secp256k1/secp256k1_nocgo_test.go | 1 - crypto/ledger/ledger_mock.go | 1 - crypto/ledger/ledger_real.go | 1 - 10 files changed, 2 insertions(+), 11 deletions(-) diff --git a/client/grpc_query_test.go b/client/grpc_query_test.go index faff1ad5dc64..b63937ac2337 100644 --- a/client/grpc_query_test.go +++ b/client/grpc_query_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package client_test diff --git a/client/query_test.go b/client/query_test.go index 7e22d3f34452..14cc25ba9d97 100644 --- a/client/query_test.go +++ b/client/query_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package client_test diff --git a/cosmovisor/process_test.go b/cosmovisor/process_test.go index d340383841b9..f86ea1eb0b60 100644 --- a/cosmovisor/process_test.go +++ b/cosmovisor/process_test.go @@ -1,4 +1,3 @@ -//go:build linux // +build linux package cosmovisor_test diff --git a/crypto/hd/hd.pb.go b/crypto/hd/hd.pb.go index bc262474aa25..cbf26a3bae22 100644 --- a/crypto/hd/hd.pb.go +++ b/crypto/hd/hd.pb.go @@ -31,8 +31,7 @@ type BIP44Params struct { CoinType uint32 `protobuf:"varint,2,opt,name=coin_type,json=coinType,proto3" json:"coin_type,omitempty"` // account splits the key space into independent user identities Account uint32 `protobuf:"varint,3,opt,name=account,proto3" json:"account,omitempty"` - // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal - // chain. + // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal chain. Change bool `protobuf:"varint,4,opt,name=change,proto3" json:"change,omitempty"` // address_index is used as child index in BIP32 derivation AddressIndex uint32 `protobuf:"varint,5,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"` diff --git a/crypto/keys/internal/ecdsa/privkey_internal_test.go b/crypto/keys/internal/ecdsa/privkey_internal_test.go index 3574d37dca8d..1eae718f698f 100644 --- a/crypto/keys/internal/ecdsa/privkey_internal_test.go +++ b/crypto/keys/internal/ecdsa/privkey_internal_test.go @@ -80,7 +80,7 @@ func (suite *SKSuite) TestSign() { // leave r untouched! high_s := new(big.Int).Mod(new(big.Int).Neg(low_s), elliptic.P256().Params().N) - require.False(suite.pk.VerifySignature(msg, signatureRaw(r, high_s))) + require.False(suite.pk.VerifySignature(msg, signatureRaw(r,high_s))) // Valid signature using low_s, but too long sigCpy = make([]byte, len(sig)+2) diff --git a/crypto/keys/secp256k1/secp256k1_cgo.go b/crypto/keys/secp256k1/secp256k1_cgo.go index 1d104364617d..42088483d3f9 100644 --- a/crypto/keys/secp256k1/secp256k1_cgo.go +++ b/crypto/keys/secp256k1/secp256k1_cgo.go @@ -1,4 +1,3 @@ -//go:build libsecp256k1 // +build libsecp256k1 package secp256k1 diff --git a/crypto/keys/secp256k1/secp256k1_cgo_test.go b/crypto/keys/secp256k1/secp256k1_cgo_test.go index 20ae3e12780c..bfaa76caf9db 100644 --- a/crypto/keys/secp256k1/secp256k1_cgo_test.go +++ b/crypto/keys/secp256k1/secp256k1_cgo_test.go @@ -1,4 +1,3 @@ -//go:build libsecp256k1 // +build libsecp256k1 package secp256k1 diff --git a/crypto/keys/secp256k1/secp256k1_nocgo_test.go b/crypto/keys/secp256k1/secp256k1_nocgo_test.go index 878a06bfe6a9..4c2c856e13cc 100644 --- a/crypto/keys/secp256k1/secp256k1_nocgo_test.go +++ b/crypto/keys/secp256k1/secp256k1_nocgo_test.go @@ -1,4 +1,3 @@ -//go:build !libsecp256k1 // +build !libsecp256k1 package secp256k1 diff --git a/crypto/ledger/ledger_mock.go b/crypto/ledger/ledger_mock.go index 1574b07e22fe..93068474710d 100644 --- a/crypto/ledger/ledger_mock.go +++ b/crypto/ledger/ledger_mock.go @@ -1,4 +1,3 @@ -//go:build ledger && test_ledger_mock // +build ledger,test_ledger_mock package ledger diff --git a/crypto/ledger/ledger_real.go b/crypto/ledger/ledger_real.go index 48c87aff7683..07f8a8e3ed6a 100644 --- a/crypto/ledger/ledger_real.go +++ b/crypto/ledger/ledger_real.go @@ -1,4 +1,3 @@ -//go:build cgo && ledger && !test_ledger_mock // +build cgo,ledger,!test_ledger_mock package ledger From 60bcd5a6fdd00c0396ebeb9b78ffe30e2ae4be7c Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Mon, 1 Nov 2021 14:30:29 +0100 Subject: [PATCH 12/28] apply suggestions --- .../base/tendermint/v1beta1/query.proto | 16 ++-- proto/cosmos/gov/v1/tx.proto | 6 +- proto/cosmos/gov/v1beta1/gov.proto | 2 +- testutil/testdata/testdata.proto | 8 +- x/feegrant/client/testutil/suite.go | 6 +- x/gov/types/tx.pb.go | 94 +++++++++---------- 6 files changed, 68 insertions(+), 64 deletions(-) diff --git a/proto/cosmos/base/tendermint/v1beta1/query.proto b/proto/cosmos/base/tendermint/v1beta1/query.proto index c5a64c3c651c..f06b19959798 100644 --- a/proto/cosmos/base/tendermint/v1beta1/query.proto +++ b/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -117,15 +117,15 @@ message GetNodeInfoResponse { // VersionInfo is the type for the GetNodeInfoResponse message. message VersionInfo { - string name = 1; - string app_name = 2; - string version = 3; - string git_commit = 4; - string build_tags = 5; - string go_version = 6; - repeated Module build_deps = 7; + string name = 1; + string app_name = 2; + string version = 3; + string git_commit = 4; + string build_tags = 5; + string go_version = 6; + repeated Module build_deps = 7; // Since: cosmos-sdk 0.43 - string cosmos_sdk_version = 8; + string cosmos_sdk_version = 8; } // Module is the type for VersionInfo diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 665d5b604f26..95f639bd1e0c 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -57,7 +57,7 @@ message MsgVote { option (gogoproto.goproto_getters) = false; uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; VoteOption option = 3; } @@ -74,7 +74,7 @@ message MsgVoteWeighted { option (gogoproto.goproto_getters) = false; uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; } @@ -112,4 +112,4 @@ message MsgSignal { } // MsgSignalResponse defined the Msg/Signal response type -message MsgSignalResponse {} \ No newline at end of file +message MsgSignalResponse {} diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 8c52fd891217..965828b0ba75 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -141,7 +141,7 @@ message Vote { // 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. - VoteOption option = 3 [deprecated = true]; + VoteOption option = 3 [deprecated = true]; // Since: cosmos-sdk 0.43 repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; } diff --git a/testutil/testdata/testdata.proto b/testutil/testdata/testdata.proto index b46cbf031df7..55e0e10b0a89 100644 --- a/testutil/testdata/testdata.proto +++ b/testutil/testdata/testdata.proto @@ -37,8 +37,8 @@ message BadMultiSignature { } message TableModel { - uint64 id = 1; - string name = 2; - uint64 number = 3; - bytes metadata = 4; + uint64 id = 1; + string name = 2; + uint64 number = 3; + bytes metadata = 4; } diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index 8651c00f12c0..cfe53c2e12b3 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -18,6 +18,7 @@ import ( clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/feegrant" "github.com/cosmos/cosmos-sdk/x/feegrant/client/cli" govtestutil "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" @@ -825,6 +826,9 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { spendLimit.String(), ) + govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(feegrant.ModuleName)) + s.Require().NoError(err) + // exec filtered fee allowance cases := []struct { name string @@ -836,7 +840,7 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { "valid proposal tx", func() (testutil.BufferWriter, error) { return govtestutil.MsgSubmitProposal(s.T(), val.ClientCtx, grantee.String(), - []sdk.Msg{govtypes.NewMsgVote(grantee, 1, govtypes.OptionYes)}, + []sdk.Msg{govtypes.NewMsgVote(govAcc.GetAddress(), 1, govtypes.OptionYes)}, fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), ) }, diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index 32def0887836..8fa5fcdd5009 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -441,53 +441,53 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 724 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x41, 0x6b, 0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, 0x0b, 0xae, 0x5c, 0x40, 0x0b, 0xcc, 0xf9, 0x88, 0xb5, 0x23, 0x22, 0x8d, 0x25, 0x0f, - 0x6d, 0x34, 0x94, 0xd1, 0xec, 0x92, 0x7c, 0x45, 0x04, 0x6d, 0xd2, 0x6b, 0xfd, 0x65, 0x0e, 0xe4, - 0x9a, 0x0c, 0xc3, 0xc7, 0x60, 0x7e, 0xec, 0x7d, 0xb1, 0xc6, 0x8e, 0x7a, 0xe2, 0xf2, 0x95, 0x6b, - 0xbf, 0xaa, 0x48, 0xaf, 0xe7, 0x4d, 0x30, 0x2d, 0x2e, 0xda, 0xd2, 0x24, 0x22, 0x8e, 0x97, 0xcd, - 0xec, 0x78, 0x8a, 0xdf, 0x01, 0xff, 0x9e, 0xb1, 0xf9, 0x39, 0xf5, 0x49, 0xbe, 0x7c, 0xe5, 0xe2, - 0x7c, 0xca, 0x7b, 0x07, 0xcc, 0x24, 0x5e, 0x2b, 0x4d, 0x42, 0x54, 0xaa, 0xbc, 0x72, 0x6e, 0x2a, - 0x25, 0xda, 0x02, 0x79, 0x75, 0x5e, 0x46, 0xc6, 0xa6, 0x88, 0x4c, 0xd9, 0x3a, 0x2f, 0x93, 0xb0, - 0x34, 0x1a, 0x87, 0x27, 0xa6, 0x7e, 0x74, 0x62, 0xea, 0x5f, 0x4e, 0x4c, 0xfd, 0xd5, 0xa9, 0xa9, - 0x1d, 0x9d, 0x9a, 0xda, 0xc7, 0x53, 0x53, 0x7b, 0x74, 0xb1, 0xd9, 0xf6, 0xc5, 0xf7, 0x47, 0x58, - 0xae, 0x95, 0x17, 0x8f, 0xff, 0xd5, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x4c, 0xc9, 0x42, - 0xe1, 0x06, 0x00, 0x00, + // 722 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xde, 0x6d, 0xda, 0xb4, 0x99, 0x6a, 0x6b, 0xc7, 0xd0, 0x6e, 0x72, 0xd8, 0xa4, 0x01, 0x25, + 0x97, 0xee, 0x36, 0x55, 0x14, 0x7a, 0x10, 0x1a, 0x8b, 0xe2, 0x21, 0x28, 0x5b, 0xac, 0x20, 0x42, + 0xd9, 0x64, 0xc7, 0xe9, 0x60, 0xb2, 0xb3, 0xec, 0x4c, 0x42, 0x73, 0x13, 0xbc, 0x88, 0x27, 0x8f, + 0x1e, 0x7b, 0xf6, 0xec, 0x6f, 0x90, 0xde, 0x2c, 0x9e, 0x3c, 0x48, 0x95, 0xf6, 0x22, 0x82, 0x17, + 0x7f, 0x81, 0xec, 0xcc, 0xec, 0x26, 0x4d, 0xb6, 0x2d, 0x82, 0x9e, 0x92, 0x79, 0xef, 0xfb, 0xbe, + 0x79, 0xdf, 0xdb, 0xf7, 0x76, 0xc1, 0x62, 0x8b, 0xb2, 0x0e, 0x65, 0x36, 0xa6, 0x3d, 0xbb, 0x57, + 0xb3, 0xf9, 0x9e, 0x15, 0x84, 0x94, 0x53, 0x78, 0x59, 0xc6, 0x2d, 0x4c, 0x7b, 0x56, 0xaf, 0x56, + 0x34, 0x15, 0xac, 0xe9, 0x32, 0x64, 0xf7, 0x6a, 0x4d, 0xc4, 0xdd, 0x9a, 0xdd, 0xa2, 0xc4, 0x97, + 0xf0, 0xe2, 0xd2, 0x69, 0x99, 0x88, 0x25, 0x13, 0x05, 0x99, 0xd8, 0x11, 0x27, 0x5b, 0x89, 0xca, + 0x54, 0x1e, 0x53, 0x4c, 0x65, 0x3c, 0xfa, 0x17, 0x13, 0x30, 0xa5, 0xb8, 0x8d, 0x6c, 0x71, 0x6a, + 0x76, 0x9f, 0xdb, 0xae, 0xdf, 0x97, 0xa9, 0xca, 0xab, 0x09, 0xb0, 0xd0, 0x60, 0x78, 0xab, 0xdb, + 0xec, 0x10, 0xfe, 0x28, 0xa4, 0x01, 0x65, 0x6e, 0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 0xc4, 0x5a, 0x21, 0x91, 0x23, 0x27, 0x9c, 0x3a, 0xc3, 0xa1, + 0x94, 0xcb, 0xae, 0xca, 0x37, 0x8f, 0x90, 0x8d, 0xef, 0x5a, 0x7b, 0x93, 0x01, 0x99, 0x06, 0xc3, + 0xf0, 0x19, 0x98, 0x1b, 0x79, 0x27, 0x95, 0x47, 0x1e, 0xf5, 0xd8, 0xc2, 0x16, 0xab, 0x17, 0x21, + 0x92, 0x95, 0xbe, 0x03, 0x26, 0xc5, 0x72, 0x2e, 0x8e, 0x33, 0xa2, 0x78, 0xd1, 0x4c, 0x8f, 0x27, + 0xfc, 0x6d, 0x70, 0xe9, 0xd4, 0x02, 0x9c, 0x81, 0x8f, 0xf3, 0xc5, 0xeb, 0xe7, 0xe7, 0x13, 0xdd, + 0xfb, 0x60, 0x3a, 0x9e, 0xb5, 0xc2, 0x38, 0x45, 0xa5, 0x8a, 0xcb, 0x67, 0xa6, 0x12, 0xa1, 0x4d, + 0x90, 0x55, 0xcf, 0xcb, 0x48, 0x69, 0x8a, 0xc8, 0x14, 0xcb, 0x67, 0x65, 0x62, 0x95, 0x7a, 0xfd, + 0xe0, 0xd8, 0xd4, 0x0f, 0x8f, 0x4d, 0xfd, 0xfb, 0xb1, 0xa9, 0xbf, 0x3d, 0x31, 0xb5, 0xc3, 0x13, + 0x53, 0xfb, 0x72, 0x62, 0x6a, 0x4f, 0xcf, 0x1f, 0xb6, 0x3d, 0xf1, 0xcd, 0x12, 0x23, 0xd7, 0xcc, + 0x8a, 0x0f, 0xc6, 0x8d, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x58, 0x70, 0x68, 0x15, 0x07, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From f9c867fb02bbbd995797b64a9659cf9ea11c2f3a Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Mon, 1 Nov 2021 22:57:31 +0100 Subject: [PATCH 13/28] revert unnecessary changes --- db/version_manager.go | 6 +- proto/cosmos/auth/v1beta1/auth.proto | 21 +++--- proto/cosmos/auth/v1beta1/query.proto | 4 +- proto/cosmos/authz/v1beta1/tx.proto | 5 +- proto/cosmos/bank/v1beta1/query.proto | 3 +- .../base/tendermint/v1beta1/query.proto | 16 ++--- proto/cosmos/base/v1beta1/coin.proto | 6 +- .../capability/v1beta1/capability.proto | 2 +- proto/cosmos/crisis/v1beta1/genesis.proto | 3 +- proto/cosmos/crypto/hd/v1/hd.proto | 27 ++++--- proto/cosmos/crypto/keyring/v1/record.proto | 18 ++--- proto/cosmos/crypto/multisig/keys.proto | 3 +- proto/cosmos/slashing/v1beta1/slashing.proto | 26 ++++--- proto/cosmos/staking/v1beta1/genesis.proto | 12 ++-- proto/cosmos/staking/v1beta1/query.proto | 2 +- proto/cosmos/staking/v1beta1/staking.proto | 71 +++++++------------ proto/cosmos/staking/v1beta1/tx.proto | 14 ++-- proto/cosmos/upgrade/v1beta1/upgrade.proto | 3 +- proto/cosmos/vesting/v1beta1/tx.proto | 7 +- proto/cosmos/vesting/v1beta1/vesting.proto | 20 ++++-- server/grpc/server_test.go | 1 - simapp/params/amino.go | 1 - testutil/network/network_test.go | 1 - testutil/testdata/testdata.proto | 8 +-- types/module/module_test.go | 4 +- x/auth/client/testutil/cli_test.go | 1 - x/auth/keeper/grpc_query_test.go | 20 +++--- x/auth/vesting/client/testutil/cli_test.go | 1 - x/authz/client/testutil/cli_test.go | 1 - x/bank/client/testutil/cli_test.go | 1 - x/crisis/client/testsuite/cli_test.go | 1 - x/distribution/client/testutil/cli_test.go | 1 - x/feegrant/client/testutil/cli_test.go | 1 - x/genutil/client/testutil/cli_test.go | 1 - x/mint/client/testutil/cli_test.go | 1 - x/params/client/testutil/cli_test.go | 1 - x/staking/client/testutil/cli_test.go | 1 - x/staking/module_test.go | 2 +- x/upgrade/client/testutil/cli_test.go | 1 - 39 files changed, 156 insertions(+), 162 deletions(-) diff --git a/db/version_manager.go b/db/version_manager.go index b8a2a6b055b5..b884e7160114 100644 --- a/db/version_manager.go +++ b/db/version_manager.go @@ -65,7 +65,7 @@ func (vm *VersionManager) Save(target uint64) (uint64, error) { } func findLimit(m map[uint64]struct{}, cmp func(uint64, uint64) bool, init uint64) uint64 { - for x := range m { + for x, _ := range m { if cmp(x, init) { init = x } @@ -99,7 +99,7 @@ func (vi *vmIterator) Value() uint64 { return vi.buf } func (vm *VersionManager) Iterator() VersionIterator { ch := make(chan uint64) go func() { - for ver := range vm.versions { + for ver, _ := range vm.versions { ch <- ver } close(ch) @@ -125,7 +125,7 @@ func (vm *VersionManager) Equal(that VersionSet) bool { func (vm *VersionManager) Copy() *VersionManager { vmap := make(map[uint64]struct{}) - for ver := range vm.versions { + for ver, _ := range vm.versions { vmap[ver] = struct{}{} } return &VersionManager{versions: vmap, initial: vm.initial, last: vm.last} diff --git a/proto/cosmos/auth/v1beta1/auth.proto b/proto/cosmos/auth/v1beta1/auth.proto index 963c6f15198d..a9e1e7e83d4a 100644 --- a/proto/cosmos/auth/v1beta1/auth.proto +++ b/proto/cosmos/auth/v1beta1/auth.proto @@ -17,10 +17,11 @@ message BaseAccount { option (cosmos_proto.implements_interface) = "AccountI"; - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty"]; - uint64 account_number = 3; - uint64 sequence = 4; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pub_key = 2 + [(gogoproto.jsontag) = "public_key,omitempty"]; + uint64 account_number = 3; + uint64 sequence = 4; } // ModuleAccount defines an account for modules that holds coins on a pool. @@ -39,9 +40,11 @@ message Params { option (gogoproto.equal) = true; option (gogoproto.goproto_stringer) = false; - uint64 max_memo_characters = 1; - uint64 tx_sig_limit = 2; - uint64 tx_size_cost_per_byte = 3; - uint64 sig_verify_cost_ed25519 = 4 [(gogoproto.customname) = "SigVerifyCostED25519"]; - uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1"]; + uint64 max_memo_characters = 1; + uint64 tx_sig_limit = 2; + uint64 tx_size_cost_per_byte = 3; + uint64 sig_verify_cost_ed25519 = 4 + [(gogoproto.customname) = "SigVerifyCostED25519"]; + uint64 sig_verify_cost_secp256k1 = 5 + [(gogoproto.customname) = "SigVerifyCostSecp256k1"]; } diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto index 7798da00233a..d99d594016a6 100644 --- a/proto/cosmos/auth/v1beta1/query.proto +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -102,10 +102,10 @@ message QueryModuleAccountsResponse { } // Bech32PrefixRequest is the request type for Bech32Prefix rpc method -message Bech32PrefixRequest {} +message Bech32PrefixRequest {} // Bech32PrefixResponse is the response type for Bech32Prefix rpc method -message Bech32PrefixResponse { +message Bech32PrefixResponse { string bech32_prefix = 1; } diff --git a/proto/cosmos/authz/v1beta1/tx.proto b/proto/cosmos/authz/v1beta1/tx.proto index b012dbe2b5e1..b99feee45889 100644 --- a/proto/cosmos/authz/v1beta1/tx.proto +++ b/proto/cosmos/authz/v1beta1/tx.proto @@ -61,9 +61,8 @@ message MsgGrantResponse {} // MsgRevoke revokes any authorization with the provided sdk.Msg type on the // granter's account with that has been granted to the grantee. message MsgRevoke { - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - ; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];; string msg_type_url = 3; } diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index e43a839e4738..bfe4ebaa819c 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -186,8 +186,7 @@ message QueryDenomOwnersRequest { // balance of the denominated token. message DenomOwner { // address defines the address that owns a particular denomination. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - ; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];; // balance is the balance of the denominated coin for an account. cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; diff --git a/proto/cosmos/base/tendermint/v1beta1/query.proto b/proto/cosmos/base/tendermint/v1beta1/query.proto index f06b19959798..c5a64c3c651c 100644 --- a/proto/cosmos/base/tendermint/v1beta1/query.proto +++ b/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -117,15 +117,15 @@ message GetNodeInfoResponse { // VersionInfo is the type for the GetNodeInfoResponse message. message VersionInfo { - string name = 1; - string app_name = 2; - string version = 3; - string git_commit = 4; - string build_tags = 5; - string go_version = 6; - repeated Module build_deps = 7; + string name = 1; + string app_name = 2; + string version = 3; + string git_commit = 4; + string build_tags = 5; + string go_version = 6; + repeated Module build_deps = 7; // Since: cosmos-sdk 0.43 - string cosmos_sdk_version = 8; + string cosmos_sdk_version = 8; } // Module is the type for VersionInfo diff --git a/proto/cosmos/base/v1beta1/coin.proto b/proto/cosmos/base/v1beta1/coin.proto index 69e67e099543..79dadf66252f 100644 --- a/proto/cosmos/base/v1beta1/coin.proto +++ b/proto/cosmos/base/v1beta1/coin.proto @@ -16,8 +16,7 @@ message Coin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 - [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; + string amount = 2 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; } // DecCoin defines a token with a denomination and a decimal amount. @@ -28,8 +27,7 @@ message DecCoin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 - [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string amount = 2 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; } // IntProto defines a Protobuf wrapper around an Int object. diff --git a/proto/cosmos/capability/v1beta1/capability.proto b/proto/cosmos/capability/v1beta1/capability.proto index c433566d3282..5212b7bef5fa 100644 --- a/proto/cosmos/capability/v1beta1/capability.proto +++ b/proto/cosmos/capability/v1beta1/capability.proto @@ -9,7 +9,7 @@ import "gogoproto/gogo.proto"; // provided to a Capability must be globally unique. message Capability { option (gogoproto.goproto_stringer) = false; - + uint64 index = 1; } diff --git a/proto/cosmos/crisis/v1beta1/genesis.proto b/proto/cosmos/crisis/v1beta1/genesis.proto index 5c2916046d50..245c71462db3 100644 --- a/proto/cosmos/crisis/v1beta1/genesis.proto +++ b/proto/cosmos/crisis/v1beta1/genesis.proto @@ -10,5 +10,6 @@ import "cosmos/base/v1beta1/coin.proto"; message GenesisState { // constant_fee is the fee used to verify the invariant in the crisis // module. - cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin constant_fee = 3 + [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/crypto/hd/v1/hd.proto b/proto/cosmos/crypto/hd/v1/hd.proto index e4a95afcba9f..eaf6ad40a9e7 100644 --- a/proto/cosmos/crypto/hd/v1/hd.proto +++ b/proto/cosmos/crypto/hd/v1/hd.proto @@ -3,21 +3,20 @@ package cosmos.crypto.hd.v1; import "gogoproto/gogo.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; +option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; option (gogoproto.goproto_getters_all) = false; // BIP44Params is used as path field in ledger item in Record. -message BIP44Params { - option (gogoproto.goproto_stringer) = false; - // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation - uint32 purpose = 1; - // coin_type is a constant that improves privacy - uint32 coin_type = 2; - // account splits the key space into independent user identities - uint32 account = 3; - // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal - // chain. - bool change = 4; - // address_index is used as child index in BIP32 derivation - uint32 address_index = 5; +message BIP44Params { + option (gogoproto.goproto_stringer) = false; + // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation + uint32 purpose = 1; + // coin_type is a constant that improves privacy + uint32 coin_type = 2; + // account splits the key space into independent user identities + uint32 account = 3; + // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal chain. + bool change = 4; + // address_index is used as child index in BIP32 derivation + uint32 address_index = 5; } diff --git a/proto/cosmos/crypto/keyring/v1/record.proto b/proto/cosmos/crypto/keyring/v1/record.proto index 9b2d3c96439f..757a8ab14084 100644 --- a/proto/cosmos/crypto/keyring/v1/record.proto +++ b/proto/cosmos/crypto/keyring/v1/record.proto @@ -5,14 +5,14 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos/crypto/hd/v1/hd.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; option (gogoproto.goproto_getters_all) = false; // Record is used for representing a key in the keyring. message Record { // name represents a name of Record string name = 1; - // pub_key represents a public key in any format + // pub_key represents a public key in any format google.protobuf.Any pub_key = 2; // Record contains one of the following items @@ -20,21 +20,21 @@ message Record { // local stores the public information about a locally stored key Local local = 3; // ledger stores the public information about a Ledger key - Ledger ledger = 4; + Ledger ledger = 4; // Multi does not store any information. - Multi multi = 5; - // Offline does not store any information. - Offline offline = 6; + Multi multi = 5; + // Offline does not store any information. + Offline offline = 6; } // Item is a keyring item stored in a keyring backend. // Local item message Local { - google.protobuf.Any priv_key = 1; - string priv_key_type = 2; + google.protobuf.Any priv_key = 1; + string priv_key_type = 2; } - // Ledger item + // Ledger item message Ledger { hd.v1.BIP44Params path = 1; } diff --git a/proto/cosmos/crypto/multisig/keys.proto b/proto/cosmos/crypto/multisig/keys.proto index 7a11fe3369b3..ea3248bc8996 100644 --- a/proto/cosmos/crypto/multisig/keys.proto +++ b/proto/cosmos/crypto/multisig/keys.proto @@ -13,5 +13,6 @@ message LegacyAminoPubKey { option (gogoproto.goproto_getters) = false; uint32 threshold = 1; - repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys"]; + repeated google.protobuf.Any public_keys = 2 + [(gogoproto.customname) = "PubKeys"]; } diff --git a/proto/cosmos/slashing/v1beta1/slashing.proto b/proto/cosmos/slashing/v1beta1/slashing.proto index 0aa9f61ffe58..5a8f3b2659be 100644 --- a/proto/cosmos/slashing/v1beta1/slashing.proto +++ b/proto/cosmos/slashing/v1beta1/slashing.proto @@ -23,7 +23,8 @@ message ValidatorSigningInfo { // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. int64 index_offset = 3; // Timestamp until which the validator is jailed due to liveness downtime. - google.protobuf.Timestamp jailed_until = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp jailed_until = 4 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; // Whether or not a validator has been tombstoned (killed out of validator set). It is set // once the validator commits an equivocation or for any other configured misbehiavor. bool tombstoned = 5; @@ -35,11 +36,20 @@ message ValidatorSigningInfo { // Params represents the parameters used for by the slashing module. message Params { int64 signed_blocks_window = 1; - bytes min_signed_per_window = 2 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - google.protobuf.Duration downtime_jail_duration = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; - bytes slash_fraction_double_sign = 4 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - bytes slash_fraction_downtime = 5 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes min_signed_per_window = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + google.protobuf.Duration downtime_jail_duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + bytes slash_fraction_double_sign = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + bytes slash_fraction_downtime = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } diff --git a/proto/cosmos/staking/v1beta1/genesis.proto b/proto/cosmos/staking/v1beta1/genesis.proto index bf3c298e39a6..20518f6375b8 100644 --- a/proto/cosmos/staking/v1beta1/genesis.proto +++ b/proto/cosmos/staking/v1beta1/genesis.proto @@ -14,12 +14,15 @@ message GenesisState { // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. - bytes last_total_power = 2 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + bytes last_total_power = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; // last_validator_powers is a special index that provides a historical list // of the last-block's bonded validators. - repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false]; + repeated LastValidatorPower last_validator_powers = 3 + [(gogoproto.nullable) = false]; // delegations defines the validator set at genesis. repeated Validator validators = 4 [(gogoproto.nullable) = false]; @@ -28,7 +31,8 @@ message GenesisState { repeated Delegation delegations = 5 [(gogoproto.nullable) = false]; // unbonding_delegations defines the unbonding delegations active at genesis. - repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false]; + repeated UnbondingDelegation unbonding_delegations = 6 + [(gogoproto.nullable) = false]; // redelegations defines the redelegations active at genesis. repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false]; diff --git a/proto/cosmos/staking/v1beta1/query.proto b/proto/cosmos/staking/v1beta1/query.proto index 02469232ba06..c0716402f9b6 100644 --- a/proto/cosmos/staking/v1beta1/query.proto +++ b/proto/cosmos/staking/v1beta1/query.proto @@ -114,7 +114,7 @@ message QueryValidatorsResponse { // QueryValidatorRequest is response type for the Query/Validator RPC method message QueryValidatorRequest { // validator_addr defines the validator address to query for. - string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryValidatorResponse is response type for the Query/Validator RPC method diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index 19d912519a06..d5205de93653 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -28,20 +28,16 @@ message CommissionRates { option (gogoproto.goproto_stringer) = false; // rate is the commission rate charged to delegators, as a fraction. - string rate = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + string rate = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. string max_rate = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. string max_change_rate = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -55,7 +51,8 @@ message Commission { // commission_rates defines the initial commission rates to be used for creating a validator. CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // update_time is the last time the commission rate was changed. - google.protobuf.Timestamp update_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp update_time = 2 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // Description defines a validator description. @@ -91,20 +88,17 @@ message Validator { // operator_address defines the address of the validator's operator; bech encoded in JSON. string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + google.protobuf.Any consensus_pubkey = 2 + [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; // jailed defined whether the validator has been jailed from bonded status or not. bool jailed = 3; // status is the validator status (bonded/unbonding/unbonded). BondStatus status = 4; // tokens define the delegated tokens (incl. self-delegation). - string tokens = 5 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; + string tokens = 5 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; // delegator_shares defines total shares issued to a validator's delegators. string delegator_shares = 6 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -113,12 +107,13 @@ message Validator { // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. int64 unbonding_height = 8; // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - google.protobuf.Timestamp unbonding_time = 9 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp unbonding_time = 9 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // commission defines the commission parameters. Commission commission = 10 [(gogoproto.nullable) = false]; // min_self_delegation is the validator's self declared minimum self delegation. string min_self_delegation = 11 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -195,11 +190,7 @@ message Delegation { // validator_address is the bech32-encoded address of the validator. string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // shares define the delegation shares received. - string shares = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + string shares = 3 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; } // UnbondingDelegation stores all of a single delegator's unbonding bonds @@ -225,19 +216,16 @@ message UnbondingDelegationEntry { // creation_height is the height which the unbonding took place. int64 creation_height = 1; // completion_time is the unix time for unbonding completion. - google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // initial_balance defines the tokens initially scheduled to receive at completion. string initial_balance = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; // balance defines the tokens to receive at completion. - string balance = 4 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; + string balance = 4 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; } // RedelegationEntry defines a redelegation object with relevant metadata. @@ -248,19 +236,17 @@ message RedelegationEntry { // creation_height defines the height which the redelegation took place. int64 creation_height = 1; // completion_time defines the unix time for redelegation completion. - google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 2 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // initial_balance defines the initial balance when redelegation started. string initial_balance = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; // shares_dst is the amount of destination-validator shares created by redelegation. - string shares_dst = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + string shares_dst = 4 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; } // Redelegation contains the list of a particular delegator's redelegating bonds @@ -286,7 +272,8 @@ message Params { option (gogoproto.goproto_stringer) = false; // unbonding_time is the time duration of unbonding. - google.protobuf.Duration unbonding_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration unbonding_time = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // max_validators is the maximum number of validators. uint32 max_validators = 2; // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). @@ -315,11 +302,7 @@ message RedelegationEntryResponse { option (gogoproto.equal) = true; RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false]; - string balance = 4 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; + string balance = 4 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; } // RedelegationResponse is equivalent to a Redelegation except that its entries @@ -338,13 +321,13 @@ message Pool { option (gogoproto.description) = true; option (gogoproto.equal) = true; string not_bonded_tokens = 1 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.jsontag) = "not_bonded_tokens", (gogoproto.nullable) = false ]; string bonded_tokens = 2 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.jsontag) = "bonded_tokens", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index b0fddf4ee2b7..a97ce7adbc46 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -40,7 +40,7 @@ message MsgCreateValidator { Description description = 1 [(gogoproto.nullable) = false]; CommissionRates commission = 2 [(gogoproto.nullable) = false]; string min_self_delegation = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", + (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; @@ -65,10 +65,14 @@ message MsgEditValidator { // it's not mandatory to update. If not updated, the deserialized rate will be // zero with no way to distinguish if an update was intended. // REF: #2373 - string commission_rate = 3 - [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; - string min_self_delegation = 4 - [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; + string commission_rate = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; + string min_self_delegation = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; } // MsgEditValidatorResponse defines the Msg/EditValidator response type. diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index e2a155bca53c..70a90b1f0ad5 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -38,7 +38,8 @@ message Plan { // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. // If this field is not empty, an error will be thrown. - google.protobuf.Any upgraded_client_state = 5 [deprecated = true]; + google.protobuf.Any upgraded_client_state = 5 + [deprecated = true]; } // SoftwareUpgradeProposal is a gov Content type for initiating a software diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto index 5042fd01bdaf..845e70582244 100644 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -35,14 +35,15 @@ message MsgCreateVestingAccount { // MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. message MsgCreateVestingAccountResponse {} + // MsgCreateVestingAccount defines a message that enables creating a vesting // account. message MsgCreatePeriodicVestingAccount { option (gogoproto.equal) = false; - string from_address = 1; - string to_address = 2; - int64 start_time = 3; + string from_address = 1; + string to_address = 2; + int64 start_time = 3; repeated Period vesting_periods = 4 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/vesting/v1beta1/vesting.proto b/proto/cosmos/vesting/v1beta1/vesting.proto index 824cc30d8bb1..59580245aea4 100644 --- a/proto/cosmos/vesting/v1beta1/vesting.proto +++ b/proto/cosmos/vesting/v1beta1/vesting.proto @@ -14,12 +14,18 @@ message BaseVestingAccount { option (gogoproto.goproto_stringer) = false; cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; - repeated cosmos.base.v1beta1.Coin original_vesting = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - repeated cosmos.base.v1beta1.Coin delegated_free = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; int64 end_time = 5; } @@ -60,7 +66,7 @@ message PeriodicVestingAccount { BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; int64 start_time = 2; - repeated Period vesting_periods = 3 [(gogoproto.nullable) = false]; + repeated Period vesting_periods = 3 [(gogoproto.nullable) = false]; } // PermanentLockedAccount implements the VestingAccount interface. It does diff --git a/server/grpc/server_test.go b/server/grpc/server_test.go index 8e34d0ff71e5..8ea293a9169c 100644 --- a/server/grpc/server_test.go +++ b/server/grpc/server_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package grpc_test diff --git a/simapp/params/amino.go b/simapp/params/amino.go index d603987dd5f5..cdf86d0ea2e0 100644 --- a/simapp/params/amino.go +++ b/simapp/params/amino.go @@ -1,4 +1,3 @@ -//go:build test_amino // +build test_amino package params diff --git a/testutil/network/network_test.go b/testutil/network/network_test.go index 7dbf18351822..e13c8c454d28 100644 --- a/testutil/network/network_test.go +++ b/testutil/network/network_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package network_test diff --git a/testutil/testdata/testdata.proto b/testutil/testdata/testdata.proto index 55e0e10b0a89..b46cbf031df7 100644 --- a/testutil/testdata/testdata.proto +++ b/testutil/testdata/testdata.proto @@ -37,8 +37,8 @@ message BadMultiSignature { } message TableModel { - uint64 id = 1; - string name = 2; - uint64 number = 3; - bytes metadata = 4; + uint64 id = 1; + string name = 2; + uint64 number = 3; + bytes metadata = 4; } diff --git a/types/module/module_test.go b/types/module/module_test.go index 0cc0dd9e24d8..4dbb4a73c5b6 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -5,17 +5,17 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" "github.com/gorilla/mux" + "github.com/golang/mock/gomock" "github.com/spf13/cobra" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/tests/mocks" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" diff --git a/x/auth/client/testutil/cli_test.go b/x/auth/client/testutil/cli_test.go index f23e88847c30..0a7a5cc25871 100644 --- a/x/auth/client/testutil/cli_test.go +++ b/x/auth/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/auth/keeper/grpc_query_test.go b/x/auth/keeper/grpc_query_test.go index 40fcf21eb7c4..9052873d94ae 100644 --- a/x/auth/keeper/grpc_query_test.go +++ b/x/auth/keeper/grpc_query_test.go @@ -1,9 +1,9 @@ package keeper_test import ( - "bytes" - "context" "fmt" + "context" + "bytes" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,7 +11,6 @@ import ( ) const addrStr = "cosmos13c3d4wq2t22dl0dstraf8jc3f902e3fsy9n3wv" - var addrBytes = []byte{0x8e, 0x22, 0xda, 0xb8, 0xa, 0x5a, 0x94, 0xdf, 0xbd, 0xb0, 0x58, 0xfa, 0x93, 0xcb, 0x11, 0x49, 0x5e, 0xac, 0xc5, 0x30} func (suite *KeeperTestSuite) TestGRPCQueryAccounts() { @@ -290,9 +289,9 @@ func (suite *KeeperTestSuite) TestBech32Prefix() { func (suite *KeeperTestSuite) TestAddressBytesToString() { testCases := []struct { - msg string - req *types.AddressBytesToStringRequest - expPass bool + msg string + req *types.AddressBytesToStringRequest + expPass bool }{ { "success", @@ -332,9 +331,9 @@ func (suite *KeeperTestSuite) TestAddressBytesToString() { func (suite *KeeperTestSuite) TestAddressStringToBytes() { testCases := []struct { - msg string - req *types.AddressStringToBytesRequest - expPass bool + msg string + req *types.AddressStringToBytesRequest + expPass bool }{ { "success", @@ -353,9 +352,10 @@ func (suite *KeeperTestSuite) TestAddressStringToBytes() { }, { "address prefix is incorrect", - &types.AddressStringToBytesRequest{AddressString: "regen13c3d4wq2t22dl0dstraf8jc3f902e3fsy9n3wv"}, + &types.AddressStringToBytesRequest{AddressString: "regen13c3d4wq2t22dl0dstraf8jc3f902e3fsy9n3wv" }, false, }, + } for _, tc := range testCases { diff --git a/x/auth/vesting/client/testutil/cli_test.go b/x/auth/vesting/client/testutil/cli_test.go index 1035ca750264..dd36a6af2d3e 100644 --- a/x/auth/vesting/client/testutil/cli_test.go +++ b/x/auth/vesting/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/authz/client/testutil/cli_test.go b/x/authz/client/testutil/cli_test.go index 5b3ef61c5a45..3c083e694726 100644 --- a/x/authz/client/testutil/cli_test.go +++ b/x/authz/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/bank/client/testutil/cli_test.go b/x/bank/client/testutil/cli_test.go index 1035ca750264..dd36a6af2d3e 100644 --- a/x/bank/client/testutil/cli_test.go +++ b/x/bank/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/crisis/client/testsuite/cli_test.go b/x/crisis/client/testsuite/cli_test.go index 5b3ef61c5a45..3c083e694726 100644 --- a/x/crisis/client/testsuite/cli_test.go +++ b/x/crisis/client/testsuite/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/distribution/client/testutil/cli_test.go b/x/distribution/client/testutil/cli_test.go index 389bbbf78a05..742c1eb68086 100644 --- a/x/distribution/client/testutil/cli_test.go +++ b/x/distribution/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/feegrant/client/testutil/cli_test.go b/x/feegrant/client/testutil/cli_test.go index 9814e9573b3f..bdbfb78d0bd1 100644 --- a/x/feegrant/client/testutil/cli_test.go +++ b/x/feegrant/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/genutil/client/testutil/cli_test.go b/x/genutil/client/testutil/cli_test.go index 1035ca750264..dd36a6af2d3e 100644 --- a/x/genutil/client/testutil/cli_test.go +++ b/x/genutil/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/mint/client/testutil/cli_test.go b/x/mint/client/testutil/cli_test.go index 1035ca750264..dd36a6af2d3e 100644 --- a/x/mint/client/testutil/cli_test.go +++ b/x/mint/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/params/client/testutil/cli_test.go b/x/params/client/testutil/cli_test.go index 1035ca750264..dd36a6af2d3e 100644 --- a/x/params/client/testutil/cli_test.go +++ b/x/params/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/staking/client/testutil/cli_test.go b/x/staking/client/testutil/cli_test.go index f23e88847c30..0a7a5cc25871 100644 --- a/x/staking/client/testutil/cli_test.go +++ b/x/staking/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil diff --git a/x/staking/module_test.go b/x/staking/module_test.go index 3f1e5d916883..8784893634b6 100644 --- a/x/staking/module_test.go +++ b/x/staking/module_test.go @@ -23,7 +23,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { genesisState := simapp.GenesisStateWithSingleValidator(t, app) stateBytes, err := tmjson.Marshal(genesisState) require.NoError(t, err) - + app.InitChain( abcitypes.RequestInitChain{ AppStateBytes: stateBytes, diff --git a/x/upgrade/client/testutil/cli_test.go b/x/upgrade/client/testutil/cli_test.go index 5b3ef61c5a45..3c083e694726 100644 --- a/x/upgrade/client/testutil/cli_test.go +++ b/x/upgrade/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil From 2c64cee59c22d6133e28a1b5536bdb2f46511d16 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Mon, 1 Nov 2021 23:01:00 +0100 Subject: [PATCH 14/28] revert a few more changes --- .../distribution/v1beta1/distribution.proto | 39 +++++++++++-------- .../cosmos/distribution/v1beta1/genesis.proto | 33 ++++++++++------ proto/cosmos/genutil/v1beta1/genesis.proto | 5 ++- proto/cosmos/mint/v1beta1/mint.proto | 16 ++++---- proto/cosmos/slashing/v1beta1/genesis.proto | 12 ++++-- proto/cosmos/staking/v1beta1/genesis.proto | 2 +- x/evidence/client/testutil/cli_test.go | 1 - 7 files changed, 65 insertions(+), 43 deletions(-) diff --git a/proto/cosmos/distribution/v1beta1/distribution.proto b/proto/cosmos/distribution/v1beta1/distribution.proto index ad12bd6049fa..c5aa94fc4f03 100644 --- a/proto/cosmos/distribution/v1beta1/distribution.proto +++ b/proto/cosmos/distribution/v1beta1/distribution.proto @@ -12,17 +12,17 @@ import "cosmos_proto/cosmos.proto"; message Params { option (gogoproto.goproto_stringer) = false; string community_tax = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; string base_proposer_reward = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; string bonus_proposer_reward = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -42,8 +42,10 @@ message Params { // read that record) // + one per validator for the zeroeth period, set on initialization message ValidatorHistoricalRewards { - repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; uint32 reference_count = 2; } @@ -66,8 +68,10 @@ message ValidatorAccumulatedCommission { // ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards // for a validator inexpensive to track, allows simple sanity checks. message ValidatorOutstandingRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; } // ValidatorSlashEvent represents a validator slash event. @@ -76,23 +80,22 @@ message ValidatorOutstandingRewards { // for delegations which are withdrawn after a slash has occurred. message ValidatorSlashEvent { uint64 validator_period = 1; - string fraction = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + string fraction = 2 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; } // ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. message ValidatorSlashEvents { option (gogoproto.goproto_stringer) = false; - repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false]; + repeated ValidatorSlashEvent validator_slash_events = 1 + [(gogoproto.nullable) = false]; } // FeePool is the global fee pool for distribution. message FeePool { - repeated cosmos.base.v1beta1.DecCoin community_pool = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; + repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; } // CommunityPoolSpendProposal details a proposal for use of community funds, @@ -119,7 +122,7 @@ message CommunityPoolSpendProposal { message DelegatorStartingInfo { uint64 previous_period = 1; string stake = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -132,7 +135,9 @@ message DelegationDelegatorReward { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = true; - string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 1 [ + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; repeated cosmos.base.v1beta1.DecCoin reward = 2 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; diff --git a/proto/cosmos/distribution/v1beta1/genesis.proto b/proto/cosmos/distribution/v1beta1/genesis.proto index 4662e8df42be..488d89e9f5ff 100644 --- a/proto/cosmos/distribution/v1beta1/genesis.proto +++ b/proto/cosmos/distribution/v1beta1/genesis.proto @@ -32,8 +32,10 @@ message ValidatorOutstandingRewardsRecord { string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // outstanding_rewards represents the oustanding rewards of a validator. - repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; } // ValidatorAccumulatedCommissionRecord is used for import / export via genesis @@ -46,7 +48,8 @@ message ValidatorAccumulatedCommissionRecord { string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // accumulated is the accumulated commission of a validator. - ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false]; + ValidatorAccumulatedCommission accumulated = 2 + [(gogoproto.nullable) = false]; } // ValidatorHistoricalRewardsRecord is used for import / export via genesis @@ -89,7 +92,8 @@ message DelegatorStartingInfoRecord { string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // starting_info defines the starting info of a delegator. - DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false]; + DelegatorStartingInfo starting_info = 3 + [(gogoproto.nullable) = false]; } // ValidatorSlashEventRecord is used for import / export via genesis json. @@ -119,26 +123,33 @@ message GenesisState { FeePool fee_pool = 2 [(gogoproto.nullable) = false]; // fee_pool defines the delegator withdraw infos at genesis. - repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 [(gogoproto.nullable) = false]; + repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 + [(gogoproto.nullable) = false]; // fee_pool defines the previous proposer at genesis. string previous_proposer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // fee_pool defines the outstanding rewards of all validators at genesis. - repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 [(gogoproto.nullable) = false]; + repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 + [(gogoproto.nullable) = false]; // fee_pool defines the accumulated commisions of all validators at genesis. - repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 [(gogoproto.nullable) = false]; + repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 + [(gogoproto.nullable) = false]; // fee_pool defines the historical rewards of all validators at genesis. - repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 [(gogoproto.nullable) = false]; + repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 + [(gogoproto.nullable) = false]; // fee_pool defines the current rewards of all validators at genesis. - repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 [(gogoproto.nullable) = false]; + repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 + [(gogoproto.nullable) = false]; // fee_pool defines the delegator starting infos at genesis. - repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 [(gogoproto.nullable) = false]; + repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 + [(gogoproto.nullable) = false]; // fee_pool defines the validator slash events at genesis. - repeated ValidatorSlashEventRecord validator_slash_events = 10 [(gogoproto.nullable) = false]; + repeated ValidatorSlashEventRecord validator_slash_events = 10 + [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/genutil/v1beta1/genesis.proto b/proto/cosmos/genutil/v1beta1/genesis.proto index 958d15feb9cd..6727b98ac889 100644 --- a/proto/cosmos/genutil/v1beta1/genesis.proto +++ b/proto/cosmos/genutil/v1beta1/genesis.proto @@ -8,5 +8,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; // GenesisState defines the raw genesis transaction in JSON. message GenesisState { // gen_txs defines the genesis transactions. - repeated bytes gen_txs = 1 [(gogoproto.casttype) = "encoding/json.RawMessage", (gogoproto.jsontag) = "gentxs"]; + repeated bytes gen_txs = 1 [ + (gogoproto.casttype) = "encoding/json.RawMessage", + (gogoproto.jsontag) = "gentxs" + ]; } diff --git a/proto/cosmos/mint/v1beta1/mint.proto b/proto/cosmos/mint/v1beta1/mint.proto index 9cfe2b76076f..f12959083663 100644 --- a/proto/cosmos/mint/v1beta1/mint.proto +++ b/proto/cosmos/mint/v1beta1/mint.proto @@ -10,13 +10,13 @@ import "cosmos_proto/cosmos.proto"; message Minter { // current annual inflation rate string inflation = 1 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false ]; // current annual expected provisions string annual_provisions = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; @@ -30,25 +30,25 @@ message Params { string mint_denom = 1; // maximum annual change in inflation rate string inflation_rate_change = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // maximum inflation rate string inflation_max = 3 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // minimum inflation rate string inflation_min = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; // goal of percent bonded atoms string goal_bonded = 5 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; diff --git a/proto/cosmos/slashing/v1beta1/genesis.proto b/proto/cosmos/slashing/v1beta1/genesis.proto index 312d56aa2fbf..6477e8a7093c 100644 --- a/proto/cosmos/slashing/v1beta1/genesis.proto +++ b/proto/cosmos/slashing/v1beta1/genesis.proto @@ -14,11 +14,13 @@ message GenesisState { // signing_infos represents a map between validator addresses and their // signing infos. - repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false]; + repeated SigningInfo signing_infos = 2 + [(gogoproto.nullable) = false]; // missed_blocks represents a map between validator addresses and their // missed blocks. - repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false]; + repeated ValidatorMissedBlocks missed_blocks = 3 + [(gogoproto.nullable) = false]; } // SigningInfo stores validator signing info of corresponding address. @@ -26,7 +28,8 @@ message SigningInfo { // address is the validator address. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_signing_info represents the signing info of this validator. - ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false]; + ValidatorSigningInfo validator_signing_info = 2 + [(gogoproto.nullable) = false]; } // ValidatorMissedBlocks contains array of missed blocks of corresponding @@ -35,7 +38,8 @@ message ValidatorMissedBlocks { // address is the validator address. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // missed_blocks is an array of missed blocks by the validator. - repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false]; + repeated MissedBlock missed_blocks = 2 + [(gogoproto.nullable) = false]; } // MissedBlock contains height and missed status as boolean. diff --git a/proto/cosmos/staking/v1beta1/genesis.proto b/proto/cosmos/staking/v1beta1/genesis.proto index 20518f6375b8..7f2c2e77c4d6 100644 --- a/proto/cosmos/staking/v1beta1/genesis.proto +++ b/proto/cosmos/staking/v1beta1/genesis.proto @@ -46,7 +46,7 @@ message LastValidatorPower { option (gogoproto.goproto_getters) = false; // address is the address of the validator. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // power defines the power of the validator. int64 power = 2; diff --git a/x/evidence/client/testutil/cli_test.go b/x/evidence/client/testutil/cli_test.go index 1035ca750264..dd36a6af2d3e 100644 --- a/x/evidence/client/testutil/cli_test.go +++ b/x/evidence/client/testutil/cli_test.go @@ -1,4 +1,3 @@ -//go:build norace // +build norace package testutil From 38b5c5ee06b0670c771c3635fcd3149cf2ea19d3 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 3 Nov 2021 12:49:29 +0100 Subject: [PATCH 15/28] fix tests --- x/authz/client/testutil/tx.go | 22 +++++++++++++++++----- x/feegrant/client/testutil/suite.go | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index 5903e2986f24..ef6a04cc7d03 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -498,8 +498,14 @@ func (s *IntegrationTestSuite) TestExecAuthorizationWithExpiration() { ) s.Require().NoError(err) // msg vote - voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) - execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) + tokens := sdk.NewCoins( + sdk.NewCoin("stake", sdk.NewInt(50)), + ) + + // msg undelegate + undelegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), + tokens.GetDenomByIndex(0), tokens[0].Amount) + execMsg := testutil.WriteToNewTempFile(s.T(), undelegateTx) // waiting for authorization to expires time.Sleep(12 * time.Second) @@ -538,9 +544,15 @@ func (s *IntegrationTestSuite) TestNewExecGenericAuthorized() { ) s.Require().NoError(err) - // msg vote - voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) - execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) + tokens := sdk.NewCoins( + sdk.NewCoin("stake", sdk.NewInt(50)), + ) + + // msg undelegate + undelegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), + tokens.GetDenomByIndex(0), tokens[0].Amount) + + execMsg := testutil.WriteToNewTempFile(s.T(), undelegateTx) testCases := []struct { name string diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index cfe53c2e12b3..782513950813 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -826,7 +826,7 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { spendLimit.String(), ) - govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(feegrant.ModuleName)) + govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(govtypes.ModuleName)) s.Require().NoError(err) // exec filtered fee allowance From a35012b8e9e7186cb2f19ef07dcb13a5b80c078b Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 3 Nov 2021 15:32:47 +0100 Subject: [PATCH 16/28] fix even more tests --- docs/core/proto-docs.md | 1 + proto/cosmos/gov/v1/tx.proto | 1 + x/authz/client/testutil/tx.go | 4 +- x/distribution/client/cli/tx.go | 16 ++- x/feegrant/client/testutil/suite.go | 6 +- x/genutil/migrations/v045/migrate.go | 12 ++- x/gov/migrations/v045/migrate.go | 14 +-- x/gov/migrations/v045/migrate_test.go | 6 +- x/gov/types/msgs.go | 24 +++-- x/gov/types/msgs_test.go | 3 +- x/gov/types/tx.pb.go | 139 +++++++++++++++++--------- 11 files changed, 148 insertions(+), 78 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 3581e8b91d41..a44afab7e428 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -5921,6 +5921,7 @@ an intention for members to vote on. | ----- | ---- | ----- | ----------- | | `title` | [string](#string) | | | | `description` | [string](#string) | | | +| `authority` | [string](#string) | | | diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 95f639bd1e0c..9c58bfe32f37 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -109,6 +109,7 @@ message MsgSignal { string title = 1; string description = 2; + string authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgSignalResponse defined the Msg/Signal response type diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index ef6a04cc7d03..dad4da9cdfa1 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -503,7 +503,7 @@ func (s *IntegrationTestSuite) TestExecAuthorizationWithExpiration() { ) // msg undelegate - undelegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), + undelegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"250000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), tokens.GetDenomByIndex(0), tokens[0].Amount) execMsg := testutil.WriteToNewTempFile(s.T(), undelegateTx) @@ -549,7 +549,7 @@ func (s *IntegrationTestSuite) TestNewExecGenericAuthorized() { ) // msg undelegate - undelegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), + undelegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"250000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), tokens.GetDenomByIndex(0), tokens[0].Amount) execMsg := testutil.WriteToNewTempFile(s.T(), undelegateTx) diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index 6a65354e0cb5..1e823d3f03cf 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -13,6 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/distribution/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -295,7 +296,7 @@ Where proposal.json contains: return err } - amount, err := sdk.ParseCoinsNormalized(proposal.Amount) + _, err = sdk.ParseCoinsNormalized(proposal.Amount) if err != nil { return err } @@ -306,14 +307,19 @@ Where proposal.json contains: } from := clientCtx.GetFromAddress() - recpAddr, err := sdk.AccAddressFromBech32(proposal.Recipient) + _, err = sdk.AccAddressFromBech32(proposal.Recipient) if err != nil { return err } - // TODO: replace content proposals with a community spend message - _ = types.NewCommunityPoolSpendProposal(proposal.Title, proposal.Description, recpAddr, amount) - msg, err := govtypes.NewMsgSubmitProposal([]sdk.Msg{}, deposit, from) + govAcc, err := clientCtx.AccountRetriever.GetAccount(clientCtx, authtypes.NewModuleAddress(govtypes.ModuleName)) + if err != nil { + return err + } + + // TODO: replace signal proposal with a community spend message + signalMsg := govtypes.NewMsgSignal(proposal.Title, proposal.Description, govAcc.GetAddress()) + msg, err := govtypes.NewMsgSubmitProposal([]sdk.Msg{signalMsg}, deposit, from) if err != nil { return err } diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index 782513950813..cc696fc3de12 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -696,7 +696,9 @@ func (s *IntegrationTestSuite) TestTxWithFeeGrant() { // granted fee allowance for an account which is not in state and creating // any tx with it by using --fee-account shouldn't fail - proposal := []sdk.Msg{govtypes.NewMsgVote(grantee, 1, govtypes.OptionYes)} + govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(govtypes.ModuleName)) + s.Require().NoError(err) + proposal := []sdk.Msg{govtypes.NewMsgSignal("test_title", "test_description", govAcc.GetAddress())} out, err := govtestutil.MsgSubmitProposal(s.T(), val.ClientCtx, grantee.String(), proposal, fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), ) @@ -704,7 +706,7 @@ func (s *IntegrationTestSuite) TestTxWithFeeGrant() { s.Require().NoError(err) var resp sdk.TxResponse s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - s.Require().Equal(uint32(0), resp.Code) + s.Require().Equal(uint32(0), resp.Code, resp.RawLog) } func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { diff --git a/x/genutil/migrations/v045/migrate.go b/x/genutil/migrations/v045/migrate.go index 7334a1dfb217..ca05c55788bd 100644 --- a/x/genutil/migrations/v045/migrate.go +++ b/x/genutil/migrations/v045/migrate.go @@ -1,9 +1,12 @@ package v045 import ( + "fmt" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/x/genutil/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" v045gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v045" v1 "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -17,11 +20,16 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { clientCtx.Codec.MustUnmarshalJSON(appState[v1.ModuleName], &oldGovState) // delete deprecated x/gov genesis state - delete(appState, types.ModuleName) + delete(appState, v1.ModuleName) + + govAcc, err := clientCtx.AccountRetriever.GetAccount(clientCtx, authtypes.NewModuleAddress(v1.ModuleName)) + if err != nil { + panic(fmt.Sprintf("failed to migrate gov genesis state: %s", err.Error())) + } // Migrate relative source genesis application state and marshal it into // the respective key. - appState[v1.ModuleName] = clientCtx.Codec.MustMarshalJSON(v045gov.Migrate(oldGovState)) + appState[v1.ModuleName] = clientCtx.Codec.MustMarshalJSON(v045gov.Migrate(oldGovState, govAcc.GetAddress())) } return appState diff --git a/x/gov/migrations/v045/migrate.go b/x/gov/migrations/v045/migrate.go index d4b4c6ba2e19..6cd5657d16c3 100644 --- a/x/gov/migrations/v045/migrate.go +++ b/x/gov/migrations/v045/migrate.go @@ -9,18 +9,18 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -func Migrate(oldGovState v1beta1.GenesisState) *types.GenesisState { +func Migrate(oldGovState v1beta1.GenesisState, govAcc sdk.AccAddress) *types.GenesisState { return &types.GenesisState{ Deposits: migrateDeposits(oldGovState.Deposits), Votes: migrateVotes(oldGovState.Votes), - Proposals: migrateProposals(oldGovState.Proposals), + Proposals: migrateProposals(oldGovState.Proposals, govAcc), DepositParams: types.DepositParams(oldGovState.DepositParams), VotingParams: types.VotingParams(oldGovState.VotingParams), TallyParams: types.TallyParams(oldGovState.TallyParams), } } -func migrateProposals(oldProposals v1beta1.Proposals) types.Proposals { +func migrateProposals(oldProposals v1beta1.Proposals, govAcc sdk.AccAddress) types.Proposals { newProposals := make(types.Proposals, len(oldProposals)) for idx, proposal := range oldProposals { content := proposal.GetContent() @@ -28,7 +28,7 @@ func migrateProposals(oldProposals v1beta1.Proposals) types.Proposals { continue } - msgs, err := sdktx.SetMsgs(migrateContent(content)) + msgs, err := sdktx.SetMsgs(migrateContent(content, govAcc)) if err != nil { panic(fmt.Sprintf("failed to marshal proposal msgs: %v", err)) } @@ -47,14 +47,14 @@ func migrateProposals(oldProposals v1beta1.Proposals) types.Proposals { return newProposals } -func migrateContent(content v1beta1.Content) []sdk.Msg { +func migrateContent(content v1beta1.Content, govAcc sdk.AccAddress) []sdk.Msg { switch content.ProposalType() { case v1beta1.ProposalTypeText: - return []sdk.Msg{types.NewMsgSignal(content.GetTitle(), content.GetDescription())} + return []sdk.Msg{types.NewMsgSignal(content.GetTitle(), content.GetDescription(), govAcc)} // TODO: enter the other proposal content types default: // NOTE: If a network is using a unique content type that isn't recognisable then it will not be possible to migrate it to the new proposal type. The best thing to do in this situation, rather than silently ignore it, is to convert it to a signal proposal - return []sdk.Msg{types.NewMsgSignal(content.GetTitle(), content.GetDescription())} + return []sdk.Msg{types.NewMsgSignal(content.GetTitle(), content.GetDescription(), govAcc)} } } diff --git a/x/gov/migrations/v045/migrate_test.go b/x/gov/migrations/v045/migrate_test.go index 3712c32bfcad..1dc99a695338 100644 --- a/x/gov/migrations/v045/migrate_test.go +++ b/x/gov/migrations/v045/migrate_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" v045gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v045" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -76,7 +77,9 @@ func TestMigrate(t *testing.T) { Proposals: proposals, } - migrated := v045gov.Migrate(govGenState) + govAcc := sdk.AccAddress("test_gov_account") + + migrated := v045gov.Migrate(govGenState, govAcc) bz, err := clientCtx.Codec.MarshalJSON(migrated) require.NoError(t, err) @@ -108,6 +111,7 @@ func TestMigrate(t *testing.T) { "messages": [ { "@type": "/cosmos.gov.v1.MsgSignal", + "authority": "cosmos1w3jhxazlvahhvhmpvd3k7atwwsq04etk", "description": "bar_description", "title": "foo_title" } diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index 1fd510990812..f26be6c69036 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -28,8 +28,8 @@ const ( ) var ( - _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{} - _ types.UnpackInterfacesMessage = &MsgSubmitProposal{} + _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgSignal{} + _ types.UnpackInterfacesMessage = &MsgSubmitProposal{} ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. @@ -297,8 +297,12 @@ func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { // NewMsgVote creates a message to cast a vote on an active proposal //nolint:interfacer -func NewMsgSignal(title, description string) *MsgSignal { - return &MsgSignal{title, description} +func NewMsgSignal(title, description string, authority sdk.AccAddress) *MsgSignal { + return &MsgSignal{ + Title: title, + Description: description, + Authority: authority.String(), + } } // Route implements Msg @@ -315,13 +319,12 @@ func (msg MsgSignal) ValidateBasic() error { if len(msg.Title) > MaxTitleLength { return sdkerrors.Wrap(ErrInvalidSignalMsg, fmt.Sprintf("signal title is longer than max length of %d", MaxTitleLength)) } - - if len(msg.Description) == 0 { - return sdkerrors.Wrap(ErrInvalidSignalMsg, "signal description cannot be blank") - } if len(msg.Description) > MaxDescriptionLength { return sdkerrors.Wrap(ErrInvalidSignalMsg, fmt.Sprintf("signal description is longer than max length of %d", MaxDescriptionLength)) } + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err) + } return nil } @@ -338,7 +341,8 @@ func (msg MsgSignal) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// GetSigners implements Msg. A signal message has no signers +// GetSigners implements Msg. A signal message must have the governance account as the signer func (msg MsgSignal) GetSigners() []sdk.AccAddress { - return []sdk.AccAddress{} + authority, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{authority} } diff --git a/x/gov/types/msgs_test.go b/x/gov/types/msgs_test.go index 05503df2e641..dbfce172c999 100644 --- a/x/gov/types/msgs_test.go +++ b/x/gov/types/msgs_test.go @@ -33,7 +33,6 @@ func TestMsgSubmitProposal(t *testing.T) { }{ {"Test Proposal", "the purpose of this proposal is to test", addrs[0], coinsPos, true}, {"", "the purpose of this proposal is to test", addrs[0], coinsPos, false}, - {"Test Proposal", "", addrs[0], coinsPos, false}, {"Test Proposal", "the purpose of this proposal is to test", sdk.AccAddress{}, coinsPos, false}, {"Test Proposal", "the purpose of this proposal is to test", addrs[0], coinsZero, true}, {"Test Proposal", "the purpose of this proposal is to test", addrs[0], coinsMulti, true}, @@ -42,7 +41,7 @@ func TestMsgSubmitProposal(t *testing.T) { } for i, tc := range tests { - proposal := []sdk.Msg{NewMsgSignal(tc.title, tc.description)} + proposal := []sdk.Msg{NewMsgSignal(tc.title, tc.description, tc.proposerAddr)} msg, err := NewMsgSubmitProposal( proposal, diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index 8fa5fcdd5009..8f67df091245 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -354,6 +354,7 @@ var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo type MsgSignal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` } func (m *MsgSignal) Reset() { *m = MsgSignal{} } @@ -441,53 +442,54 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 722 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xde, 0x6d, 0xda, 0xb4, 0x99, 0x6a, 0x6b, 0xc7, 0xd0, 0x6e, 0x72, 0xd8, 0xa4, 0x01, 0x25, - 0x97, 0xee, 0x36, 0x55, 0x14, 0x7a, 0x10, 0x1a, 0x8b, 0xe2, 0x21, 0x28, 0x5b, 0xac, 0x20, 0x42, - 0xd9, 0x64, 0xc7, 0xe9, 0x60, 0xb2, 0xb3, 0xec, 0x4c, 0x42, 0x73, 0x13, 0xbc, 0x88, 0x27, 0x8f, - 0x1e, 0x7b, 0xf6, 0xec, 0x6f, 0x90, 0xde, 0x2c, 0x9e, 0x3c, 0x48, 0x95, 0xf6, 0x22, 0x82, 0x17, - 0x7f, 0x81, 0xec, 0xcc, 0xec, 0x26, 0x4d, 0xb6, 0x2d, 0x82, 0x9e, 0x92, 0x79, 0xef, 0xfb, 0xbe, - 0x79, 0xdf, 0xdb, 0xf7, 0x76, 0xc1, 0x62, 0x8b, 0xb2, 0x0e, 0x65, 0x36, 0xa6, 0x3d, 0xbb, 0x57, - 0xb3, 0xf9, 0x9e, 0x15, 0x84, 0x94, 0x53, 0x78, 0x59, 0xc6, 0x2d, 0x4c, 0x7b, 0x56, 0xaf, 0x56, - 0x34, 0x15, 0xac, 0xe9, 0x32, 0x64, 0xf7, 0x6a, 0x4d, 0xc4, 0xdd, 0x9a, 0xdd, 0xa2, 0xc4, 0x97, - 0xf0, 0xe2, 0xd2, 0x69, 0x99, 0x88, 0x25, 0x13, 0x05, 0x99, 0xd8, 0x11, 0x27, 0x5b, 0x89, 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, 0x34, 0x40, 0x61, 0xac, 0x09, 0x0e, 0x62, 0x01, 0xf5, 0x19, - 0x82, 0xab, 0x60, 0x36, 0x50, 0xb1, 0x1d, 0xe2, 0x19, 0x7a, 0x59, 0xaf, 0x4e, 0xd6, 0xe7, 0x7f, - 0x1e, 0x95, 0x86, 0xc3, 0x0e, 0x88, 0x0f, 0x0f, 0xbc, 0xca, 0x47, 0x1d, 0x4c, 0x37, 0x18, 0xde, - 0xa6, 0x1c, 0xc1, 0x7b, 0x69, 0xec, 0x6b, 0x23, 0xec, 0xdf, 0x47, 0x25, 0xd8, 0x77, 0x3b, 0xed, - 0xf5, 0xca, 0x50, 0xb0, 0x32, 0xac, 0x09, 0x2d, 0x30, 0xd5, 0xa3, 0x1c, 0x85, 0xc6, 0xc4, 0x05, - 0x3e, 0x25, 0x0c, 0xd6, 0x40, 0x96, 0x06, 0x9c, 0x50, 0x5f, 0x34, 0x66, 0x6e, 0xf0, 0x1c, 0xe4, - 0xf4, 0x59, 0x51, 0x71, 0x0f, 0x05, 0xc0, 0x51, 0xc0, 0x94, 0xbe, 0x2c, 0x80, 0x79, 0xe5, 0x23, - 0xee, 0x46, 0xe5, 0x93, 0x9e, 0xc4, 0x9e, 0x20, 0x82, 0x77, 0x39, 0xf2, 0xe0, 0xed, 0x34, 0x8f, - 0x8b, 0xff, 0xc1, 0xd4, 0x06, 0x98, 0x96, 0xb5, 0x32, 0x23, 0x23, 0xa6, 0x6b, 0x79, 0xc4, 0x55, - 0x5c, 0xd2, 0xc0, 0x5d, 0x7d, 0x32, 0x9a, 0x32, 0x27, 0xe6, 0xa5, 0x98, 0x2c, 0x80, 0xa5, 0x11, - 0x43, 0x89, 0xd9, 0x5f, 0x3a, 0x00, 0x0d, 0x86, 0xe3, 0x71, 0xfb, 0xeb, 0x49, 0x80, 0xb7, 0x40, - 0x4e, 0xad, 0x03, 0xbd, 0xd8, 0xe4, 0x00, 0x0a, 0x5b, 0x20, 0xeb, 0x76, 0x68, 0xd7, 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6, 0x8d, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x58, 0x70, 0x68, 0x15, 0x07, - 0x00, 0x00, + // 739 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xc1, 0x6b, 0x13, 0x4d, + 0x14, 0xdf, 0x6d, 0xda, 0xb4, 0x99, 0x7e, 0x5f, 0xfb, 0x75, 0xbe, 0xd0, 0x6e, 0x72, 0xd8, 0xa4, + 0x01, 0x25, 0x97, 0xee, 0x36, 0x55, 0x14, 0x7a, 0x10, 0x1a, 0x8b, 0xe2, 0x21, 0x28, 0x5b, 0xa8, + 0x20, 0x42, 0xd9, 0x64, 0xc7, 0xe9, 0x60, 0xb2, 0xb3, 0xec, 0x4c, 0x42, 0x73, 0x13, 0xbc, 0x88, + 0x20, 0x78, 0xf4, 0xd8, 0xb3, 0x67, 0xff, 0x06, 0xe9, 0xcd, 0xe2, 0xc9, 0x83, 0x54, 0x69, 0x2f, + 0x22, 0x78, 0xf1, 0x2f, 0x90, 0x9d, 0x99, 0xdd, 0xa4, 0xc9, 0xb6, 0x41, 0xd0, 0x53, 0x32, 0xef, + 0xfd, 0x7e, 0x6f, 0xdf, 0xef, 0xed, 0xef, 0xcd, 0x82, 0xe5, 0x16, 0x65, 0x1d, 0xca, 0x6c, 0x4c, + 0x7b, 0x76, 0xaf, 0x66, 0xf3, 0x03, 0x2b, 0x08, 0x29, 0xa7, 0xf0, 0x5f, 0x19, 0xb7, 0x30, 0xed, + 0x59, 0xbd, 0x5a, 0xd1, 0x54, 0xb0, 0xa6, 0xcb, 0x90, 0xdd, 0xab, 0x35, 0x11, 0x77, 0x6b, 0x76, + 0x8b, 0x12, 0x5f, 0xc2, 0x8b, 0x2b, 0xe7, 0xcb, 0x44, 0x2c, 0x99, 0x28, 0xc8, 0xc4, 0x9e, 0x38, + 0xd9, 0xaa, 0xa8, 0x4c, 0x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xd2, 0x00, 0x85, 0xb1, 0x21, 0x38, + 0x88, 0x05, 0xd4, 0x67, 0x08, 0xae, 0x83, 0xf9, 0x40, 0xc5, 0xf6, 0x88, 0x67, 0xe8, 0x65, 0xbd, + 0x3a, 0x5d, 0x5f, 0xfc, 0x7e, 0x52, 0x1a, 0x0e, 0x3b, 0x20, 0x3e, 0xdc, 0xf3, 0x2a, 0xef, 0x75, + 0x30, 0xdb, 0x60, 0x78, 0x97, 0x72, 0x04, 0xef, 0xa4, 0xb1, 0xaf, 0x8c, 0xb0, 0x7f, 0x9e, 0x94, + 0x60, 0xdf, 0xed, 0xb4, 0x37, 0x2b, 0x43, 0xc1, 0xca, 0x70, 0x4d, 0x68, 0x81, 0x99, 0x1e, 0xe5, + 0x28, 0x34, 0xa6, 0x26, 0xe8, 0x94, 0x30, 0x58, 0x03, 0x59, 0x1a, 0x70, 0x42, 0x7d, 0x31, 0x98, + 0x85, 0xc1, 0x7b, 0x90, 0xee, 0xb3, 0xa2, 0xe6, 0xee, 0x0b, 0x80, 0xa3, 0x80, 0x29, 0x73, 0x59, + 0x02, 0x8b, 0x4a, 0x47, 0x3c, 0x8d, 0xca, 0x07, 0x3d, 0x89, 0x3d, 0x44, 0x04, 0xef, 0x73, 0xe4, + 0xc1, 0x9b, 0x69, 0x1a, 0x97, 0xff, 0x82, 0xa8, 0x2d, 0x30, 0x2b, 0x7b, 0x65, 0x46, 0x46, 0xb8, + 0x6b, 0x75, 0x44, 0x55, 0xdc, 0xd2, 0x40, 0x5d, 0x7d, 0x3a, 0x72, 0x99, 0x13, 0xf3, 0x52, 0x44, + 0x16, 0xc0, 0xca, 0x88, 0xa0, 0x44, 0xec, 0x0f, 0x1d, 0x80, 0x06, 0xc3, 0xb1, 0xdd, 0x7e, 0xdb, + 0x09, 0xf0, 0x06, 0xc8, 0xa9, 0x75, 0xa0, 0x93, 0x45, 0x0e, 0xa0, 0xb0, 0x05, 0xb2, 0x6e, 0x87, + 0x76, 0x7d, 0xae, 0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0xf4, 0x40, 0x7c, 0xec, 0x84, 0x57, + 0x9b, 0x59, 0xf1, 0xa5, 0xb9, 0xf6, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x10, 0xd7, 0x01, 0xca, 0x4e, + 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1043,6 +1045,13 @@ func (m *MsgSignal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x1a + } if len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) @@ -1235,6 +1244,10 @@ func (m *MsgSignal) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2105,6 +2118,38 @@ func (m *MsgSignal) Unmarshal(dAtA []byte) error { } m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 4d5727595ac7dc97cf5bfd2416dc4acb56d057fc Mon Sep 17 00:00:00 2001 From: Marie Gauthier Date: Wed, 10 Nov 2021 13:41:07 +0100 Subject: [PATCH 17/28] Fix authz cli tests (#10519) * Fix authz cli tests * Fix typo --- x/authz/client/testutil/tx.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index dad4da9cdfa1..f63e912af4c0 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -14,9 +14,12 @@ import ( clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" + auth "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz/client/cli" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" bank "github.com/cosmos/cosmos-sdk/x/bank/types" + govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" + govtestutil "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingcli "github.com/cosmos/cosmos-sdk/x/staking/client/cli" ) @@ -50,6 +53,14 @@ func (s *IntegrationTestSuite) SetupSuite() { _, err = s.network.WaitForHeight(1) s.Require().NoError(err) + // create a proposal with deposit + govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, auth.NewModuleAddress(govtypes.ModuleName)) + s.Require().NoError(err) + proposal := []sdk.Msg{govtypes.NewMsgSignal("test_title", "test_description", govAcc.GetAddress())} + _, err = govtestutil.MsgSubmitProposal(s.T(), val.ClientCtx, val.Address.String(), proposal, + fmt.Sprintf("--%s=%s", govcli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, govtypes.DefaultMinDepositTokens).String())) + s.Require().NoError(err) + // Create new account in the keyring. s.grantee[1] = s.createAccount("grantee2") // Send some funds to the new account. @@ -497,15 +508,10 @@ func (s *IntegrationTestSuite) TestExecAuthorizationWithExpiration() { }, ) s.Require().NoError(err) - // msg vote - tokens := sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(50)), - ) - // msg undelegate - undelegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"250000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), - tokens.GetDenomByIndex(0), tokens[0].Amount) - execMsg := testutil.WriteToNewTempFile(s.T(), undelegateTx) + // msg vote + voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) + execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) // waiting for authorization to expires time.Sleep(12 * time.Second) @@ -544,15 +550,9 @@ func (s *IntegrationTestSuite) TestNewExecGenericAuthorized() { ) s.Require().NoError(err) - tokens := sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(50)), - ) - - // msg undelegate - undelegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"250000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), - tokens.GetDenomByIndex(0), tokens[0].Amount) - - execMsg := testutil.WriteToNewTempFile(s.T(), undelegateTx) + // msg vote + voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) + execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) testCases := []struct { name string From 7b58936696e9e0f565ab259b72e01132a3d0318a Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 17 Nov 2021 16:04:42 +0100 Subject: [PATCH 18/28] fix compiler breakage --- x/auth/middleware/tips_test.go | 2 +- x/nft/module/module.go | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/x/auth/middleware/tips_test.go b/x/auth/middleware/tips_test.go index b7f3c9ae8866..00cba9f7dd78 100644 --- a/x/auth/middleware/tips_test.go +++ b/x/auth/middleware/tips_test.go @@ -32,7 +32,7 @@ func (s *MWTestSuite) setupAcctsForTips(ctx sdk.Context) (sdk.Context, []testAcc s.Require().NoError(err) // Create dummy proposal for tipper to vote on. - prop, err := govtypes.NewProposal(govtypes.NewTextProposal("foo", "bar"), 1, time.Now(), time.Now().Add(time.Hour)) + prop, err := govtypes.NewProposal([]sdk.Msg{govtypes.NewMsgVote(accts[0].acc.GetAddress(), 1, govtypes.OptionYes)}, 1, time.Now(), time.Now().Add(time.Hour)) s.Require().NoError(err) s.app.GovKeeper.SetProposal(ctx, prop) s.app.GovKeeper.ActivateVotingPeriod(ctx, prop) diff --git a/x/nft/module/module.go b/x/nft/module/module.go index 0b456e55c33c..275cb10f4a7e 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -173,12 +173,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } -// ProposalContents returns all the nft content functions used to -// simulate governance proposals. -func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // RandomizedParams creates randomized nft param changes for the simulator. func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { return nil From 766d99f42194465413df256cbbed7e161ab49b65 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 17 Nov 2021 16:13:00 +0100 Subject: [PATCH 19/28] rename proto version from v1 to v1beta2 --- docs/core/proto-docs.md | 1172 ++++++++--------- .../cosmos/gov/{v1 => v1beta2}/genesis.proto | 4 +- proto/cosmos/gov/{v1 => v1beta2}/gov.proto | 2 +- proto/cosmos/gov/{v1 => v1beta2}/query.proto | 20 +- proto/cosmos/gov/{v1 => v1beta2}/tx.proto | 4 +- x/gov/types/genesis.pb.go | 66 +- x/gov/types/gov.pb.go | 234 ++-- x/gov/types/query.pb.go | 239 ++-- x/gov/types/query.pb.gw.go | 18 +- x/gov/types/tx.pb.go | 174 +-- 10 files changed, 967 insertions(+), 966 deletions(-) rename proto/cosmos/gov/{v1 => v1beta2}/genesis.proto (95%) rename proto/cosmos/gov/{v1 => v1beta2}/gov.proto (99%) rename proto/cosmos/gov/{v1 => v1beta2}/query.proto (89%) rename proto/cosmos/gov/{v1 => v1beta2}/tx.proto (98%) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index cc7c92895699..c8b47842b5da 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -54,18 +54,6 @@ - [Query](#cosmos.authz.v1beta1.Query) -- [cosmos/base/abci/v1beta1/abci.proto](#cosmos/base/abci/v1beta1/abci.proto) - - [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) - - [Attribute](#cosmos.base.abci.v1beta1.Attribute) - - [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) - - [MsgData](#cosmos.base.abci.v1beta1.MsgData) - - [Result](#cosmos.base.abci.v1beta1.Result) - - [SearchTxsResult](#cosmos.base.abci.v1beta1.SearchTxsResult) - - [SimulationResponse](#cosmos.base.abci.v1beta1.SimulationResponse) - - [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) - - [TxMsgData](#cosmos.base.abci.v1beta1.TxMsgData) - - [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) - - [cosmos/authz/v1beta1/tx.proto](#cosmos/authz/v1beta1/tx.proto) - [MsgExec](#cosmos.authz.v1beta1.MsgExec) - [MsgExecResponse](#cosmos.authz.v1beta1.MsgExecResponse) @@ -127,6 +115,18 @@ - [Msg](#cosmos.bank.v1beta1.Msg) +- [cosmos/base/abci/v1beta1/abci.proto](#cosmos/base/abci/v1beta1/abci.proto) + - [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) + - [Attribute](#cosmos.base.abci.v1beta1.Attribute) + - [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) + - [MsgData](#cosmos.base.abci.v1beta1.MsgData) + - [Result](#cosmos.base.abci.v1beta1.Result) + - [SearchTxsResult](#cosmos.base.abci.v1beta1.SearchTxsResult) + - [SimulationResponse](#cosmos.base.abci.v1beta1.SimulationResponse) + - [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) + - [TxMsgData](#cosmos.base.abci.v1beta1.TxMsgData) + - [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) + - [cosmos/base/kv/v1beta1/kv.proto](#cosmos/base/kv/v1beta1/kv.proto) - [Pair](#cosmos.base.kv.v1beta1.Pair) - [Pairs](#cosmos.base.kv.v1beta1.Pairs) @@ -358,56 +358,6 @@ - [cosmos/genutil/v1beta1/genesis.proto](#cosmos/genutil/v1beta1/genesis.proto) - [GenesisState](#cosmos.genutil.v1beta1.GenesisState) -- [cosmos/gov/v1/gov.proto](#cosmos/gov/v1/gov.proto) - - [Deposit](#cosmos.gov.v1.Deposit) - - [DepositParams](#cosmos.gov.v1.DepositParams) - - [Proposal](#cosmos.gov.v1.Proposal) - - [TallyParams](#cosmos.gov.v1.TallyParams) - - [TallyResult](#cosmos.gov.v1.TallyResult) - - [Vote](#cosmos.gov.v1.Vote) - - [VotingParams](#cosmos.gov.v1.VotingParams) - - [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) - - - [ProposalStatus](#cosmos.gov.v1.ProposalStatus) - - [VoteOption](#cosmos.gov.v1.VoteOption) - -- [cosmos/gov/v1/genesis.proto](#cosmos/gov/v1/genesis.proto) - - [GenesisState](#cosmos.gov.v1.GenesisState) - -- [cosmos/gov/v1/query.proto](#cosmos/gov/v1/query.proto) - - [QueryDepositRequest](#cosmos.gov.v1.QueryDepositRequest) - - [QueryDepositResponse](#cosmos.gov.v1.QueryDepositResponse) - - [QueryDepositsRequest](#cosmos.gov.v1.QueryDepositsRequest) - - [QueryDepositsResponse](#cosmos.gov.v1.QueryDepositsResponse) - - [QueryParamsRequest](#cosmos.gov.v1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.gov.v1.QueryParamsResponse) - - [QueryProposalRequest](#cosmos.gov.v1.QueryProposalRequest) - - [QueryProposalResponse](#cosmos.gov.v1.QueryProposalResponse) - - [QueryProposalsRequest](#cosmos.gov.v1.QueryProposalsRequest) - - [QueryProposalsResponse](#cosmos.gov.v1.QueryProposalsResponse) - - [QueryTallyResultRequest](#cosmos.gov.v1.QueryTallyResultRequest) - - [QueryTallyResultResponse](#cosmos.gov.v1.QueryTallyResultResponse) - - [QueryVoteRequest](#cosmos.gov.v1.QueryVoteRequest) - - [QueryVoteResponse](#cosmos.gov.v1.QueryVoteResponse) - - [QueryVotesRequest](#cosmos.gov.v1.QueryVotesRequest) - - [QueryVotesResponse](#cosmos.gov.v1.QueryVotesResponse) - - - [Query](#cosmos.gov.v1.Query) - -- [cosmos/gov/v1/tx.proto](#cosmos/gov/v1/tx.proto) - - [MsgDeposit](#cosmos.gov.v1.MsgDeposit) - - [MsgDepositResponse](#cosmos.gov.v1.MsgDepositResponse) - - [MsgSignal](#cosmos.gov.v1.MsgSignal) - - [MsgSignalResponse](#cosmos.gov.v1.MsgSignalResponse) - - [MsgSubmitProposal](#cosmos.gov.v1.MsgSubmitProposal) - - [MsgSubmitProposalResponse](#cosmos.gov.v1.MsgSubmitProposalResponse) - - [MsgVote](#cosmos.gov.v1.MsgVote) - - [MsgVoteResponse](#cosmos.gov.v1.MsgVoteResponse) - - [MsgVoteWeighted](#cosmos.gov.v1.MsgVoteWeighted) - - [MsgVoteWeightedResponse](#cosmos.gov.v1.MsgVoteWeightedResponse) - - - [Msg](#cosmos.gov.v1.Msg) - - [cosmos/gov/v1beta1/gov.proto](#cosmos/gov/v1beta1/gov.proto) - [Deposit](#cosmos.gov.v1beta1.Deposit) - [DepositParams](#cosmos.gov.v1beta1.DepositParams) @@ -425,6 +375,56 @@ - [cosmos/gov/v1beta1/genesis.proto](#cosmos/gov/v1beta1/genesis.proto) - [GenesisState](#cosmos.gov.v1beta1.GenesisState) +- [cosmos/gov/v1beta2/gov.proto](#cosmos/gov/v1beta2/gov.proto) + - [Deposit](#cosmos.gov.v1beta2.Deposit) + - [DepositParams](#cosmos.gov.v1beta2.DepositParams) + - [Proposal](#cosmos.gov.v1beta2.Proposal) + - [TallyParams](#cosmos.gov.v1beta2.TallyParams) + - [TallyResult](#cosmos.gov.v1beta2.TallyResult) + - [Vote](#cosmos.gov.v1beta2.Vote) + - [VotingParams](#cosmos.gov.v1beta2.VotingParams) + - [WeightedVoteOption](#cosmos.gov.v1beta2.WeightedVoteOption) + + - [ProposalStatus](#cosmos.gov.v1beta2.ProposalStatus) + - [VoteOption](#cosmos.gov.v1beta2.VoteOption) + +- [cosmos/gov/v1beta2/genesis.proto](#cosmos/gov/v1beta2/genesis.proto) + - [GenesisState](#cosmos.gov.v1beta2.GenesisState) + +- [cosmos/gov/v1beta2/query.proto](#cosmos/gov/v1beta2/query.proto) + - [QueryDepositRequest](#cosmos.gov.v1beta2.QueryDepositRequest) + - [QueryDepositResponse](#cosmos.gov.v1beta2.QueryDepositResponse) + - [QueryDepositsRequest](#cosmos.gov.v1beta2.QueryDepositsRequest) + - [QueryDepositsResponse](#cosmos.gov.v1beta2.QueryDepositsResponse) + - [QueryParamsRequest](#cosmos.gov.v1beta2.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.gov.v1beta2.QueryParamsResponse) + - [QueryProposalRequest](#cosmos.gov.v1beta2.QueryProposalRequest) + - [QueryProposalResponse](#cosmos.gov.v1beta2.QueryProposalResponse) + - [QueryProposalsRequest](#cosmos.gov.v1beta2.QueryProposalsRequest) + - [QueryProposalsResponse](#cosmos.gov.v1beta2.QueryProposalsResponse) + - [QueryTallyResultRequest](#cosmos.gov.v1beta2.QueryTallyResultRequest) + - [QueryTallyResultResponse](#cosmos.gov.v1beta2.QueryTallyResultResponse) + - [QueryVoteRequest](#cosmos.gov.v1beta2.QueryVoteRequest) + - [QueryVoteResponse](#cosmos.gov.v1beta2.QueryVoteResponse) + - [QueryVotesRequest](#cosmos.gov.v1beta2.QueryVotesRequest) + - [QueryVotesResponse](#cosmos.gov.v1beta2.QueryVotesResponse) + + - [Query](#cosmos.gov.v1beta2.Query) + +- [cosmos/gov/v1beta2/tx.proto](#cosmos/gov/v1beta2/tx.proto) + - [MsgDeposit](#cosmos.gov.v1beta2.MsgDeposit) + - [MsgDepositResponse](#cosmos.gov.v1beta2.MsgDepositResponse) + - [MsgSignal](#cosmos.gov.v1beta2.MsgSignal) + - [MsgSignalResponse](#cosmos.gov.v1beta2.MsgSignalResponse) + - [MsgSubmitProposal](#cosmos.gov.v1beta2.MsgSubmitProposal) + - [MsgSubmitProposalResponse](#cosmos.gov.v1beta2.MsgSubmitProposalResponse) + - [MsgVote](#cosmos.gov.v1beta2.MsgVote) + - [MsgVoteResponse](#cosmos.gov.v1beta2.MsgVoteResponse) + - [MsgVoteWeighted](#cosmos.gov.v1beta2.MsgVoteWeighted) + - [MsgVoteWeightedResponse](#cosmos.gov.v1beta2.MsgVoteWeightedResponse) + + - [Msg](#cosmos.gov.v1beta2.Msg) + - [cosmos/group/v1beta1/types.proto](#cosmos/group/v1beta1/types.proto) - [GroupAccountInfo](#cosmos.group.v1beta1.GroupAccountInfo) - [GroupInfo](#cosmos.group.v1beta1.GroupInfo) @@ -1389,203 +1389,6 @@ Query defines the gRPC querier service. - -

Top

- -## cosmos/base/abci/v1beta1/abci.proto - - - - - -### ABCIMessageLog -ABCIMessageLog defines a structure containing an indexed tx ABCI message log. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `msg_index` | [uint32](#uint32) | | | -| `log` | [string](#string) | | | -| `events` | [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) | repeated | Events contains a slice of Event objects that were emitted during some execution. | - - - - - - - - -### Attribute -Attribute defines an attribute wrapper where the key and value are -strings instead of raw bytes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [string](#string) | | | -| `value` | [string](#string) | | | - - - - - - - - -### GasInfo -GasInfo defines tx execution gas context. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gas_wanted` | [uint64](#uint64) | | GasWanted is the maximum units of work we allow this tx to perform. | -| `gas_used` | [uint64](#uint64) | | GasUsed is the amount of gas actually consumed. | - - - - - - - - -### MsgData -MsgData defines the data returned in a Result object during message -execution. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `msg_type` | [string](#string) | | | -| `data` | [bytes](#bytes) | | | - - - - - - - - -### Result -Result is the union of ResponseFormat and ResponseCheckTx. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data is any data returned from message or handler execution. It MUST be length prefixed in order to separate data from multiple message executions. | -| `log` | [string](#string) | | Log contains the log information from message or handler execution. | -| `events` | [tendermint.abci.Event](#tendermint.abci.Event) | repeated | Events contains a slice of Event objects that were emitted during message or handler execution. | - - - - - - - - -### SearchTxsResult -SearchTxsResult defines a structure for querying txs pageable - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `total_count` | [uint64](#uint64) | | Count of all txs | -| `count` | [uint64](#uint64) | | Count of txs in current page | -| `page_number` | [uint64](#uint64) | | Index of current page, start from 1 | -| `page_total` | [uint64](#uint64) | | Count of total pages | -| `limit` | [uint64](#uint64) | | Max count txs per page | -| `txs` | [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | List of txs in current page | - - - - - - - - -### SimulationResponse -SimulationResponse defines the response generated when a transaction is -successfully simulated. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gas_info` | [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | | -| `result` | [Result](#cosmos.base.abci.v1beta1.Result) | | | - - - - - - - - -### StringEvent -StringEvent defines en Event object wrapper where all the attributes -contain key/value pairs that are strings instead of raw bytes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `type` | [string](#string) | | | -| `attributes` | [Attribute](#cosmos.base.abci.v1beta1.Attribute) | repeated | | - - - - - - - - -### TxMsgData -TxMsgData defines a list of MsgData. A transaction will have a MsgData object -for each message. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `data` | [MsgData](#cosmos.base.abci.v1beta1.MsgData) | repeated | | - - - - - - - - -### TxResponse -TxResponse defines a structure containing relevant tx data and metadata. The -tags are stringified and the log is JSON decoded. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | The block height | -| `txhash` | [string](#string) | | The transaction hash. | -| `codespace` | [string](#string) | | Namespace for the Code | -| `code` | [uint32](#uint32) | | Response code. | -| `data` | [string](#string) | | Result bytes, if any. | -| `raw_log` | [string](#string) | | The output of the application's logger (raw string). May be non-deterministic. | -| `logs` | [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) | repeated | The output of the application's logger (typed). May be non-deterministic. | -| `info` | [string](#string) | | Additional information. May be non-deterministic. | -| `gas_wanted` | [int64](#int64) | | Amount of gas requested for transaction. | -| `gas_used` | [int64](#int64) | | Amount of gas consumed by transaction. | -| `tx` | [google.protobuf.Any](#google.protobuf.Any) | | The request transaction bytes. | -| `timestamp` | [string](#string) | | Time of the previous block. For heights > 1, it's the weighted median of the timestamps of the valid votes in the block.LastCommit. For height == 1, it's genesis time. | - - - - - - - - - - - - - - -

Top

@@ -2403,33 +2206,230 @@ Msg defines the bank Msg service. - +

Top

-## cosmos/base/kv/v1beta1/kv.proto +## cosmos/base/abci/v1beta1/abci.proto - + -### Pair -Pair defines a key/value bytes tuple. +### ABCIMessageLog +ABCIMessageLog defines a structure containing an indexed tx ABCI message log. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | -| `value` | [bytes](#bytes) | | | - - +| `msg_index` | [uint32](#uint32) | | | +| `log` | [string](#string) | | | +| `events` | [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) | repeated | Events contains a slice of Event objects that were emitted during some execution. | - -### Pairs -Pairs defines a repeated slice of Pair objects. + + + +### Attribute +Attribute defines an attribute wrapper where the key and value are +strings instead of raw bytes. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [string](#string) | | | +| `value` | [string](#string) | | | + + + + + + + + +### GasInfo +GasInfo defines tx execution gas context. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `gas_wanted` | [uint64](#uint64) | | GasWanted is the maximum units of work we allow this tx to perform. | +| `gas_used` | [uint64](#uint64) | | GasUsed is the amount of gas actually consumed. | + + + + + + + + +### MsgData +MsgData defines the data returned in a Result object during message +execution. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `msg_type` | [string](#string) | | | +| `data` | [bytes](#bytes) | | | + + + + + + + + +### Result +Result is the union of ResponseFormat and ResponseCheckTx. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `data` | [bytes](#bytes) | | Data is any data returned from message or handler execution. It MUST be length prefixed in order to separate data from multiple message executions. | +| `log` | [string](#string) | | Log contains the log information from message or handler execution. | +| `events` | [tendermint.abci.Event](#tendermint.abci.Event) | repeated | Events contains a slice of Event objects that were emitted during message or handler execution. | + + + + + + + + +### SearchTxsResult +SearchTxsResult defines a structure for querying txs pageable + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `total_count` | [uint64](#uint64) | | Count of all txs | +| `count` | [uint64](#uint64) | | Count of txs in current page | +| `page_number` | [uint64](#uint64) | | Index of current page, start from 1 | +| `page_total` | [uint64](#uint64) | | Count of total pages | +| `limit` | [uint64](#uint64) | | Max count txs per page | +| `txs` | [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | List of txs in current page | + + + + + + + + +### SimulationResponse +SimulationResponse defines the response generated when a transaction is +successfully simulated. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `gas_info` | [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | | +| `result` | [Result](#cosmos.base.abci.v1beta1.Result) | | | + + + + + + + + +### StringEvent +StringEvent defines en Event object wrapper where all the attributes +contain key/value pairs that are strings instead of raw bytes. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `type` | [string](#string) | | | +| `attributes` | [Attribute](#cosmos.base.abci.v1beta1.Attribute) | repeated | | + + + + + + + + +### TxMsgData +TxMsgData defines a list of MsgData. A transaction will have a MsgData object +for each message. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `data` | [MsgData](#cosmos.base.abci.v1beta1.MsgData) | repeated | | + + + + + + + + +### TxResponse +TxResponse defines a structure containing relevant tx data and metadata. The +tags are stringified and the log is JSON decoded. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | The block height | +| `txhash` | [string](#string) | | The transaction hash. | +| `codespace` | [string](#string) | | Namespace for the Code | +| `code` | [uint32](#uint32) | | Response code. | +| `data` | [string](#string) | | Result bytes, if any. | +| `raw_log` | [string](#string) | | The output of the application's logger (raw string). May be non-deterministic. | +| `logs` | [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) | repeated | The output of the application's logger (typed). May be non-deterministic. | +| `info` | [string](#string) | | Additional information. May be non-deterministic. | +| `gas_wanted` | [int64](#int64) | | Amount of gas requested for transaction. | +| `gas_used` | [int64](#int64) | | Amount of gas consumed by transaction. | +| `tx` | [google.protobuf.Any](#google.protobuf.Any) | | The request transaction bytes. | +| `timestamp` | [string](#string) | | Time of the previous block. For heights > 1, it's the weighted median of the timestamps of the valid votes in the block.LastCommit. For height == 1, it's genesis time. | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/base/kv/v1beta1/kv.proto + + + + + +### Pair +Pair defines a key/value bytes tuple. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | +| `value` | [bytes](#bytes) | | | + + + + + + + + +### Pairs +Pairs defines a repeated slice of Pair objects. | Field | Type | Label | Description | @@ -5365,14 +5365,14 @@ GenesisState defines the raw genesis transaction in JSON. - +

Top

-## cosmos/gov/v1/gov.proto +## cosmos/gov/v1beta1/gov.proto - + ### Deposit Deposit defines an amount deposited by an account address to an active @@ -5390,7 +5390,7 @@ proposal. - + ### DepositParams DepositParams defines the params for deposits on governance proposals. @@ -5406,7 +5406,7 @@ DepositParams defines the params for deposits on governance proposals. - + ### Proposal Proposal defines the core field members of a governance proposal. @@ -5415,9 +5415,9 @@ Proposal defines the core field members of a governance proposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | -| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | -| `status` | [ProposalStatus](#cosmos.gov.v1.ProposalStatus) | | | -| `final_tally_result` | [TallyResult](#cosmos.gov.v1.TallyResult) | | | +| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | +| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | | `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | | `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | | `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | @@ -5429,7 +5429,7 @@ Proposal defines the core field members of a governance proposal. - + ### TallyParams TallyParams defines the params for tallying votes on governance proposals. @@ -5446,7 +5446,7 @@ TallyParams defines the params for tallying votes on governance proposals. - + ### TallyResult TallyResult defines a standard tally for a governance proposal. @@ -5464,7 +5464,24 @@ TallyResult defines a standard tally for a governance proposal. - + + +### TextProposal +TextProposal defines a standard text proposal whose changes need to be +manually updated in case of approval. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | + + + + + + + ### Vote Vote defines a vote on a governance proposal. @@ -5475,15 +5492,15 @@ A Vote consists of a proposal ID, the voter, and the vote option. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | **Deprecated.** 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. | -| `options` | [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) | repeated | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** 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. | +| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | Since: cosmos-sdk 0.43 | - + ### VotingParams VotingParams defines the params for voting on governance proposals. @@ -5498,15 +5515,17 @@ VotingParams defines the params for voting on governance proposals. - + ### WeightedVoteOption WeightedVoteOption defines a unit of vote for vote split. +Since: cosmos-sdk 0.43 + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | | `weight` | [string](#string) | | | @@ -5516,7 +5535,7 @@ WeightedVoteOption defines a unit of vote for vote split. - + ### ProposalStatus ProposalStatus enumerates the valid statuses of a proposal. @@ -5532,7 +5551,7 @@ ProposalStatus enumerates the valid statuses of a proposal. - + ### VoteOption VoteOption enumerates the valid vote options for a given governance proposal. @@ -5554,14 +5573,14 @@ VoteOption enumerates the valid vote options for a given governance proposal. - +

Top

-## cosmos/gov/v1/genesis.proto +## cosmos/gov/v1beta1/genesis.proto - + ### GenesisState GenesisState defines the gov module's genesis state. @@ -5570,12 +5589,12 @@ GenesisState defines the gov module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | -| `deposits` | [Deposit](#cosmos.gov.v1.Deposit) | repeated | deposits defines all the deposits present at genesis. | -| `votes` | [Vote](#cosmos.gov.v1.Vote) | repeated | votes defines all the votes present at genesis. | -| `proposals` | [Proposal](#cosmos.gov.v1.Proposal) | repeated | proposals defines all the proposals present at genesis. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1.DepositParams) | | params defines all the paramaters of related to deposit. | -| `voting_params` | [VotingParams](#cosmos.gov.v1.VotingParams) | | params defines all the paramaters of related to voting. | -| `tally_params` | [TallyParams](#cosmos.gov.v1.TallyParams) | | params defines all the paramaters of related to tally. | +| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | +| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | +| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | proposals defines all the proposals present at genesis. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | +| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | +| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | @@ -5591,238 +5610,274 @@ GenesisState defines the gov module's genesis state. - +

Top

-## cosmos/gov/v1/query.proto +## cosmos/gov/v1beta2/gov.proto - + -### QueryDepositRequest -QueryDepositRequest is the request type for the Query/Deposit RPC method. +### Deposit +Deposit defines an amount deposited by an account address to an active +proposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | - - +| `proposal_id` | [uint64](#uint64) | | | +| `depositor` | [string](#string) | | | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - -### QueryDepositResponse -QueryDepositResponse is the response type for the Query/Deposit RPC method. + + + +### DepositParams +DepositParams defines the params for deposits on governance proposals. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposit` | [Deposit](#cosmos.gov.v1.Deposit) | | deposit defines the requested deposit. | +| `min_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum deposit for a proposal to enter voting period. | +| `max_deposit_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. | - + -### QueryDepositsRequest -QueryDepositsRequest is the request type for the Query/Deposits RPC method. +### Proposal +Proposal defines the core field members of a governance proposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | +| `proposal_id` | [uint64](#uint64) | | | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `status` | [ProposalStatus](#cosmos.gov.v1beta2.ProposalStatus) | | | +| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta2.TallyResult) | | | +| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - + -### QueryDepositsResponse -QueryDepositsResponse is the response type for the Query/Deposits RPC method. +### TallyParams +TallyParams defines the params for tallying votes on governance proposals. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposits` | [Deposit](#cosmos.gov.v1.Deposit) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | +| `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. | - + -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params RPC method. +### TallyResult +TallyResult defines a standard tally for a governance proposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params_type` | [string](#string) | | params_type defines which parameters to query for, can be one of "voting", "tallying" or "deposit". | +| `yes` | [string](#string) | | | +| `abstain` | [string](#string) | | | +| `no` | [string](#string) | | | +| `no_with_veto` | [string](#string) | | | - + -### QueryParamsResponse -QueryParamsResponse is the response type for the Query/Params RPC method. +### Vote +Vote defines a vote on a governance proposal. +A Vote consists of a proposal ID, the voter, and the vote option. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `voting_params` | [VotingParams](#cosmos.gov.v1.VotingParams) | | voting_params defines the parameters related to voting. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1.DepositParams) | | deposit_params defines the parameters related to deposit. | -| `tally_params` | [TallyParams](#cosmos.gov.v1.TallyParams) | | tally_params defines the parameters related to tally. | +| `proposal_id` | [uint64](#uint64) | | | +| `voter` | [string](#string) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta2.VoteOption) | | **Deprecated.** 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. | +| `options` | [WeightedVoteOption](#cosmos.gov.v1beta2.WeightedVoteOption) | repeated | | - + -### QueryProposalRequest -QueryProposalRequest is the request type for the Query/Proposal RPC method. +### VotingParams +VotingParams defines the params for voting on governance proposals. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `voting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Length of the voting period. | - + -### QueryProposalResponse -QueryProposalResponse is the response type for the Query/Proposal RPC method. +### WeightedVoteOption +WeightedVoteOption defines a unit of vote for vote split. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal` | [Proposal](#cosmos.gov.v1.Proposal) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta2.VoteOption) | | | +| `weight` | [string](#string) | | | + - -### QueryProposalsRequest -QueryProposalsRequest is the request type for the Query/Proposals RPC method. + +### ProposalStatus +ProposalStatus enumerates the valid statuses of a proposal. -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_status` | [ProposalStatus](#cosmos.gov.v1.ProposalStatus) | | proposal_status defines the status of the proposals. | -| `voter` | [string](#string) | | voter defines the voter address for the proposals. | -| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | +| Name | Number | Description | +| ---- | ------ | ----------- | +| PROPOSAL_STATUS_UNSPECIFIED | 0 | PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. | +| PROPOSAL_STATUS_DEPOSIT_PERIOD | 1 | PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period. | +| PROPOSAL_STATUS_VOTING_PERIOD | 2 | PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period. | +| PROPOSAL_STATUS_PASSED | 3 | PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed. | +| PROPOSAL_STATUS_REJECTED | 4 | PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected. | +| PROPOSAL_STATUS_FAILED | 5 | PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. | + +### VoteOption +VoteOption enumerates the valid vote options for a given governance proposal. +| Name | Number | Description | +| ---- | ------ | ----------- | +| VOTE_OPTION_UNSPECIFIED | 0 | VOTE_OPTION_UNSPECIFIED defines a no-op vote option. | +| VOTE_OPTION_YES | 1 | VOTE_OPTION_YES defines a yes vote option. | +| VOTE_OPTION_ABSTAIN | 2 | VOTE_OPTION_ABSTAIN defines an abstain vote option. | +| VOTE_OPTION_NO | 3 | VOTE_OPTION_NO defines a no vote option. | +| VOTE_OPTION_NO_WITH_VETO | 4 | VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. | - -### QueryProposalsResponse -QueryProposalsResponse is the response type for the Query/Proposals RPC -method. + + + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposals` | [Proposal](#cosmos.gov.v1.Proposal) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + +

Top

+## cosmos/gov/v1beta2/genesis.proto - + -### QueryTallyResultRequest -QueryTallyResultRequest is the request type for the Query/Tally RPC method. +### GenesisState +GenesisState defines the gov module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | +| `deposits` | [Deposit](#cosmos.gov.v1beta2.Deposit) | repeated | deposits defines all the deposits present at genesis. | +| `votes` | [Vote](#cosmos.gov.v1beta2.Vote) | repeated | votes defines all the votes present at genesis. | +| `proposals` | [Proposal](#cosmos.gov.v1beta2.Proposal) | repeated | proposals defines all the proposals present at genesis. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1beta2.DepositParams) | | params defines all the paramaters of related to deposit. | +| `voting_params` | [VotingParams](#cosmos.gov.v1beta2.VotingParams) | | params defines all the paramaters of related to voting. | +| `tally_params` | [TallyParams](#cosmos.gov.v1beta2.TallyParams) | | params defines all the paramaters of related to tally. | + - + -### QueryTallyResultResponse -QueryTallyResultResponse is the response type for the Query/Tally RPC method. + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tally` | [TallyResult](#cosmos.gov.v1.TallyResult) | | tally defines the requested tally. | + +

Top

+## cosmos/gov/v1beta2/query.proto - + -### QueryVoteRequest -QueryVoteRequest is the request type for the Query/Vote RPC method. +### QueryDepositRequest +QueryDepositRequest is the request type for the Query/Deposit RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `voter` | [string](#string) | | voter defines the oter address for the proposals. | +| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | - + -### QueryVoteResponse -QueryVoteResponse is the response type for the Query/Vote RPC method. +### QueryDepositResponse +QueryDepositResponse is the response type for the Query/Deposit RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `vote` | [Vote](#cosmos.gov.v1.Vote) | | vote defined the queried vote. | +| `deposit` | [Deposit](#cosmos.gov.v1beta2.Deposit) | | deposit defines the requested deposit. | - + -### QueryVotesRequest -QueryVotesRequest is the request type for the Query/Votes RPC method. +### QueryDepositsRequest +QueryDepositsRequest is the request type for the Query/Deposits RPC method. | Field | Type | Label | Description | @@ -5835,195 +5890,206 @@ QueryVotesRequest is the request type for the Query/Votes RPC method. - + -### QueryVotesResponse -QueryVotesResponse is the response type for the Query/Votes RPC method. +### QueryDepositsResponse +QueryDepositsResponse is the response type for the Query/Deposits RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `votes` | [Vote](#cosmos.gov.v1.Vote) | repeated | votes defined the queried votes. | +| `deposits` | [Deposit](#cosmos.gov.v1beta2.Deposit) | repeated | | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - + - +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params_type` | [string](#string) | | params_type defines which parameters to query for, can be one of "voting", "tallying" or "deposit". | -### Query -Query defines the gRPC querier service for gov module -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1/proposals/{proposal_id}| -| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1/proposals| -| `Vote` | [QueryVoteRequest](#cosmos.gov.v1.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}| -| `Votes` | [QueryVotesRequest](#cosmos.gov.v1.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1/proposals/{proposal_id}/votes| -| `Params` | [QueryParamsRequest](#cosmos.gov.v1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1/params/{params_type}| -| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}| -| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1/proposals/{proposal_id}/deposits| -| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1/proposals/{proposal_id}/tally| - - -

Top

+ + +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `voting_params` | [VotingParams](#cosmos.gov.v1beta2.VotingParams) | | voting_params defines the parameters related to voting. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1beta2.DepositParams) | | deposit_params defines the parameters related to deposit. | +| `tally_params` | [TallyParams](#cosmos.gov.v1beta2.TallyParams) | | tally_params defines the parameters related to tally. | -## cosmos/gov/v1/tx.proto - -### MsgDeposit -MsgDeposit defines a message to submit a deposit to an existing proposal. + + + +### QueryProposalRequest +QueryProposalRequest is the request type for the Query/Proposal RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `depositor` | [string](#string) | | | -| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | - + -### MsgDepositResponse -MsgDepositResponse defines the Msg/Deposit response type. +### QueryProposalResponse +QueryProposalResponse is the response type for the Query/Proposal RPC method. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal` | [Proposal](#cosmos.gov.v1beta2.Proposal) | | | - -### MsgSignal -MsgSignal is functionally a no-op message that can be submitted in a proposal to signal -an intention for members to vote on. + + + +### QueryProposalsRequest +QueryProposalsRequest is the request type for the Query/Proposals RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `authority` | [string](#string) | | | +| `proposal_status` | [ProposalStatus](#cosmos.gov.v1beta2.ProposalStatus) | | proposal_status defines the status of the proposals. | +| `voter` | [string](#string) | | voter defines the voter address for the proposals. | +| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - + -### MsgSignalResponse -MsgSignalResponse defined the Msg/Signal response type +### QueryProposalsResponse +QueryProposalsResponse is the response type for the Query/Proposals RPC +method. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposals` | [Proposal](#cosmos.gov.v1beta2.Proposal) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - -### MsgSubmitProposal -MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -proposal Content. + + + +### QueryTallyResultRequest +QueryTallyResultRequest is the request type for the Query/Tally RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | -| `initial_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `proposer` | [string](#string) | | | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | - + -### MsgSubmitProposalResponse -MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +### QueryTallyResultResponse +QueryTallyResultResponse is the response type for the Query/Tally RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | +| `tally` | [TallyResult](#cosmos.gov.v1beta2.TallyResult) | | tally defines the requested tally. | - + -### MsgVote -MsgVote defines a message to cast a vote. +### QueryVoteRequest +QueryVoteRequest is the request type for the Query/Vote RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1.VoteOption) | | | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `voter` | [string](#string) | | voter defines the oter address for the proposals. | - + -### MsgVoteResponse -MsgVoteResponse defines the Msg/Vote response type. +### QueryVoteResponse +QueryVoteResponse is the response type for the Query/Vote RPC method. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `vote` | [Vote](#cosmos.gov.v1beta2.Vote) | | vote defined the queried vote. | - -### MsgVoteWeighted -MsgVoteWeighted defines a message to cast a vote. -Since: cosmos-sdk 0.43 + + +### QueryVotesRequest +QueryVotesRequest is the request type for the Query/Votes RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `voter` | [string](#string) | | | -| `options` | [WeightedVoteOption](#cosmos.gov.v1.WeightedVoteOption) | repeated | | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - + -### MsgVoteWeightedResponse -MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +### QueryVotesResponse +QueryVotesResponse is the response type for the Query/Votes RPC method. -Since: cosmos-sdk 0.43 + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `votes` | [Vote](#cosmos.gov.v1beta2.Vote) | repeated | votes defined the queried votes. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -6036,37 +6102,37 @@ Since: cosmos-sdk 0.43 - + -### Msg -Msg defines the gov Msg service. +### Query +Query defines the gRPC querier service for gov module | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | -| `Vote` | [MsgVote](#cosmos.gov.v1.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | -| `VoteWeighted` | [MsgVoteWeighted](#cosmos.gov.v1.MsgVoteWeighted) | [MsgVoteWeightedResponse](#cosmos.gov.v1.MsgVoteWeightedResponse) | VoteWeighted defines a method to add a weighted vote on a specific proposal. - -Since: cosmos-sdk 0.43 | | -| `Deposit` | [MsgDeposit](#cosmos.gov.v1.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | -| `Signal` | [MsgSignal](#cosmos.gov.v1.MsgSignal) | [MsgSignalResponse](#cosmos.gov.v1.MsgSignalResponse) | Signal is a basic governance proposal message which has no functionality but is used to gather signal on a certain intention. | | +| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1beta2.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1beta2.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}| +| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1beta2.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1beta2.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1beta2/proposals| +| `Vote` | [QueryVoteRequest](#cosmos.gov.v1beta2.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1beta2.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/votes/{voter}| +| `Votes` | [QueryVotesRequest](#cosmos.gov.v1beta2.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1beta2.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/votes| +| `Params` | [QueryParamsRequest](#cosmos.gov.v1beta2.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1beta2.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1beta2/params/{params_type}| +| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1beta2.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1beta2.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/deposits/{depositor}| +| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1beta2.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1beta2.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/deposits| +| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1beta2.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1beta2.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/tally| - +

Top

-## cosmos/gov/v1beta1/gov.proto +## cosmos/gov/v1beta2/tx.proto - + -### Deposit -Deposit defines an amount deposited by an account address to an active -proposal. +### MsgDeposit +MsgDeposit defines a message to submit a deposit to an existing proposal. | Field | Type | Label | Description | @@ -6080,221 +6146,155 @@ proposal. - - -### DepositParams -DepositParams defines the params for deposits on governance proposals. - + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `min_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum deposit for a proposal to enter voting period. | -| `max_deposit_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. | +### MsgDepositResponse +MsgDepositResponse defines the Msg/Deposit response type. - + -### Proposal -Proposal defines the core field members of a governance proposal. +### MsgSignal +MsgSignal is functionally a no-op message that can be submitted in a proposal to signal +an intention for members to vote on. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | -| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | -| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - - +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `authority` | [string](#string) | | | - -### TallyParams -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. | +### MsgSignalResponse +MsgSignalResponse defined the Msg/Signal response type - + -### TallyResult -TallyResult defines a standard tally for a governance proposal. +### MsgSubmitProposal +MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +proposal Content. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `yes` | [string](#string) | | | -| `abstain` | [string](#string) | | | -| `no` | [string](#string) | | | -| `no_with_veto` | [string](#string) | | | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `initial_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `proposer` | [string](#string) | | | - + -### TextProposal -TextProposal defines a standard text proposal whose changes need to be -manually updated in case of approval. +### MsgSubmitProposalResponse +MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | +| `proposal_id` | [uint64](#uint64) | | | - + -### Vote -Vote defines a vote on a governance proposal. -A Vote consists of a proposal ID, the voter, and the vote option. +### MsgVote +MsgVote defines a message to cast a vote. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** 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. | -| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | Since: cosmos-sdk 0.43 | +| `option` | [VoteOption](#cosmos.gov.v1beta2.VoteOption) | | | - + -### VotingParams -VotingParams defines the params for voting on governance proposals. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `voting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Length of the voting period. | +### MsgVoteResponse +MsgVoteResponse defines the Msg/Vote response type. - + -### WeightedVoteOption -WeightedVoteOption defines a unit of vote for vote split. +### MsgVoteWeighted +MsgVoteWeighted defines a message to cast a vote. Since: cosmos-sdk 0.43 | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | -| `weight` | [string](#string) | | | - +| `proposal_id` | [uint64](#uint64) | | | +| `voter` | [string](#string) | | | +| `options` | [WeightedVoteOption](#cosmos.gov.v1beta2.WeightedVoteOption) | repeated | | - - + -### ProposalStatus -ProposalStatus enumerates the valid statuses of a proposal. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| PROPOSAL_STATUS_UNSPECIFIED | 0 | PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. | -| PROPOSAL_STATUS_DEPOSIT_PERIOD | 1 | PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period. | -| PROPOSAL_STATUS_VOTING_PERIOD | 2 | PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period. | -| PROPOSAL_STATUS_PASSED | 3 | PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed. | -| PROPOSAL_STATUS_REJECTED | 4 | PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected. | -| PROPOSAL_STATUS_FAILED | 5 | PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. | +### MsgVoteWeightedResponse +MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +Since: cosmos-sdk 0.43 - -### VoteOption -VoteOption enumerates the valid vote options for a given governance proposal. -| Name | Number | Description | -| ---- | ------ | ----------- | -| VOTE_OPTION_UNSPECIFIED | 0 | VOTE_OPTION_UNSPECIFIED defines a no-op vote option. | -| VOTE_OPTION_YES | 1 | VOTE_OPTION_YES defines a yes vote option. | -| VOTE_OPTION_ABSTAIN | 2 | VOTE_OPTION_ABSTAIN defines an abstain vote option. | -| VOTE_OPTION_NO | 3 | VOTE_OPTION_NO defines a no vote option. | -| VOTE_OPTION_NO_WITH_VETO | 4 | VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. | + - - - - - -

Top

- -## cosmos/gov/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState defines the gov module's genesis state. - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | -| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | -| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | -| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | proposals defines all the proposals present at genesis. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | -| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | -| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | + +### Msg +Msg defines the gov Msg service. +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1beta2.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1beta2.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | +| `Vote` | [MsgVote](#cosmos.gov.v1beta2.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1beta2.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | +| `VoteWeighted` | [MsgVoteWeighted](#cosmos.gov.v1beta2.MsgVoteWeighted) | [MsgVoteWeightedResponse](#cosmos.gov.v1beta2.MsgVoteWeightedResponse) | VoteWeighted defines a method to add a weighted vote on a specific proposal. - - - - - - - +Since: cosmos-sdk 0.43 | | +| `Deposit` | [MsgDeposit](#cosmos.gov.v1beta2.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta2.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | +| `Signal` | [MsgSignal](#cosmos.gov.v1beta2.MsgSignal) | [MsgSignalResponse](#cosmos.gov.v1beta2.MsgSignalResponse) | Signal is a basic governance proposal message which has no functionality but is used to gather signal on a certain intention. | | diff --git a/proto/cosmos/gov/v1/genesis.proto b/proto/cosmos/gov/v1beta2/genesis.proto similarity index 95% rename from proto/cosmos/gov/v1/genesis.proto rename to proto/cosmos/gov/v1beta2/genesis.proto index 44f4bffc1a03..b2b8fe95d797 100644 --- a/proto/cosmos/gov/v1/genesis.proto +++ b/proto/cosmos/gov/v1beta2/genesis.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package cosmos.gov.v1; +package cosmos.gov.v1beta2; import "gogoproto/gogo.proto"; -import "cosmos/gov/v1/gov.proto"; +import "cosmos/gov/v1beta2/gov.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1beta2/gov.proto similarity index 99% rename from proto/cosmos/gov/v1/gov.proto rename to proto/cosmos/gov/v1beta2/gov.proto index a28fb1778a38..8644c7cf5578 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1beta2/gov.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package cosmos.gov.v1; +package cosmos.gov.v1beta2; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; diff --git a/proto/cosmos/gov/v1/query.proto b/proto/cosmos/gov/v1beta2/query.proto similarity index 89% rename from proto/cosmos/gov/v1/query.proto rename to proto/cosmos/gov/v1beta2/query.proto index 050cb6b90192..6ea1aa98b05a 100644 --- a/proto/cosmos/gov/v1/query.proto +++ b/proto/cosmos/gov/v1beta2/query.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package cosmos.gov.v1; +package cosmos.gov.v1beta2; import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/gov/v1/gov.proto"; +import "cosmos/gov/v1beta2/gov.proto"; import "cosmos_proto/cosmos.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; @@ -13,42 +13,42 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; service Query { // Proposal queries proposal details based on ProposalID. rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}"; + option (google.api.http).get = "/cosmos/gov/v1beta2/proposals/{proposal_id}"; } // Proposals queries all proposals based on given status. rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals"; + option (google.api.http).get = "/cosmos/gov/v1beta2/proposals"; } // Vote queries voted information based on proposalID, voterAddr. rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}"; + option (google.api.http).get = "/cosmos/gov/v1beta2/proposals/{proposal_id}/votes/{voter}"; } // Votes queries votes of a given proposal. rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes"; + option (google.api.http).get = "/cosmos/gov/v1beta2/proposals/{proposal_id}/votes"; } // Params queries all parameters of the gov module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}"; + option (google.api.http).get = "/cosmos/gov/v1beta2/params/{params_type}"; } // Deposit queries single deposit information based proposalID, depositAddr. rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}"; + option (google.api.http).get = "/cosmos/gov/v1beta2/proposals/{proposal_id}/deposits/{depositor}"; } // Deposits queries all deposits of a single proposal. rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits"; + option (google.api.http).get = "/cosmos/gov/v1beta2/proposals/{proposal_id}/deposits"; } // TallyResult queries the tally of a proposal vote. rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { - option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/tally"; + option (google.api.http).get = "/cosmos/gov/v1beta2/proposals/{proposal_id}/tally"; } } diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1beta2/tx.proto similarity index 98% rename from proto/cosmos/gov/v1/tx.proto rename to proto/cosmos/gov/v1beta2/tx.proto index 9c58bfe32f37..38190606521b 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1beta2/tx.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package cosmos.gov.v1; +package cosmos.gov.v1beta2; import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/gov/v1/gov.proto"; +import "cosmos/gov/v1beta2/gov.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; diff --git a/x/gov/types/genesis.pb.go b/x/gov/types/genesis.pb.go index e1ee2061a6d7..4eb8a5da2d47 100644 --- a/x/gov/types/genesis.pb.go +++ b/x/gov/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1/genesis.proto +// source: cosmos/gov/v1beta2/genesis.proto package types @@ -45,7 +45,7 @@ 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_ef7cfd15e3ded621, []int{0} + return fileDescriptor_7915ab39bb5aa171, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -124,40 +124,40 @@ func (m *GenesisState) GetTallyParams() TallyParams { } func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1beta2.GenesisState") } -func init() { proto.RegisterFile("cosmos/gov/v1/genesis.proto", fileDescriptor_ef7cfd15e3ded621) } +func init() { proto.RegisterFile("cosmos/gov/v1beta2/genesis.proto", fileDescriptor_7915ab39bb5aa171) } -var fileDescriptor_ef7cfd15e3ded621 = []byte{ - // 426 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0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, 0xb6, 0xb1, 0xb5, 0xdb, 0x8d, 0xad, 0xfd, 0xdc, 0xd8, 0xda, 0xa5, 0x97, - 0xe5, 0xec, 0xd3, 0x97, 0x85, 0x7f, 0x05, 0x65, 0xa0, 0x6e, 0x51, 0xfe, 0x3c, 0xc3, 0xe4, 0x73, - 0xf0, 0x55, 0x1c, 0x26, 0x5b, 0x56, 0x29, 0x2e, 0xf6, 0xc5, 0x61, 0x3e, 0xff, 0x13, 0x00, 0x00, - 0xff, 0xff, 0x1b, 0x9c, 0x82, 0xe7, 0xf5, 0x02, 0x00, 0x00, +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, 0x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 0xd3, 0x35, 0x19, 0x57, 0xa0, 0x87, 0xad, 0x3d, 0xc7, 0xca, 0xe3, 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, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index f52e74c5c080..e6ec82ef985d 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1/gov.proto +// source: cosmos/gov/v1beta2/gov.proto package types @@ -69,7 +69,7 @@ func (x VoteOption) String() string { } func (VoteOption) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{0} + return fileDescriptor_5abf7b8852811c49, []int{0} } // ProposalStatus enumerates the valid statuses of a proposal. @@ -118,19 +118,19 @@ func (x ProposalStatus) String() string { } func (ProposalStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{1} + 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.v1.VoteOption" json:"option,omitempty"` + 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"` } func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } func (*WeightedVoteOption) ProtoMessage() {} func (*WeightedVoteOption) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{0} + return fileDescriptor_5abf7b8852811c49, []int{0} } func (m *WeightedVoteOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -170,7 +170,7 @@ type Deposit struct { func (m *Deposit) Reset() { *m = Deposit{} } func (*Deposit) ProtoMessage() {} func (*Deposit) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{1} + return fileDescriptor_5abf7b8852811c49, []int{1} } func (m *Deposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -203,7 +203,7 @@ var xxx_messageInfo_Deposit proto.InternalMessageInfo 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.v1.ProposalStatus" json:"status,omitempty" yaml:"proposal_status"` + 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"` @@ -215,7 +215,7 @@ type Proposal struct { func (m *Proposal) Reset() { *m = Proposal{} } func (*Proposal) ProtoMessage() {} func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{2} + return fileDescriptor_5abf7b8852811c49, []int{2} } func (m *Proposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -255,7 +255,7 @@ type TallyResult struct { func (m *TallyResult) Reset() { *m = TallyResult{} } func (*TallyResult) ProtoMessage() {} func (*TallyResult) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{3} + return fileDescriptor_5abf7b8852811c49, []int{3} } func (m *TallyResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -292,14 +292,14 @@ 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.v1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. + 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"` } func (m *Vote) Reset() { *m = Vote{} } func (*Vote) ProtoMessage() {} func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{4} + return fileDescriptor_5abf7b8852811c49, []int{4} } func (m *Vote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -340,7 +340,7 @@ type DepositParams struct { func (m *DepositParams) Reset() { *m = DepositParams{} } func (*DepositParams) ProtoMessage() {} func (*DepositParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{5} + return fileDescriptor_5abf7b8852811c49, []int{5} } func (m *DepositParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -378,7 +378,7 @@ type VotingParams struct { func (m *VotingParams) Reset() { *m = VotingParams{} } func (*VotingParams) ProtoMessage() {} func (*VotingParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{6} + return fileDescriptor_5abf7b8852811c49, []int{6} } func (m *VotingParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -422,7 +422,7 @@ type TallyParams struct { func (m *TallyParams) Reset() { *m = TallyParams{} } func (*TallyParams) ProtoMessage() {} func (*TallyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{7} + return fileDescriptor_5abf7b8852811c49, []int{7} } func (m *TallyParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -452,109 +452,109 @@ func (m *TallyParams) XXX_DiscardUnknown() { var xxx_messageInfo_TallyParams proto.InternalMessageInfo func init() { - proto.RegisterEnum("cosmos.gov.v1.VoteOption", VoteOption_name, VoteOption_value) - proto.RegisterEnum("cosmos.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) - proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1.WeightedVoteOption") - proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1.Deposit") - proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1.Proposal") - proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1.TallyResult") - proto.RegisterType((*Vote)(nil), "cosmos.gov.v1.Vote") - proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1.DepositParams") - proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1.VotingParams") - proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1.TallyParams") -} - -func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } - -var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1382 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xcf, 0x8f, 0xd3, 0xc6, - 0x17, 0x8f, 0x93, 0x90, 0xdd, 0x9d, 0xcd, 0x2e, 0x66, 0x76, 0xbf, 0xbb, 0x5e, 0x7f, 0x8b, 0x6d, - 0x42, 0x55, 0xad, 0x10, 0x24, 0x2c, 0xfd, 0x21, 0x75, 0xdb, 0x4b, 0x4c, 0x4c, 0x09, 0x42, 0x49, - 0xea, 0x98, 0x20, 0xa8, 0x54, 0xcb, 0x1b, 0x0f, 0x59, 0x97, 0xd8, 0x13, 0xe2, 0xc9, 0x42, 0x6e, - 0xbd, 0x54, 0x42, 0x39, 0x71, 0xe4, 0x12, 0x09, 0xa9, 0xb7, 0x9e, 0xf9, 0x07, 0x7a, 0xe3, 0xd0, - 0x03, 0xe5, 0x84, 0x5a, 0x29, 0x94, 0x45, 0xaa, 0x28, 0x47, 0xfe, 0x82, 0xca, 0x9e, 0xf1, 0x26, - 0xf1, 0xa2, 0xa6, 0x5b, 0x4e, 0xeb, 0xcc, 0x7c, 0x7e, 0xbc, 0xf7, 0x3c, 0xef, 0x79, 0x16, 0xac, - 0x37, 0xb1, 0xef, 0x62, 0xbf, 0xd0, 0xc2, 0x7b, 0x85, 0xbd, 0xad, 0xe0, 0x4f, 0xbe, 0xd3, 0xc5, - 0x04, 0xc3, 0x25, 0xba, 0x91, 0x0f, 0x56, 0xf6, 0xb6, 0x44, 0x89, 0xe1, 0x76, 0x2c, 0x1f, 0x15, - 0xf6, 0xb6, 0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 0x06, 0x43, 0x05, 0x52, 0x6e, 0x63, 0xe2, - 0x9c, 0xc3, 0xb3, 0x60, 0x2d, 0x4e, 0xad, 0x15, 0xeb, 0x75, 0xad, 0xc4, 0xa7, 0x44, 0x7e, 0x30, - 0x54, 0xb2, 0x94, 0x53, 0xb3, 0x7c, 0x1f, 0x05, 0x57, 0x40, 0x21, 0x8e, 0xd6, 0xb5, 0x2b, 0xda, - 0x45, 0x43, 0x2b, 0xf1, 0x69, 0x11, 0x0e, 0x86, 0xca, 0x32, 0xc5, 0xeb, 0xe8, 0x3b, 0xd4, 0x24, - 0xe8, 0x9d, 0xfa, 0x97, 0x8a, 0xe5, 0xab, 0x5a, 0x89, 0x3f, 0x36, 0xa9, 0x7f, 0xc9, 0x72, 0xda, - 0xc8, 0xa6, 0xe5, 0x54, 0x2b, 0x4f, 0x5e, 0x4a, 0x89, 0xe7, 0x2f, 0xa5, 0xc4, 0xf7, 0xfb, 0x52, - 0xe2, 0xc9, 0xbe, 0xc4, 0x3d, 0xdd, 0x97, 0xb8, 0x3f, 0xf6, 0x25, 0xee, 0xc1, 0x2b, 0x29, 0xf1, - 0xf4, 0x95, 0x94, 0x78, 0xfe, 0x4a, 0x4a, 0xdc, 0xfc, 0xe7, 0xf9, 0x75, 0x2f, 0xfc, 0x97, 0x29, - 0x3c, 0xb6, 0x3b, 0x99, 0x70, 0x22, 0x7c, 0xfc, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x66, 0xbe, - 0x9b, 0x99, 0x4d, 0x0d, 0x00, 0x00, + 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{ + // 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, 0xa4, 0xa6, 0xbd, 0x78, 0xf1, 0xa6, 0x18, 0x21, 0xdb, + 0x5a, 0x2f, 0x46, 0x50, 0xa9, 0xab, 0x8d, 0x77, 0x70, 0xb6, 0xf5, 0xee, 0x18, 0xef, 0x38, 0x90, + 0x5b, 0x2f, 0x95, 0x90, 0x4f, 0x1c, 0xb9, 0x58, 0x42, 0xed, 0xad, 0x67, 0xbe, 0x40, 0x6f, 0x1c, + 0x7a, 0xa0, 0x9c, 0x50, 0x0f, 0xa6, 0x04, 0xb5, 0xa2, 0xf4, 0xc6, 0x27, 0xa8, 0x76, 0x66, 0x36, + 0xb1, 0x9d, 0xa8, 0x26, 0xe5, 0x94, 0xf5, 0xcc, 0xef, 0xcf, 0xf3, 0x3c, 0x3b, 0xcf, 0xb3, 0x13, + 0x70, 0xba, 0x81, 0x43, 0x1f, 0x87, 0x6b, 0x4d, 0xbc, 0xb3, 0xb6, 0x73, 0x69, 0x0b, 0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xd4, 0x73, 0xef, 0x06, 0xca, 0x12, 0x0b, + 0x60, 0x3f, 0x46, 0x26, 0xa2, 0x99, 0x5c, 0x0d, 0xb6, 0x01, 0xbc, 0xe3, 0x05, 0x4e, 0xcb, 0x26, + 0x4e, 0xab, 0xb5, 0x6b, 0x77, 0x50, 0xd8, 0x6d, 0x11, 0x29, 0xad, 0x0a, 0xab, 0xb3, 0xeb, 0xca, + 0x51, 0x1e, 0x56, 0x84, 0x33, 0x29, 0x4c, 0xff, 0x7f, 0x54, 0xcd, 0x77, 0x03, 0x65, 0x85, 0x99, + 0x1c, 0x16, 0xd2, 0x4c, 0x91, 0x2e, 0x0e, 0x91, 0xe0, 0x97, 0x60, 0x36, 0xec, 0x6e, 0xf9, 0x1e, + 0xb1, 0xa3, 0x3e, 0x91, 0x4e, 0x50, 0xab, 0xdc, 0xa1, 0xf4, 0xad, 0xb8, 0x89, 0x74, 0x99, 0xbb, + 0x40, 0xe6, 0x32, 0x44, 0xd6, 0x1e, 0xbe, 0x54, 0x04, 0x13, 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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b, 0xee, 0xf5, 0xd5, 0x05, 0x46, 0x19, 0xe9, 0x10, 0xf8, 0x29, + 0xf8, 0xdf, 0x38, 0xb9, 0x5e, 0xb1, 0x4a, 0xe5, 0x2f, 0x62, 0x6e, 0x32, 0xb7, 0xd4, 0xeb, 0xab, + 0x90, 0x71, 0xeb, 0x43, 0xe7, 0x1c, 0x9e, 0x07, 0x4b, 0xe3, 0xd4, 0x6a, 0xa1, 0x56, 0x33, 0x8a, + 0x62, 0x2a, 0x27, 0xf6, 0xfa, 0x6a, 0x96, 0x71, 0xaa, 0x4e, 0x18, 0xa2, 0xe8, 0x5a, 0x28, 0x8d, + 0xa3, 0x4d, 0xe3, 0x9a, 0x71, 0xc5, 0x32, 0x8a, 0x62, 0x3a, 0x07, 0x7b, 0x7d, 0x75, 0x9e, 0xe1, + 0x4d, 0xf4, 0x35, 0x6a, 0x10, 0x74, 0xa4, 0xfe, 0x66, 0xa1, 0x74, 0xdd, 0x28, 0x8a, 0x27, 0x86, + 0xf5, 0x37, 0x1d, 0xaf, 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 { diff --git a/x/gov/types/query.pb.go b/x/gov/types/query.pb.go index 7f17e5546d50..606cc1ff783d 100644 --- a/x/gov/types/query.pb.go +++ b/x/gov/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1/query.proto +// source: cosmos/gov/v1beta2/query.proto package types @@ -41,7 +41,7 @@ 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_46a436d1109b50d0, []int{0} + return fileDescriptor_3efdc0c4615c3665, []int{0} } func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -86,7 +86,7 @@ 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_46a436d1109b50d0, []int{1} + return fileDescriptor_3efdc0c4615c3665, []int{1} } func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -125,7 +125,7 @@ func (m *QueryProposalResponse) GetProposal() Proposal { // 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.v1.ProposalStatus" json:"proposal_status,omitempty"` + 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. @@ -138,7 +138,7 @@ 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_46a436d1109b50d0, []int{2} + return fileDescriptor_3efdc0c4615c3665, []int{2} } func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -179,7 +179,7 @@ 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_46a436d1109b50d0, []int{3} + return fileDescriptor_3efdc0c4615c3665, []int{3} } func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -234,7 +234,7 @@ 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_46a436d1109b50d0, []int{4} + return fileDescriptor_3efdc0c4615c3665, []int{4} } func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -273,7 +273,7 @@ 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_46a436d1109b50d0, []int{5} + return fileDescriptor_3efdc0c4615c3665, []int{5} } func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -321,7 +321,7 @@ 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_46a436d1109b50d0, []int{6} + return fileDescriptor_3efdc0c4615c3665, []int{6} } func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -376,7 +376,7 @@ 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_46a436d1109b50d0, []int{7} + return fileDescriptor_3efdc0c4615c3665, []int{7} } func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -430,7 +430,7 @@ 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_46a436d1109b50d0, []int{8} + return fileDescriptor_3efdc0c4615c3665, []int{8} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -480,7 +480,7 @@ 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_46a436d1109b50d0, []int{9} + return fileDescriptor_3efdc0c4615c3665, []int{9} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -542,7 +542,7 @@ 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_46a436d1109b50d0, []int{10} + return fileDescriptor_3efdc0c4615c3665, []int{10} } func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -581,7 +581,7 @@ 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_46a436d1109b50d0, []int{11} + return fileDescriptor_3efdc0c4615c3665, []int{11} } func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -629,7 +629,7 @@ 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_46a436d1109b50d0, []int{12} + return fileDescriptor_3efdc0c4615c3665, []int{12} } func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -683,7 +683,7 @@ 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_46a436d1109b50d0, []int{13} + return fileDescriptor_3efdc0c4615c3665, []int{13} } func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -736,7 +736,7 @@ 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_46a436d1109b50d0, []int{14} + return fileDescriptor_3efdc0c4615c3665, []int{14} } func (m *QueryTallyResultRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -782,7 +782,7 @@ func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultRespon func (m *QueryTallyResultResponse) String() string { return proto.CompactTextString(m) } func (*QueryTallyResultResponse) ProtoMessage() {} func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{15} + return fileDescriptor_3efdc0c4615c3665, []int{15} } func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -819,90 +819,91 @@ func (m *QueryTallyResultResponse) GetTally() TallyResult { } func init() { - proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1.QueryProposalRequest") - proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1.QueryProposalResponse") - proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1.QueryProposalsRequest") - proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1.QueryProposalsResponse") - proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1.QueryVoteRequest") - proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1.QueryVoteResponse") - proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1.QueryVotesRequest") - proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1.QueryVotesResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1.QueryParamsResponse") - proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1.QueryDepositRequest") - proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1.QueryDepositResponse") - proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1.QueryDepositsRequest") - proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1.QueryDepositsResponse") - proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1.QueryTallyResultRequest") - proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1.QueryTallyResultResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1/query.proto", fileDescriptor_46a436d1109b50d0) } - -var fileDescriptor_46a436d1109b50d0 = []byte{ - // 989 bytes of a gzipped FileDescriptorProto + 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{ + // 998 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x41, 0x6f, 0x1b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e, 0xa8, 0x91, 0x27, 0x07, 0x35, - 0xf2, 0xf7, 0x41, 0x8d, 0x7c, 0x77, 0x58, 0x2b, 0x3c, 0x39, 0xac, 0x15, 0xfe, 0x38, 0xac, 0x15, - 0x3e, 0x5b, 0xf1, 0x03, 0xf9, 0x79, 0x7f, 0xdb, 0xb9, 0xc3, 0x77, 0x0c, 0xa3, 0xfe, 0x67, 0x55, - 0xb4, 0xbf, 0x60, 0xf7, 0x14, 0x7d, 0x34, 0x05, 0x62, 0xfb, 0x8c, 0xfa, 0x93, 0xe2, 0xad, 0xff, - 0x03, 0x00, 0x00, 0xff, 0xff, 0xab, 0xeb, 0x81, 0xa1, 0x12, 0x0d, 0x00, 0x00, + 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, 0xef, 0x9b, 0x37, 0x6f, 0x1c, 0x5a, 0xbf, 0xcd, + 0xf8, 0x16, 0xe3, 0x96, 0xcb, 0x86, 0xd6, 0x70, 0x65, 0xd3, 0x11, 0x76, 0xcb, 0xba, 0x33, 0x70, + 0x82, 0x6d, 0xd3, 0x0f, 0x98, 0x60, 0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6b, 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, } // Reference imports to suppress errors if they are not otherwise used. @@ -945,7 +946,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Proposal", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Query/Proposal", in, out, opts...) if err != nil { return nil, err } @@ -954,7 +955,7 @@ func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, op func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { out := new(QueryProposalsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Proposals", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Query/Proposals", in, out, opts...) if err != nil { return nil, err } @@ -963,7 +964,7 @@ func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { out := new(QueryVoteResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Vote", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Query/Vote", in, out, opts...) if err != nil { return nil, err } @@ -972,7 +973,7 @@ func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...gr func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { out := new(QueryVotesResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Votes", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Query/Votes", in, out, opts...) if err != nil { return nil, err } @@ -981,7 +982,7 @@ func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ... func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -990,7 +991,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { out := new(QueryDepositResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Deposit", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Query/Deposit", in, out, opts...) if err != nil { return nil, err } @@ -999,7 +1000,7 @@ func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { out := new(QueryDepositsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Deposits", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Query/Deposits", in, out, opts...) if err != nil { return nil, err } @@ -1008,7 +1009,7 @@ func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, op func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/TallyResult", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Query/TallyResult", in, out, opts...) if err != nil { return nil, err } @@ -1078,7 +1079,7 @@ func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Proposal", + FullMethod: "/cosmos.gov.v1beta2.Query/Proposal", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest)) @@ -1096,7 +1097,7 @@ func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Proposals", + FullMethod: "/cosmos.gov.v1beta2.Query/Proposals", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest)) @@ -1114,7 +1115,7 @@ func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Vote", + FullMethod: "/cosmos.gov.v1beta2.Query/Vote", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest)) @@ -1132,7 +1133,7 @@ func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Votes", + FullMethod: "/cosmos.gov.v1beta2.Query/Votes", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest)) @@ -1150,7 +1151,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Params", + FullMethod: "/cosmos.gov.v1beta2.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -1168,7 +1169,7 @@ func _Query_Deposit_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Deposit", + FullMethod: "/cosmos.gov.v1beta2.Query/Deposit", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) @@ -1186,7 +1187,7 @@ func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Deposits", + FullMethod: "/cosmos.gov.v1beta2.Query/Deposits", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest)) @@ -1204,7 +1205,7 @@ func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Query/TallyResult", + FullMethod: "/cosmos.gov.v1beta2.Query/TallyResult", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) @@ -1213,7 +1214,7 @@ func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(i } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.gov.v1.Query", + ServiceName: "cosmos.gov.v1beta2.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1250,7 +1251,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/gov/v1/query.proto", + Metadata: "cosmos/gov/v1beta2/query.proto", } func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/gov/types/query.pb.gw.go b/x/gov/types/query.pb.gw.go index 00b3afcc7313..7145295e7e10 100644 --- a/x/gov/types/query.pb.gw.go +++ b/x/gov/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/gov/v1/query.proto +// source: cosmos/gov/v1beta2/query.proto /* Package types is a reverse proxy. @@ -896,21 +896,21 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } 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", "v1", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false))) + 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", "v1", "proposals"}, "", 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", "v1", "proposals", "proposal_id", "votes", "voter"}, "", 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", "v1", "proposals", "proposal_id", "votes"}, "", 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", "v1", "params", "params_type"}, "", 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", "v1", "proposals", "proposal_id", "deposits", "depositor"}, "", 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", "v1", "proposals", "proposal_id", "deposits"}, "", 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", "v1", "proposals", "proposal_id", "tally"}, "", 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 ( diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index 8f67df091245..956a11cf9639 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1/tx.proto +// source: cosmos/gov/v1beta2/tx.proto package types @@ -43,7 +43,7 @@ type MsgSubmitProposal struct { func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } func (*MsgSubmitProposal) ProtoMessage() {} func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{0} + return fileDescriptor_4214261f6b3f9ed4, []int{0} } func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -81,7 +81,7 @@ func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResp func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) } func (*MsgSubmitProposalResponse) ProtoMessage() {} func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{1} + return fileDescriptor_4214261f6b3f9ed4, []int{1} } func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,13 +121,13 @@ func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { type MsgVote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1.VoteOption" json:"option,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 (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{2} + return fileDescriptor_4214261f6b3f9ed4, []int{2} } func (m *MsgVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -164,7 +164,7 @@ 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_9ff8f4a63b6fc9a9, []int{3} + return fileDescriptor_4214261f6b3f9ed4, []int{3} } func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -205,7 +205,7 @@ type MsgVoteWeighted struct { func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } func (*MsgVoteWeighted) ProtoMessage() {} func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{4} + return fileDescriptor_4214261f6b3f9ed4, []int{4} } func (m *MsgVoteWeighted) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -244,7 +244,7 @@ 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_9ff8f4a63b6fc9a9, []int{5} + return fileDescriptor_4214261f6b3f9ed4, []int{5} } func (m *MsgVoteWeightedResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -283,7 +283,7 @@ type MsgDeposit struct { func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } func (*MsgDeposit) ProtoMessage() {} func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{6} + return fileDescriptor_4214261f6b3f9ed4, []int{6} } func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -320,7 +320,7 @@ 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_9ff8f4a63b6fc9a9, []int{7} + return fileDescriptor_4214261f6b3f9ed4, []int{7} } func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,7 +360,7 @@ type MsgSignal struct { func (m *MsgSignal) Reset() { *m = MsgSignal{} } func (*MsgSignal) ProtoMessage() {} func (*MsgSignal) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{8} + return fileDescriptor_4214261f6b3f9ed4, []int{8} } func (m *MsgSignal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -397,7 +397,7 @@ func (m *MsgSignalResponse) Reset() { *m = MsgSignalResponse{} } func (m *MsgSignalResponse) String() string { return proto.CompactTextString(m) } func (*MsgSignalResponse) ProtoMessage() {} func (*MsgSignalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{9} + return fileDescriptor_4214261f6b3f9ed4, []int{9} } func (m *MsgSignalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -427,69 +427,69 @@ func (m *MsgSignalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSignalResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1.MsgSubmitProposal") - proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitProposalResponse") - proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1.MsgVote") - proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1.MsgVoteResponse") - proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1.MsgVoteWeighted") - proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1.MsgVoteWeightedResponse") - proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1.MsgDeposit") - proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1.MsgDepositResponse") - proto.RegisterType((*MsgSignal)(nil), "cosmos.gov.v1.MsgSignal") - proto.RegisterType((*MsgSignalResponse)(nil), "cosmos.gov.v1.MsgSignalResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } - -var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 739 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xc1, 0x6b, 0x13, 0x4d, - 0x14, 0xdf, 0x6d, 0xda, 0xb4, 0x99, 0x7e, 0x5f, 0xfb, 0x75, 0xbe, 0xd0, 0x6e, 0x72, 0xd8, 0xa4, - 0x01, 0x25, 0x97, 0xee, 0x36, 0x55, 0x14, 0x7a, 0x10, 0x1a, 0x8b, 0xe2, 0x21, 0x28, 0x5b, 0xa8, - 0x20, 0x42, 0xd9, 0x64, 0xc7, 0xe9, 0x60, 0xb2, 0xb3, 0xec, 0x4c, 0x42, 0x73, 0x13, 0xbc, 0x88, - 0x20, 0x78, 0xf4, 0xd8, 0xb3, 0x67, 0xff, 0x06, 0xe9, 0xcd, 0xe2, 0xc9, 0x83, 0x54, 0x69, 0x2f, - 0x22, 0x78, 0xf1, 0x2f, 0x90, 0x9d, 0x99, 0xdd, 0xa4, 0xc9, 0xb6, 0x41, 0xd0, 0x53, 0x32, 0xef, - 0xfd, 0x7e, 0x6f, 0xdf, 0xef, 0xed, 0xef, 0xcd, 0x82, 0xe5, 0x16, 0x65, 0x1d, 0xca, 0x6c, 0x4c, - 0x7b, 0x76, 0xaf, 0x66, 0xf3, 0x03, 0x2b, 0x08, 0x29, 0xa7, 0xf0, 0x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x94, 0xf5, 0x6a, 0xae, 0x6e, 0x7c, 0x7c, 0xb7, 0x96, 0x57, 0x4f, 0xdc, 0xf2, 0xbc, 0x10, - 0x31, 0xb6, 0xc3, 0x43, 0xe2, 0x63, 0x27, 0x41, 0x6e, 0xfe, 0xf7, 0xe2, 0xb0, 0xa4, 0xbd, 0x39, - 0x2c, 0x69, 0xdf, 0x0e, 0x4b, 0xda, 0xb3, 0xcf, 0x65, 0xad, 0xd2, 0x00, 0x85, 0xb1, 0x21, 0x38, - 0x88, 0x05, 0xd4, 0x67, 0x08, 0xae, 0x83, 0xf9, 0x40, 0xc5, 0xf6, 0x88, 0x67, 0xe8, 0x65, 0xbd, - 0x3a, 0x5d, 0x5f, 0xfc, 0x7e, 0x52, 0x1a, 0x0e, 0x3b, 0x20, 0x3e, 0xdc, 0xf3, 0x2a, 0xef, 0x75, - 0x30, 0xdb, 0x60, 0x78, 0x97, 0x72, 0x04, 0xef, 0xa4, 0xb1, 0xaf, 0x8c, 0xb0, 0x7f, 0x9e, 0x94, - 0x60, 0xdf, 0xed, 0xb4, 0x37, 0x2b, 0x43, 0xc1, 0xca, 0x70, 0x4d, 0x68, 0x81, 0x99, 0x1e, 0xe5, - 0x28, 0x34, 0xa6, 0x26, 0xe8, 0x94, 0x30, 0x58, 0x03, 0x59, 0x1a, 0x70, 0x42, 0x7d, 0x31, 0x98, - 0x85, 0xc1, 0x7b, 0x90, 0xee, 0xb3, 0xa2, 0xe6, 0xee, 0x0b, 0x80, 0xa3, 0x80, 0x29, 0x73, 0x59, - 0x02, 0x8b, 0x4a, 0x47, 0x3c, 0x8d, 0xca, 0x07, 0x3d, 0x89, 0x3d, 0x44, 0x04, 0xef, 0x73, 0xe4, - 0xc1, 0x9b, 0x69, 0x1a, 0x97, 0xff, 0x82, 0xa8, 0x2d, 0x30, 0x2b, 0x7b, 0x65, 0x46, 0x46, 0xb8, - 0x6b, 0x75, 0x44, 0x55, 0xdc, 0xd2, 0x40, 0x5d, 0x7d, 0x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 0x1b, 0x64, 0xd5, 0x7b, 0x36, 0x52, 0x86, 0x22, 0x32, 0xc5, 0xf2, 0x45, 0x99, 0xb8, 0x4a, - 0xbd, 0x7e, 0x74, 0x6a, 0xea, 0xc7, 0xa7, 0xa6, 0xfe, 0xf5, 0xd4, 0xd4, 0x5f, 0x9f, 0x99, 0xda, - 0xf1, 0x99, 0xa9, 0x7d, 0x3a, 0x33, 0xb5, 0x47, 0x97, 0xbb, 0xf4, 0x40, 0x7c, 0xec, 0x84, 0x57, - 0x9b, 0x59, 0xf1, 0xa5, 0xb9, 0xf6, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x10, 0xd7, 0x01, 0xca, 0x4e, - 0x07, 0x00, 0x00, + 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") + proto.RegisterType((*MsgSignal)(nil), "cosmos.gov.v1beta2.MsgSignal") + proto.RegisterType((*MsgSignalResponse)(nil), "cosmos.gov.v1beta2.MsgSignalResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) } + +var fileDescriptor_4214261f6b3f9ed4 = []byte{ + // 741 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0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, 0x99, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -529,7 +529,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/SubmitProposal", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/SubmitProposal", in, out, opts...) if err != nil { return nil, err } @@ -538,7 +538,7 @@ func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, o func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Vote", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/Vote", in, out, opts...) if err != nil { return nil, err } @@ -547,7 +547,7 @@ func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOpti func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { out := new(MsgVoteWeightedResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/VoteWeighted", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/VoteWeighted", in, out, opts...) if err != nil { return nil, err } @@ -556,7 +556,7 @@ func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { out := new(MsgDepositResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Deposit", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/Deposit", in, out, opts...) if err != nil { return nil, err } @@ -565,7 +565,7 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca func (c *msgClient) Signal(ctx context.Context, in *MsgSignal, opts ...grpc.CallOption) (*MsgSignalResponse, error) { out := new(MsgSignalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Signal", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/Signal", in, out, opts...) if err != nil { return nil, err } @@ -623,7 +623,7 @@ func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/SubmitProposal", + FullMethod: "/cosmos.gov.v1beta2.Msg/SubmitProposal", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal)) @@ -641,7 +641,7 @@ func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/Vote", + FullMethod: "/cosmos.gov.v1beta2.Msg/Vote", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Vote(ctx, req.(*MsgVote)) @@ -659,7 +659,7 @@ func _Msg_VoteWeighted_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/VoteWeighted", + FullMethod: "/cosmos.gov.v1beta2.Msg/VoteWeighted", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).VoteWeighted(ctx, req.(*MsgVoteWeighted)) @@ -677,7 +677,7 @@ func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/Deposit", + FullMethod: "/cosmos.gov.v1beta2.Msg/Deposit", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) @@ -695,7 +695,7 @@ func _Msg_Signal_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/Signal", + FullMethod: "/cosmos.gov.v1beta2.Msg/Signal", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Signal(ctx, req.(*MsgSignal)) @@ -704,7 +704,7 @@ func _Msg_Signal_Handler(srv interface{}, ctx context.Context, dec func(interfac } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.gov.v1.Msg", + ServiceName: "cosmos.gov.v1beta2.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -729,7 +729,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/gov/v1/tx.proto", + Metadata: "cosmos/gov/v1beta2/tx.proto", } func (m *MsgSubmitProposal) Marshal() (dAtA []byte, err error) { From 0a3b09c5723827a915df5f95f13d79b2329d4f7b Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 17 Nov 2021 16:38:36 +0100 Subject: [PATCH 20/28] remove signal msg from gov --- docs/core/proto-docs.md | 31 -- go.mod | 2 +- proto/cosmos/gov/v1beta2/tx.proto | 19 -- x/authz/client/testutil/tx.go | 5 +- x/authz/tx.pb.go | 68 ++-- x/distribution/client/cli/tx.go | 7 +- x/feegrant/client/testutil/suite.go | 5 +- x/feegrant/tx.pb.go | 42 ++- x/gov/keeper/msg_server.go | 12 - x/gov/migrations/v045/migrate.go | 4 +- x/gov/types/codec.go | 2 - x/gov/types/msgs.go | 64 +--- x/gov/types/msgs_test.go | 37 -- x/gov/types/tx.pb.go | 503 +++------------------------- x/group/query.pb.go | 118 ++++--- x/nft/tx.pb.go | 28 +- x/upgrade/client/cli/tx.go | 4 +- 17 files changed, 185 insertions(+), 766 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index c8b47842b5da..acf098d4f04f 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -414,8 +414,6 @@ - [cosmos/gov/v1beta2/tx.proto](#cosmos/gov/v1beta2/tx.proto) - [MsgDeposit](#cosmos.gov.v1beta2.MsgDeposit) - [MsgDepositResponse](#cosmos.gov.v1beta2.MsgDepositResponse) - - [MsgSignal](#cosmos.gov.v1beta2.MsgSignal) - - [MsgSignalResponse](#cosmos.gov.v1beta2.MsgSignalResponse) - [MsgSubmitProposal](#cosmos.gov.v1beta2.MsgSubmitProposal) - [MsgSubmitProposalResponse](#cosmos.gov.v1beta2.MsgSubmitProposalResponse) - [MsgVote](#cosmos.gov.v1beta2.MsgVote) @@ -6156,34 +6154,6 @@ MsgDepositResponse defines the Msg/Deposit response type. - - -### MsgSignal -MsgSignal is functionally a no-op message that can be submitted in a proposal to signal -an intention for members to vote on. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `authority` | [string](#string) | | | - - - - - - - - -### MsgSignalResponse -MsgSignalResponse defined the Msg/Signal response type - - - - - - ### MsgSubmitProposal @@ -6294,7 +6264,6 @@ Msg defines the gov Msg service. Since: cosmos-sdk 0.43 | | | `Deposit` | [MsgDeposit](#cosmos.gov.v1beta2.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta2.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | -| `Signal` | [MsgSignal](#cosmos.gov.v1beta2.MsgSignal) | [MsgSignalResponse](#cosmos.gov.v1beta2.MsgSignalResponse) | Signal is a basic governance proposal message which has no functionality but is used to gather signal on a certain intention. | | diff --git a/go.mod b/go.mod index 46673904b5f5..2ed5f06b422c 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,6 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.5.9 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 @@ -89,6 +88,7 @@ require ( github.com/gorilla/websocket v1.4.2 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.2.1 // indirect diff --git a/proto/cosmos/gov/v1beta2/tx.proto b/proto/cosmos/gov/v1beta2/tx.proto index 38190606521b..d082416985b8 100644 --- a/proto/cosmos/gov/v1beta2/tx.proto +++ b/proto/cosmos/gov/v1beta2/tx.proto @@ -24,10 +24,6 @@ service Msg { // Deposit defines a method to add deposit on a specific proposal. rpc Deposit(MsgDeposit) returns (MsgDepositResponse); - - // Signal is a basic governance proposal message which has no functionality - // but is used to gather signal on a certain intention. - rpc Signal(MsgSignal) returns (MsgSignalResponse); } // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -99,18 +95,3 @@ message MsgDeposit { // MsgDepositResponse defines the Msg/Deposit response type. message MsgDepositResponse {} -// MsgSignal is functionally a no-op message that can be submitted in a proposal to signal -// an intention for members to vote on. -message MsgSignal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - string title = 1; - string description = 2; - string authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgSignalResponse defined the Msg/Signal response type -message MsgSignalResponse {} diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index f63e912af4c0..04b5b1ceabc7 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -54,10 +54,9 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(err) // create a proposal with deposit - govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, auth.NewModuleAddress(govtypes.ModuleName)) + _, err = s.cfg.AccountRetriever.GetAccount(val.ClientCtx, auth.NewModuleAddress(govtypes.ModuleName)) s.Require().NoError(err) - proposal := []sdk.Msg{govtypes.NewMsgSignal("test_title", "test_description", govAcc.GetAddress())} - _, err = govtestutil.MsgSubmitProposal(s.T(), val.ClientCtx, val.Address.String(), proposal, + _, err = govtestutil.MsgSubmitProposal(s.T(), val.ClientCtx, val.Address.String(), []sdk.Msg{}, fmt.Sprintf("--%s=%s", govcli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, govtypes.DefaultMinDepositTokens).String())) s.Require().NoError(err) diff --git a/x/authz/tx.pb.go b/x/authz/tx.pb.go index 3bab5a68d6f9..b7c9987186da 100644 --- a/x/authz/tx.pb.go +++ b/x/authz/tx.pb.go @@ -8,14 +8,12 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" 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" - _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -282,40 +280,38 @@ func init() { func init() { proto.RegisterFile("cosmos/authz/v1beta1/tx.proto", fileDescriptor_3ceddab7d8589ad1) } var fileDescriptor_3ceddab7d8589ad1 = []byte{ - // 517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x93, 0xcf, 0x6e, 0xd3, 0x4c, - 0x14, 0xc5, 0x33, 0x4d, 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cf, 0xe8, 0xeb, 0x7c, 0xea, 0xdc, 0xc0, 0xd7, 0x37, 0xb6, 0x4a, 0xb3, 0xbd, 0x1f, - 0x08, 0x57, 0x7d, 0x60, 0xc6, 0x0b, 0xbc, 0xab, 0xfe, 0x15, 0x6b, 0x7b, 0x68, 0x65, 0x97, 0xad, - 0x7b, 0x97, 0xeb, 0x9b, 0xfc, 0x9e, 0xe3, 0x9a, 0x4c, 0xe8, 0xe8, 0x42, 0x7e, 0x2d, 0xb7, 0xee, - 0x5e, 0x2a, 0x6f, 0x6e, 0x0b, 0xf0, 0x9e, 0x9e, 0x67, 0xfb, 0xc2, 0x03, 0x0a, 0x68, 0xdd, 0xff, - 0x0b, 0x50, 0xde, 0xe9, 0x79, 0x8b, 0xef, 0x56, 0x65, 0xb1, 0xb4, 0xd0, 0xf9, 0xd2, 0x42, 0xdf, - 0x96, 0x16, 0x7a, 0xbf, 0xb2, 0x2a, 0xe7, 0x2b, 0xab, 0xf2, 0x65, 0x65, 0x55, 0xde, 0xdc, 0x61, - 0xb1, 0x18, 0x17, 0x11, 0x19, 0xf2, 0x44, 0x3f, 0x79, 0xfd, 0xe9, 0xc2, 0x68, 0xe2, 0xce, 0xd4, - 0x63, 0x8b, 0xf6, 0xe4, 0x5f, 0xf3, 0xe8, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0x05, 0x3d, - 0x79, 0x58, 0x04, 0x00, 0x00, + // 490 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xf6, 0x36, 0x69, 0xf3, 0xcb, 0xb6, 0xd2, 0x0f, 0x4c, 0x0e, 0xae, 0xa1, 0xae, 0x65, 0xf1, + 0x27, 0x12, 0x64, 0xad, 0x86, 0x03, 0xe7, 0x58, 0x42, 0x48, 0x08, 0x0b, 0xc9, 0xc0, 0x85, 0x4b,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, 0xaf, 0xf4, 0xf3, 0xf8, + 0xd2, 0x06, 0x4d, 0x70, 0x1f, 0xfc, 0x85, 0x60, 0x66, 0x46, 0xd1, 0xe2, 0x87, 0x67, 0x2d, 0x96, + 0x1e, 0xba, 0x58, 0x7a, 0xe8, 0xfb, 0xd2, 0x43, 0x1f, 0x56, 0x9e, 0x75, 0xb1, 0xf2, 0xac, 0xaf, + 0x2b, 0xcf, 0x7a, 0x7b, 0x97, 0x8d, 0xe4, 0xb0, 0xe8, 0x91, 0x3e, 0xcf, 0xca, 0xc7, 0x5a, 0x7e, + 0x5a, 0x30, 0x18, 0x87, 0x33, 0xfd, 0xd8, 0x7a, 0x7b, 0xea, 0xd6, 0x3c, 0xfe, 0x15, 0x00, 0x00, + 0xff, 0xff, 0x08, 0x13, 0x12, 0x19, 0x12, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index 1e823d3f03cf..bc2d1659542c 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -12,8 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/distribution/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -312,14 +312,13 @@ Where proposal.json contains: return err } - govAcc, err := clientCtx.AccountRetriever.GetAccount(clientCtx, authtypes.NewModuleAddress(govtypes.ModuleName)) + _, err = clientCtx.AccountRetriever.GetAccount(clientCtx, authtypes.NewModuleAddress(govtypes.ModuleName)) if err != nil { return err } // TODO: replace signal proposal with a community spend message - signalMsg := govtypes.NewMsgSignal(proposal.Title, proposal.Description, govAcc.GetAddress()) - msg, err := govtypes.NewMsgSubmitProposal([]sdk.Msg{signalMsg}, deposit, from) + msg, err := govtypes.NewMsgSubmitProposal([]sdk.Msg{}, deposit, from) if err != nil { return err } diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index a4a62b423dec..a8f500f9620e 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -696,11 +696,10 @@ func (s *IntegrationTestSuite) TestTxWithFeeGrant() { // granted fee allowance for an account which is not in state and creating // any tx with it by using --fee-account shouldn't fail - govAcc, err := s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(govtypes.ModuleName)) + _, err = s.cfg.AccountRetriever.GetAccount(val.ClientCtx, authtypes.NewModuleAddress(govtypes.ModuleName)) s.Require().NoError(err) - proposal := []sdk.Msg{govtypes.NewMsgSignal("test_title", "test_description", govAcc.GetAddress())} out, err := govtestutil.MsgSubmitProposal(s.T(), val.ClientCtx, grantee.String(), - proposal, fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), + []sdk.Msg{}, fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), ) s.Require().NoError(err) diff --git a/x/feegrant/tx.pb.go b/x/feegrant/tx.pb.go index 41ed8b17fba9..aa926c944746 100644 --- a/x/feegrant/tx.pb.go +++ b/x/feegrant/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/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" @@ -234,30 +233,29 @@ func init() { func init() { proto.RegisterFile("cosmos/feegrant/v1beta1/tx.proto", fileDescriptor_dd44ad7946dad783) } var fileDescriptor_dd44ad7946dad783 = []byte{ - // 361 bytes of a gzipped FileDescriptorProto + // 352 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff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, 0x18, 0xd0, 0xd2, 0xc3, 0x11, 0xcf, 0x7a, 0x18, 0x3e, 0x95, + 0x32, 0x22, 0x5e, 0x2d, 0xcc, 0x66, 0xa1, 0x62, 0x2e, 0x7e, 0xf4, 0x20, 0xd1, 0xc6, 0x67, 0x0c, + 0x9a, 0x62, 0x29, 0x63, 0x12, 0x14, 0xc3, 0x2c, 0x75, 0x72, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, + 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, + 0xc6, 0x63, 0x39, 0x86, 0x28, 0xf5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, + 0x68, 0xfa, 0x84, 0x52, 0xba, 0xc5, 0x29, 0xd9, 0xfa, 0x15, 0xf0, 0xfc, 0x90, 0xc4, 0x06, 0x4e, + 0x16, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x23, 0xac, 0x1e, 0xb4, 0x29, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 7a9b2c7a27a2..e24f4eaba801 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -175,15 +175,3 @@ func (k msgServer) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types return &types.MsgDepositResponse{}, nil } - -func (k msgServer) Signal(goCtx context.Context, msg *types.MsgSignal) (*types.MsgSignalResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeSignalProposal, - sdk.NewAttribute(types.AttributeSignalTitle, msg.Title), - sdk.NewAttribute(types.AttributeSignalDescription, msg.Description), - ), - ) - return &types.MsgSignalResponse{}, nil -} diff --git a/x/gov/migrations/v045/migrate.go b/x/gov/migrations/v045/migrate.go index 6cd5657d16c3..bbda45093958 100644 --- a/x/gov/migrations/v045/migrate.go +++ b/x/gov/migrations/v045/migrate.go @@ -50,11 +50,11 @@ func migrateProposals(oldProposals v1beta1.Proposals, govAcc sdk.AccAddress) typ func migrateContent(content v1beta1.Content, govAcc sdk.AccAddress) []sdk.Msg { switch content.ProposalType() { case v1beta1.ProposalTypeText: - return []sdk.Msg{types.NewMsgSignal(content.GetTitle(), content.GetDescription(), govAcc)} + return []sdk.Msg{} // TODO: enter the other proposal content types default: // NOTE: If a network is using a unique content type that isn't recognisable then it will not be possible to migrate it to the new proposal type. The best thing to do in this situation, rather than silently ignore it, is to convert it to a signal proposal - return []sdk.Msg{types.NewMsgSignal(content.GetTitle(), content.GetDescription(), govAcc)} + return []sdk.Msg{} } } diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index 471fd3645b88..62da2c5b227b 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -15,7 +15,6 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDeposit{}, "cosmos-sdk/MsgDeposit", nil) cdc.RegisterConcrete(&MsgVote{}, "cosmos-sdk/MsgVote", nil) cdc.RegisterConcrete(&MsgVoteWeighted{}, "cosmos-sdk/MsgVoteWeighted", nil) - cdc.RegisterConcrete(&MsgSignal{}, "cosmos-sdk/MsgSignal", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -24,7 +23,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgVote{}, &MsgVoteWeighted{}, &MsgDeposit{}, - &MsgSignal{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index f26be6c69036..3357d3f032a9 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -2,7 +2,6 @@ package types import ( "fmt" - "strings" "sigs.k8s.io/yaml" @@ -28,8 +27,8 @@ const ( ) var ( - _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgSignal{} - _ types.UnpackInterfacesMessage = &MsgSubmitProposal{} + _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{} + _ types.UnpackInterfacesMessage = &MsgSubmitProposal{} ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. @@ -103,9 +102,10 @@ func (m MsgSubmitProposal) ValidateBasic() error { } // Empty messages are not allowed - if m.Messages == nil || len(m.Messages) == 0 { - return ErrNoProposalMsgs - } + // TODO: ValidateBasic should check that either metadata or length is non nil + // if m.Messages == nil || len(m.Messages) == 0 { + // return ErrNoProposalMsgs + // } msgs, err := m.GetMessages() if err != nil { @@ -294,55 +294,3 @@ func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { voter, _ := sdk.AccAddressFromBech32(msg.Voter) return []sdk.AccAddress{voter} } - -// NewMsgVote creates a message to cast a vote on an active proposal -//nolint:interfacer -func NewMsgSignal(title, description string, authority sdk.AccAddress) *MsgSignal { - return &MsgSignal{ - Title: title, - Description: description, - Authority: authority.String(), - } -} - -// Route implements Msg -func (msg MsgSignal) Route() string { return RouterKey } - -// Type implements Msg -func (msg MsgSignal) Type() string { return TypeMsgSignal } - -// ValidateBasic implements Msg -func (msg MsgSignal) ValidateBasic() error { - if len(strings.TrimSpace(msg.Title)) == 0 { - return sdkerrors.Wrap(ErrInvalidSignalMsg, "signal title cannot be blank") - } - if len(msg.Title) > MaxTitleLength { - return sdkerrors.Wrap(ErrInvalidSignalMsg, fmt.Sprintf("signal title is longer than max length of %d", MaxTitleLength)) - } - if len(msg.Description) > MaxDescriptionLength { - return sdkerrors.Wrap(ErrInvalidSignalMsg, fmt.Sprintf("signal description is longer than max length of %d", MaxDescriptionLength)) - } - if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { - return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err) - } - - return nil -} - -// String implements the Stringer interface -func (msg MsgSignal) String() string { - out, _ := yaml.Marshal(msg) - return string(out) -} - -// GetSignBytes implements Msg -func (msg MsgSignal) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) - return sdk.MustSortJSON(bz) -} - -// GetSigners implements Msg. A signal message must have the governance account as the signer -func (msg MsgSignal) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} diff --git a/x/gov/types/msgs_test.go b/x/gov/types/msgs_test.go index dbfce172c999..6f426937e93c 100644 --- a/x/gov/types/msgs_test.go +++ b/x/gov/types/msgs_test.go @@ -1,7 +1,6 @@ package types import ( - "strings" "testing" "github.com/stretchr/testify/require" @@ -23,42 +22,6 @@ func init() { coinsMulti.Sort() } -// test ValidateBasic for MsgCreateValidator -func TestMsgSubmitProposal(t *testing.T) { - tests := []struct { - title, description string - proposerAddr sdk.AccAddress - initialDeposit sdk.Coins - expectPass bool - }{ - {"Test Proposal", "the purpose of this proposal is to test", addrs[0], coinsPos, true}, - {"", "the purpose of this proposal is to test", addrs[0], coinsPos, false}, - {"Test Proposal", "the purpose of this proposal is to test", sdk.AccAddress{}, coinsPos, false}, - {"Test Proposal", "the purpose of this proposal is to test", addrs[0], coinsZero, true}, - {"Test Proposal", "the purpose of this proposal is to test", addrs[0], coinsMulti, true}, - {strings.Repeat("#", MaxTitleLength*2), "the purpose of this proposal is to test", addrs[0], coinsMulti, false}, - {"Test Proposal", strings.Repeat("#", MaxDescriptionLength*2), addrs[0], coinsMulti, false}, - } - - for i, tc := range tests { - proposal := []sdk.Msg{NewMsgSignal(tc.title, tc.description, tc.proposerAddr)} - - msg, err := NewMsgSubmitProposal( - proposal, - tc.initialDeposit, - tc.proposerAddr, - ) - - require.NoError(t, err) - - if tc.expectPass { - require.NoError(t, msg.ValidateBasic(), "test: %v", i) - } else { - require.Error(t, msg.ValidateBasic(), "test: %v", i) - } - } -} - func TestMsgDepositGetSignBytes(t *testing.T) { addr := sdk.AccAddress("addr1") msg := NewMsgDeposit(addr, 0, coinsPos) diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index 956a11cf9639..1ba0d1d0c49a 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -349,83 +349,6 @@ func (m *MsgDepositResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo -// MsgSignal is functionally a no-op message that can be submitted in a proposal to signal -// an intention for members to vote on. -type MsgSignal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` -} - -func (m *MsgSignal) Reset() { *m = MsgSignal{} } -func (*MsgSignal) ProtoMessage() {} -func (*MsgSignal) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{8} -} -func (m *MsgSignal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSignal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSignal.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 *MsgSignal) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSignal.Merge(m, src) -} -func (m *MsgSignal) XXX_Size() int { - return m.Size() -} -func (m *MsgSignal) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSignal.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSignal proto.InternalMessageInfo - -// MsgSignalResponse defined the Msg/Signal response type -type MsgSignalResponse struct { -} - -func (m *MsgSignalResponse) Reset() { *m = MsgSignalResponse{} } -func (m *MsgSignalResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSignalResponse) ProtoMessage() {} -func (*MsgSignalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{9} -} -func (m *MsgSignalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSignalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSignalResponse.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 *MsgSignalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSignalResponse.Merge(m, src) -} -func (m *MsgSignalResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSignalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSignalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSignalResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1beta2.MsgSubmitProposal") proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta2.MsgSubmitProposalResponse") @@ -435,61 +358,54 @@ func init() { proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1beta2.MsgVoteWeightedResponse") proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta2.MsgDeposit") proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta2.MsgDepositResponse") - proto.RegisterType((*MsgSignal)(nil), "cosmos.gov.v1beta2.MsgSignal") - proto.RegisterType((*MsgSignalResponse)(nil), "cosmos.gov.v1beta2.MsgSignalResponse") } func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) } var fileDescriptor_4214261f6b3f9ed4 = []byte{ - // 741 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x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ipped 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, 0x62, 0xd0, 0x26, + 0xac, 0x6f, 0x2b, 0xb0, 0x64, 0x2a, 0x41, 0xd3, 0xe3, 0x58, 0x29, 0x96, 0x9c, 0x16, 0xa3, 0x41, + 0xac, 0x29, 0x5d, 0xcd, 0x48, 0x18, 0xe9, 0x63, 0xb4, 0x18, 0xa3, 0x1b, 0xf2, 0xe4, 0xa8, 0xf4, + 0x31, 0x54, 0x20, 0x8c, 0xb0, 0x38, 0x1e, 0xfd, 0x97, 0x08, 0x08, 0x63, 0xa4, 0x8d, 0x1d, 0x79, + 0x6a, 0xf6, 0x36, 0x1d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, 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, } // Reference imports to suppress errors if they are not otherwise used. @@ -514,9 +430,6 @@ type MsgClient interface { 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) - // Signal is a basic governance proposal message which has no functionality - // but is used to gather signal on a certain intention. - Signal(ctx context.Context, in *MsgSignal, opts ...grpc.CallOption) (*MsgSignalResponse, error) } type msgClient struct { @@ -563,15 +476,6 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca return out, nil } -func (c *msgClient) Signal(ctx context.Context, in *MsgSignal, opts ...grpc.CallOption) (*MsgSignalResponse, error) { - out := new(MsgSignalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/Signal", 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. @@ -584,9 +488,6 @@ type MsgServer interface { VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) // Deposit defines a method to add deposit on a specific proposal. Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) - // Signal is a basic governance proposal message which has no functionality - // but is used to gather signal on a certain intention. - Signal(context.Context, *MsgSignal) (*MsgSignalResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -605,9 +506,6 @@ func (*UnimplementedMsgServer) VoteWeighted(ctx context.Context, req *MsgVoteWei func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") } -func (*UnimplementedMsgServer) Signal(ctx context.Context, req *MsgSignal) (*MsgSignalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Signal not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -685,24 +583,6 @@ func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } -func _Msg_Signal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSignal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Signal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta2.Msg/Signal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Signal(ctx, req.(*MsgSignal)) - } - return interceptor(ctx, in, info, handler) -} - var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.gov.v1beta2.Msg", HandlerType: (*MsgServer)(nil), @@ -723,10 +603,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "Deposit", Handler: _Msg_Deposit_Handler, }, - { - MethodName: "Signal", - Handler: _Msg_Signal_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/gov/v1beta2/tx.proto", @@ -1025,73 +901,6 @@ func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgSignal) 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 *MsgSignal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSignal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSignalResponse) 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 *MsgSignalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSignalResponse) 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 @@ -1230,36 +1039,6 @@ func (m *MsgDepositResponse) Size() (n int) { return n } -func (m *MsgSignal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSignalResponse) 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 } @@ -2025,202 +1804,6 @@ func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSignal) 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: MsgSignal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSignal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", 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.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = 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 *MsgSignalResponse) 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: MsgSignalResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSignalResponse: 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 diff --git a/x/group/query.pb.go b/x/group/query.pb.go index 2b4b9f281902..68b93abd5b55 100644 --- a/x/group/query.pb.go +++ b/x/group/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" grpc "google.golang.org/grpc" @@ -1205,65 +1204,64 @@ func init() { func init() { proto.RegisterFile("cosmos/group/v1beta1/query.proto", fileDescriptor_ae47912b18757b1a) } var fileDescriptor_ae47912b18757b1a = []byte{ - // 915 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x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- 0xb5, 0xb5, 0xb2, 0x27, 0xda, 0x79, 0x32, 0x93, 0x16, 0xdb, 0xd9, 0x5b, 0xfb, 0x0e, 0x81, 0xe9, - 0x88, 0xdc, 0x5b, 0x0c, 0x26, 0x29, 0xb8, 0x5f, 0x43, 0x73, 0xa2, 0x3d, 0x32, 0x0c, 0x3a, 0x60, - 0xec, 0x11, 0x31, 0xdc, 0x19, 0x87, 0xa2, 0x30, 0x9c, 0xf4, 0x84, 0xc0, 0x7f, 0x5e, 0x50, 0xab, - 0xdc, 0x77, 0xc7, 0xa6, 0xd6, 0x00, 0x2f, 0x09, 0xce, 0x37, 0x5d, 0x42, 0x70, 0x65, 0x8b, 0xdc, - 0x2d, 0xb7, 0xe8, 0x51, 0x4b, 0xe3, 0xc0, 0xf4, 0x8a, 0xfd, 0x8c, 0xe0, 0x28, 0x83, 0xda, 0x02, - 0x65, 0xf6, 0xaa, 0x48, 0x12, 0x55, 0x31, 0x35, 0xc3, 0x5e, 0xb8, 0xb3, 0x43, 0x50, 0xd4, 0x4f, - 0x77, 0xab, 0xf8, 0x11, 0x60, 0x88, 0x09, 0x13, 0x76, 0x61, 0xcc, 0x9b, 0x02, 0x84, 0xf9, 0x70, - 0x09, 0xa1, 0x63, 0xb5, 0x78, 0x29, 0x19, 0x18, 0x17, 0xfb, 0x00, 0xfe, 0xec, 0x3c, 0xda, 0x85, - 0x62, 0x5c, 0x84, 0xee, 0x11, 0x5a, 0x5c, 0xee, 0x8b, 0x83, 0xc9, 0x29, 0xfc, 0xd6, 0x3e, 0x61, - 0x0a, 0x72, 0x5c, 0x90, 0xe0, 0x28, 0x2c, 0x16, 0x12, 0xe3, 0x31, 0xa1, 0x09, 0x13, 0x81, 0xc1, - 0x4c, 0x88, 0x8d, 0xd0, 0x71, 0xa9, 0x8b, 0x8b, 0xc9, 0x09, 0x98, 0xf3, 0x29, 0x81, 0x4c, 0xd8, - 0x90, 0x23, 0xac, 0x24, 0xb4, 0xac, 0x63, 0x3a, 0x13, 0x4b, 0x7d, 0xf3, 0x7a, 0x2b, 0xe1, 0x2e, - 0xf4, 0xa1, 0x24, 0x60, 0x46, 0xa9, 0x6f, 0x1e, 0x2a, 0xa9, 0xc2, 0xa8, 0x7b, 0x48, 0x09, 0x73, - 0x11, 0x41, 0x3a, 0x8e, 0x54, 0x71, 0x3e, 0x11, 0x16, 0x93, 0x1c, 0x11, 0xf8, 0xb7, 0xc7, 0x95, - 0x28, 0x5c, 0x49, 0x10, 0x28, 0xfc, 0xaa, 0x17, 0x57, 0xbf, 0x85, 0x8a, 0x92, 0x1e, 0x11, 0xf8, - 0x2b, 0xe4, 0x0a, 0x12, 0x2e, 0x47, 0xc4, 0xec, 0x7d, 0x4d, 0x8a, 0x2b, 0xfd, 0xd2, 0x50, 0xc6, - 0x01, 0xfc, 0xd1, 0x71, 0x55, 0x08, 0x4b, 0x31, 0xa1, 0xba, 0xef, 0x37, 0xb1, 0xd8, 0x0f, 0xc5, - 0xdf, 0xf1, 0xed, 0x67, 0x6e, 0xe4, 0x8e, 0x0f, 0xb9, 0x31, 0x22, 0x77, 0x7c, 0xd8, 0x61, 0x5e, - 0xbe, 0xfe, 0xe1, 0x24, 0x47, 0x8e, 0x4f, 0x72, 0xe4, 0xcb, 0x49, 0x8e, 0x1c, 0x9d, 0xe6, 0x06, - 0x8e, 0x4f, 0x73, 0x03, 0x9f, 0x4f, 0x73, 0x03, 0xb7, 0x67, 0xf4, 0xba, 0x7d, 0xb7, 0x55, 0x91, - 0xab, 0xb4, 0x81, 0x1f, 0x2c, 0xf0, 0xcf, 0x82, 0x55, 0xbb, 0x57, 0x38, 0xe0, 0x9f, 0x4b, 0x2a, - 0xc3, 0xec, 0x23, 0xc6, 0xf2, 0xd7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x49, 0xfa, 0xed, 0x7d, - 0x11, 0x00, 0x00, + // 900 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcf, 0x4f, 0xd4, 0x40, + 0x14, 0x66, 0x94, 0x9f, 0x0f, 0x51, 0x53, 0x51, 0x97, 0xaa, 0xcb, 0x52, 0x89, 0x12, 0x90, 0x2e, + 0x2c, 0x91, 0x8d, 0x68, 0x4c, 0xd8, 0x83, 0x84, 0x03, 0x09, 0x96, 0xc4, 0x83, 0x1e, 0x48, 0x77, + 0xb7, 0xac, 0x1b, 0xdd, 0x76, 0x69, 0xbb, 0x04, 0x62, 0xbc, 0xf9, 0xe3, 0x4a, 0x34, 0x31, 0xd1, + 0x83, 0x89, 0x7f, 0x80, 0x37, 0x6f, 0xfe, 0x03, 0xde, 0x24, 0x9e, 0x3c, 0x1a, 0xf8, 0x47, 0x4c, + 0x67, 0x5e, 0xdb, 0xed, 0xee, 0x6c, 0xdb, 0xd5, 0x46, 0x39, 0x91, 0x59, 0xbe, 0xef, 0xbd, 0x6f, + 0xbe, 0xf7, 0x66, 0xe6, 0xa5, 0x90, 0x29, 0x19, 0x56, 0xcd, 0xb0, 0xb2, 0x15, 0xd3, 0x68, 0xd4, + 0xb3, 0x3b, 0xf3, 0x45, 0xcd, 0x56, 0xe7, 0xb3, 0xdb, 0x0d, 0xcd, 0xdc, 0x93, 0xeb, 0xa6, 0x61, + 0x1b, 0xc2, 0x28, 0x43, 0xc8, 0x14, 0x21, 0x23, 0x42, 0xe4, 0xf3, 0xec, 0xbd, 0xba, 0x66, 0x31, + 0x9e, 0x38, 0x8d, 0x88, 0xa2, 0x6a, 0x69, 0x2c, 0xa0, 0x07, 0xab, 0xab, 0x95, 0xaa, 0xae, 0xda, + 0x55, 0x43, 0x47, 0xec, 0x18, 0xc3, 0x6e, 0xd2, 0x55, 0x16, 0x13, 0xd2, 0x85, 0x94, 0x83, 0xf3, + 0xf7, 0x1d, 0xf2, 0x8a, 0x93, 0x68, 0x55, 0xdf, 0x32, 0x14, 0x6d, 0xbb, 0xa1, 0x59, 0xb6, 0x30, + 0x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, 0x49, 0xc0, 0x8c, 0x7c, 0xd7, 0x3c, 0x54, 0x52, 0x82, 0x41, 0xf7, 0x92, + 0x12, 0xa6, 0x43, 0x82, 0xb4, 0x5c, 0xa9, 0xe2, 0x4c, 0x2c, 0x2c, 0x26, 0xd9, 0x27, 0x70, 0xb1, + 0xc3, 0x93, 0x28, 0xdc, 0x8a, 0x11, 0x88, 0xff, 0xd4, 0x8b, 0x4b, 0x7f, 0x42, 0x45, 0x49, 0x2f, + 0x08, 0x9c, 0xe3, 0x3c, 0x41, 0xc2, 0xcd, 0x90, 0x98, 0x9d, 0x9f, 0x49, 0x71, 0xb1, 0x5b, 0x1a, + 0xca, 0xd8, 0x85, 0x33, 0x2d, 0x4f, 0x85, 0x30, 0x1f, 0x11, 0xaa, 0xfd, 0x7d, 0x13, 0x73, 0xdd, + 0x50, 0xfc, 0x13, 0xdf, 0x7c, 0xe7, 0x86, 0x9e, 0x78, 0xce, 0x8b, 0x11, 0x7a, 0xe2, 0x79, 0x97, + 0x79, 0xe1, 0xee, 0xb7, 0xc3, 0x34, 0x39, 0x38, 0x4c, 0x93, 0x5f, 0x87, 0x69, 0xb2, 0x7f, 0x94, + 0xee, 0x39, 0x38, 0x4a, 0xf7, 0xfc, 0x3c, 0x4a, 0xf7, 0x3c, 0x9c, 0xac, 0x54, 0xed, 0xc7, 0x8d, + 0xa2, 0x5c, 0x32, 0x6a, 0xf8, 0xc1, 0x02, 0xff, 0xcc, 0x5a, 0xe5, 0x27, 0xd9, 0x5d, 0xf6, 0x61, + 0xa4, 0xd8, 0x4f, 0x3f, 0x62, 0x2c, 0xfc, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xd9, 0x5b, 0xcf, + 0x67, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/nft/tx.pb.go b/x/nft/tx.pb.go index f2a78068a90e..d7a85c952a43 100644 --- a/x/nft/tx.pb.go +++ b/x/nft/tx.pb.go @@ -145,23 +145,23 @@ func init() { func init() { proto.RegisterFile("cosmos/nft/v1beta1/tx.proto", fileDescriptor_35818c6a0ef51f08) } var fileDescriptor_35818c6a0ef51f08 = []byte{ - // 252 bytes of a gzipped FileDescriptorProto + // 244 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x4b, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x48, 0xea, 0xe5, 0xa5, 0x95, 0xe8, - 0x41, 0x25, 0xa5, 0x64, 0xb0, 0x68, 0x00, 0xc9, 0x83, 0x75, 0x28, 0x65, 0x70, 0xb1, 0xfb, 0x16, - 0xa7, 0x07, 0xa7, 0xe6, 0xa5, 0x08, 0x49, 0x72, 0x71, 0x24, 0xe7, 0x24, 0x16, 0x17, 0xc7, 0x67, - 0xa6, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xb1, 0x83, 0xf9, 0x9e, 0x29, 0x42, 0x7c, 0x5c, - 0x4c, 0x99, 0x29, 0x12, 0x4c, 0x60, 0x41, 0xa6, 0xcc, 0x14, 0x21, 0x31, 0x2e, 0xb6, 0xe2, 0xd4, - 0xbc, 0x94, 0xd4, 0x22, 0x09, 0x66, 0xb0, 0x18, 0x94, 0x27, 0x24, 0xc5, 0xc5, 0x51, 0x94, 0x9a, - 0x9c, 0x9a, 0x59, 0x96, 0x5a, 0x24, 0xc1, 0x02, 0x96, 0x81, 0xf3, 0x95, 0x04, 0xb9, 0xf8, 0xa1, - 0x36, 0x05, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x1a, 0xf9, 0x73, 0x31, 0xfb, 0x16, 0xa7, - 0x0b, 0x79, 0x70, 0xb1, 0x80, 0x1d, 0x20, 0xad, 0x87, 0xe9, 0x7c, 0x3d, 0xa8, 0x1e, 0x29, 0x65, - 0x3c, 0x92, 0x30, 0x03, 0x9d, 0x6c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, - 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, - 0x4a, 0x29, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x1a, 0x20, 0x10, - 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x14, 0x22, 0x49, 0x6c, 0xe0, 0x20, 0x31, 0x06, 0x04, - 0x00, 0x00, 0xff, 0xff, 0x63, 0xa3, 0x43, 0x38, 0x63, 0x01, 0x00, 0x00, + 0x41, 0x25, 0x95, 0x32, 0xb8, 0xd8, 0x7d, 0x8b, 0xd3, 0x83, 0x53, 0xf3, 0x52, 0x84, 0x24, 0xb9, + 0x38, 0x92, 0x73, 0x12, 0x8b, 0x8b, 0xe3, 0x33, 0x53, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, + 0xd8, 0xc1, 0x7c, 0xcf, 0x14, 0x21, 0x3e, 0x2e, 0xa6, 0xcc, 0x14, 0x09, 0x26, 0xb0, 0x20, 0x53, + 0x66, 0x8a, 0x90, 0x18, 0x17, 0x5b, 0x71, 0x6a, 0x5e, 0x4a, 0x6a, 0x91, 0x04, 0x33, 0x58, 0x0c, + 0xca, 0x13, 0x92, 0xe2, 0xe2, 0x28, 0x4a, 0x4d, 0x4e, 0xcd, 0x2c, 0x4b, 0x2d, 0x92, 0x60, 0x01, + 0xcb, 0xc0, 0xf9, 0x4a, 0x82, 0x5c, 0xfc, 0x50, 0x9b, 0x82, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, + 0x53, 0x8d, 0xfc, 0xb9, 0x98, 0x7d, 0x8b, 0xd3, 0x85, 0x3c, 0xb8, 0x58, 0xc0, 0x0e, 0x90, 0xd6, + 0xc3, 0x74, 0xa0, 0x1e, 0x54, 0x8f, 0x94, 0x32, 0x1e, 0x49, 0x98, 0x81, 0x4e, 0x36, 0x27, 0x1e, + 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, + 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, + 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x0d, 0x23, 0x08, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x01, 0x0a, + 0xb0, 0x24, 0x36, 0x70, 0x30, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x40, 0xdf, 0xd5, 0xe6, + 0x45, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/upgrade/client/cli/tx.go b/x/upgrade/client/cli/tx.go index f2f8801758ca..76c99f956904 100644 --- a/x/upgrade/client/cli/tx.go +++ b/x/upgrade/client/cli/tx.go @@ -21,8 +21,8 @@ const ( FlagUpgradeInfo = "upgrade-info" FlagNoValidate = "no-validate" FlagDaemonName = "daemon-name" - FlagTitle = "title" - FlagDescription = "description" + FlagTitle = "title" + FlagDescription = "description" ) // GetTxCmd returns the transaction commands for this module From f292d8853a11cf518a3cb8bcb14add7eefef9d84 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 17 Nov 2021 16:45:42 +0100 Subject: [PATCH 21/28] complete renamin to v1beta2 --- client/docs/swagger-ui/swagger.yaml | 36 +++++++++++++-------------- x/authz/client/cli/tx.go | 2 +- x/authz/client/testutil/tx.go | 4 +-- x/feegrant/client/cli/tx.go | 2 +- x/gov/migrations/v045/migrate_test.go | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 830efbc7e3b1..0994694908ce 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -25056,7 +25056,7 @@ definitions: description: >- QueryEvidenceResponse is the response type for the Query/Evidence RPC method. - cosmos.gov.v1.Deposit: + cosmos.gov.v1beta2.Deposit: type: object properties: proposal_id: @@ -25081,7 +25081,7 @@ definitions: description: |- Deposit defines an amount deposited by an account address to an active proposal. - cosmos.gov.v1.DepositParams: + cosmos.gov.v1beta2.DepositParams: type: object properties: min_deposit: @@ -25106,7 +25106,7 @@ definitions: value: 2 months. description: DepositParams defines the params for deposits on governance proposals. - cosmos.gov.v1.Proposal: + cosmos.gov.v1beta2.Proposal: type: object properties: proposal_id: @@ -25334,7 +25334,7 @@ definitions: type: string format: date-time description: Proposal defines the core field members of a governance proposal. - cosmos.gov.v1.ProposalStatus: + cosmos.gov.v1beta2.ProposalStatus: type: string enum: - PROPOSAL_STATUS_UNSPECIFIED @@ -25358,7 +25358,7 @@ definitions: been rejected. - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. - cosmos.gov.v1.QueryDepositResponse: + cosmos.gov.v1beta2.QueryDepositResponse: type: object properties: deposit: @@ -25392,7 +25392,7 @@ definitions: description: >- QueryDepositResponse is the response type for the Query/Deposit RPC method. - cosmos.gov.v1.QueryDepositsResponse: + cosmos.gov.v1beta2.QueryDepositsResponse: type: object properties: deposits: @@ -25448,7 +25448,7 @@ definitions: description: >- QueryDepositsResponse is the response type for the Query/Deposits RPC method. - cosmos.gov.v1.QueryParamsResponse: + cosmos.gov.v1beta2.QueryParamsResponse: type: object properties: voting_params: @@ -25511,7 +25511,7 @@ definitions: be vetoed. Default value: 1/3. description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.gov.v1.QueryProposalResponse: + cosmos.gov.v1beta2.QueryProposalResponse: type: object properties: proposal: @@ -25754,7 +25754,7 @@ definitions: description: >- QueryProposalResponse is the response type for the Query/Proposal RPC method. - cosmos.gov.v1.QueryProposalsResponse: + cosmos.gov.v1beta2.QueryProposalsResponse: type: object properties: proposals: @@ -26021,7 +26021,7 @@ definitions: description: |- QueryProposalsResponse is the response type for the Query/Proposals RPC method. - cosmos.gov.v1.QueryTallyResultResponse: + cosmos.gov.v1beta2.QueryTallyResultResponse: type: object properties: tally: @@ -26039,7 +26039,7 @@ definitions: description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. - cosmos.gov.v1.QueryVoteResponse: + cosmos.gov.v1beta2.QueryVoteResponse: type: object properties: vote: @@ -26097,7 +26097,7 @@ definitions: Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. description: QueryVoteResponse is the response type for the Query/Vote RPC method. - cosmos.gov.v1.QueryVotesResponse: + cosmos.gov.v1beta2.QueryVotesResponse: type: object properties: votes: @@ -26176,7 +26176,7 @@ definitions: was set, its value is undefined otherwise description: QueryVotesResponse is the response type for the Query/Votes RPC method. - cosmos.gov.v1.TallyParams: + cosmos.gov.v1beta2.TallyParams: type: object properties: quorum: @@ -26198,7 +26198,7 @@ definitions: Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. description: TallyParams defines the params for tallying votes on governance proposals. - cosmos.gov.v1.TallyResult: + cosmos.gov.v1beta2.TallyResult: type: object properties: 'yes': @@ -26210,7 +26210,7 @@ definitions: no_with_veto: type: string description: TallyResult defines a standard tally for a governance proposal. - cosmos.gov.v1.Vote: + cosmos.gov.v1beta2.Vote: type: object properties: proposal_id: @@ -26264,7 +26264,7 @@ definitions: description: |- Vote defines a vote on a governance proposal. A Vote consists of a proposal ID, the voter, and the vote option. - cosmos.gov.v1.VoteOption: + cosmos.gov.v1beta2.VoteOption: type: string enum: - VOTE_OPTION_UNSPECIFIED @@ -26282,14 +26282,14 @@ definitions: - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - cosmos.gov.v1.VotingParams: + cosmos.gov.v1beta2.VotingParams: type: object properties: voting_period: type: string description: Length of the voting period. description: VotingParams defines the params for voting on governance proposals. - cosmos.gov.v1.WeightedVoteOption: + cosmos.gov.v1beta2.WeightedVoteOption: type: object properties: option: diff --git a/x/authz/client/cli/tx.go b/x/authz/client/cli/tx.go index 7d4125cbb2ec..18531486cc15 100644 --- a/x/authz/client/cli/tx.go +++ b/x/authz/client/cli/tx.go @@ -60,7 +60,7 @@ func NewCmdGrantAuthorization() *cobra.Command { Examples: $ %s tx %s grant cosmos1skjw.. send %s --spend-limit=1000stake --from=cosmos1skl.. - $ %s tx %s grant cosmos1skjw.. generic --msg-type=/cosmos.gov.v1.MsgVote --from=cosmos1sk.. + $ %s tx %s grant cosmos1skjw.. generic --msg-type=/cosmos.gov.v1beta2.MsgVote --from=cosmos1sk.. `, version.AppName, authz.ModuleName, bank.SendAuthorization{}.MsgTypeURL(), version.AppName, authz.ModuleName), ), Args: cobra.ExactArgs(2), diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index 04b5b1ceabc7..9b5d7a4cdeea 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -509,7 +509,7 @@ func (s *IntegrationTestSuite) TestExecAuthorizationWithExpiration() { s.Require().NoError(err) // msg vote - voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) + voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1beta2.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) // waiting for authorization to expires @@ -550,7 +550,7 @@ func (s *IntegrationTestSuite) TestNewExecGenericAuthorized() { s.Require().NoError(err) // msg vote - voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) + voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1beta2.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) testCases := []struct { diff --git a/x/feegrant/client/cli/tx.go b/x/feegrant/client/cli/tx.go index 9be1bb821b96..73d56dea4fd9 100644 --- a/x/feegrant/client/cli/tx.go +++ b/x/feegrant/client/cli/tx.go @@ -57,7 +57,7 @@ Examples: %s tx %s grant cosmos1skjw... cosmos1skjw... --spend-limit 100stake --expiration 2022-01-30T15:04:05Z or %s tx %s grant cosmos1skjw... cosmos1skjw... --spend-limit 100stake --period 3600 --period-limit 10stake --expiration 36000 or %s tx %s grant cosmos1skjw... cosmos1skjw... --spend-limit 100stake --expiration 2022-01-30T15:04:05Z - --allowed-messages "/cosmos.gov.v1.MsgSubmitProposal,/cosmos.gov.v1.MsgVote" + --allowed-messages "/cosmos.gov.v1beta2.MsgSubmitProposal,/cosmos.gov.v1beta2.MsgVote" `, version.AppName, feegrant.ModuleName, version.AppName, feegrant.ModuleName, version.AppName, feegrant.ModuleName, ), ), diff --git a/x/gov/migrations/v045/migrate_test.go b/x/gov/migrations/v045/migrate_test.go index 1dc99a695338..e735c977f31b 100644 --- a/x/gov/migrations/v045/migrate_test.go +++ b/x/gov/migrations/v045/migrate_test.go @@ -110,7 +110,7 @@ func TestMigrate(t *testing.T) { }, "messages": [ { - "@type": "/cosmos.gov.v1.MsgSignal", + "@type": "/cosmos.gov.v1beta2.MsgSignal", "authority": "cosmos1w3jhxazlvahhvhmpvd3k7atwwsq04etk", "description": "bar_description", "title": "foo_title" From 8485e6cc4c6939856ff2cde25fd9286d35de4e09 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Thu, 18 Nov 2021 11:25:46 +0100 Subject: [PATCH 22/28] fix migration and grpc tests --- x/gov/client/testutil/grpc.go | 52 +++++++++++++-------------- x/gov/migrations/v045/migrate_test.go | 9 +---- 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/x/gov/client/testutil/grpc.go b/x/gov/client/testutil/grpc.go index 090b27753df4..f1ce4b4d298d 100644 --- a/x/gov/client/testutil/grpc.go +++ b/x/gov/client/testutil/grpc.go @@ -22,17 +22,17 @@ func (s *IntegrationTestSuite) TestGetProposalGRPC() { }{ { "empty proposal", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s", val.APIAddress, ""), true, }, { "get non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, "10"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s", val.APIAddress, "10"), true, }, { "get proposal with id", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s", val.APIAddress, "1"), false, }, } @@ -68,7 +68,7 @@ func (s *IntegrationTestSuite) TestGetProposalsGRPC() { }{ { "get proposals with height 1", - fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.APIAddress), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals", val.APIAddress), map[string]string{ grpctypes.GRPCBlockHeightHeader: "1", }, @@ -77,14 +77,14 @@ func (s *IntegrationTestSuite) TestGetProposalsGRPC() { }, { "valid request", - fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.APIAddress), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals", val.APIAddress), map[string]string{}, 3, false, }, { "valid request with filter by status", - fmt.Sprintf("%s/cosmos/gov/v1/proposals?proposal_status=1", val.APIAddress), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals?proposal_status=1", val.APIAddress), map[string]string{}, 1, false, @@ -123,31 +123,31 @@ func (s *IntegrationTestSuite) TestGetProposalVoteGRPC() { }{ { "empty proposal", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "", voterAddressBech32), true, types.NewNonSplitVoteOption(types.OptionYes), }, { "get non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "10", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "10", voterAddressBech32), true, types.NewNonSplitVoteOption(types.OptionYes), }, { "get proposal with wrong voter address", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "1", "wrongVoterAddress"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "1", "wrongVoterAddress"), true, types.NewNonSplitVoteOption(types.OptionYes), }, { "get proposal with id", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "1", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "1", voterAddressBech32), false, types.NewNonSplitVoteOption(types.OptionYes), }, { "get proposal with id for split vote", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "3", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "3", voterAddressBech32), false, types.WeightedVoteOptions{ types.WeightedVoteOption{Option: types.OptionYes, Weight: sdk.NewDecWithPrec(60, 2)}, @@ -192,12 +192,12 @@ func (s *IntegrationTestSuite) TestGetProposalVotesGRPC() { }{ { "votes with empty proposal id", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes", val.APIAddress, ""), true, }, { "get votes with valid id", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes", val.APIAddress, "1"), false, }, } @@ -231,22 +231,22 @@ func (s *IntegrationTestSuite) TestGetProposalDepositGRPC() { }{ { "get deposit with empty proposal id", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, "", val.Address.String()), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits/%s", val.APIAddress, "", val.Address.String()), true, }, { "get deposit of non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, "10", val.Address.String()), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits/%s", val.APIAddress, "10", val.Address.String()), true, }, { "get deposit with wrong depositer address", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, "1", "wrongDepositerAddress"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits/%s", val.APIAddress, "1", "wrongDepositerAddress"), true, }, { "get deposit valid request", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, "1", val.Address.String()), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits/%s", val.APIAddress, "1", val.Address.String()), false, }, } @@ -280,12 +280,12 @@ func (s *IntegrationTestSuite) TestGetProposalDepositsGRPC() { }{ { "get deposits with empty proposal id", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits", val.APIAddress, ""), true, }, { "valid request", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits", val.APIAddress, "1"), false, }, } @@ -320,17 +320,17 @@ func (s *IntegrationTestSuite) TestGetTallyGRPC() { }{ { "get tally with no proposal id", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/tally", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/tally", val.APIAddress, ""), true, }, { "get tally with non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/tally", val.APIAddress, "10"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/tally", val.APIAddress, "10"), true, }, { "get tally valid request", - fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/tally", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/tally", val.APIAddress, "1"), false, }, } @@ -366,12 +366,12 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { }{ { "request params with empty params type", - fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, ""), true, nil, nil, }, { "get deposit params", - fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, types.ParamDeposit), + fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, types.ParamDeposit), false, &types.QueryParamsResponse{}, &types.QueryParamsResponse{ @@ -380,7 +380,7 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { }, { "get vote params", - fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, types.ParamVoting), + fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, types.ParamVoting), false, &types.QueryParamsResponse{}, &types.QueryParamsResponse{ @@ -389,7 +389,7 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { }, { "get tally params", - fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, types.ParamTallying), + fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, types.ParamTallying), false, &types.QueryParamsResponse{}, &types.QueryParamsResponse{ diff --git a/x/gov/migrations/v045/migrate_test.go b/x/gov/migrations/v045/migrate_test.go index e735c977f31b..674a22da7f61 100644 --- a/x/gov/migrations/v045/migrate_test.go +++ b/x/gov/migrations/v045/migrate_test.go @@ -108,14 +108,7 @@ func TestMigrate(t *testing.T) { "no_with_veto": "0", "yes": "0" }, - "messages": [ - { - "@type": "/cosmos.gov.v1beta2.MsgSignal", - "authority": "cosmos1w3jhxazlvahhvhmpvd3k7atwwsq04etk", - "description": "bar_description", - "title": "foo_title" - } - ], + "messages": [], "proposal_id": "5", "status": "PROPOSAL_STATUS_DEPOSIT_PERIOD", "submit_time": "2019-01-01T01:00:00Z", From 9a5d243adac7432ad4eb990bf420e2235e2d1110 Mon Sep 17 00:00:00 2001 From: Callum Date: Tue, 23 Nov 2021 22:20:57 +0100 Subject: [PATCH 23/28] run go mod tidy --- x/group/go.mod | 2 +- x/group/go.sum | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/x/group/go.mod b/x/group/go.mod index f7f7f51d58f9..a1aa5674ef30 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -4,7 +4,7 @@ module github.com/cosmos/cosmos-sdk/x/group require ( github.com/cockroachdb/apd/v2 v2.0.2 - github.com/cosmos/cosmos-proto v0.0.0-20210914142853-23ed61ac79ce + github.com/cosmos/cosmos-proto v0.0.0-20211123144845-528f5002c9f8 github.com/cosmos/cosmos-sdk v0.44.0 github.com/gogo/protobuf v1.3.3 github.com/stretchr/testify v1.7.0 diff --git a/x/group/go.sum b/x/group/go.sum index b3b606e8e7be..21b291093163 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -257,8 +257,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-proto v0.0.0-20210914142853-23ed61ac79ce h1:nin7WtIMETZ8LezEYa5e9/iqyEgQka1x0cQYqgUeTGM= -github.com/cosmos/cosmos-proto v0.0.0-20210914142853-23ed61ac79ce/go.mod h1:g2Q3cd94kOBVRAv7ahdtO27yUc4cpNuHGnI40qanl1k= +github.com/cosmos/cosmos-proto v0.0.0-20211123144845-528f5002c9f8 h1:JOVLjm4qgBMnjZIciFqfFMzeIIuJTOXdlpzJdvXQbVA= +github.com/cosmos/cosmos-proto v0.0.0-20211123144845-528f5002c9f8/go.mod h1:msdDWOvfStHLG+Z2y2SJ0dcqimZ2vc8M1MPnZ4jOF7U= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -609,8 +609,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.4.1 h1:3A2Mh8smGFcf5M+gmcv898mZdrxpseik45IpcyISLsA= -github.com/hashicorp/go-getter v1.4.1/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= +github.com/hashicorp/go-getter v1.5.9 h1:b7ahZW50iQiUek/at3CvZhPK1/jiV6CtKcsJiR6E4R0= +github.com/hashicorp/go-getter v1.5.9/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -733,6 +733,7 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= @@ -1210,8 +1211,8 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= -github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= From c37019bfb2460bb6272f5675bd34e77a49e8fb98 Mon Sep 17 00:00:00 2001 From: Callum Date: Thu, 25 Nov 2021 12:53:26 +0100 Subject: [PATCH 24/28] minor update --- x/feegrant/simulation/genesis.go | 2 +- x/gov/simulation/operations_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x/feegrant/simulation/genesis.go b/x/feegrant/simulation/genesis.go index d01e42b2b663..78bc579cca79 100644 --- a/x/feegrant/simulation/genesis.go +++ b/x/feegrant/simulation/genesis.go @@ -48,7 +48,7 @@ func generateRandomAllowances(granter, grantee sdk.AccAddress, r *rand.Rand) fee filteredAllowance, err := feegrant.NewGrant(granter, grantee, &feegrant.AllowedMsgAllowance{ Allowance: basicAllowance.GetAllowance(), - AllowedMessages: []string{"/cosmos.gov.v1beta1.MsgSubmitProposal"}, + AllowedMessages: []string{"/cosmos.gov.v1beta2.MsgSubmitProposal"}, }) if err != nil { panic(err) diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 299d5e0bca29..9a83e46aff39 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -38,7 +38,7 @@ func TestWeightedOperations(t *testing.T) { cdc := app.AppCodec() appParams := make(simtypes.AppParams) - weightesOps := simulation.WeightedOperations(appParams, cdc, app.AccountKeeper, + weightedOps := simulation.WeightedOperations(appParams, cdc, app.AccountKeeper, app.BankKeeper, app.GovKeeper, ) @@ -58,7 +58,7 @@ func TestWeightedOperations(t *testing.T) { {simappparams.DefaultWeightMsgVoteWeighted, types.ModuleName, types.TypeMsgVoteWeighted}, } - for i, w := range weightesOps { + for i, w := range weightedOps { operationMsg, _, _ := w.Op()(r, app.BaseApp, ctx, accs, ctx.ChainID()) // the following checks are very much dependent from the ordering of the output given // by WeightedOperations. if the ordering in WeightedOperations changes some tests From 0c64c1a6372d9a243ef137caa4dfa45d496a1db4 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 3 Dec 2021 16:11:19 +0100 Subject: [PATCH 25/28] add back v1beta1 query and tx proto files --- proto/cosmos/gov/v1beta1/query.proto | 191 +++++++++++++++++++++++++++ proto/cosmos/gov/v1beta1/tx.proto | 96 ++++++++++++++ 2 files changed, 287 insertions(+) create mode 100644 proto/cosmos/gov/v1beta1/query.proto create mode 100644 proto/cosmos/gov/v1beta1/tx.proto diff --git a/proto/cosmos/gov/v1beta1/query.proto b/proto/cosmos/gov/v1beta1/query.proto new file mode 100644 index 000000000000..e8837fd275a7 --- /dev/null +++ b/proto/cosmos/gov/v1beta1/query.proto @@ -0,0 +1,191 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// Query defines the gRPC querier service for gov module +service Query { + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; + } + + // Deposit queries single deposit information based proposalID, depositAddr. + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; + } +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +message QueryProposalRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +message QueryProposalResponse { + Proposal proposal = 1 [(gogoproto.nullable) = false]; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_status defines the status of the proposals. + ProposalStatus proposal_status = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +message QueryProposalsResponse { + repeated Proposal proposals = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +message QueryVoteRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter defines the oter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +message QueryVoteResponse { + // vote defined the queried vote. + Vote vote = 1 [(gogoproto.nullable) = false]; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +message QueryVotesRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +message QueryVotesResponse { + // votes defined the queried votes. + repeated Vote votes = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // voting_params defines the parameters related to voting. + VotingParams voting_params = 1 [(gogoproto.nullable) = false]; + // deposit_params defines the parameters related to deposit. + DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3 [(gogoproto.nullable) = false]; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +message QueryDepositResponse { + // deposit defines the requested deposit. + Deposit deposit = 1 [(gogoproto.nullable) = false]; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +message QueryDepositsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +message QueryDepositsResponse { + repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +message QueryTallyResultRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto new file mode 100644 index 000000000000..35c9669edaf5 --- /dev/null +++ b/proto/cosmos/gov/v1beta1/tx.proto @@ -0,0 +1,96 @@ +syntax = "proto3"; +package cosmos.gov.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +// Msg defines the bank Msg service. +service Msg { + // SubmitProposal defines a method to create new proposal given a content. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + // + // Since: cosmos-sdk 0.43 + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; +} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + VoteOption option = 3; +} + +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +// +// Since: cosmos-sdk 0.43 +message MsgVoteWeighted { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +// +// Since: cosmos-sdk 0.43 +message MsgVoteWeightedResponse {} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +message MsgDeposit { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} From a6d4edd82d243bc6c6e3f5c3126b82cbdcc87964 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 3 Dec 2021 17:28:44 +0100 Subject: [PATCH 26/28] generate new proto --- docs/core/proto-docs.md | 623 +---- x/gov/types/v1beta1/query.pb.go | 3862 ++++++++++++++++++++++++++++ x/gov/types/v1beta1/query.pb.gw.go | 932 +++++++ x/gov/types/v1beta1/tx.pb.go | 1887 ++++++++++++++ 4 files changed, 6773 insertions(+), 531 deletions(-) create mode 100644 x/gov/types/v1beta1/query.pb.go create mode 100644 x/gov/types/v1beta1/query.pb.gw.go create mode 100644 x/gov/types/v1beta1/tx.pb.go diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 292d03fb93b5..7dd29cfbd7d2 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -375,53 +375,37 @@ - [cosmos/gov/v1beta1/genesis.proto](#cosmos/gov/v1beta1/genesis.proto) - [GenesisState](#cosmos.gov.v1beta1.GenesisState) -- [cosmos/gov/v1beta2/gov.proto](#cosmos/gov/v1beta2/gov.proto) - - [Deposit](#cosmos.gov.v1beta2.Deposit) - - [DepositParams](#cosmos.gov.v1beta2.DepositParams) - - [Proposal](#cosmos.gov.v1beta2.Proposal) - - [TallyParams](#cosmos.gov.v1beta2.TallyParams) - - [TallyResult](#cosmos.gov.v1beta2.TallyResult) - - [Vote](#cosmos.gov.v1beta2.Vote) - - [VotingParams](#cosmos.gov.v1beta2.VotingParams) - - [WeightedVoteOption](#cosmos.gov.v1beta2.WeightedVoteOption) - - - [ProposalStatus](#cosmos.gov.v1beta2.ProposalStatus) - - [VoteOption](#cosmos.gov.v1beta2.VoteOption) - -- [cosmos/gov/v1beta2/genesis.proto](#cosmos/gov/v1beta2/genesis.proto) - - [GenesisState](#cosmos.gov.v1beta2.GenesisState) - -- [cosmos/gov/v1beta2/query.proto](#cosmos/gov/v1beta2/query.proto) - - [QueryDepositRequest](#cosmos.gov.v1beta2.QueryDepositRequest) - - [QueryDepositResponse](#cosmos.gov.v1beta2.QueryDepositResponse) - - [QueryDepositsRequest](#cosmos.gov.v1beta2.QueryDepositsRequest) - - [QueryDepositsResponse](#cosmos.gov.v1beta2.QueryDepositsResponse) - - [QueryParamsRequest](#cosmos.gov.v1beta2.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.gov.v1beta2.QueryParamsResponse) - - [QueryProposalRequest](#cosmos.gov.v1beta2.QueryProposalRequest) - - [QueryProposalResponse](#cosmos.gov.v1beta2.QueryProposalResponse) - - [QueryProposalsRequest](#cosmos.gov.v1beta2.QueryProposalsRequest) - - [QueryProposalsResponse](#cosmos.gov.v1beta2.QueryProposalsResponse) - - [QueryTallyResultRequest](#cosmos.gov.v1beta2.QueryTallyResultRequest) - - [QueryTallyResultResponse](#cosmos.gov.v1beta2.QueryTallyResultResponse) - - [QueryVoteRequest](#cosmos.gov.v1beta2.QueryVoteRequest) - - [QueryVoteResponse](#cosmos.gov.v1beta2.QueryVoteResponse) - - [QueryVotesRequest](#cosmos.gov.v1beta2.QueryVotesRequest) - - [QueryVotesResponse](#cosmos.gov.v1beta2.QueryVotesResponse) - - - [Query](#cosmos.gov.v1beta2.Query) - -- [cosmos/gov/v1beta2/tx.proto](#cosmos/gov/v1beta2/tx.proto) - - [MsgDeposit](#cosmos.gov.v1beta2.MsgDeposit) - - [MsgDepositResponse](#cosmos.gov.v1beta2.MsgDepositResponse) - - [MsgSubmitProposal](#cosmos.gov.v1beta2.MsgSubmitProposal) - - [MsgSubmitProposalResponse](#cosmos.gov.v1beta2.MsgSubmitProposalResponse) - - [MsgVote](#cosmos.gov.v1beta2.MsgVote) - - [MsgVoteResponse](#cosmos.gov.v1beta2.MsgVoteResponse) - - [MsgVoteWeighted](#cosmos.gov.v1beta2.MsgVoteWeighted) - - [MsgVoteWeightedResponse](#cosmos.gov.v1beta2.MsgVoteWeightedResponse) - - - [Msg](#cosmos.gov.v1beta2.Msg) +- [cosmos/gov/v1beta1/query.proto](#cosmos/gov/v1beta1/query.proto) + - [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) + - [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) + - [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) + - [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) + - [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) + - [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) + - [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) + - [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) + - [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) + - [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) + - [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) + - [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) + - [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) + - [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) + - [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) + + - [Query](#cosmos.gov.v1beta1.Query) + +- [cosmos/gov/v1beta1/tx.proto](#cosmos/gov/v1beta1/tx.proto) + - [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) + - [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) + - [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) + - [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) + - [MsgVote](#cosmos.gov.v1beta1.MsgVote) + - [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) + - [MsgVoteWeighted](#cosmos.gov.v1beta1.MsgVoteWeighted) + - [MsgVoteWeightedResponse](#cosmos.gov.v1beta1.MsgVoteWeightedResponse) + + - [Msg](#cosmos.gov.v1beta1.Msg) - [cosmos/gov/v1beta2/gov.proto](#cosmos/gov/v1beta2/gov.proto) - [Deposit](#cosmos.gov.v1beta2.Deposit) @@ -2326,203 +2310,6 @@ execution. - - -### Result -Result is the union of ResponseFormat and ResponseCheckTx. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data is any data returned from message or handler execution. It MUST be length prefixed in order to separate data from multiple message executions. | -| `log` | [string](#string) | | Log contains the log information from message or handler execution. | -| `events` | [tendermint.abci.Event](#tendermint.abci.Event) | repeated | Events contains a slice of Event objects that were emitted during message or handler execution. | - - - - - - - - -### SearchTxsResult -SearchTxsResult defines a structure for querying txs pageable - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `total_count` | [uint64](#uint64) | | Count of all txs | -| `count` | [uint64](#uint64) | | Count of txs in current page | -| `page_number` | [uint64](#uint64) | | Index of current page, start from 1 | -| `page_total` | [uint64](#uint64) | | Count of total pages | -| `limit` | [uint64](#uint64) | | Max count txs per page | -| `txs` | [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | List of txs in current page | - - - - - - - - -### SimulationResponse -SimulationResponse defines the response generated when a transaction is -successfully simulated. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gas_info` | [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | | -| `result` | [Result](#cosmos.base.abci.v1beta1.Result) | | | - - - - - - - - -### StringEvent -StringEvent defines en Event object wrapper where all the attributes -contain key/value pairs that are strings instead of raw bytes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `type` | [string](#string) | | | -| `attributes` | [Attribute](#cosmos.base.abci.v1beta1.Attribute) | repeated | | - - - - - - - - -### TxMsgData -TxMsgData defines a list of MsgData. A transaction will have a MsgData object -for each message. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `data` | [MsgData](#cosmos.base.abci.v1beta1.MsgData) | repeated | | - - - - - - - - -### TxResponse -TxResponse defines a structure containing relevant tx data and metadata. The -tags are stringified and the log is JSON decoded. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | The block height | -| `txhash` | [string](#string) | | The transaction hash. | -| `codespace` | [string](#string) | | Namespace for the Code | -| `code` | [uint32](#uint32) | | Response code. | -| `data` | [string](#string) | | Result bytes, if any. | -| `raw_log` | [string](#string) | | The output of the application's logger (raw string). May be non-deterministic. | -| `logs` | [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) | repeated | The output of the application's logger (typed). May be non-deterministic. | -| `info` | [string](#string) | | Additional information. May be non-deterministic. | -| `gas_wanted` | [int64](#int64) | | Amount of gas requested for transaction. | -| `gas_used` | [int64](#int64) | | Amount of gas consumed by transaction. | -| `tx` | [google.protobuf.Any](#google.protobuf.Any) | | The request transaction bytes. | -| `timestamp` | [string](#string) | | Time of the previous block. For heights > 1, it's the weighted median of the timestamps of the valid votes in the block.LastCommit. For height == 1, it's genesis time. | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/base/abci/v1beta1/abci.proto - - - - - -### ABCIMessageLog -ABCIMessageLog defines a structure containing an indexed tx ABCI message log. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `msg_index` | [uint32](#uint32) | | | -| `log` | [string](#string) | | | -| `events` | [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) | repeated | Events contains a slice of Event objects that were emitted during some execution. | - - - - - - - - -### Attribute -Attribute defines an attribute wrapper where the key and value are -strings instead of raw bytes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [string](#string) | | | -| `value` | [string](#string) | | | - - - - - - - - -### GasInfo -GasInfo defines tx execution gas context. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gas_wanted` | [uint64](#uint64) | | GasWanted is the maximum units of work we allow this tx to perform. | -| `gas_used` | [uint64](#uint64) | | GasUsed is the amount of gas actually consumed. | - - - - - - - - -### MsgData -MsgData defines the data returned in a Result object during message -execution. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `msg_type` | [string](#string) | | | -| `data` | [bytes](#bytes) | | | - - - - - - ### Result @@ -5862,256 +5649,30 @@ GenesisState defines the gov module's genesis state. - +

Top

-## cosmos/gov/v1beta2/gov.proto +## cosmos/gov/v1beta1/query.proto - + -### Deposit -Deposit defines an amount deposited by an account address to an active -proposal. +### QueryDepositRequest +QueryDepositRequest is the request type for the Query/Deposit RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `depositor` | [string](#string) | | | -| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | - - -### DepositParams -DepositParams defines the params for deposits on governance proposals. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `min_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum deposit for a proposal to enter voting period. | -| `max_deposit_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. | - - - - - - - - -### Proposal -Proposal defines the core field members of a governance proposal. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | -| `status` | [ProposalStatus](#cosmos.gov.v1beta2.ProposalStatus) | | | -| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta2.TallyResult) | | | -| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - - - - - - - - -### TallyParams -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. | - - - - - - - - -### TallyResult -TallyResult defines a standard tally for a governance proposal. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `yes` | [string](#string) | | | -| `abstain` | [string](#string) | | | -| `no` | [string](#string) | | | -| `no_with_veto` | [string](#string) | | | - - - - - - - - -### Vote -Vote defines a vote on a governance proposal. -A Vote consists of a proposal ID, the voter, and the vote option. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta2.VoteOption) | | **Deprecated.** 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. | -| `options` | [WeightedVoteOption](#cosmos.gov.v1beta2.WeightedVoteOption) | repeated | | - - - - - - - - -### VotingParams -VotingParams defines the params for voting on governance proposals. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `voting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Length of the voting period. | - - - - - - - - -### WeightedVoteOption -WeightedVoteOption defines a unit of vote for vote split. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `option` | [VoteOption](#cosmos.gov.v1beta2.VoteOption) | | | -| `weight` | [string](#string) | | | - - - - - - - - - - -### ProposalStatus -ProposalStatus enumerates the valid statuses of a proposal. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| PROPOSAL_STATUS_UNSPECIFIED | 0 | PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. | -| PROPOSAL_STATUS_DEPOSIT_PERIOD | 1 | PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period. | -| PROPOSAL_STATUS_VOTING_PERIOD | 2 | PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period. | -| PROPOSAL_STATUS_PASSED | 3 | PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed. | -| PROPOSAL_STATUS_REJECTED | 4 | PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected. | -| PROPOSAL_STATUS_FAILED | 5 | PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. | - - - - - -### VoteOption -VoteOption enumerates the valid vote options for a given governance proposal. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| VOTE_OPTION_UNSPECIFIED | 0 | VOTE_OPTION_UNSPECIFIED defines a no-op vote option. | -| VOTE_OPTION_YES | 1 | VOTE_OPTION_YES defines a yes vote option. | -| VOTE_OPTION_ABSTAIN | 2 | VOTE_OPTION_ABSTAIN defines an abstain vote option. | -| VOTE_OPTION_NO | 3 | VOTE_OPTION_NO defines a no vote option. | -| VOTE_OPTION_NO_WITH_VETO | 4 | VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. | - - - - - - - - - - - -

Top

- -## cosmos/gov/v1beta2/genesis.proto - - - - - -### GenesisState -GenesisState defines the gov module's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | -| `deposits` | [Deposit](#cosmos.gov.v1beta2.Deposit) | repeated | deposits defines all the deposits present at genesis. | -| `votes` | [Vote](#cosmos.gov.v1beta2.Vote) | repeated | votes defines all the votes present at genesis. | -| `proposals` | [Proposal](#cosmos.gov.v1beta2.Proposal) | repeated | proposals defines all the proposals present at genesis. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1beta2.DepositParams) | | params defines all the paramaters of related to deposit. | -| `voting_params` | [VotingParams](#cosmos.gov.v1beta2.VotingParams) | | params defines all the paramaters of related to voting. | -| `tally_params` | [TallyParams](#cosmos.gov.v1beta2.TallyParams) | | params defines all the paramaters of related to tally. | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/gov/v1beta2/query.proto - - - - - -### QueryDepositRequest -QueryDepositRequest is the request type for the Query/Deposit RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | - - - - - - - + ### QueryDepositResponse QueryDepositResponse is the response type for the Query/Deposit RPC method. @@ -6119,14 +5680,14 @@ QueryDepositResponse is the response type for the Query/Deposit RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposit` | [Deposit](#cosmos.gov.v1beta2.Deposit) | | deposit defines the requested deposit. | +| `deposit` | [Deposit](#cosmos.gov.v1beta1.Deposit) | | deposit defines the requested deposit. | - + ### QueryDepositsRequest QueryDepositsRequest is the request type for the Query/Deposits RPC method. @@ -6142,7 +5703,7 @@ QueryDepositsRequest is the request type for the Query/Deposits RPC method. - + ### QueryDepositsResponse QueryDepositsResponse is the response type for the Query/Deposits RPC method. @@ -6150,7 +5711,7 @@ QueryDepositsResponse is the response type for the Query/Deposits RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposits` | [Deposit](#cosmos.gov.v1beta2.Deposit) | repeated | | +| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -6158,7 +5719,7 @@ QueryDepositsResponse is the response type for the Query/Deposits RPC method. - + ### QueryParamsRequest QueryParamsRequest is the request type for the Query/Params RPC method. @@ -6173,7 +5734,7 @@ QueryParamsRequest is the request type for the Query/Params RPC method. - + ### QueryParamsResponse QueryParamsResponse is the response type for the Query/Params RPC method. @@ -6181,16 +5742,16 @@ QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `voting_params` | [VotingParams](#cosmos.gov.v1beta2.VotingParams) | | voting_params defines the parameters related to voting. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1beta2.DepositParams) | | deposit_params defines the parameters related to deposit. | -| `tally_params` | [TallyParams](#cosmos.gov.v1beta2.TallyParams) | | tally_params defines the parameters related to tally. | +| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | voting_params defines the parameters related to voting. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | deposit_params defines the parameters related to deposit. | +| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | tally_params defines the parameters related to tally. | - + ### QueryProposalRequest QueryProposalRequest is the request type for the Query/Proposal RPC method. @@ -6205,7 +5766,7 @@ QueryProposalRequest is the request type for the Query/Proposal RPC method. - + ### QueryProposalResponse QueryProposalResponse is the response type for the Query/Proposal RPC method. @@ -6213,14 +5774,14 @@ QueryProposalResponse is the response type for the Query/Proposal RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal` | [Proposal](#cosmos.gov.v1beta2.Proposal) | | | +| `proposal` | [Proposal](#cosmos.gov.v1beta1.Proposal) | | | - + ### QueryProposalsRequest QueryProposalsRequest is the request type for the Query/Proposals RPC method. @@ -6228,7 +5789,7 @@ QueryProposalsRequest is the request type for the Query/Proposals RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_status` | [ProposalStatus](#cosmos.gov.v1beta2.ProposalStatus) | | proposal_status defines the status of the proposals. | +| `proposal_status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | proposal_status defines the status of the proposals. | | `voter` | [string](#string) | | voter defines the voter address for the proposals. | | `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | @@ -6238,7 +5799,7 @@ QueryProposalsRequest is the request type for the Query/Proposals RPC method. - + ### QueryProposalsResponse QueryProposalsResponse is the response type for the Query/Proposals RPC @@ -6247,7 +5808,7 @@ method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposals` | [Proposal](#cosmos.gov.v1beta2.Proposal) | repeated | | +| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -6255,7 +5816,7 @@ method. - + ### QueryTallyResultRequest QueryTallyResultRequest is the request type for the Query/Tally RPC method. @@ -6270,7 +5831,7 @@ QueryTallyResultRequest is the request type for the Query/Tally RPC method. - + ### QueryTallyResultResponse QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -6278,14 +5839,14 @@ QueryTallyResultResponse is the response type for the Query/Tally RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `tally` | [TallyResult](#cosmos.gov.v1beta2.TallyResult) | | tally defines the requested tally. | +| `tally` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | tally defines the requested tally. | - + ### QueryVoteRequest QueryVoteRequest is the request type for the Query/Vote RPC method. @@ -6301,7 +5862,7 @@ QueryVoteRequest is the request type for the Query/Vote RPC method. - + ### QueryVoteResponse QueryVoteResponse is the response type for the Query/Vote RPC method. @@ -6309,14 +5870,14 @@ QueryVoteResponse is the response type for the Query/Vote RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `vote` | [Vote](#cosmos.gov.v1beta2.Vote) | | vote defined the queried vote. | +| `vote` | [Vote](#cosmos.gov.v1beta1.Vote) | | vote defined the queried vote. | - + ### QueryVotesRequest QueryVotesRequest is the request type for the Query/Votes RPC method. @@ -6332,7 +5893,7 @@ QueryVotesRequest is the request type for the Query/Votes RPC method. - + ### QueryVotesResponse QueryVotesResponse is the response type for the Query/Votes RPC method. @@ -6340,7 +5901,7 @@ QueryVotesResponse is the response type for the Query/Votes RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `votes` | [Vote](#cosmos.gov.v1beta2.Vote) | repeated | votes defined the queried votes. | +| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defined the queried votes. | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -6354,34 +5915,34 @@ QueryVotesResponse is the response type for the Query/Votes RPC method. - + ### Query Query defines the gRPC querier service for gov module | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1beta2.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1beta2.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}| -| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1beta2.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1beta2.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1beta2/proposals| -| `Vote` | [QueryVoteRequest](#cosmos.gov.v1beta2.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1beta2.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/votes/{voter}| -| `Votes` | [QueryVotesRequest](#cosmos.gov.v1beta2.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1beta2.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/votes| -| `Params` | [QueryParamsRequest](#cosmos.gov.v1beta2.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1beta2.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1beta2/params/{params_type}| -| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1beta2.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1beta2.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/deposits/{depositor}| -| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1beta2.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1beta2.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/deposits| -| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1beta2.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1beta2.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1beta2/proposals/{proposal_id}/tally| +| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}| +| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1beta1/proposals| +| `Vote` | [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}| +| `Votes` | [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes| +| `Params` | [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1beta1/params/{params_type}| +| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}| +| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits| +| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/tally| - +

Top

-## cosmos/gov/v1beta2/tx.proto +## cosmos/gov/v1beta1/tx.proto - + ### MsgDeposit MsgDeposit defines a message to submit a deposit to an existing proposal. @@ -6398,7 +5959,7 @@ MsgDeposit defines a message to submit a deposit to an existing proposal. - + ### MsgDepositResponse MsgDepositResponse defines the Msg/Deposit response type. @@ -6408,7 +5969,7 @@ MsgDepositResponse defines the Msg/Deposit response type. - + ### MsgSubmitProposal MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -6417,7 +5978,7 @@ proposal Content. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | | `initial_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | | `proposer` | [string](#string) | | | @@ -6426,7 +5987,7 @@ proposal Content. - + ### MsgSubmitProposalResponse MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. @@ -6441,7 +6002,7 @@ MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. - + ### MsgVote MsgVote defines a message to cast a vote. @@ -6451,14 +6012,14 @@ MsgVote defines a message to cast a vote. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta2.VoteOption) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | - + ### MsgVoteResponse MsgVoteResponse defines the Msg/Vote response type. @@ -6468,7 +6029,7 @@ MsgVoteResponse defines the Msg/Vote response type. - + ### MsgVoteWeighted MsgVoteWeighted defines a message to cast a vote. @@ -6480,14 +6041,14 @@ Since: cosmos-sdk 0.43 | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `options` | [WeightedVoteOption](#cosmos.gov.v1beta2.WeightedVoteOption) | repeated | | +| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | - + ### MsgVoteWeightedResponse MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. @@ -6505,19 +6066,19 @@ Since: cosmos-sdk 0.43 - + ### Msg -Msg defines the gov Msg service. +Msg defines the bank Msg service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1beta2.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1beta2.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | -| `Vote` | [MsgVote](#cosmos.gov.v1beta2.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1beta2.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | -| `VoteWeighted` | [MsgVoteWeighted](#cosmos.gov.v1beta2.MsgVoteWeighted) | [MsgVoteWeightedResponse](#cosmos.gov.v1beta2.MsgVoteWeightedResponse) | VoteWeighted defines a method to add a weighted vote on a specific proposal. +| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | +| `Vote` | [MsgVote](#cosmos.gov.v1beta1.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | +| `VoteWeighted` | [MsgVoteWeighted](#cosmos.gov.v1beta1.MsgVoteWeighted) | [MsgVoteWeightedResponse](#cosmos.gov.v1beta1.MsgVoteWeightedResponse) | VoteWeighted defines a method to add a weighted vote on a specific proposal. Since: cosmos-sdk 0.43 | | -| `Deposit` | [MsgDeposit](#cosmos.gov.v1beta2.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta2.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | +| `Deposit` | [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | diff --git a/x/gov/types/v1beta1/query.pb.go b/x/gov/types/v1beta1/query.pb.go new file mode 100644 index 000000000000..3d3ccae4bfad --- /dev/null +++ b/x/gov/types/v1beta1/query.pb.go @@ -0,0 +1,3862 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1beta1/query.proto + +package v1beta1 + +import ( + context "context" + 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" + 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_e35c0d133e91c0a2, []int{0} +} +func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposalRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalRequest.Merge(m, src) +} +func (m *QueryProposalRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalRequest proto.InternalMessageInfo + +func (m *QueryProposalRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +type QueryProposalResponse struct { + Proposal Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"` +} + +func (m *QueryProposalResponse) Reset() { *m = QueryProposalResponse{} } +func (m *QueryProposalResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposalResponse) ProtoMessage() {} +func (*QueryProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{1} +} +func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalResponse.Merge(m, src) +} +func (m *QueryProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalResponse proto.InternalMessageInfo + +func (m *QueryProposalResponse) GetProposal() Proposal { + if m != nil { + return m.Proposal + } + return Proposal{} +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +type QueryProposalsRequest struct { + // proposal_status defines the status of the proposals. + ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1beta1.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_e35c0d133e91c0a2, []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 + +// 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"` + // 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_e35c0d133e91c0a2, []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_e35c0d133e91c0a2, []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 + +// 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"` +} + +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_e35c0d133e91c0a2, []int{5} +} +func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVoteResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVoteResponse.Merge(m, src) +} +func (m *QueryVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVoteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo + +func (m *QueryVoteResponse) GetVote() Vote { + if m != nil { + return m.Vote + } + return Vote{} +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +type QueryVotesRequest struct { + // 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_e35c0d133e91c0a2, []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"` + // 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_e35c0d133e91c0a2, []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_e35c0d133e91c0a2, []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"` + // deposit_params defines the parameters related to deposit. + DepositParams DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` + // tally_params defines the parameters related to tally. + TallyParams TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{9} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetVotingParams() VotingParams { + if m != nil { + return m.VotingParams + } + return VotingParams{} +} + +func (m *QueryParamsResponse) GetDepositParams() DepositParams { + if m != nil { + return m.DepositParams + } + return DepositParams{} +} + +func (m *QueryParamsResponse) GetTallyParams() TallyParams { + if m != nil { + return m.TallyParams + } + return TallyParams{} +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +type QueryDepositRequest struct { + // 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_e35c0d133e91c0a2, []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 + +// 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"` +} + +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_e35c0d133e91c0a2, []int{11} +} +func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositResponse.Merge(m, src) +} +func (m *QueryDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo + +func (m *QueryDepositResponse) GetDeposit() Deposit { + if m != nil { + return m.Deposit + } + return Deposit{} +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +type QueryDepositsRequest struct { + // 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_e35c0d133e91c0a2, []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"` + // 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_e35c0d133e91c0a2, []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_e35c0d133e91c0a2, []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"` +} + +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_e35c0d133e91c0a2, []int{15} +} +func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTallyResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTallyResultResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTallyResultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTallyResultResponse.Merge(m, src) +} +func (m *QueryTallyResultResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTallyResultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTallyResultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTallyResultResponse proto.InternalMessageInfo + +func (m *QueryTallyResultResponse) GetTally() TallyResult { + if m != nil { + return m.Tally + } + return TallyResult{} +} + +func init() { + proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1beta1.QueryProposalRequest") + proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1beta1.QueryProposalResponse") + proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1beta1.QueryProposalsRequest") + proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1beta1.QueryProposalsResponse") + proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1beta1.QueryVoteRequest") + proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1beta1.QueryVoteResponse") + proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1beta1.QueryVotesRequest") + proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1beta1.QueryVotesResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1beta1.QueryDepositRequest") + proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1beta1.QueryDepositResponse") + proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1beta1.QueryDepositsRequest") + proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1beta1.QueryDepositsResponse") + proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1beta1.QueryTallyResultRequest") + proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1beta1.QueryTallyResultResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1beta1/query.proto", fileDescriptor_e35c0d133e91c0a2) } + +var fileDescriptor_e35c0d133e91c0a2 = []byte{ + // 997 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xb8, 0x4e, 0x6b, 0xbf, 0xb4, 0x01, 0x1e, 0x01, 0x8c, 0x29, 0x76, 0x58, 0xd1, 0xd6, + 0xa4, 0xc4, 0xdb, 0x24, 0xa5, 0xa8, 0x2d, 0xa0, 0x36, 0x42, 0x6d, 0xa1, 0x12, 0x2a, 0x4e, 0x05, + 0x12, 0x97, 0x68, 0x53, 0xaf, 0x96, 0x15, 0x8e, 0x67, 0xeb, 0x19, 0x5b, 0x8d, 0x42, 0x84, 0xc4, + 0x09, 0xc4, 0x05, 0x54, 0xc4, 0x0d, 0xa8, 0x54, 0x89, 0x5f, 0xc0, 0x8f, 0xe8, 0xb1, 0x02, 0x0e, + 0x9c, 0x10, 0x4a, 0x38, 0xf0, 0x23, 0x38, 0xa0, 0x9d, 0x79, 0xb3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, 0x83, 0xc3, 0x34, 0x35, 0xc7, 0x67, 0x4b, 0xbc, 0x19, 0xb5, 0x53, 0x99, 0x38, 0x92, + 0x75, 0x46, 0xc9, 0x9a, 0xc7, 0x66, 0xaa, 0x2c, 0x85, 0xb5, 0xb7, 0x62, 0xcf, 0xcf, 0x36, 0xfe, + 0xc4, 0xe0, 0x08, 0xdd, 0x70, 0x1c, 0x9f, 0x26, 0x39, 0x8c, 0x6b, 0xcd, 0x6c, 0x20, 0x09, 0xba, + 0xa6, 0x04, 0xad, 0xe0, 0xa5, 0x49, 0x7c, 0x32, 0x23, 0xc6, 0xde, 0x8a, 0xc6, 0xf4, 0x36, 0x7e, + 0xcf, 0xa0, 0x6c, 0x46, 0x18, 0x66, 0x0a, 0x10, 0xd9, 0xd7, 0x70, 0xef, 0x3c, 0xb4, 0xde, 0x50, + 0x5a, 0xcf, 0xe1, 0xd9, 0x47, 0xd1, 0x8a, 0xf7, 0x19, 0x4c, 0xc7, 0xa6, 0x09, 0x9e, 0x1e, 0x9b, + 0x78, 0xff, 0x9c, 0xab, 0xbd, 0x9a, 0x0f, 0xfc, 0x5f, 0x9a, 0x4f, 0x8d, 0xb5, 0x95, 0x77, 0x1f, + 0xec, 0xd4, 0xd9, 0xc3, 0x9d, 0x3a, 0xfb, 0x73, 0xa7, 0xce, 0xbe, 0xde, 0xad, 0x17, 0x1e, 0xee, + 0xd6, 0x0b, 0xbf, 0xef, 0xd6, 0x0b, 0x1f, 0x9d, 0xf1, 0x7c, 0xf9, 0xf1, 0x60, 0xbd, 0x75, 0x8b, + 0x6f, 0x98, 0xb0, 0xfa, 0xcf, 0x82, 0xe8, 0x7c, 0x62, 0xdf, 0x51, 0x39, 0xc2, 0x96, 0x11, 0x26, + 0xd3, 0xfa, 0x61, 0xf5, 0xbf, 0xd0, 0xf2, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x69, 0xc4, + 0x93, 0xda, 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.v1beta1.Query/Proposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { + out := new(QueryProposalsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Proposals", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { + out := new(QueryVoteResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Vote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { + out := new(QueryVotesResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Votes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { + out := new(QueryDepositResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { + out := new(QueryDepositsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposits", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { + out := new(QueryTallyResultResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/TallyResult", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +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.v1beta1.Query/Proposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposalsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Proposals(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Proposals", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Vote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Vote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVotesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Votes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Votes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDepositRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDepositsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Deposits(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Deposits", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTallyResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TallyResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/TallyResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.gov.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Proposal", + Handler: _Query_Proposal_Handler, + }, + { + MethodName: "Proposals", + Handler: _Query_Proposals_Handler, + }, + { + MethodName: "Vote", + Handler: _Query_Vote_Handler, + }, + { + MethodName: "Votes", + Handler: _Query_Votes_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Deposit", + Handler: _Query_Deposit_Handler, + }, + { + MethodName: "Deposits", + Handler: _Query_Deposits_Handler, + }, + { + MethodName: "TallyResult", + Handler: _Query_TallyResult_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/gov/v1beta1/query.proto", +} + +func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryProposalsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.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 + { + 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 + { + size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryDepositRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryDepositsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.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 + { + size, err := m.Tally.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryProposalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Proposal.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryProposalsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalStatus != 0 { + n += 1 + sovQuery(uint64(m.ProposalStatus)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.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 + 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 + l = m.VotingParams.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.DepositParams.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.TallyParams.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDepositRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Deposit.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDepositsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + if m.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 + 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 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 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 err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 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 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/v1beta1/query.pb.gw.go b/x/gov/types/v1beta1/query.pb.gw.go new file mode 100644 index 000000000000..f53f467d4a46 --- /dev/null +++ b/x/gov/types/v1beta1/query.pb.gw.go @@ -0,0 +1,932 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/gov/v1beta1/query.proto + +/* +Package v1beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1beta1 + +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", "v1beta1", "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", "v1beta1", "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", "v1beta1", "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", "v1beta1", "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", "v1beta1", "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", "v1beta1", "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", "v1beta1", "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", "v1beta1", "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/v1beta1/tx.pb.go b/x/gov/types/v1beta1/tx.pb.go new file mode 100644 index 000000000000..e10538a0f3d5 --- /dev/null +++ b/x/gov/types/v1beta1/tx.pb.go @@ -0,0 +1,1887 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1beta1/tx.proto + +package v1beta1 + +import ( + context "context" + 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" + 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 { + Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,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"` +} + +func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } +func (*MsgSubmitProposal) ProtoMessage() {} +func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []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 + +// 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"` +} + +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_3c053992595e3dce, []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"` + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` +} + +func (m *MsgVote) Reset() { *m = MsgVote{} } +func (*MsgVote) ProtoMessage() {} +func (*MsgVote) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []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 + +// 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_3c053992595e3dce, []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"` +} + +func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } +func (*MsgVoteWeighted) ProtoMessage() {} +func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []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 + +// 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_3c053992595e3dce, []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"` + 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"` +} + +func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } +func (*MsgDeposit) ProtoMessage() {} +func (*MsgDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []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 + +// 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_3c053992595e3dce, []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.v1beta1.MsgSubmitProposal") + proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta1.MsgSubmitProposalResponse") + proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta1.MsgVote") + proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta1.MsgVoteResponse") + proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1beta1.MsgVoteWeighted") + proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1beta1.MsgVoteWeightedResponse") + proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta1.MsgDeposit") + proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta1.MsgDepositResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) } + +var fileDescriptor_3c053992595e3dce = []byte{ + // 654 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0xd3, 0x4e, + 0x10, 0xb5, 0x93, 0xfe, 0x9a, 0x5f, 0x27, 0xa8, 0xa5, 0x56, 0x24, 0x92, 0x14, 0xd9, 0x51, 0x10, + 0x55, 0x24, 0x14, 0xbb, 0x0d, 0xa8, 0x07, 0x38, 0x35, 0x45, 0x08, 0x90, 0x22, 0xc0, 0x95, 0x40, + 0xe2, 0x52, 0x92, 0x78, 0xbb, 0xb5, 0x68, 0x3c, 0x56, 0x76, 0x13, 0xb5, 0x37, 0x8e, 0x9c, 0x10, + 0x47, 0x8e, 0x3d, 0x73, 0x2e, 0x37, 0x3e, 0x40, 0xc5, 0xa9, 0xe2, 0xc4, 0x01, 0x15, 0xd4, 0x5e, + 0x10, 0x82, 0xef, 0x80, 0xec, 0xdd, 0x75, 0xa1, 0x75, 0xd3, 0xf2, 0xe7, 0x94, 0xec, 0xbe, 0xf7, + 0x66, 0xe6, 0xcd, 0xce, 0x7a, 0x61, 0xa6, 0x8b, 0xac, 0x87, 0xcc, 0xa1, 0x38, 0x74, 0x86, 0xf3, + 0x1d, 0xc2, 0xdb, 0xf3, 0x0e, 0xdf, 0xb0, 0xc3, 0x3e, 0x72, 0x34, 0x0c, 0x01, 0xda, 0x14, 0x87, + 0xb6, 0x04, 0xcb, 0xa6, 0x14, 0x74, 0xda, 0x8c, 0x24, 0x8a, 0x2e, 0xfa, 0x81, 0xd0, 0x94, 0x2f, + 0xa6, 0x04, 0x8c, 0xf4, 0x02, 0x2d, 0x09, 0x74, 0x25, 0x5e, 0x39, 0x32, 0xbc, 0x80, 0x0a, 0x14, + 0x29, 0x8a, 0xfd, 0xe8, 0x9f, 0x12, 0x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xdf, 0x32, 0x90, 0x6d, 0x31, 0x6a, 0xac, 0xc2, 0xe4, 0x91, 0xcf, 0xc1, 0xe5, 0xb4, 0x33, + 0x38, 0x76, 0x4b, 0xca, 0xf5, 0x33, 0xd1, 0x92, 0xcb, 0x74, 0x1b, 0xc6, 0xe2, 0x6b, 0x31, 0x73, + 0x82, 0x2c, 0x02, 0xcb, 0x97, 0x46, 0x80, 0x49, 0xa4, 0x27, 0x70, 0xee, 0x97, 0xa9, 0x1c, 0x25, + 0x52, 0xa4, 0xf2, 0x95, 0x33, 0x90, 0x92, 0x0c, 0x0f, 0x20, 0xa7, 0xa6, 0xc3, 0x3c, 0x41, 0x27, + 0xf1, 0xf2, 0xec, 0x68, 0x5c, 0x85, 0x6c, 0xde, 0xdd, 0xd9, 0x37, 0xf5, 0xdd, 0x7d, 0x53, 0xff, + 0xbc, 0x6f, 0xea, 0x2f, 0x0f, 0x4c, 0x6d, 0xf7, 0xc0, 0xd4, 0x3e, 0x1c, 0x98, 0xda, 0xe3, 0xb9, + 0x91, 0x47, 0xbc, 0x11, 0xbf, 0x0a, 0xf1, 0x41, 0xab, 0xb7, 0xa1, 0x33, 0x1e, 0x7f, 0x96, 0xaf, + 0xfe, 0x08, 0x00, 0x00, 0xff, 0xff, 0xde, 0x27, 0x9f, 0x48, 0x89, 0x06, 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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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/v1beta1/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 m.Content != nil { + { + size, err := m.Content.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 m.Content != nil { + l = m.Content.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 Content", 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 + } + if m.Content == nil { + m.Content = &types.Any{} + } + if err := m.Content.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") +) From ab39d389a1def45747f27053de1888b1e30d4b4d Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 3 Dec 2021 17:28:53 +0100 Subject: [PATCH 27/28] remove tx proto --- proto/cosmos/gov/v1beta1/tx.proto | 96 -- x/gov/types/v1beta1/tx.pb.go | 1887 ----------------------------- 2 files changed, 1983 deletions(-) delete mode 100644 proto/cosmos/gov/v1beta1/tx.proto delete mode 100644 x/gov/types/v1beta1/tx.pb.go diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto deleted file mode 100644 index 35c9669edaf5..000000000000 --- a/proto/cosmos/gov/v1beta1/tx.proto +++ /dev/null @@ -1,96 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/gov/v1beta1/gov.proto"; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; - -// Msg defines the bank Msg service. -service Msg { - // SubmitProposal defines a method to create new proposal given a content. - rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); - - // Vote defines a method to add a vote on a specific proposal. - rpc Vote(MsgVote) returns (MsgVoteResponse); - - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - // - // Since: cosmos-sdk 0.43 - rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); - - // Deposit defines a method to add deposit on a specific proposal. - rpc Deposit(MsgDeposit) returns (MsgDepositResponse); -} - -// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -// proposal Content. -message MsgSubmitProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; - repeated cosmos.base.v1beta1.Coin initial_deposit = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} - -// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -message MsgSubmitProposalResponse { - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; -} - -// MsgVote defines a message to cast a vote. -message MsgVote { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - VoteOption option = 3; -} - -// MsgVoteResponse defines the Msg/Vote response type. -message MsgVoteResponse {} - -// MsgVoteWeighted defines a message to cast a vote. -// -// Since: cosmos-sdk 0.43 -message MsgVoteWeighted { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1; - string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; -} - -// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -// -// Since: cosmos-sdk 0.43 -message MsgVoteWeightedResponse {} - -// MsgDeposit defines a message to submit a deposit to an existing proposal. -message MsgDeposit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; - string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// MsgDepositResponse defines the Msg/Deposit response type. -message MsgDepositResponse {} diff --git a/x/gov/types/v1beta1/tx.pb.go b/x/gov/types/v1beta1/tx.pb.go deleted file mode 100644 index e10538a0f3d5..000000000000 --- a/x/gov/types/v1beta1/tx.pb.go +++ /dev/null @@ -1,1887 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta1/tx.proto - -package v1beta1 - -import ( - context "context" - 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" - 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 { - Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,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"` -} - -func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } -func (*MsgSubmitProposal) ProtoMessage() {} -func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []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 - -// 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"` -} - -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_3c053992595e3dce, []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"` - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` -} - -func (m *MsgVote) Reset() { *m = MsgVote{} } -func (*MsgVote) ProtoMessage() {} -func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []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 - -// 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_3c053992595e3dce, []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"` -} - -func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } -func (*MsgVoteWeighted) ProtoMessage() {} -func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []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 - -// 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_3c053992595e3dce, []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"` - 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"` -} - -func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } -func (*MsgDeposit) ProtoMessage() {} -func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []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 - -// 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_3c053992595e3dce, []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.v1beta1.MsgSubmitProposal") - proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta1.MsgSubmitProposalResponse") - proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta1.MsgVote") - proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta1.MsgVoteResponse") - proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1beta1.MsgVoteWeighted") - proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1beta1.MsgVoteWeightedResponse") - proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta1.MsgDeposit") - proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta1.MsgDepositResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) } - -var fileDescriptor_3c053992595e3dce = []byte{ - // 654 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0xd3, 0x4e, - 0x10, 0xb5, 0x93, 0xfe, 0x9a, 0x5f, 0x27, 0xa8, 0xa5, 0x56, 0x24, 0x92, 0x14, 0xd9, 0x51, 0x10, - 0x55, 0x24, 0x14, 0xbb, 0x0d, 0xa8, 0x07, 0x38, 0x35, 0x45, 0x08, 0x90, 0x22, 0xc0, 0x95, 0x40, - 0xe2, 0x52, 0x92, 0x78, 0xbb, 0xb5, 0x68, 0x3c, 0x56, 0x76, 0x13, 0xb5, 0x37, 0x8e, 0x9c, 0x10, - 0x47, 0x8e, 0x3d, 0x73, 0x2e, 0x37, 0x3e, 0x40, 0xc5, 0xa9, 0xe2, 0xc4, 0x01, 0x15, 0xd4, 0x5e, - 0x10, 0x82, 0xef, 0x80, 0xec, 0xdd, 0x75, 0xa1, 0x75, 0xd3, 0xf2, 0xe7, 0x94, 0xec, 0xbe, 0xf7, - 0x66, 0xe6, 0xcd, 0xce, 0x7a, 0x61, 0xa6, 0x8b, 0xac, 0x87, 0xcc, 0xa1, 0x38, 0x74, 0x86, 0xf3, - 0x1d, 0xc2, 0xdb, 0xf3, 0x0e, 0xdf, 0xb0, 0xc3, 0x3e, 0x72, 0x34, 0x0c, 0x01, 0xda, 0x14, 0x87, - 0xb6, 0x04, 0xcb, 0xa6, 0x14, 0x74, 0xda, 0x8c, 0x24, 0x8a, 0x2e, 0xfa, 0x81, 0xd0, 0x94, 0x2f, - 0xa6, 0x04, 0x8c, 0xf4, 0x02, 0x2d, 0x09, 0x74, 0x25, 0x5e, 0x39, 0x32, 0xbc, 0x80, 0x0a, 0x14, - 0x29, 0x8a, 0xfd, 0xe8, 0x9f, 0x12, 0x50, 0x44, 0xba, 0x4e, 0x9c, 0x78, 0xd5, 0x19, 0xac, 0x3a, - 0xed, 0x60, 0x53, 0x40, 0xd5, 0x17, 0x19, 0x98, 0x6e, 0x31, 0xba, 0x3c, 0xe8, 0xf4, 0x7c, 0x7e, - 0xbf, 0x8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0xe2, 0x6b, 0x31, 0x73, - 0x82, 0x2c, 0x02, 0xcb, 0x97, 0x46, 0x80, 0x49, 0xa4, 0x27, 0x70, 0xee, 0x97, 0xa9, 0x1c, 0x25, - 0x52, 0xa4, 0xf2, 0x95, 0x33, 0x90, 0x92, 0x0c, 0x0f, 0x20, 0xa7, 0xa6, 0xc3, 0x3c, 0x41, 0x27, - 0xf1, 0xf2, 0xec, 0x68, 0x5c, 0x85, 0x6c, 0xde, 0xdd, 0xd9, 0x37, 0xf5, 0xdd, 0x7d, 0x53, 0xff, - 0xbc, 0x6f, 0xea, 0x2f, 0x0f, 0x4c, 0x6d, 0xf7, 0xc0, 0xd4, 0x3e, 0x1c, 0x98, 0xda, 0xe3, 0xb9, - 0x91, 0x47, 0xbc, 0x11, 0xbf, 0x0a, 0xf1, 0x41, 0xab, 0xb7, 0xa1, 0x33, 0x1e, 0x7f, 0x96, 0xaf, - 0xfe, 0x08, 0x00, 0x00, 0xff, 0xff, 0xde, 0x27, 0x9f, 0x48, 0x89, 0x06, 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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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/v1beta1/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 m.Content != nil { - { - size, err := m.Content.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 m.Content != nil { - l = m.Content.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 Content", 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 - } - if m.Content == nil { - m.Content = &types.Any{} - } - if err := m.Content.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") -) From dbf7e9c2212dc56ed3a50cf246703b824618db03 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 3 Dec 2021 18:51:17 +0100 Subject: [PATCH 28/28] rename weights --- simapp/params/weights.go | 3 +-- x/gov/simulation/operations.go | 2 +- x/gov/simulation/operations_test.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/simapp/params/weights.go b/simapp/params/weights.go index 62fbb556f954..125cbbdc1f2a 100644 --- a/simapp/params/weights.go +++ b/simapp/params/weights.go @@ -17,8 +17,7 @@ const ( DefaultWeightMsgDelegate int = 100 DefaultWeightMsgUndelegate int = 100 DefaultWeightMsgBeginRedelegate int = 100 - - DefaultWeightMsgSignalProposal int = 5 + DefaultWeightMsgSubmitProposal int = 5 // feegrant DefaultWeightGrantAllowance int = 100 diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 73410d9d52f3..d559b020a349 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -41,7 +41,7 @@ func WeightedOperations( appParams.GetOrGenerate(cdc, OpWeightMsgSubmitProposal, &weightMsgSubmitProposal, nil, func(_ *rand.Rand) { - weightMsgSubmitProposal = simappparams.DefaultWeightMsgSignalProposal + weightMsgSubmitProposal = simappparams.DefaultWeightMsgSubmitProposal }, ) diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 9a83e46aff39..430ab42e7844 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -52,7 +52,7 @@ func TestWeightedOperations(t *testing.T) { opMsgRoute string opMsgName string }{ - {simappparams.DefaultWeightMsgSignalProposal, types.ModuleName, types.TypeMsgSubmitProposal}, + {simappparams.DefaultWeightMsgSubmitProposal, types.ModuleName, types.TypeMsgSubmitProposal}, {simappparams.DefaultWeightMsgDeposit, types.ModuleName, types.TypeMsgDeposit}, {simappparams.DefaultWeightMsgVote, types.ModuleName, types.TypeMsgVote}, {simappparams.DefaultWeightMsgVoteWeighted, types.ModuleName, types.TypeMsgVoteWeighted},