Skip to content

Commit

Permalink
use @aaronc's suggested proto upgrade method
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnya97 committed Jan 25, 2021
1 parent be40971 commit 56ed27a
Show file tree
Hide file tree
Showing 5 changed files with 155 additions and 114 deletions.
49 changes: 48 additions & 1 deletion docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
- [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)
Expand Down Expand Up @@ -283,6 +284,8 @@
- [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse)
- [MsgVote](#cosmos.gov.v1beta1.MsgVote)
- [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse)
- [MsgWeightedVote](#cosmos.gov.v1beta1.MsgWeightedVote)
- [MsgWeightedVoteResponse](#cosmos.gov.v1beta1.MsgWeightedVoteResponse)

- [Msg](#cosmos.gov.v1beta1.Msg)

Expand Down Expand Up @@ -3904,7 +3907,7 @@ 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) | | |
| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | |



Expand All @@ -3925,6 +3928,22 @@ VotingParams defines the params for voting on governance proposals.




<a name="cosmos.gov.v1beta1.WeightedVoteOption"></a>

### WeightedVoteOption
WeightedVoteOption defines a unit of vote for vote split.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | |
| `weight` | [string](#string) | | |





<!-- end messages -->


Expand Down Expand Up @@ -4382,6 +4401,33 @@ MsgVoteResponse defines the Msg/Vote response type.




<a name="cosmos.gov.v1beta1.MsgWeightedVote"></a>

### MsgWeightedVote
MsgVote defines a message to cast a vote.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `proposal_id` | [uint64](#uint64) | | |
| `voter` | [string](#string) | | |
| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | |






<a name="cosmos.gov.v1beta1.MsgWeightedVoteResponse"></a>

### MsgWeightedVoteResponse
MsgWeightedVoteResponse defines the MsgWeightedVote response type.





<!-- end messages -->

<!-- end enums -->
Expand All @@ -4398,6 +4444,7 @@ Msg defines the bank Msg service.
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `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. | |
| `WeightedVote` | [MsgWeightedVote](#cosmos.gov.v1beta1.MsgWeightedVote) | [MsgWeightedVoteResponse](#cosmos.gov.v1beta1.MsgWeightedVoteResponse) | WeightedVote 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. | |

<!-- end services -->
Expand Down
10 changes: 6 additions & 4 deletions proto/cosmos/gov/v1beta1/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ enum VoteOption {
// WeightedVoteOption defines a unit of vote for vote split.
message WeightedVoteOption {
VoteOption option = 1;
string weight = 2 [
string weight = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"weight\""
Expand Down Expand Up @@ -129,9 +129,11 @@ message Vote {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.equal) = false;

uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""];
string voter = 2;
repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false];
uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""];
string voter = 2;
reserved 3;
reserved "option";
repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false];
}

// DepositParams defines the params for deposits on governance proposals.
Expand Down
8 changes: 4 additions & 4 deletions proto/cosmos/gov/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ message MsgVote {

// MsgVote defines a message to cast a vote.
message MsgWeightedVote {
option (gogoproto.equal) = false;
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", (gogoproto.moretags) = "yaml:\"proposal_id\""];
string voter = 2;
repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false];
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""];
string voter = 2;
repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false];
}

// MsgVoteResponse defines the Msg/Vote response type.
Expand Down
Loading

0 comments on commit 56ed27a

Please sign in to comment.