basic migration for SubVote type

This commit is contained in:
antstalepresh 2020-10-27 21:50:11 +10:00
parent da0c3910a3
commit 09a282dda3
11 changed files with 482 additions and 263 deletions

View File

@ -29,6 +29,15 @@ enum VoteOption {
VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"];
}
message SubVote {
VoteOption option = 1;
string rate = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"rate\""
];
}
// TextProposal defines a standard text proposal whose changes need to be
// manually updated in case of approval.
message TextProposal {
@ -119,9 +128,9 @@ message Vote {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.equal) = false;
uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""];
string voter = 2;
repeated VoteOption options = 3;
uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""];
string voter = 2;
repeated SubVote sub_votes = 3 [(gogoproto.nullable) = false];
}
// DepositParams defines the params for deposits on governance proposals.

View File

@ -50,9 +50,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;
VoteOption option = 3;
uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""];
string voter = 2;
repeated SubVote sub_votes = 3 [(gogoproto.nullable) = false];
}
// MsgVoteResponse defines the Msg/Vote response type.

View File

@ -117,7 +117,7 @@ func newVoteHandlerFn(clientCtx client.Context) http.HandlerFunc {
}
// create the message
msg := types.NewMsgVote(req.Voter, proposalID, voteOption)
msg := types.NewMsgVote(req.Voter, proposalID, []types.SubVote{types.NewSubVote(voteOption, 1)})
if rest.CheckBadRequestError(w, msg.ValidateBasic()) {
return
}

View File

@ -101,7 +101,7 @@ func QueryVotesByTxQuery(clientCtx client.Context, params types.QueryProposalVot
votes = append(votes, types.Vote{
Voter: voteMsg.Voter,
ProposalId: params.ProposalID,
Option: voteMsg.Option,
SubVotes: voteMsg.SubVotes,
})
}
}
@ -148,7 +148,7 @@ func QueryVoteByTxQuery(clientCtx client.Context, params types.QueryVoteParams)
vote := types.Vote{
Voter: voteMsg.Voter,
ProposalId: params.ProposalID,
Option: voteMsg.Option,
SubVotes: voteMsg.SubVotes,
}
bz, err := clientCtx.JSONMarshaler.MarshalJSON(&vote)

View File

@ -64,7 +64,7 @@ func (k msgServer) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVo
if accErr != nil {
return nil, accErr
}
err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, msg.Option)
err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, msg.SubVotes)
if err != nil {
return nil, err
}

View File

@ -9,7 +9,7 @@ import (
)
// AddVote adds a vote on a specific proposal
func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, option types.VoteOption) error {
func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, subvotes []types.SubVote) error {
proposal, ok := keeper.GetProposal(ctx, proposalID)
if !ok {
return sdkerrors.Wrapf(types.ErrUnknownProposal, "%d", proposalID)
@ -22,7 +22,7 @@ func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A
return sdkerrors.Wrap(types.ErrInvalidVote, option.String())
}
vote := types.NewVote(proposalID, voterAddr, option)
vote := types.NewVote(proposalID, voterAddr, subvotes)
keeper.SetVote(ctx, vote)
ctx.EventManager().EmitEvent(

View File

@ -118,7 +118,7 @@ func Migrate(oldGovState v036gov.GenesisState) *v040gov.GenesisState {
newVotes[i] = v040gov.Vote{
ProposalId: oldVote.ProposalID,
Voter: oldVote.Voter.String(),
Option: migrateVoteOption(oldVote.Option),
SubVotes: []v040gov.SubVote{v040gov.NewSubVote(migrateVoteOption(oldVote.Option), 1)},
}
}

View File

@ -121,6 +121,43 @@ func (ProposalStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{1}
}
type SubVote struct {
Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"`
Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate" yaml:"rate"`
}
func (m *SubVote) Reset() { *m = SubVote{} }
func (*SubVote) ProtoMessage() {}
func (*SubVote) Descriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{0}
}
func (m *SubVote) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SubVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SubVote.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 *SubVote) XXX_Merge(src proto.Message) {
xxx_messageInfo_SubVote.Merge(m, src)
}
func (m *SubVote) XXX_Size() int {
return m.Size()
}
func (m *SubVote) XXX_DiscardUnknown() {
xxx_messageInfo_SubVote.DiscardUnknown(m)
}
var xxx_messageInfo_SubVote proto.InternalMessageInfo
// TextProposal defines a standard text proposal whose changes need to be
// manually updated in case of approval.
type TextProposal struct {
@ -131,7 +168,7 @@ type TextProposal struct {
func (m *TextProposal) Reset() { *m = TextProposal{} }
func (*TextProposal) ProtoMessage() {}
func (*TextProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{0}
return fileDescriptor_6e82113c1a9a4b7c, []int{1}
}
func (m *TextProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -171,7 +208,7 @@ type Deposit struct {
func (m *Deposit) Reset() { *m = Deposit{} }
func (*Deposit) ProtoMessage() {}
func (*Deposit) Descriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{1}
return fileDescriptor_6e82113c1a9a4b7c, []int{2}
}
func (m *Deposit) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -216,7 +253,7 @@ type Proposal struct {
func (m *Proposal) Reset() { *m = Proposal{} }
func (*Proposal) ProtoMessage() {}
func (*Proposal) Descriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{2}
return fileDescriptor_6e82113c1a9a4b7c, []int{3}
}
func (m *Proposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -256,7 +293,7 @@ type TallyResult struct {
func (m *TallyResult) Reset() { *m = TallyResult{} }
func (*TallyResult) ProtoMessage() {}
func (*TallyResult) Descriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{3}
return fileDescriptor_6e82113c1a9a4b7c, []int{4}
}
func (m *TallyResult) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -288,15 +325,15 @@ 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"`
Options []VoteOption `protobuf:"varint,3,rep,packed,name=options,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"options,omitempty"`
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"`
SubVotes []SubVote `protobuf:"bytes,3,rep,name=sub_votes,json=subVotes,proto3" json:"sub_votes"`
}
func (m *Vote) Reset() { *m = Vote{} }
func (*Vote) ProtoMessage() {}
func (*Vote) Descriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{4}
return fileDescriptor_6e82113c1a9a4b7c, []int{5}
}
func (m *Vote) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -337,7 +374,7 @@ type DepositParams struct {
func (m *DepositParams) Reset() { *m = DepositParams{} }
func (*DepositParams) ProtoMessage() {}
func (*DepositParams) Descriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{5}
return fileDescriptor_6e82113c1a9a4b7c, []int{6}
}
func (m *DepositParams) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -375,7 +412,7 @@ type VotingParams struct {
func (m *VotingParams) Reset() { *m = VotingParams{} }
func (*VotingParams) ProtoMessage() {}
func (*VotingParams) Descriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{6}
return fileDescriptor_6e82113c1a9a4b7c, []int{7}
}
func (m *VotingParams) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -419,7 +456,7 @@ type TallyParams struct {
func (m *TallyParams) Reset() { *m = TallyParams{} }
func (*TallyParams) ProtoMessage() {}
func (*TallyParams) Descriptor() ([]byte, []int) {
return fileDescriptor_6e82113c1a9a4b7c, []int{7}
return fileDescriptor_6e82113c1a9a4b7c, []int{8}
}
func (m *TallyParams) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -451,6 +488,7 @@ 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((*SubVote)(nil), "cosmos.gov.v1beta1.SubVote")
proto.RegisterType((*TextProposal)(nil), "cosmos.gov.v1beta1.TextProposal")
proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1beta1.Deposit")
proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1beta1.Proposal")
@ -464,94 +502,98 @@ func init() {
func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) }
var fileDescriptor_6e82113c1a9a4b7c = []byte{
// 1380 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x5f, 0x6c, 0xdb, 0xd4,
0x17, 0x8e, 0xd3, 0xff, 0x37, 0x69, 0xea, 0xdd, 0x66, 0x6d, 0xea, 0xdf, 0x7e, 0xb6, 0x31, 0x08,
0x55, 0xd3, 0x96, 0x6e, 0x05, 0x09, 0xe8, 0x24, 0x44, 0xd2, 0x78, 0x2c, 0x68, 0x4a, 0x22, 0xc7,
0xcb, 0xb4, 0xf1, 0x60, 0x39, 0xc9, 0x5d, 0x6a, 0x88, 0x7d, 0x43, 0x7c, 0x53, 0x1a, 0xf1, 0xc2,
0xe3, 0x14, 0x24, 0xb4, 0xc7, 0x21, 0x14, 0x69, 0x12, 0x6f, 0x3c, 0xf3, 0xcc, 0x73, 0x85, 0x90,
0x98, 0x78, 0x9a, 0x40, 0xca, 0x58, 0x27, 0xa1, 0xa9, 0x8f, 0x7d, 0xe0, 0x19, 0xd9, 0xf7, 0xba,
0x71, 0x92, 0x8a, 0x12, 0x9e, 0x66, 0x9f, 0x7b, 0xbe, 0xef, 0x3b, 0xf7, 0xf3, 0x39, 0x27, 0x2b,
0xb8, 0x54, 0xc3, 0xae, 0x8d, 0xdd, 0xad, 0x06, 0xde, 0xdf, 0xda, 0xbf, 0x5e, 0x45, 0xc4, 0xbc,
0xee, 0x3d, 0xa7, 0x5b, 0x6d, 0x4c, 0x30, 0x84, 0xf4, 0x34, 0xed, 0x45, 0xd8, 0xa9, 0x20, 0x32,
0x44, 0xd5, 0x74, 0xd1, 0x29, 0xa4, 0x86, 0x2d, 0x87, 0x62, 0x84, 0x64, 0x03, 0x37, 0xb0, 0xff,
0xb8, 0xe5, 0x3d, 0xb1, 0xe8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xd7, 0x45, 0x75, 0x78, 0x0d, 0xa4, 0xc6, 0xb3, 0x35, 0xf5, 0x23, 0x75, 0x57,
0x57, 0x73, 0xfc, 0xac, 0x00, 0x7b, 0x7d, 0x39, 0x41, 0xf3, 0x35, 0xf4, 0x09, 0xaa, 0x11, 0x74,
0x26, 0xff, 0xcd, 0x4c, 0xfe, 0xb6, 0x9a, 0xe3, 0xe7, 0xc2, 0xfc, 0x37, 0x4d, 0xab, 0x89, 0xea,
0xd4, 0xce, 0x6c, 0xe1, 0xf0, 0x85, 0x18, 0x79, 0xf6, 0x42, 0x8c, 0x7c, 0x79, 0x24, 0x46, 0x0e,
0x8f, 0x44, 0xee, 0xe9, 0x91, 0xc8, 0xfd, 0x71, 0x24, 0x72, 0x8f, 0x5e, 0x8a, 0x91, 0xa7, 0x2f,
0xc5, 0xc8, 0xb3, 0x97, 0x62, 0xe4, 0xfe, 0x3f, 0x2f, 0xc4, 0x03, 0xff, 0x8f, 0x21, 0xbf, 0x9f,
0xab, 0xf3, 0xfe, 0x0e, 0x79, 0xeb, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd9, 0xc3, 0x29, 0xda,
0x27, 0x0d, 0x00, 0x00,
// 1442 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x5f, 0x6c, 0xdb, 0x54,
0x17, 0x8f, 0xd3, 0xf4, 0x4f, 0x6e, 0xd2, 0xd6, 0xbb, 0xed, 0xda, 0x34, 0xdb, 0x67, 0xfb, 0xf3,
0xf7, 0x09, 0x55, 0xd3, 0x96, 0x6e, 0x05, 0x81, 0xe8, 0xc4, 0x44, 0xdc, 0x78, 0x2c, 0x68, 0x4a,
0x82, 0xe3, 0x65, 0xda, 0x78, 0xb0, 0x9c, 0xe4, 0x2e, 0x35, 0xc4, 0xbe, 0x21, 0xbe, 0x29, 0xad,
0x78, 0xe1, 0x71, 0x0a, 0x12,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e, 0xb6, 0x9a, 0xe3, 0xa7, 0xc3, 0xfc, 0x37, 0x4d, 0xab, 0x89, 0xea, 0xb4, 0x9c,
0x4a, 0xe1, 0xe0, 0x85, 0x10, 0x79, 0xf6, 0x42, 0x88, 0x7c, 0x7e, 0x28, 0x44, 0x0e, 0x0e, 0x05,
0xee, 0xe9, 0xa1, 0xc0, 0xfd, 0x7e, 0x28, 0x70, 0x8f, 0x5e, 0x0a, 0x91, 0xa7, 0x2f, 0x85, 0xc8,
0xb3, 0x97, 0x42, 0xe4, 0xfe, 0xdf, 0x2f, 0xc4, 0x3d, 0xff, 0x3f, 0x35, 0xbf, 0x9f, 0xab, 0x33,
0xfe, 0x0e, 0x79, 0xfd, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x68, 0xea, 0xf2, 0xc4, 0x0d,
0x00, 0x00,
}
func (this *TextProposal) Equal(that interface{}) bool {
@ -667,6 +709,44 @@ func (this *TallyResult) Equal(that interface{}) bool {
}
return true
}
func (m *SubVote) 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 *SubVote) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SubVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
{
size := m.Rate.Size()
i -= size
if _, err := m.Rate.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)
@ -937,23 +1017,19 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if len(m.Options) > 0 {
dAtA8 := make([]byte, len(m.Options)*10)
var j7 int
for _, num := range m.Options {
for num >= 1<<7 {
dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j7++
if len(m.SubVotes) > 0 {
for iNdEx := len(m.SubVotes) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.SubVotes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGov(dAtA, i, uint64(size))
}
dAtA8[j7] = uint8(num)
j7++
i--
dAtA[i] = 0x1a
}
i -= j7
copy(dAtA[i:], dAtA8[:j7])
i = encodeVarintGov(dAtA, i, uint64(j7))
i--
dAtA[i] = 0x1a
}
if len(m.Voter) > 0 {
i -= len(m.Voter)
@ -990,12 +1066,12 @@ func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
n9, err9 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxDepositPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod):])
if err9 != nil {
return 0, err9
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 -= n9
i = encodeVarintGov(dAtA, i, uint64(n9))
i -= n7
i = encodeVarintGov(dAtA, i, uint64(n7))
i--
dAtA[i] = 0x12
if len(m.MinDeposit) > 0 {
@ -1035,12 +1111,12 @@ func (m *VotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
n10, err10 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.VotingPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod):])
if err10 != nil {
return 0, err10
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 -= n10
i = encodeVarintGov(dAtA, i, uint64(n10))
i -= n8
i = encodeVarintGov(dAtA, i, uint64(n8))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
@ -1110,6 +1186,20 @@ func encodeVarintGov(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
func (m *SubVote) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Option != 0 {
n += 1 + sovGov(uint64(m.Option))
}
l = m.Rate.Size()
n += 1 + l + sovGov(uint64(l))
return n
}
func (m *TextProposal) Size() (n int) {
if m == nil {
return 0
@ -1214,12 +1304,11 @@ func (m *Vote) Size() (n int) {
if l > 0 {
n += 1 + l + sovGov(uint64(l))
}
if len(m.Options) > 0 {
l = 0
for _, e := range m.Options {
l += sovGov(uint64(e))
if len(m.SubVotes) > 0 {
for _, e := range m.SubVotes {
l = e.Size()
n += 1 + l + sovGov(uint64(l))
}
n += 1 + sovGov(uint64(l)) + l
}
return n
}
@ -1273,6 +1362,112 @@ func sovGov(x uint64) (n int) {
func sozGov(x uint64) (n int) {
return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *SubVote) 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: SubVote: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SubVote: 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 Rate", 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.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGov(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGov
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthGov
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *TextProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@ -2124,74 +2319,39 @@ func (m *Vote) Unmarshal(dAtA []byte) error {
m.Voter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType == 0 {
var v VoteOption
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGov
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= VoteOption(b&0x7F) << shift
if b < 0x80 {
break
}
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SubVotes", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGov
}
m.Options = append(m.Options, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGov
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
packedLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if packedLen < 0 {
return ErrInvalidLengthGov
}
postIndex := iNdEx + packedLen
if postIndex < 0 {
return ErrInvalidLengthGov
}
if postIndex > l {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
var elementCount int
if elementCount != 0 && len(m.Options) == 0 {
m.Options = make([]VoteOption, 0, elementCount)
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
for iNdEx < postIndex {
var v VoteOption
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGov
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= VoteOption(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Options = append(m.Options, v)
}
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
}
if msglen < 0 {
return ErrInvalidLengthGov
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGov
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.SubVotes = append(m.SubVotes, SubVote{})
if err := m.SubVotes[len(m.SubVotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGov(dAtA[iNdEx:])

View File

@ -177,8 +177,8 @@ func (msg MsgDeposit) GetSigners() []sdk.AccAddress {
// NewMsgVote creates a message to cast a vote on an active proposal
//nolint:interfacer
func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *MsgVote {
return &MsgVote{proposalID, voter.String(), option}
func NewMsgVote(voter sdk.AccAddress, proposalID uint64, subVotes []SubVote) *MsgVote {
return &MsgVote{proposalID, voter.String(), subVotes}
}
// Route implements Msg
@ -192,8 +192,10 @@ func (msg MsgVote) ValidateBasic() error {
if msg.Voter == "" {
return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Voter)
}
if !ValidVoteOption(msg.Option) {
return sdkerrors.Wrap(ErrInvalidVote, msg.Option.String())
for _, subvote := range msg.SubVotes {
if !ValidSubVote(subvote) {
return sdkerrors.Wrap(ErrInvalidVote, subvote.String())
}
}
return nil

View File

@ -119,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 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"`
SubVotes []SubVote `protobuf:"bytes,3,rep,name=sub_votes,json=subVotes,proto3" json:"sub_votes"`
}
func (m *MsgVote) Reset() { *m = MsgVote{} }
@ -281,44 +281,45 @@ func init() {
func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) }
var fileDescriptor_3c053992595e3dce = []byte{
// 586 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xbf, 0x6f, 0xd3, 0x40,
0x14, 0xb6, 0x93, 0xd2, 0xd0, 0x8b, 0x94, 0xd2, 0x53, 0x84, 0x12, 0xb7, 0xb2, 0x23, 0xa3, 0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// 593 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x31, 0x6f, 0xd3, 0x40,
0x14, 0xb6, 0x93, 0xd2, 0xb4, 0x17, 0xa9, 0xa5, 0xa7, 0x08, 0x25, 0x4e, 0x65, 0x47, 0x46, 0x45,
0x59, 0x62, 0xd3, 0xb0, 0x15, 0x09, 0x09, 0x17, 0x21, 0x40, 0x8a, 0x04, 0xae, 0xc4, 0xc0, 0x12,
0xd9, 0x8e, 0x6b, 0x2c, 0x12, 0x3f, 0x2b, 0x77, 0x8e, 0x9a, 0x8d, 0x11, 0x31, 0x00, 0x23, 0x63,
0x66, 0x66, 0x16, 0xfe, 0x41, 0xc5, 0xd4, 0x91, 0x01, 0x05, 0x94, 0x2c, 0xc0, 0xd8, 0x5f, 0x80,
0xec, 0xbb, 0x4b, 0xab, 0x26, 0x8d, 0x40, 0xea, 0x94, 0xbc, 0xf7, 0xdd, 0xf7, 0xe9, 0xbe, 0xef,
0x3d, 0x1f, 0xaa, 0x7a, 0x40, 0x7a, 0x40, 0xcc, 0x00, 0x06, 0xe6, 0x60, 0xd7, 0xf5, 0xa9, 0xb3,
0x6b, 0xd2, 0x23, 0x23, 0xee, 0x03, 0x05, 0x8c, 0x19, 0x68, 0x04, 0x30, 0x30, 0x38, 0xa8, 0xa8,
0x9c, 0xe0, 0x3a, 0xc4, 0x9f, 0x31, 0x3c, 0x08, 0x23, 0xc6, 0x51, 0xb6, 0x17, 0x08, 0xa6, 0x7c,
0x86, 0x56, 0x18, 0xda, 0xce, 0x2a, 0x93, 0xcb, 0x33, 0xa8, 0x14, 0x40, 0x00, 0xac, 0x9f, 0xfe,
0x13, 0x84, 0x00, 0x20, 0xe8, 0xfa, 0x66, 0x56, 0xb9, 0xc9, 0xa1, 0xe9, 0x44, 0x43, 0x06, 0xe9,
0xef, 0x73, 0x68, 0xab, 0x45, 0x82, 0x83, 0xc4, 0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 0xfe, 0x30, 0x55, 0xa5, 0x93, 0xa9,
0x2a, 0x7d, 0x9b, 0xaa, 0xd2, 0x8b, 0xe5, 0x03, 0x38, 0xca, 0x1e, 0xbc, 0x6c, 0x0c, 0xee, 0x6a,
0xf6, 0xd2, 0xdc, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x2c, 0x84, 0x48, 0x5c, 0x05, 0x00,
0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -583,10 +584,19 @@ func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.Option != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.Option))
i--
dAtA[i] = 0x18
if len(m.SubVotes) > 0 {
for iNdEx := len(m.SubVotes) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.SubVotes[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)
@ -757,8 +767,11 @@ func (m *MsgVote) Size() (n int) {
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
if m.Option != 0 {
n += 1 + sovTx(uint64(m.Option))
if len(m.SubVotes) > 0 {
for _, e := range m.SubVotes {
l = e.Size()
n += 1 + l + sovTx(uint64(l))
}
}
return n
}
@ -1117,10 +1130,10 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error {
m.Voter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType)
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SubVotes", wireType)
}
m.Option = 0
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
@ -1130,11 +1143,26 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.Option |= VoteOption(b&0x7F) << shift
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.SubVotes = append(m.SubVotes, SubVote{})
if err := m.SubVotes[len(m.SubVotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTx(dAtA[iNdEx:])

View File

@ -1,6 +1,7 @@
package types
import (
"encoding/json"
"fmt"
yaml "gopkg.in/yaml.v2"
@ -10,8 +11,8 @@ import (
// NewVote creates a new Vote instance
//nolint:interfacer
func NewVote(proposalID uint64, voter sdk.AccAddress, option VoteOption) Vote {
return Vote{proposalID, voter.String(), option}
func NewVote(proposalID uint64, voter sdk.AccAddress, subvotes []SubVote) Vote {
return Vote{proposalID, voter.String(), subvotes}
}
func (v Vote) String() string {
@ -43,7 +44,7 @@ func (v Votes) String() string {
}
out := fmt.Sprintf("Votes for Proposal %d:", v[0].ProposalId)
for _, vot := range v {
out += fmt.Sprintf("\n %s: %s", vot.Voter, vot.Option)
out += fmt.Sprintf("\n %s: %s", vot.Voter, vot.SubVotes)
}
return out
}
@ -53,6 +54,25 @@ func (v Vote) Empty() bool {
return v.String() == Vote{}.String()
}
// NewSubVote creates a new Vote instance
//nolint:interfacer
func NewSubVote(option VoteOption, rate int64) SubVote {
return SubVote{option, sdk.NewDec(rate)}
}
func (v SubVote) String() string {
out, _ := json.Marshal(v)
return string(out)
}
// ValidSubVote returns true if the sub vote is valid and false otherwise.
func ValidSubVote(subvote SubVote) bool {
if !subvote.Rate.IsPositive() {
return false
}
return ValidVoteOption(subvote.Option)
}
// VoteOptionFromString returns a VoteOption from a string. It returns an error
// if the string is invalid.
func VoteOptionFromString(str string) (VoteOption, error) {