From e8155d67d0f8d1f2e6eb5b9e8fb95b8e58e6acd6 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 28 Jan 2020 16:30:28 -0500 Subject: [PATCH 01/31] Simple refactoring of gov to use protobuf for store encoding (for everything besides proposal) --- simapp/app.go | 3 +- x/gov/keeper/deposit.go | 2 +- x/gov/keeper/keeper.go | 5 +- x/gov/keeper/proposal.go | 15 +- x/gov/keeper/test_common.go | 2 +- x/gov/keeper/vote.go | 2 +- x/gov/types/codec.go | 25 + x/gov/types/codec.pb.go | 3412 +++++++++++++++++++++++++++++++++++ x/gov/types/codec.proto | 131 ++ x/gov/types/deposit.go | 7 - x/gov/types/msgs.go | 14 - x/gov/types/proposal.go | 19 - x/gov/types/tally.go | 8 - x/gov/types/vote.go | 19 - 14 files changed, 3587 insertions(+), 77 deletions(-) create mode 100644 x/gov/types/codec.pb.go create mode 100644 x/gov/types/codec.proto diff --git a/simapp/app.go b/simapp/app.go index e7253c9a7..f8919cc99 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -1,6 +1,7 @@ package simapp import ( + "github.com/cosmos/cosmos-sdk/x/gov/types" "io" "os" @@ -207,7 +208,7 @@ func NewSimApp( AddRoute(distr.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgrade.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) app.GovKeeper = gov.NewKeeper( - app.cdc, keys[gov.StoreKey], app.subspaces[gov.ModuleName], app.SupplyKeeper, + types.NewAminoGovCodec(app.cdc), keys[gov.StoreKey], app.subspaces[gov.ModuleName], app.SupplyKeeper, &stakingKeeper, govRouter, ) diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 423679998..910ba4b8d 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -23,7 +23,7 @@ func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAdd // SetDeposit sets a Deposit to the gov store func (keeper Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit) { store := ctx.KVStore(keeper.storeKey) - bz := keeper.cdc.MustMarshalBinaryLengthPrefixed(deposit) + bz := keeper.cdc.MustMarshalBinaryLengthPrefixed(&deposit) store.Set(types.DepositKey(deposit.ProposalID, deposit.Depositor), bz) } diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 7a51e6e2b..0904a4ea2 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -4,7 +4,6 @@ import ( "fmt" "time" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/supply/exported" @@ -27,7 +26,7 @@ type Keeper struct { storeKey sdk.StoreKey // The codec codec for binary encoding/decoding. - cdc *codec.Codec + cdc types.GovCodec // Proposal router router types.Router @@ -41,7 +40,7 @@ type Keeper struct { // // CONTRACT: the parameter Subspace must have the param key table already initialized func NewKeeper( - cdc *codec.Codec, key sdk.StoreKey, paramSpace types.ParamSubspace, + cdc types.GovCodec, key sdk.StoreKey, paramSpace types.ParamSubspace, supplyKeeper types.SupplyKeeper, sk types.StakingKeeper, rtr types.Router, ) Keeper { diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index c5d569314..5f795b62d 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -55,14 +55,20 @@ func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (proposal t if bz == nil { return } - keeper.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &proposal) + err := keeper.cdc.UnmarshalProposal(bz, &proposal) + if err != nil { + panic(err) + } return proposal, true } // SetProposal set a proposal to store func (keeper Keeper) SetProposal(ctx sdk.Context, proposal types.Proposal) { store := ctx.KVStore(keeper.storeKey) - bz := keeper.cdc.MustMarshalBinaryLengthPrefixed(proposal) + bz, err := keeper.cdc.MarshalProposal(proposal) + if err != nil { + panic(err) + } store.Set(types.ProposalKey(proposal.ProposalID), bz) } @@ -86,7 +92,10 @@ func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Pr defer iterator.Close() for ; iterator.Valid(); iterator.Next() { var proposal types.Proposal - keeper.cdc.MustUnmarshalBinaryLengthPrefixed(iterator.Value(), &proposal) + err := keeper.cdc.UnmarshalProposal(iterator.Value(), &proposal) + if err != nil { + panic(err) + } if cb(proposal) { break diff --git a/x/gov/keeper/test_common.go b/x/gov/keeper/test_common.go index 84df63afb..983df0579 100644 --- a/x/gov/keeper/test_common.go +++ b/x/gov/keeper/test_common.go @@ -161,7 +161,7 @@ func createTestInput( AddRoute(types.RouterKey, types.ProposalHandler) keeper := NewKeeper( - cdc, keyGov, pk.Subspace(types.DefaultParamspace).WithKeyTable(types.ParamKeyTable()), supplyKeeper, sk, rtr, + types.NewAminoGovCodec(cdc), keyGov, pk.Subspace(types.DefaultParamspace).WithKeyTable(types.ParamKeyTable()), supplyKeeper, sk, rtr, ) keeper.SetProposalID(ctx, types.DefaultStartingProposalID) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 309446714..819130e64 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -69,7 +69,7 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A // SetVote sets a Vote to the gov store func (keeper Keeper) SetVote(ctx sdk.Context, vote types.Vote) { store := ctx.KVStore(keeper.storeKey) - bz := keeper.cdc.MustMarshalBinaryLengthPrefixed(vote) + bz := keeper.cdc.MustMarshalBinaryLengthPrefixed(&vote) store.Set(types.VoteKey(vote.ProposalID, vote.Voter), bz) } diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index fc3de0e3f..ff7ad8a77 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -30,3 +30,28 @@ func RegisterProposalTypeCodec(o interface{}, name string) { func init() { RegisterCodec(ModuleCdc) } + +type GovCodec interface { + codec.Marshaler + MarshalProposal(p Proposal) ([]byte, error) + UnmarshalProposal(bz []byte, ptr *Proposal) error +} + +type AminoGovCodec struct { + codec.Marshaler + amino *codec.Codec +} + +func NewAminoGovCodec(amino *codec.Codec) AminoGovCodec { + return AminoGovCodec{Marshaler: codec.NewHybridCodec(amino), amino: amino} +} + +func (a AminoGovCodec) MarshalProposal(p Proposal) ([]byte, error) { + return a.amino.MarshalBinaryBare(p) +} + +func (a AminoGovCodec) UnmarshalProposal(bz []byte, ptr *Proposal) error { + return a.amino.UnmarshalBinaryBare(bz, ptr) +} + +var _ GovCodec = AminoGovCodec{} diff --git a/x/gov/types/codec.pb.go b/x/gov/types/codec.pb.go new file mode 100644 index 000000000..be21d7f2c --- /dev/null +++ b/x/gov/types/codec.pb.go @@ -0,0 +1,3412 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: x/gov/types/codec.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/regen-network/cosmos-proto" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + 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 defines a vote option +type VoteOption int32 + +const ( + OptionEmpty VoteOption = 0 + OptionYes VoteOption = 1 + OptionAbstain VoteOption = 2 + OptionNo VoteOption = 3 + OptionNoWithVeto VoteOption = 4 +) + +var VoteOption_name = map[int32]string{ + 0: "EMPTY", + 1: "YES", + 2: "ABSTAIN", + 3: "NO", + 4: "NO_WITH_VETO", +} + +var VoteOption_value = map[string]int32{ + "EMPTY": 0, + "YES": 1, + "ABSTAIN": 2, + "NO": 3, + "NO_WITH_VETO": 4, +} + +func (VoteOption) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_4ed4b2a5a30fa918, []int{0} +} + +// ProposalStatus is a type alias that represents a proposal status as a byte +type ProposalStatus int32 + +const ( + StatusNil ProposalStatus = 0 + StatusDepositPeriod ProposalStatus = 1 + StatusVotingPeriod ProposalStatus = 2 + StatusPassed ProposalStatus = 3 + StatusRejected ProposalStatus = 4 + StatusFailed ProposalStatus = 5 +) + +var ProposalStatus_name = map[int32]string{ + 0: "NIL", + 1: "DEPOSIT_PERIOD", + 2: "VOTING_PERIOD", + 3: "PASSED", + 4: "REJECTED", + 5: "FAILED", +} + +var ProposalStatus_value = map[string]int32{ + "NIL": 0, + "DEPOSIT_PERIOD": 1, + "VOTING_PERIOD": 2, + "PASSED": 3, + "REJECTED": 4, + "FAILED": 5, +} + +func (ProposalStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_4ed4b2a5a30fa918, []int{1} +} + +type MsgCommon struct { + // Types that are valid to be assigned to Sum: + // *MsgCommon_GovDeposit + // *MsgCommon_GovVote + Sum isMsgCommon_Sum `protobuf_oneof:"sum"` +} + +func (m *MsgCommon) Reset() { *m = MsgCommon{} } +func (*MsgCommon) ProtoMessage() {} +func (*MsgCommon) Descriptor() ([]byte, []int) { + return fileDescriptor_4ed4b2a5a30fa918, []int{0} +} +func (m *MsgCommon) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCommon) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCommon.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 *MsgCommon) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCommon.Merge(m, src) +} +func (m *MsgCommon) XXX_Size() int { + return m.Size() +} +func (m *MsgCommon) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCommon.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCommon proto.InternalMessageInfo + +type isMsgCommon_Sum interface { + isMsgCommon_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgCommon_GovDeposit struct { + GovDeposit *MsgDeposit `protobuf:"bytes,1,opt,name=gov_deposit,json=govDeposit,proto3,oneof" json:"gov_deposit,omitempty"` +} +type MsgCommon_GovVote struct { + GovVote *MsgVote `protobuf:"bytes,2,opt,name=gov_vote,json=govVote,proto3,oneof" json:"gov_vote,omitempty"` +} + +func (*MsgCommon_GovDeposit) isMsgCommon_Sum() {} +func (*MsgCommon_GovVote) isMsgCommon_Sum() {} + +func (m *MsgCommon) GetSum() isMsgCommon_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *MsgCommon) GetGovDeposit() *MsgDeposit { + if x, ok := m.GetSum().(*MsgCommon_GovDeposit); ok { + return x.GovDeposit + } + return nil +} + +func (m *MsgCommon) GetGovVote() *MsgVote { + if x, ok := m.GetSum().(*MsgCommon_GovVote); ok { + return x.GovVote + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgCommon) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgCommon_GovDeposit)(nil), + (*MsgCommon_GovVote)(nil), + } +} + +type MsgSubmitProposalBase struct { + IntialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=intial_deposit,json=intialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"intial_deposit" yaml:"initial_deposit"` + Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty"` +} + +func (m *MsgSubmitProposalBase) Reset() { *m = MsgSubmitProposalBase{} } +func (*MsgSubmitProposalBase) ProtoMessage() {} +func (*MsgSubmitProposalBase) Descriptor() ([]byte, []int) { + return fileDescriptor_4ed4b2a5a30fa918, []int{1} +} +func (m *MsgSubmitProposalBase) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitProposalBase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitProposalBase.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 *MsgSubmitProposalBase) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitProposalBase.Merge(m, src) +} +func (m *MsgSubmitProposalBase) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitProposalBase) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitProposalBase.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitProposalBase 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" yaml:"proposal_id"` + Depositor github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=depositor,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"depositor,omitempty"` + 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_4ed4b2a5a30fa918, []int{2} +} +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 + +// 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 github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=voter,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"voter,omitempty"` + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos_sdk.x.gov.v1.VoteOption" json:"option,omitempty"` +} + +func (m *MsgVote) Reset() { *m = MsgVote{} } +func (*MsgVote) ProtoMessage() {} +func (*MsgVote) Descriptor() ([]byte, []int) { + return fileDescriptor_4ed4b2a5a30fa918, []int{3} +} +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 + +// 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_4ed4b2a5a30fa918, []int{4} +} +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 github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=depositor,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"depositor,omitempty"` + 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_4ed4b2a5a30fa918, []int{5} +} +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 + +type ProposalBase struct { + ProposalID uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` + Status ProposalStatus `protobuf:"varint,2,opt,name=status,proto3,enum=cosmos_sdk.x.gov.v1.ProposalStatus" json:"status,omitempty"` + FinalTallyResult TallyResult `protobuf:"bytes,3,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"` + SubmitTime time.Time `protobuf:"bytes,4,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time"` + DepositEndTime time.Time `protobuf:"bytes,5,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time"` + TotalDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=total_deposit,json=totalDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total_deposit"` + VotingStartTime time.Time `protobuf:"bytes,7,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time"` + VotingEndTime time.Time `protobuf:"bytes,8,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time"` +} + +func (m *ProposalBase) Reset() { *m = ProposalBase{} } +func (m *ProposalBase) String() string { return proto.CompactTextString(m) } +func (*ProposalBase) ProtoMessage() {} +func (*ProposalBase) Descriptor() ([]byte, []int) { + return fileDescriptor_4ed4b2a5a30fa918, []int{6} +} +func (m *ProposalBase) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalBase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalBase.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 *ProposalBase) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalBase.Merge(m, src) +} +func (m *ProposalBase) XXX_Size() int { + return m.Size() +} +func (m *ProposalBase) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalBase.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalBase proto.InternalMessageInfo + +// TallyResult defines a standard tally for a 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_4ed4b2a5a30fa918, []int{7} +} +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 + +type Vote struct { + ProposalID uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` + Voter github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=voter,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"voter,omitempty"` + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos_sdk.x.gov.v1.VoteOption" json:"option,omitempty"` +} + +func (m *Vote) Reset() { *m = Vote{} } +func (*Vote) ProtoMessage() {} +func (*Vote) Descriptor() ([]byte, []int) { + return fileDescriptor_4ed4b2a5a30fa918, []int{8} +} +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 + +type BasicProposal struct { + *ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base,omitempty"` + Content *BasicContent `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` +} + +func (m *BasicProposal) Reset() { *m = BasicProposal{} } +func (*BasicProposal) ProtoMessage() {} +func (*BasicProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_4ed4b2a5a30fa918, []int{9} +} +func (m *BasicProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BasicProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BasicProposal.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 *BasicProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasicProposal.Merge(m, src) +} +func (m *BasicProposal) XXX_Size() int { + return m.Size() +} +func (m *BasicProposal) XXX_DiscardUnknown() { + xxx_messageInfo_BasicProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_BasicProposal proto.InternalMessageInfo + +type BasicContent struct { + // Types that are valid to be assigned to Sum: + // *BasicContent_Text + Sum isBasicContent_Sum `protobuf_oneof:"sum"` +} + +func (m *BasicContent) Reset() { *m = BasicContent{} } +func (*BasicContent) ProtoMessage() {} +func (*BasicContent) Descriptor() ([]byte, []int) { + return fileDescriptor_4ed4b2a5a30fa918, []int{10} +} +func (m *BasicContent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BasicContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BasicContent.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 *BasicContent) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasicContent.Merge(m, src) +} +func (m *BasicContent) XXX_Size() int { + return m.Size() +} +func (m *BasicContent) XXX_DiscardUnknown() { + xxx_messageInfo_BasicContent.DiscardUnknown(m) +} + +var xxx_messageInfo_BasicContent proto.InternalMessageInfo + +type isBasicContent_Sum interface { + isBasicContent_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type BasicContent_Text struct { + Text *TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"` +} + +func (*BasicContent_Text) isBasicContent_Sum() {} + +func (m *BasicContent) GetSum() isBasicContent_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *BasicContent) GetText() *TextProposal { + if x, ok := m.GetSum().(*BasicContent_Text); ok { + return x.Text + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*BasicContent) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*BasicContent_Text)(nil), + } +} + +func init() { + proto.RegisterEnum("cosmos_sdk.x.gov.v1.VoteOption", VoteOption_name, VoteOption_value) + proto.RegisterEnum("cosmos_sdk.x.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) + proto.RegisterType((*MsgCommon)(nil), "cosmos_sdk.x.gov.v1.MsgCommon") + proto.RegisterType((*MsgSubmitProposalBase)(nil), "cosmos_sdk.x.gov.v1.MsgSubmitProposalBase") + proto.RegisterType((*MsgDeposit)(nil), "cosmos_sdk.x.gov.v1.MsgDeposit") + proto.RegisterType((*MsgVote)(nil), "cosmos_sdk.x.gov.v1.MsgVote") + proto.RegisterType((*TextProposal)(nil), "cosmos_sdk.x.gov.v1.TextProposal") + proto.RegisterType((*Deposit)(nil), "cosmos_sdk.x.gov.v1.Deposit") + proto.RegisterType((*ProposalBase)(nil), "cosmos_sdk.x.gov.v1.ProposalBase") + proto.RegisterType((*TallyResult)(nil), "cosmos_sdk.x.gov.v1.TallyResult") + proto.RegisterType((*Vote)(nil), "cosmos_sdk.x.gov.v1.Vote") + proto.RegisterType((*BasicProposal)(nil), "cosmos_sdk.x.gov.v1.BasicProposal") + proto.RegisterType((*BasicContent)(nil), "cosmos_sdk.x.gov.v1.BasicContent") +} + +func init() { proto.RegisterFile("x/gov/types/codec.proto", fileDescriptor_4ed4b2a5a30fa918) } + +var fileDescriptor_4ed4b2a5a30fa918 = []byte{ + // 1279 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcf, 0x6b, 0x1b, 0xc7, + 0x17, 0xdf, 0x95, 0x64, 0xcb, 0x7e, 0xfa, 0x91, 0xcd, 0x38, 0xdf, 0xc4, 0x2c, 0x41, 0xbb, 0x5f, + 0xb5, 0x04, 0x37, 0x21, 0x72, 0xe3, 0x1c, 0x42, 0x1d, 0x28, 0xd5, 0x5a, 0x9b, 0x58, 0x21, 0x96, + 0xc4, 0x4a, 0x38, 0xa4, 0x50, 0x96, 0xb5, 0x76, 0xb3, 0xde, 0x44, 0xda, 0x11, 0x9a, 0x91, 0x6a, + 0xdf, 0x72, 0x2a, 0xad, 0x4e, 0xa1, 0x50, 0xe8, 0x45, 0x10, 0x68, 0x0e, 0xa1, 0xf4, 0xd0, 0x43, + 0xff, 0x81, 0xf6, 0x14, 0x7a, 0x69, 0x8e, 0xa1, 0x14, 0xa5, 0x71, 0x6e, 0xa5, 0xa7, 0x40, 0x2f, + 0x3d, 0x95, 0x9d, 0xd9, 0x8d, 0xd7, 0xd4, 0x09, 0x11, 0x49, 0x29, 0xf4, 0x62, 0x34, 0x33, 0x9f, + 0xcf, 0x67, 0xdf, 0xfb, 0xcc, 0xdb, 0xf7, 0xd6, 0x70, 0x62, 0x67, 0xd9, 0xc5, 0xc3, 0x65, 0xba, + 0xdb, 0x73, 0xc8, 0x72, 0x1b, 0xdb, 0x4e, 0xbb, 0xd4, 0xeb, 0x63, 0x8a, 0xd1, 0x42, 0x1b, 0x93, + 0x2e, 0x26, 0x26, 0xb1, 0x6f, 0x95, 0x76, 0x4a, 0x2e, 0x1e, 0x96, 0x86, 0xe7, 0xe4, 0xa3, 0x1c, + 0xc7, 0xfe, 0x72, 0x9c, 0x7c, 0x8a, 0x6e, 0x7b, 0x7d, 0xdb, 0xec, 0x59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, 0x65, 0x8d, 0xf2, + 0xfc, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xd5, 0x14, 0x59, 0x49, 0x0d, 0x00, 0x00, +} + +type ProposalBaseFace interface { + Proto() github_com_gogo_protobuf_proto.Message + GetProposalID() uint64 + GetStatus() ProposalStatus + GetFinalTallyResult() TallyResult + GetSubmitTime() time.Time + GetDepositEndTime() time.Time + GetTotalDeposit() github_com_cosmos_cosmos_sdk_types.Coins + GetVotingStartTime() time.Time + GetVotingEndTime() time.Time +} + +func (this *ProposalBase) Proto() github_com_gogo_protobuf_proto.Message { + return this +} + +func (this *ProposalBase) TestProto() github_com_gogo_protobuf_proto.Message { + return NewProposalBaseFromFace(this) +} + +func (this *ProposalBase) GetProposalID() uint64 { + return this.ProposalID +} + +func (this *ProposalBase) GetStatus() ProposalStatus { + return this.Status +} + +func (this *ProposalBase) GetFinalTallyResult() TallyResult { + return this.FinalTallyResult +} + +func (this *ProposalBase) GetSubmitTime() time.Time { + return this.SubmitTime +} + +func (this *ProposalBase) GetDepositEndTime() time.Time { + return this.DepositEndTime +} + +func (this *ProposalBase) GetTotalDeposit() github_com_cosmos_cosmos_sdk_types.Coins { + return this.TotalDeposit +} + +func (this *ProposalBase) GetVotingStartTime() time.Time { + return this.VotingStartTime +} + +func (this *ProposalBase) GetVotingEndTime() time.Time { + return this.VotingEndTime +} + +func NewProposalBaseFromFace(that ProposalBaseFace) *ProposalBase { + this := &ProposalBase{} + this.ProposalID = that.GetProposalID() + this.Status = that.GetStatus() + this.FinalTallyResult = that.GetFinalTallyResult() + this.SubmitTime = that.GetSubmitTime() + this.DepositEndTime = that.GetDepositEndTime() + this.TotalDeposit = that.GetTotalDeposit() + this.VotingStartTime = that.GetVotingStartTime() + this.VotingEndTime = that.GetVotingEndTime() + return this +} + +func (this *MsgCommon) GetMsg() github_com_cosmos_cosmos_sdk_types.Msg { + if x := this.GetGovDeposit(); x != nil { + return x + } + if x := this.GetGovVote(); x != nil { + return x + } + return nil +} + +func (this *MsgCommon) SetMsg(value github_com_cosmos_cosmos_sdk_types.Msg) error { + if value == nil { + this.Sum = nil + return nil + } + switch vt := value.(type) { + case *MsgDeposit: + this.Sum = &MsgCommon_GovDeposit{vt} + return nil + case MsgDeposit: + this.Sum = &MsgCommon_GovDeposit{&vt} + return nil + case *MsgVote: + this.Sum = &MsgCommon_GovVote{vt} + return nil + case MsgVote: + this.Sum = &MsgCommon_GovVote{&vt} + return nil + } + return fmt.Errorf("can't encode value of type %T as message MsgCommon", value) +} + +func (this *BasicContent) GetContent() Content { + if x := this.GetText(); x != nil { + return x + } + return nil +} + +func (this *BasicContent) SetContent(value Content) error { + if value == nil { + this.Sum = nil + return nil + } + switch vt := value.(type) { + case *TextProposal: + this.Sum = &BasicContent_Text{vt} + return nil + case TextProposal: + this.Sum = &BasicContent_Text{&vt} + return nil + } + return fmt.Errorf("can't encode value of type %T as message BasicContent", value) +} + +func (m *MsgCommon) 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 *MsgCommon) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCommon) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *MsgCommon_GovDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCommon_GovDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.GovDeposit != nil { + { + size, err := m.GovDeposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *MsgCommon_GovVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCommon_GovVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.GovVote != nil { + { + size, err := m.GovVote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *MsgSubmitProposalBase) 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 *MsgSubmitProposalBase) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitProposalBase) 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 = encodeVarintCodec(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x12 + } + if len(m.IntialDeposit) > 0 { + for iNdEx := len(m.IntialDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IntialDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + 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 = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintCodec(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalID != 0 { + i = encodeVarintCodec(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 = encodeVarintCodec(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x18 + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintCodec(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalID != 0 { + i = encodeVarintCodec(dAtA, i, uint64(m.ProposalID)) + 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 = encodeVarintCodec(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 = encodeVarintCodec(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 = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintCodec(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalID != 0 { + i = encodeVarintCodec(dAtA, i, uint64(m.ProposalID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProposalBase) 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 *ProposalBase) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.VotingEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingEndTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintCodec(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x42 + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.VotingStartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingStartTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintCodec(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + 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 = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.DepositEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.DepositEndTime):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintCodec(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x2a + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.SubmitTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintCodec(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x22 + { + size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Status != 0 { + i = encodeVarintCodec(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if m.ProposalID != 0 { + i = encodeVarintCodec(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 = encodeVarintCodec(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 = encodeVarintCodec(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 = encodeVarintCodec(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 = encodeVarintCodec(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 m.Option != 0 { + i = encodeVarintCodec(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x18 + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintCodec(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalID != 0 { + i = encodeVarintCodec(dAtA, i, uint64(m.ProposalID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BasicProposal) 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 *BasicProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasicProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Content != nil { + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ProposalBase != nil { + { + size, err := m.ProposalBase.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BasicContent) 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 *BasicContent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasicContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *BasicContent_Text) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasicContent_Text) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Text != nil { + { + size, err := m.Text.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func encodeVarintCodec(dAtA []byte, offset int, v uint64) int { + offset -= sovCodec(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCommon) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *MsgCommon_GovDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GovDeposit != nil { + l = m.GovDeposit.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} +func (m *MsgCommon_GovVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GovVote != nil { + l = m.GovVote.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} +func (m *MsgSubmitProposalBase) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.IntialDeposit) > 0 { + for _, e := range m.IntialDeposit { + l = e.Size() + n += 1 + l + sovCodec(uint64(l)) + } + } + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *MsgDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalID != 0 { + n += 1 + sovCodec(uint64(m.ProposalID)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovCodec(uint64(l)) + } + } + return n +} + +func (m *MsgVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalID != 0 { + n += 1 + sovCodec(uint64(m.ProposalID)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + if m.Option != 0 { + n += 1 + sovCodec(uint64(m.Option)) + } + 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 + sovCodec(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovCodec(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 + sovCodec(uint64(m.ProposalID)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovCodec(uint64(l)) + } + } + return n +} + +func (m *ProposalBase) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalID != 0 { + n += 1 + sovCodec(uint64(m.ProposalID)) + } + if m.Status != 0 { + n += 1 + sovCodec(uint64(m.Status)) + } + l = m.FinalTallyResult.Size() + n += 1 + l + sovCodec(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime) + n += 1 + l + sovCodec(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.DepositEndTime) + n += 1 + l + sovCodec(uint64(l)) + if len(m.TotalDeposit) > 0 { + for _, e := range m.TotalDeposit { + l = e.Size() + n += 1 + l + sovCodec(uint64(l)) + } + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingStartTime) + n += 1 + l + sovCodec(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingEndTime) + n += 1 + l + sovCodec(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 + sovCodec(uint64(l)) + l = m.Abstain.Size() + n += 1 + l + sovCodec(uint64(l)) + l = m.No.Size() + n += 1 + l + sovCodec(uint64(l)) + l = m.NoWithVeto.Size() + n += 1 + l + sovCodec(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 + sovCodec(uint64(m.ProposalID)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovCodec(uint64(l)) + } + if m.Option != 0 { + n += 1 + sovCodec(uint64(m.Option)) + } + return n +} + +func (m *BasicProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalBase != nil { + l = m.ProposalBase.Size() + n += 1 + l + sovCodec(uint64(l)) + } + if m.Content != nil { + l = m.Content.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func (m *BasicContent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *BasicContent_Text) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Text != nil { + l = m.Text.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + +func sovCodec(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCodec(x uint64) (n int) { + return sovCodec(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *MsgCommon) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&MsgCommon{`, + `Sum:` + fmt.Sprintf("%v", this.Sum) + `,`, + `}`, + }, "") + return s +} +func (this *MsgCommon_GovDeposit) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&MsgCommon_GovDeposit{`, + `GovDeposit:` + strings.Replace(fmt.Sprintf("%v", this.GovDeposit), "MsgDeposit", "MsgDeposit", 1) + `,`, + `}`, + }, "") + return s +} +func (this *MsgCommon_GovVote) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&MsgCommon_GovVote{`, + `GovVote:` + strings.Replace(fmt.Sprintf("%v", this.GovVote), "MsgVote", "MsgVote", 1) + `,`, + `}`, + }, "") + return s +} +func (this *MsgSubmitProposalBase) String() string { + if this == nil { + return "nil" + } + repeatedStringForIntialDeposit := "[]Coin{" + for _, f := range this.IntialDeposit { + repeatedStringForIntialDeposit += fmt.Sprintf("%v", f) + "," + } + repeatedStringForIntialDeposit += "}" + s := strings.Join([]string{`&MsgSubmitProposalBase{`, + `IntialDeposit:` + repeatedStringForIntialDeposit + `,`, + `Proposer:` + fmt.Sprintf("%v", this.Proposer) + `,`, + `}`, + }, "") + return s +} +func (this *BasicContent) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BasicContent{`, + `Sum:` + fmt.Sprintf("%v", this.Sum) + `,`, + `}`, + }, "") + return s +} +func (this *BasicContent_Text) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BasicContent_Text{`, + `Text:` + strings.Replace(fmt.Sprintf("%v", this.Text), "TextProposal", "TextProposal", 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringCodec(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *MsgCommon) 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 ErrIntOverflowCodec + } + 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: MsgCommon: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCommon: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgDeposit{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &MsgCommon_GovDeposit{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovVote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &MsgVote{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &MsgCommon_GovVote{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitProposalBase) 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 ErrIntOverflowCodec + } + 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: MsgSubmitProposalBase: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposalBase: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IntialDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IntialDeposit = append(m.IntialDeposit, types.Coin{}) + if err := m.IntialDeposit[len(m.IntialDeposit)-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 Proposer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposer = append(m.Proposer[:0], dAtA[iNdEx:postIndex]...) + if m.Proposer == nil { + m.Proposer = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + 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 ErrIntOverflowCodec + } + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Depositor = append(m.Depositor[:0], dAtA[iNdEx:postIndex]...) + if m.Depositor == nil { + m.Depositor = []byte{} + } + iNdEx = postIndex + case 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + 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 ErrIntOverflowCodec + } + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = append(m.Voter[:0], dAtA[iNdEx:postIndex]...) + if m.Voter == nil { + m.Voter = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 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 ErrIntOverflowCodec + } + 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 := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + 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 ErrIntOverflowCodec + } + 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 ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 ErrIntOverflowCodec + } + 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 ErrInvalidLengthCodec + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + 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 ErrIntOverflowCodec + } + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Depositor = append(m.Depositor[:0], dAtA[iNdEx:postIndex]...) + if m.Depositor == nil { + m.Depositor = []byte{} + } + iNdEx = postIndex + case 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposalBase) 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 ErrIntOverflowCodec + } + 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: ProposalBase: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposalBase: 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= ProposalStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FinalTallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 5: + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 6: + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 7: + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 8: + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + 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 ErrIntOverflowCodec + } + 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 byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + 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 := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + 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 ErrIntOverflowCodec + } + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = append(m.Voter[:0], dAtA[iNdEx:postIndex]...) + if m.Voter == nil { + m.Voter = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 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 ErrIntOverflowCodec + } + 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 := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BasicProposal) 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 ErrIntOverflowCodec + } + 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: BasicProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasicProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalBase", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProposalBase == nil { + m.ProposalBase = &ProposalBase{} + } + if err := m.ProposalBase.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Content == nil { + m.Content = &BasicContent{} + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BasicContent) 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 ErrIntOverflowCodec + } + 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: BasicContent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasicContent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TextProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &BasicContent_Text{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCodec(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, ErrIntOverflowCodec + } + 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, ErrIntOverflowCodec + } + 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, ErrIntOverflowCodec + } + 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, ErrInvalidLengthCodec + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCodec + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCodec + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCodec = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCodec = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/gov/types/codec.proto b/x/gov/types/codec.proto new file mode 100644 index 000000000..8d2dd42ac --- /dev/null +++ b/x/gov/types/codec.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; +package cosmos_sdk.x.gov.v1; + +import "types/types.proto"; +import "third_party/proto/gogoproto/gogo.proto"; +import "third_party/proto/cosmos-proto/cosmos.proto"; +import "google/protobuf/timestamp.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; + +message MsgCommon { + option (cosmos_proto.interface_type) = "github.com/cosmos/cosmos-sdk/types.Msg"; + option (gogoproto.stringer) = true; + oneof sum { + MsgDeposit gov_deposit = 1; + MsgVote gov_vote = 2; + } +} + +message MsgSubmitProposalBase { + option (gogoproto.stringer) = true; + repeated cosmos_sdk.v1.Coin intial_deposit = 1 [(gogoproto.nullable) = false + ,(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ,(gogoproto.moretags) = "yaml:\"initial_deposit\""]; + bytes proposer = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; +} + +// MsgDeposit defines a message to submit a deposit to an existing proposal +message MsgDeposit { + uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" + ,(gogoproto.moretags) = "yaml:\"proposal_id\"" + ,(gogoproto.jsontag) = "proposal_id"]; + bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + repeated cosmos_sdk.v1.Coin amount = 3 [(gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// VoteOption defines a vote option +enum VoteOption { + option (gogoproto.enum_stringer) = false; + option (gogoproto.goproto_enum_stringer) = false; + option (gogoproto.goproto_enum_prefix) = false; + EMPTY = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; + YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; + ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; + NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; + NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; +} + +// MsgVote defines a message to cast a vote +message MsgVote { + uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" + ,(gogoproto.moretags) = "yaml:\"proposal_id\"" + ,(gogoproto.jsontag) = "proposal_id"]; + bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + VoteOption option = 3; +} + +// TextProposal defines a standard text proposal whose changes need to be +// manually updated in case of approval +message TextProposal { + string title = 1; + string description = 2; +} + +// Deposit defines an amount deposited by an account address to an active proposal +message Deposit { + uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" + ,(gogoproto.moretags) = "yaml:\"proposal_id\""]; + bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + repeated cosmos_sdk.v1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +message ProposalBase { + option (gogoproto.goproto_stringer) = true; + option (gogoproto.face) = true; + uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" + ,(gogoproto.moretags) = "yaml:\"proposal_id\""]; + ProposalStatus status = 2; + TallyResult final_tally_result = 3 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp submit_time = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp deposit_end_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + repeated cosmos_sdk.v1.Coin total_deposit = 6 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + google.protobuf.Timestamp voting_start_time = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp voting_end_time = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +// ProposalStatus is a type alias that represents a proposal status as a byte +enum ProposalStatus { + option (gogoproto.enum_stringer) = false; + option (gogoproto.goproto_enum_stringer) = false; + option (gogoproto.goproto_enum_prefix) = false; + NIL = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; + DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; + VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; + PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; + REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; + FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; +} + +// TallyResult defines a standard tally for a proposal +message TallyResult { + bytes yes = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + bytes abstain = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + bytes no = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + bytes no_with_veto = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false + ,(gogoproto.moretags) = "yaml:\"no_with_veto\""]; +} + +message Vote { + uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" + ,(gogoproto.moretags) = "yaml:\"proposal_id\""]; + bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + VoteOption option = 3; +} + +message BasicProposal { + ProposalBase base = 1 [(gogoproto.embed) = true]; + BasicContent content = 2; +} + +message BasicContent { + option (cosmos_proto.interface_type) = "Content"; + option (gogoproto.stringer) = true; + oneof sum { + TextProposal text = 1; + } +} diff --git a/x/gov/types/deposit.go b/x/gov/types/deposit.go index 4d9ff9304..098bc9b2e 100644 --- a/x/gov/types/deposit.go +++ b/x/gov/types/deposit.go @@ -6,13 +6,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// Deposit defines an amount deposited by an account address to an active proposal -type Deposit struct { - ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"` // proposalID of the proposal - Depositor sdk.AccAddress `json:"depositor" yaml:"depositor"` // Address of the depositor - Amount sdk.Coins `json:"amount" yaml:"amount"` // Deposit amount -} - // NewDeposit creates a new Deposit instance func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) Deposit { return Deposit{proposalID, depositor, amount} diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index 882e0c560..56ea7614b 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -75,13 +75,6 @@ func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.Proposer} } -// MsgDeposit defines a message to submit a deposit to an existing proposal -type MsgDeposit struct { - ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"` // ID of the proposal - Depositor sdk.AccAddress `json:"depositor" yaml:"depositor"` // Address of the depositor - Amount sdk.Coins `json:"amount" yaml:"amount"` // Coins to add to the proposal's deposit -} - // NewMsgDeposit creates a new MsgDeposit instance func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) MsgDeposit { return MsgDeposit{proposalID, depositor, amount} @@ -128,13 +121,6 @@ func (msg MsgDeposit) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.Depositor} } -// MsgVote defines a message to cast a vote -type MsgVote struct { - ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"` // ID of the proposal - Voter sdk.AccAddress `json:"voter" yaml:"voter"` // address of the voter - Option VoteOption `json:"option" yaml:"option"` // option from OptionSet chosen by the voter -} - // NewMsgVote creates a message to cast a vote on an active proposal func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) MsgVote { return MsgVote{proposalID, voter, option} diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index 945cf7866..66658cd67 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -79,18 +79,6 @@ type ( // ProposalQueue defines a queue for proposal ids ProposalQueue []uint64 - // ProposalStatus is a type alias that represents a proposal status as a byte - ProposalStatus byte -) - -// Valid Proposal statuses -const ( - StatusNil ProposalStatus = 0x00 - StatusDepositPeriod ProposalStatus = 0x01 - StatusVotingPeriod ProposalStatus = 0x02 - StatusPassed ProposalStatus = 0x03 - StatusRejected ProposalStatus = 0x04 - StatusFailed ProposalStatus = 0x05 ) // ProposalStatusFromString turns a string into a ProposalStatus @@ -205,13 +193,6 @@ const ( ProposalTypeText string = "Text" ) -// TextProposal defines a standard text proposal whose changes need to be -// manually updated in case of approval -type TextProposal struct { - Title string `json:"title" yaml:"title"` - Description string `json:"description" yaml:"description"` -} - // NewTextProposal creates a text proposal Content func NewTextProposal(title, description string) Content { return TextProposal{title, description} diff --git a/x/gov/types/tally.go b/x/gov/types/tally.go index d437816e9..6020abe5b 100644 --- a/x/gov/types/tally.go +++ b/x/gov/types/tally.go @@ -28,14 +28,6 @@ func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens sdk.Int, delegator } } -// TallyResult defines a standard tally for a proposal -type TallyResult struct { - Yes sdk.Int `json:"yes" yaml:"yes"` - Abstain sdk.Int `json:"abstain" yaml:"abstain"` - No sdk.Int `json:"no" yaml:"no"` - NoWithVeto sdk.Int `json:"no_with_veto" yaml:"no_with_veto"` -} - // NewTallyResult creates a new TallyResult instance func NewTallyResult(yes, abstain, no, noWithVeto sdk.Int) TallyResult { return TallyResult{ diff --git a/x/gov/types/vote.go b/x/gov/types/vote.go index ca49fdb6f..f74f27ef2 100644 --- a/x/gov/types/vote.go +++ b/x/gov/types/vote.go @@ -7,13 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// Vote -type Vote struct { - ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"` // proposalID of the proposal - Voter sdk.AccAddress `json:"voter" yaml:"voter"` // address of the voter - Option VoteOption `json:"option" yaml:"option"` // option from OptionSet chosen by the voter -} - // NewVote creates a new Vote instance func NewVote(proposalID uint64, voter sdk.AccAddress, option VoteOption) Vote { return Vote{proposalID, voter, option} @@ -49,18 +42,6 @@ func (v Vote) Empty() bool { return v.Equals(Vote{}) } -// VoteOption defines a vote option -type VoteOption byte - -// Vote options -const ( - OptionEmpty VoteOption = 0x00 - OptionYes VoteOption = 0x01 - OptionAbstain VoteOption = 0x02 - OptionNo VoteOption = 0x03 - OptionNoWithVeto VoteOption = 0x04 -) - // VoteOptionFromString returns a VoteOption from a string. It returns an error // if the string is invalid. func VoteOptionFromString(str string) (VoteOption, error) { From 3919645e8b349b9311bd9c6f68b2b2605c009e4f Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 17 Feb 2020 14:21:07 -0500 Subject: [PATCH 02/31] Rename GovCodec to gov.Codec --- x/gov/keeper/keeper.go | 4 ++-- x/gov/types/codec.go | 16 +++++++++------- x/gov/types/codec.proto | 9 --------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 0904a4ea2..d8983bd41 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -26,7 +26,7 @@ type Keeper struct { storeKey sdk.StoreKey // The codec codec for binary encoding/decoding. - cdc types.GovCodec + cdc types.Codec // Proposal router router types.Router @@ -40,7 +40,7 @@ type Keeper struct { // // CONTRACT: the parameter Subspace must have the param key table already initialized func NewKeeper( - cdc types.GovCodec, key sdk.StoreKey, paramSpace types.ParamSubspace, + cdc types.Codec, key sdk.StoreKey, paramSpace types.ParamSubspace, supplyKeeper types.SupplyKeeper, sk types.StakingKeeper, rtr types.Router, ) Keeper { diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index ff7ad8a77..6e85045dd 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -4,6 +4,14 @@ import ( "github.com/cosmos/cosmos-sdk/codec" ) +type Codec interface { + codec.Marshaler + + MarshalProposal(p Proposal) ([]byte, error) + UnmarshalProposal(bz []byte, ptr *Proposal) error +} + + // module codec var ModuleCdc = codec.New() @@ -31,12 +39,6 @@ func init() { RegisterCodec(ModuleCdc) } -type GovCodec interface { - codec.Marshaler - MarshalProposal(p Proposal) ([]byte, error) - UnmarshalProposal(bz []byte, ptr *Proposal) error -} - type AminoGovCodec struct { codec.Marshaler amino *codec.Codec @@ -54,4 +56,4 @@ func (a AminoGovCodec) UnmarshalProposal(bz []byte, ptr *Proposal) error { return a.amino.UnmarshalBinaryBare(bz, ptr) } -var _ GovCodec = AminoGovCodec{} +var _ Codec = AminoGovCodec{} diff --git a/x/gov/types/codec.proto b/x/gov/types/codec.proto index 8d2dd42ac..0eaa5c60b 100644 --- a/x/gov/types/codec.proto +++ b/x/gov/types/codec.proto @@ -11,15 +11,6 @@ option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = false; option (gogoproto.goproto_getters_all) = false; -message MsgCommon { - option (cosmos_proto.interface_type) = "github.com/cosmos/cosmos-sdk/types.Msg"; - option (gogoproto.stringer) = true; - oneof sum { - MsgDeposit gov_deposit = 1; - MsgVote gov_vote = 2; - } -} - message MsgSubmitProposalBase { option (gogoproto.stringer) = true; repeated cosmos_sdk.v1.Coin intial_deposit = 1 [(gogoproto.nullable) = false From d563248bbbd8919fe9a15e4a245ba8c073295037 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 17 Feb 2020 14:29:24 -0500 Subject: [PATCH 03/31] mv codec.proto -> types.proto --- x/gov/types/{codec.pb.go => types.pb.go} | 990 +++++++---------------- x/gov/types/{codec.proto => types.proto} | 0 2 files changed, 303 insertions(+), 687 deletions(-) rename x/gov/types/{codec.pb.go => types.pb.go} (71%) rename x/gov/types/{codec.proto => types.proto} (100%) diff --git a/x/gov/types/codec.pb.go b/x/gov/types/types.pb.go similarity index 71% rename from x/gov/types/codec.pb.go rename to x/gov/types/types.pb.go index be21d7f2c..3f7a18cce 100644 --- a/x/gov/types/codec.pb.go +++ b/x/gov/types/types.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: x/gov/types/codec.proto +// source: x/gov/types/types.proto package types @@ -61,7 +61,7 @@ var VoteOption_value = map[string]int32{ } func (VoteOption) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{0} + return fileDescriptor_a5ae5e91b5b3fb03, []int{0} } // ProposalStatus is a type alias that represents a proposal status as a byte @@ -95,91 +95,7 @@ var ProposalStatus_value = map[string]int32{ } func (ProposalStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{1} -} - -type MsgCommon struct { - // Types that are valid to be assigned to Sum: - // *MsgCommon_GovDeposit - // *MsgCommon_GovVote - Sum isMsgCommon_Sum `protobuf_oneof:"sum"` -} - -func (m *MsgCommon) Reset() { *m = MsgCommon{} } -func (*MsgCommon) ProtoMessage() {} -func (*MsgCommon) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{0} -} -func (m *MsgCommon) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCommon) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCommon.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 *MsgCommon) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCommon.Merge(m, src) -} -func (m *MsgCommon) XXX_Size() int { - return m.Size() -} -func (m *MsgCommon) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCommon.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCommon proto.InternalMessageInfo - -type isMsgCommon_Sum interface { - isMsgCommon_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type MsgCommon_GovDeposit struct { - GovDeposit *MsgDeposit `protobuf:"bytes,1,opt,name=gov_deposit,json=govDeposit,proto3,oneof" json:"gov_deposit,omitempty"` -} -type MsgCommon_GovVote struct { - GovVote *MsgVote `protobuf:"bytes,2,opt,name=gov_vote,json=govVote,proto3,oneof" json:"gov_vote,omitempty"` -} - -func (*MsgCommon_GovDeposit) isMsgCommon_Sum() {} -func (*MsgCommon_GovVote) isMsgCommon_Sum() {} - -func (m *MsgCommon) GetSum() isMsgCommon_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *MsgCommon) GetGovDeposit() *MsgDeposit { - if x, ok := m.GetSum().(*MsgCommon_GovDeposit); ok { - return x.GovDeposit - } - return nil -} - -func (m *MsgCommon) GetGovVote() *MsgVote { - if x, ok := m.GetSum().(*MsgCommon_GovVote); ok { - return x.GovVote - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MsgCommon) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MsgCommon_GovDeposit)(nil), - (*MsgCommon_GovVote)(nil), - } + return fileDescriptor_a5ae5e91b5b3fb03, []int{1} } type MsgSubmitProposalBase struct { @@ -190,7 +106,7 @@ type MsgSubmitProposalBase struct { func (m *MsgSubmitProposalBase) Reset() { *m = MsgSubmitProposalBase{} } func (*MsgSubmitProposalBase) ProtoMessage() {} func (*MsgSubmitProposalBase) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{1} + return fileDescriptor_a5ae5e91b5b3fb03, []int{0} } func (m *MsgSubmitProposalBase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -229,7 +145,7 @@ type MsgDeposit struct { func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } func (*MsgDeposit) ProtoMessage() {} func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{2} + return fileDescriptor_a5ae5e91b5b3fb03, []int{1} } func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -268,7 +184,7 @@ type MsgVote struct { func (m *MsgVote) Reset() { *m = MsgVote{} } func (*MsgVote) ProtoMessage() {} func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{3} + return fileDescriptor_a5ae5e91b5b3fb03, []int{2} } func (m *MsgVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -307,7 +223,7 @@ type TextProposal struct { func (m *TextProposal) Reset() { *m = TextProposal{} } func (*TextProposal) ProtoMessage() {} func (*TextProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{4} + return fileDescriptor_a5ae5e91b5b3fb03, []int{3} } func (m *TextProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -346,7 +262,7 @@ type Deposit struct { func (m *Deposit) Reset() { *m = Deposit{} } func (*Deposit) ProtoMessage() {} func (*Deposit) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{5} + return fileDescriptor_a5ae5e91b5b3fb03, []int{4} } func (m *Deposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -390,7 +306,7 @@ func (m *ProposalBase) Reset() { *m = ProposalBase{} } func (m *ProposalBase) String() string { return proto.CompactTextString(m) } func (*ProposalBase) ProtoMessage() {} func (*ProposalBase) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{6} + return fileDescriptor_a5ae5e91b5b3fb03, []int{5} } func (m *ProposalBase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -430,7 +346,7 @@ type TallyResult struct { func (m *TallyResult) Reset() { *m = TallyResult{} } func (*TallyResult) ProtoMessage() {} func (*TallyResult) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{7} + return fileDescriptor_a5ae5e91b5b3fb03, []int{6} } func (m *TallyResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -468,7 +384,7 @@ type Vote struct { func (m *Vote) Reset() { *m = Vote{} } func (*Vote) ProtoMessage() {} func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{8} + return fileDescriptor_a5ae5e91b5b3fb03, []int{7} } func (m *Vote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -505,7 +421,7 @@ type BasicProposal struct { func (m *BasicProposal) Reset() { *m = BasicProposal{} } func (*BasicProposal) ProtoMessage() {} func (*BasicProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{9} + return fileDescriptor_a5ae5e91b5b3fb03, []int{8} } func (m *BasicProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -543,7 +459,7 @@ type BasicContent struct { func (m *BasicContent) Reset() { *m = BasicContent{} } func (*BasicContent) ProtoMessage() {} func (*BasicContent) Descriptor() ([]byte, []int) { - return fileDescriptor_4ed4b2a5a30fa918, []int{10} + return fileDescriptor_a5ae5e91b5b3fb03, []int{9} } func (m *BasicContent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -608,7 +524,6 @@ func (*BasicContent) XXX_OneofWrappers() []interface{} { func init() { proto.RegisterEnum("cosmos_sdk.x.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos_sdk.x.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) - proto.RegisterType((*MsgCommon)(nil), "cosmos_sdk.x.gov.v1.MsgCommon") proto.RegisterType((*MsgSubmitProposalBase)(nil), "cosmos_sdk.x.gov.v1.MsgSubmitProposalBase") proto.RegisterType((*MsgDeposit)(nil), "cosmos_sdk.x.gov.v1.MsgDeposit") proto.RegisterType((*MsgVote)(nil), "cosmos_sdk.x.gov.v1.MsgVote") @@ -621,90 +536,86 @@ func init() { proto.RegisterType((*BasicContent)(nil), "cosmos_sdk.x.gov.v1.BasicContent") } -func init() { proto.RegisterFile("x/gov/types/codec.proto", fileDescriptor_4ed4b2a5a30fa918) } +func init() { proto.RegisterFile("x/gov/types/types.proto", fileDescriptor_a5ae5e91b5b3fb03) } -var fileDescriptor_4ed4b2a5a30fa918 = []byte{ - // 1279 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcf, 0x6b, 0x1b, 0xc7, - 0x17, 0xdf, 0x95, 0x64, 0xcb, 0x7e, 0xfa, 0x91, 0xcd, 0x38, 0xdf, 0xc4, 0x2c, 0x41, 0xbb, 0x5f, - 0xb5, 0x04, 0x37, 0x21, 0x72, 0xe3, 0x1c, 0x42, 0x1d, 0x28, 0xd5, 0x5a, 0x9b, 0x58, 0x21, 0x96, - 0xc4, 0x4a, 0x38, 0xa4, 0x50, 0x96, 0xb5, 0x76, 0xb3, 0xde, 0x44, 0xda, 0x11, 0x9a, 0x91, 0x6a, - 0xdf, 0x72, 0x2a, 0xad, 0x4e, 0xa1, 0x50, 0xe8, 0x45, 0x10, 0x68, 0x0e, 0xa1, 0xf4, 0xd0, 0x43, - 0xff, 0x81, 0xf6, 0x14, 0x7a, 0x69, 0x8e, 0xa1, 0x14, 0xa5, 0x71, 0x6e, 0xa5, 0xa7, 0x40, 0x2f, - 0x3d, 0x95, 0x9d, 0xd9, 0x8d, 0xd7, 0xd4, 0x09, 0x11, 0x49, 0x29, 0xf4, 0x62, 0x34, 0x33, 0x9f, - 0xcf, 0x67, 0xdf, 0xfb, 0xcc, 0xdb, 0xf7, 0xd6, 0x70, 0x62, 0x67, 0xd9, 0xc5, 0xc3, 0x65, 0xba, - 0xdb, 0x73, 0xc8, 0x72, 0x1b, 0xdb, 0x4e, 0xbb, 0xd4, 0xeb, 0x63, 0x8a, 0xd1, 0x42, 0x1b, 0x93, - 0x2e, 0x26, 0x26, 0xb1, 0x6f, 0x95, 0x76, 0x4a, 0x2e, 0x1e, 0x96, 0x86, 0xe7, 0xe4, 0xa3, 0x1c, - 0xc7, 0xfe, 0x72, 0x9c, 0x7c, 0x8a, 0x6e, 0x7b, 0x7d, 0xdb, 0xec, 0x59, 0x7d, 0xba, 0xbb, 0xcc, - 0xb6, 0x96, 0x5d, 0x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, 0xff, 0xff, 0xb4, 0xd5, 0x14, 0x59, 0x49, 0x0d, 0x00, 0x00, +var fileDescriptor_a5ae5e91b5b3fb03 = []byte{ + // 1208 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcf, 0x8b, 0xdb, 0x46, + 0x1b, 0x96, 0x6c, 0xef, 0x7a, 0xf3, 0xfa, 0x47, 0x94, 0xd9, 0x7c, 0xc9, 0x22, 0x3e, 0x24, 0xd5, + 0x2d, 0x61, 0x9b, 0x10, 0x6d, 0xb3, 0x39, 0x04, 0x36, 0x50, 0x6a, 0xc5, 0x4a, 0xe2, 0x90, 0xb5, + 0x8d, 0x6c, 0x36, 0xa4, 0x50, 0x84, 0xd6, 0x52, 0xbc, 0x4a, 0x6c, 0x8d, 0xf1, 0x8c, 0xdd, 0xdd, + 0x5b, 0x4e, 0xa5, 0xf5, 0x29, 0x14, 0x0a, 0xbd, 0x18, 0x02, 0xcd, 0x21, 0x94, 0x1e, 0x7a, 0xe8, + 0x5f, 0xd0, 0x53, 0xe8, 0xa5, 0x39, 0x86, 0x52, 0x9c, 0x66, 0x73, 0x2b, 0x3d, 0x05, 0x7a, 0xe9, + 0xa9, 0x68, 0x46, 0xca, 0x6a, 0xc9, 0x26, 0xc4, 0x24, 0xa5, 0xd0, 0xcb, 0xb2, 0x9a, 0x79, 0x9e, + 0x67, 0xde, 0xf7, 0x99, 0x57, 0x8f, 0x76, 0xe1, 0xf8, 0xf6, 0x4a, 0x07, 0x8f, 0x56, 0xe8, 0x4e, + 0xdf, 0x23, 0xfc, 0xa7, 0xde, 0x1f, 0x60, 0x8a, 0xd1, 0x62, 0x1b, 0x93, 0x1e, 0x26, 0x36, 0x71, + 0x6f, 0xe9, 0xdb, 0x7a, 0x07, 0x8f, 0xf4, 0xd1, 0x19, 0xf9, 0xc8, 0x0b, 0x38, 0xf9, 0x04, 0xdd, + 0xf2, 0x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, 0x18, + 0x9b, 0x92, 0x8f, 0x8d, 0x27, 0x1a, 0xe2, 0xd8, 0x0d, 0x16, 0x20, 0x11, 0xf4, 0xff, 0x30, 0xdf, + 0x28, 0x37, 0x9b, 0x66, 0x45, 0x4a, 0xcb, 0xd2, 0x78, 0xa2, 0xe5, 0x39, 0xa6, 0xe1, 0x10, 0xe2, + 0xb9, 0x48, 0x83, 0x05, 0xcb, 0xbc, 0x62, 0x5e, 0x68, 0x99, 0x15, 0x29, 0x23, 0xa3, 0xf1, 0x44, + 0x2b, 0x46, 0x1f, 0x1e, 0xef, 0xa6, 0xd7, 0xa6, 0x1e, 0xe3, 0x5f, 0x2c, 0x57, 0xaf, 0x9a, 0x15, + 0x69, 0x2e, 0xc9, 0xbf, 0xe8, 0xf8, 0x5d, 0xcf, 0xdd, 0xdf, 0xae, 0x51, 0x7b, 0xf0, 0x44, 0x11, + 0x1e, 0x3d, 0x51, 0x84, 0xdb, 0xbb, 0x8a, 0xf0, 0x60, 0x57, 0x11, 0x1f, 0xee, 0x2a, 0xe2, 0x6f, + 0xbb, 0x8a, 0x78, 0xe7, 0xa9, 0x22, 0x3c, 0x7c, 0xaa, 0x08, 0x8f, 0x9e, 0x2a, 0xc2, 0xc7, 0xaf, + 0x4e, 0xea, 0xc4, 0xff, 0x1b, 0x9b, 0xf3, 0x2c, 0x28, 0xcf, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, + 0xaa, 0x0c, 0xd1, 0xcc, 0x85, 0x0c, 0x00, 0x00, } type ProposalBaseFace interface { @@ -772,38 +683,6 @@ func NewProposalBaseFromFace(that ProposalBaseFace) *ProposalBase { return this } -func (this *MsgCommon) GetMsg() github_com_cosmos_cosmos_sdk_types.Msg { - if x := this.GetGovDeposit(); x != nil { - return x - } - if x := this.GetGovVote(); x != nil { - return x - } - return nil -} - -func (this *MsgCommon) SetMsg(value github_com_cosmos_cosmos_sdk_types.Msg) error { - if value == nil { - this.Sum = nil - return nil - } - switch vt := value.(type) { - case *MsgDeposit: - this.Sum = &MsgCommon_GovDeposit{vt} - return nil - case MsgDeposit: - this.Sum = &MsgCommon_GovDeposit{&vt} - return nil - case *MsgVote: - this.Sum = &MsgCommon_GovVote{vt} - return nil - case MsgVote: - this.Sum = &MsgCommon_GovVote{&vt} - return nil - } - return fmt.Errorf("can't encode value of type %T as message MsgCommon", value) -} - func (this *BasicContent) GetContent() Content { if x := this.GetText(); x != nil { return x @@ -827,80 +706,6 @@ func (this *BasicContent) SetContent(value Content) error { return fmt.Errorf("can't encode value of type %T as message BasicContent", value) } -func (m *MsgCommon) 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 *MsgCommon) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCommon) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *MsgCommon_GovDeposit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCommon_GovDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.GovDeposit != nil { - { - size, err := m.GovDeposit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *MsgCommon_GovVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCommon_GovVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.GovVote != nil { - { - size, err := m.GovVote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} func (m *MsgSubmitProposalBase) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -924,7 +729,7 @@ func (m *MsgSubmitProposalBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Proposer) > 0 { i -= len(m.Proposer) copy(dAtA[i:], m.Proposer) - i = encodeVarintCodec(dAtA, i, uint64(len(m.Proposer))) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Proposer))) i-- dAtA[i] = 0x12 } @@ -936,7 +741,7 @@ func (m *MsgSubmitProposalBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -973,7 +778,7 @@ func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -982,12 +787,12 @@ func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Depositor) > 0 { i -= len(m.Depositor) copy(dAtA[i:], m.Depositor) - i = encodeVarintCodec(dAtA, i, uint64(len(m.Depositor))) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Depositor))) i-- dAtA[i] = 0x12 } if m.ProposalID != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.ProposalID)) + i = encodeVarintTypes(dAtA, i, uint64(m.ProposalID)) i-- dAtA[i] = 0x8 } @@ -1015,19 +820,19 @@ func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.Option != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.Option)) + i = encodeVarintTypes(dAtA, i, uint64(m.Option)) i-- dAtA[i] = 0x18 } if len(m.Voter) > 0 { i -= len(m.Voter) copy(dAtA[i:], m.Voter) - i = encodeVarintCodec(dAtA, i, uint64(len(m.Voter))) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Voter))) i-- dAtA[i] = 0x12 } if m.ProposalID != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.ProposalID)) + i = encodeVarintTypes(dAtA, i, uint64(m.ProposalID)) i-- dAtA[i] = 0x8 } @@ -1057,14 +862,14 @@ func (m *TextProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) - i = encodeVarintCodec(dAtA, i, uint64(len(m.Description))) + i = encodeVarintTypes(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 = encodeVarintCodec(dAtA, i, uint64(len(m.Title))) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Title))) i-- dAtA[i] = 0xa } @@ -1099,7 +904,7 @@ func (m *Deposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -1108,12 +913,12 @@ func (m *Deposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Depositor) > 0 { i -= len(m.Depositor) copy(dAtA[i:], m.Depositor) - i = encodeVarintCodec(dAtA, i, uint64(len(m.Depositor))) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Depositor))) i-- dAtA[i] = 0x12 } if m.ProposalID != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.ProposalID)) + i = encodeVarintTypes(dAtA, i, uint64(m.ProposalID)) i-- dAtA[i] = 0x8 } @@ -1140,20 +945,20 @@ func (m *ProposalBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.VotingEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingEndTime):]) - if err3 != nil { - return 0, err3 + 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 -= n3 - i = encodeVarintCodec(dAtA, i, uint64(n3)) + i -= n1 + i = encodeVarintTypes(dAtA, i, uint64(n1)) i-- dAtA[i] = 0x42 - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.VotingStartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingStartTime):]) - if err4 != nil { - return 0, err4 + 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 -= n4 - i = encodeVarintCodec(dAtA, i, uint64(n4)) + i -= n2 + i = encodeVarintTypes(dAtA, i, uint64(n2)) i-- dAtA[i] = 0x3a if len(m.TotalDeposit) > 0 { @@ -1164,26 +969,26 @@ func (m *ProposalBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x32 } } - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.DepositEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.DepositEndTime):]) - if err5 != nil { - return 0, err5 + 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 -= n5 - i = encodeVarintCodec(dAtA, i, uint64(n5)) + i -= n3 + i = encodeVarintTypes(dAtA, i, uint64(n3)) i-- dAtA[i] = 0x2a - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.SubmitTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime):]) - if err6 != nil { - return 0, err6 + 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 -= n6 - i = encodeVarintCodec(dAtA, i, uint64(n6)) + i -= n4 + i = encodeVarintTypes(dAtA, i, uint64(n4)) i-- dAtA[i] = 0x22 { @@ -1192,17 +997,17 @@ func (m *ProposalBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a if m.Status != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.Status)) + i = encodeVarintTypes(dAtA, i, uint64(m.Status)) i-- dAtA[i] = 0x10 } if m.ProposalID != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.ProposalID)) + i = encodeVarintTypes(dAtA, i, uint64(m.ProposalID)) i-- dAtA[i] = 0x8 } @@ -1235,7 +1040,7 @@ func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { if _, err := m.NoWithVeto.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -1245,7 +1050,7 @@ func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { if _, err := m.No.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -1255,7 +1060,7 @@ func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { if _, err := m.Abstain.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 @@ -1265,7 +1070,7 @@ func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { if _, err := m.Yes.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -1293,19 +1098,19 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.Option != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.Option)) + i = encodeVarintTypes(dAtA, i, uint64(m.Option)) i-- dAtA[i] = 0x18 } if len(m.Voter) > 0 { i -= len(m.Voter) copy(dAtA[i:], m.Voter) - i = encodeVarintCodec(dAtA, i, uint64(len(m.Voter))) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Voter))) i-- dAtA[i] = 0x12 } if m.ProposalID != 0 { - i = encodeVarintCodec(dAtA, i, uint64(m.ProposalID)) + i = encodeVarintTypes(dAtA, i, uint64(m.ProposalID)) i-- dAtA[i] = 0x8 } @@ -1339,7 +1144,7 @@ func (m *BasicProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 @@ -1351,7 +1156,7 @@ func (m *BasicProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -1405,15 +1210,15 @@ func (m *BasicContent_Text) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarintCodec(dAtA []byte, offset int, v uint64) int { - offset -= sovCodec(v) +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -1423,42 +1228,6 @@ func encodeVarintCodec(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgCommon) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *MsgCommon_GovDeposit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GovDeposit != nil { - l = m.GovDeposit.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} -func (m *MsgCommon_GovVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GovVote != nil { - l = m.GovVote.Size() - n += 1 + l + sovCodec(uint64(l)) - } - return n -} func (m *MsgSubmitProposalBase) Size() (n int) { if m == nil { return 0 @@ -1468,12 +1237,12 @@ func (m *MsgSubmitProposalBase) Size() (n int) { if len(m.IntialDeposit) > 0 { for _, e := range m.IntialDeposit { l = e.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } } l = len(m.Proposer) if l > 0 { - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } return n } @@ -1485,16 +1254,16 @@ func (m *MsgDeposit) Size() (n int) { var l int _ = l if m.ProposalID != 0 { - n += 1 + sovCodec(uint64(m.ProposalID)) + n += 1 + sovTypes(uint64(m.ProposalID)) } l = len(m.Depositor) if l > 0 { - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } if len(m.Amount) > 0 { for _, e := range m.Amount { l = e.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } } return n @@ -1507,14 +1276,14 @@ func (m *MsgVote) Size() (n int) { var l int _ = l if m.ProposalID != 0 { - n += 1 + sovCodec(uint64(m.ProposalID)) + n += 1 + sovTypes(uint64(m.ProposalID)) } l = len(m.Voter) if l > 0 { - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } if m.Option != 0 { - n += 1 + sovCodec(uint64(m.Option)) + n += 1 + sovTypes(uint64(m.Option)) } return n } @@ -1527,11 +1296,11 @@ func (m *TextProposal) Size() (n int) { _ = l l = len(m.Title) if l > 0 { - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } l = len(m.Description) if l > 0 { - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } return n } @@ -1543,16 +1312,16 @@ func (m *Deposit) Size() (n int) { var l int _ = l if m.ProposalID != 0 { - n += 1 + sovCodec(uint64(m.ProposalID)) + n += 1 + sovTypes(uint64(m.ProposalID)) } l = len(m.Depositor) if l > 0 { - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } if len(m.Amount) > 0 { for _, e := range m.Amount { l = e.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } } return n @@ -1565,27 +1334,27 @@ func (m *ProposalBase) Size() (n int) { var l int _ = l if m.ProposalID != 0 { - n += 1 + sovCodec(uint64(m.ProposalID)) + n += 1 + sovTypes(uint64(m.ProposalID)) } if m.Status != 0 { - n += 1 + sovCodec(uint64(m.Status)) + n += 1 + sovTypes(uint64(m.Status)) } l = m.FinalTallyResult.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime) - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.DepositEndTime) - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) if len(m.TotalDeposit) > 0 { for _, e := range m.TotalDeposit { l = e.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingStartTime) - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingEndTime) - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) return n } @@ -1596,13 +1365,13 @@ func (m *TallyResult) Size() (n int) { var l int _ = l l = m.Yes.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) l = m.Abstain.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) l = m.No.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) l = m.NoWithVeto.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) return n } @@ -1613,14 +1382,14 @@ func (m *Vote) Size() (n int) { var l int _ = l if m.ProposalID != 0 { - n += 1 + sovCodec(uint64(m.ProposalID)) + n += 1 + sovTypes(uint64(m.ProposalID)) } l = len(m.Voter) if l > 0 { - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } if m.Option != 0 { - n += 1 + sovCodec(uint64(m.Option)) + n += 1 + sovTypes(uint64(m.Option)) } return n } @@ -1633,11 +1402,11 @@ func (m *BasicProposal) Size() (n int) { _ = l if m.ProposalBase != nil { l = m.ProposalBase.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } if m.Content != nil { l = m.Content.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } return n } @@ -1662,46 +1431,16 @@ func (m *BasicContent_Text) Size() (n int) { _ = l if m.Text != nil { l = m.Text.Size() - n += 1 + l + sovCodec(uint64(l)) + n += 1 + l + sovTypes(uint64(l)) } return n } -func sovCodec(x uint64) (n int) { +func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozCodec(x uint64) (n int) { - return sovCodec(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *MsgCommon) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MsgCommon{`, - `Sum:` + fmt.Sprintf("%v", this.Sum) + `,`, - `}`, - }, "") - return s -} -func (this *MsgCommon_GovDeposit) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MsgCommon_GovDeposit{`, - `GovDeposit:` + strings.Replace(fmt.Sprintf("%v", this.GovDeposit), "MsgDeposit", "MsgDeposit", 1) + `,`, - `}`, - }, "") - return s -} -func (this *MsgCommon_GovVote) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MsgCommon_GovVote{`, - `GovVote:` + strings.Replace(fmt.Sprintf("%v", this.GovVote), "MsgVote", "MsgVote", 1) + `,`, - `}`, - }, "") - return s +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *MsgSubmitProposalBase) String() string { if this == nil { @@ -1739,7 +1478,7 @@ func (this *BasicContent_Text) String() string { }, "") return s } -func valueToStringCodec(v interface{}) string { +func valueToStringTypes(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" @@ -1747,129 +1486,6 @@ func valueToStringCodec(v interface{}) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } -func (m *MsgCommon) 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 ErrIntOverflowCodec - } - 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: MsgCommon: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCommon: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovDeposit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &MsgDeposit{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &MsgCommon_GovDeposit{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovVote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &MsgVote{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &MsgCommon_GovVote{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1878,7 +1494,7 @@ func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1906,7 +1522,7 @@ func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1919,11 +1535,11 @@ func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -1940,7 +1556,7 @@ func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1953,11 +1569,11 @@ func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -1969,15 +1585,15 @@ func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1999,7 +1615,7 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2027,7 +1643,7 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { m.ProposalID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2046,7 +1662,7 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2059,11 +1675,11 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2080,7 +1696,7 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2093,11 +1709,11 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2109,15 +1725,15 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2139,7 +1755,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2167,7 +1783,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { m.ProposalID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2186,7 +1802,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2199,11 +1815,11 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2220,7 +1836,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { m.Option = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2234,15 +1850,15 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2264,7 +1880,7 @@ func (m *TextProposal) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2292,7 +1908,7 @@ func (m *TextProposal) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2306,11 +1922,11 @@ func (m *TextProposal) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2324,7 +1940,7 @@ func (m *TextProposal) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2338,11 +1954,11 @@ func (m *TextProposal) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2351,15 +1967,15 @@ func (m *TextProposal) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2381,7 +1997,7 @@ func (m *Deposit) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2409,7 +2025,7 @@ func (m *Deposit) Unmarshal(dAtA []byte) error { m.ProposalID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2428,7 +2044,7 @@ func (m *Deposit) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2441,11 +2057,11 @@ func (m *Deposit) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2462,7 +2078,7 @@ func (m *Deposit) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2475,11 +2091,11 @@ func (m *Deposit) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2491,15 +2107,15 @@ func (m *Deposit) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2521,7 +2137,7 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2549,7 +2165,7 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { m.ProposalID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2568,7 +2184,7 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2587,7 +2203,7 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2600,11 +2216,11 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2620,7 +2236,7 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2633,11 +2249,11 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2653,7 +2269,7 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2666,11 +2282,11 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2686,7 +2302,7 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2699,11 +2315,11 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2720,7 +2336,7 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2733,11 +2349,11 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2753,7 +2369,7 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2766,11 +2382,11 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2781,15 +2397,15 @@ func (m *ProposalBase) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2811,7 +2427,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2839,7 +2455,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2852,11 +2468,11 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2872,7 +2488,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2885,11 +2501,11 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2905,7 +2521,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2918,11 +2534,11 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2938,7 +2554,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2951,11 +2567,11 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -2966,15 +2582,15 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2996,7 +2612,7 @@ func (m *Vote) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3024,7 +2640,7 @@ func (m *Vote) Unmarshal(dAtA []byte) error { m.ProposalID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3043,7 +2659,7 @@ func (m *Vote) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3056,11 +2672,11 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -3077,7 +2693,7 @@ func (m *Vote) Unmarshal(dAtA []byte) error { m.Option = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3091,15 +2707,15 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3121,7 +2737,7 @@ func (m *BasicProposal) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3149,7 +2765,7 @@ func (m *BasicProposal) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3162,11 +2778,11 @@ func (m *BasicProposal) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -3185,7 +2801,7 @@ func (m *BasicProposal) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3198,11 +2814,11 @@ func (m *BasicProposal) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -3216,15 +2832,15 @@ func (m *BasicProposal) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3246,7 +2862,7 @@ func (m *BasicContent) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3274,7 +2890,7 @@ func (m *BasicContent) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowCodec + return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3287,11 +2903,11 @@ func (m *BasicContent) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF @@ -3304,15 +2920,15 @@ func (m *BasicContent) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipCodec(dAtA[iNdEx:]) + skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCodec + return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3326,7 +2942,7 @@ func (m *BasicContent) Unmarshal(dAtA []byte) error { } return nil } -func skipCodec(dAtA []byte) (n int, err error) { +func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -3334,7 +2950,7 @@ func skipCodec(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowCodec + return 0, ErrIntOverflowTypes } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -3351,7 +2967,7 @@ func skipCodec(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowCodec + return 0, ErrIntOverflowTypes } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -3367,7 +2983,7 @@ func skipCodec(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowCodec + return 0, ErrIntOverflowTypes } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -3380,14 +2996,14 @@ func skipCodec(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthCodec + return 0, ErrInvalidLengthTypes } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCodec + return 0, ErrUnexpectedEndOfGroupTypes } depth-- case 5: @@ -3396,7 +3012,7 @@ func skipCodec(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthCodec + return 0, ErrInvalidLengthTypes } if depth == 0 { return iNdEx, nil @@ -3406,7 +3022,7 @@ func skipCodec(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCodec = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCodec = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") ) diff --git a/x/gov/types/codec.proto b/x/gov/types/types.proto similarity index 100% rename from x/gov/types/codec.proto rename to x/gov/types/types.proto From 38d44e839e1fdd465b579eab8365ace63ff71c34 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 17 Feb 2020 14:57:14 -0500 Subject: [PATCH 04/31] WIP on fixing tests --- x/gov/keeper/keeper_test.go | 6 ++++-- x/gov/keeper/proposal_test.go | 4 +++- x/gov/keeper/querier_test.go | 12 ++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index 9cd2a0559..7e288ef82 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -1,6 +1,7 @@ package keeper import ( + proto "github.com/gogo/protobuf/types" "testing" "github.com/stretchr/testify/require" @@ -45,7 +46,8 @@ func TestProposalQueues(t *testing.T) { activeIterator := keeper.ActiveProposalQueueIterator(ctx, proposal.VotingEndTime) require.True(t, activeIterator.Valid()) - keeper.cdc.UnmarshalBinaryLengthPrefixed(activeIterator.Value(), &proposalID) - require.Equal(t, proposalID, proposal.ProposalID) + var proposalIdWrapper proto.UInt64Value + keeper.cdc.UnmarshalBinaryLengthPrefixed(activeIterator.Value(), &proposalIdWrapper) + require.Equal(t, proposalIdWrapper.Value, proposal.ProposalID) activeIterator.Close() } diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 5848e0d75..ef43de365 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -99,7 +99,9 @@ func registerTestCodec(cdc *codec.Codec) { func TestSubmitProposal(t *testing.T) { ctx, _, _, keeper, _, _ := createTestInput(t, false, 100) // nolint: dogsled - registerTestCodec(keeper.cdc) + cdc := codec.New() + + registerTestCodec(cdc) testCases := []struct { content types.Content diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 54aeae6fe..a33be5128 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -16,7 +16,7 @@ import ( const custom = "custom" -func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier sdk.Querier) (types.DepositParams, types.VotingParams, types.TallyParams) { +func getQueriedParams(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier) (types.DepositParams, types.VotingParams, types.TallyParams) { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryParams, types.ParamDeposit}, "/"), Data: []byte{}, @@ -57,7 +57,7 @@ func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier s } func getQueriedProposals( - t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier sdk.Querier, + t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, depositor, voter sdk.AccAddress, status types.ProposalStatus, page, limit int, ) []types.Proposal { @@ -76,7 +76,7 @@ func getQueriedProposals( return proposals } -func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier sdk.Querier, proposalID uint64, depositor sdk.AccAddress) types.Deposit { +func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, proposalID uint64, depositor sdk.AccAddress) types.Deposit { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryDeposit}, "/"), Data: cdc.MustMarshalJSON(types.NewQueryDepositParams(proposalID, depositor)), @@ -92,7 +92,7 @@ func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier return deposit } -func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier sdk.Querier, proposalID uint64) []types.Deposit { +func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, proposalID uint64) []types.Deposit { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryDeposits}, "/"), Data: cdc.MustMarshalJSON(types.NewQueryProposalParams(proposalID)), @@ -108,7 +108,7 @@ func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier return deposits } -func getQueriedVote(t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier sdk.Querier, proposalID uint64, voter sdk.AccAddress) types.Vote { +func getQueriedVote(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, proposalID uint64, voter sdk.AccAddress) types.Vote { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryVote}, "/"), Data: cdc.MustMarshalJSON(types.NewQueryVoteParams(proposalID, voter)), @@ -124,7 +124,7 @@ func getQueriedVote(t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier sdk return vote } -func getQueriedVotes(t *testing.T, ctx sdk.Context, cdc *codec.Codec, querier sdk.Querier, +func getQueriedVotes(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, proposalID uint64, page, limit int) []types.Vote { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryVote}, "/"), From 2e0033afcf0c03f65e87f18e3af3ae0b7c3c9e29 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 17 Feb 2020 16:53:24 -0500 Subject: [PATCH 05/31] Update x/gov/types/codec.go Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com> --- x/gov/types/codec.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index 6e85045dd..5226877f9 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -11,7 +11,6 @@ type Codec interface { UnmarshalProposal(bz []byte, ptr *Proposal) error } - // module codec var ModuleCdc = codec.New() From 830ada0fa4dd7eb7ad8b203276e89e0d66f0cc6d Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 25 Feb 2020 15:58:31 -0500 Subject: [PATCH 06/31] WIP on StdProposal --- x/std.proto | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 x/std.proto diff --git a/x/std.proto b/x/std.proto new file mode 100644 index 000000000..07c87b301 --- /dev/null +++ b/x/std.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package cosmos_sdk.x.v1; + +import "gov/types/types.proto"; +import "params/types/proposal/types.proto"; +import "upgrade/types/types.proto"; + +message StdProposal { + oneof sum { + cosmos_sdk.x.gov.v1.TextProposal text = 1; + cosmos_sdk.x.params.v1.ParameterChangeProposal parameter_change = 2; + cosmos_sdk.x.upgrade.v1.SoftwareUpgradeProposal software_upgrade = 3; + cosmos_sdk.x.upgrade.v1.CancelSoftwareUpgradeProposal cancel_software_upgrade = 4; + } +} From 2cf8a5e955ff7a89a5d903f013d53c1548a87ac1 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Wed, 26 Feb 2020 10:41:35 -0500 Subject: [PATCH 07/31] WIP on proposal proto --- {x => codec/std}/std.proto | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename {x => codec/std}/std.proto (60%) diff --git a/x/std.proto b/codec/std/std.proto similarity index 60% rename from x/std.proto rename to codec/std/std.proto index 07c87b301..359580d30 100644 --- a/x/std.proto +++ b/codec/std/std.proto @@ -1,9 +1,10 @@ syntax = "proto3"; package cosmos_sdk.x.v1; -import "gov/types/types.proto"; -import "params/types/proposal/types.proto"; -import "upgrade/types/types.proto"; +import "x/gov/types/types.proto"; +import "x/params/types/proposal/types.proto"; +import "x/upgrade/types/types.proto"; +import "x/distribution/types/types.proto"; message StdProposal { oneof sum { @@ -11,5 +12,6 @@ message StdProposal { cosmos_sdk.x.params.v1.ParameterChangeProposal parameter_change = 2; cosmos_sdk.x.upgrade.v1.SoftwareUpgradeProposal software_upgrade = 3; cosmos_sdk.x.upgrade.v1.CancelSoftwareUpgradeProposal cancel_software_upgrade = 4; + cosmos_sdk.x.distribution.v1.CommunityPoolSpendProposal community_pool_spend = 5; } } From 8bd648eef19112c0c89b3fa4420b29ff5954d1cc Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Wed, 26 Feb 2020 20:14:08 -0500 Subject: [PATCH 08/31] WIP on std codec --- codec/std/std.pb.go | 1015 +++++++++++++++++++++++++++++++++++++++++ codec/std/std.proto | 23 +- simapp/app.go | 3 +- simapp/codec/codec.go | 22 + 4 files changed, 1055 insertions(+), 8 deletions(-) create mode 100644 codec/std/std.pb.go diff --git a/codec/std/std.pb.go b/codec/std/std.pb.go new file mode 100644 index 000000000..985a5f8b5 --- /dev/null +++ b/codec/std/std.pb.go @@ -0,0 +1,1015 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: codec/std/std.proto + +package std + +import ( + fmt "fmt" + types2 "github.com/cosmos/cosmos-sdk/x/distribution/types" + github_com_cosmos_cosmos_sdk_x_gov_types "github.com/cosmos/cosmos-sdk/x/gov/types" + types "github.com/cosmos/cosmos-sdk/x/gov/types" + proposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + types1 "github.com/cosmos/cosmos-sdk/x/upgrade/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-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 + +type StdProposal struct { + types.ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` + Content StdProposal_Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` +} + +func (m *StdProposal) Reset() { *m = StdProposal{} } +func (m *StdProposal) String() string { return proto.CompactTextString(m) } +func (*StdProposal) ProtoMessage() {} +func (*StdProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_bfdf2c6f71a73b14, []int{0} +} +func (m *StdProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StdProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StdProposal.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 *StdProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_StdProposal.Merge(m, src) +} +func (m *StdProposal) XXX_Size() int { + return m.Size() +} +func (m *StdProposal) XXX_DiscardUnknown() { + xxx_messageInfo_StdProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_StdProposal proto.InternalMessageInfo + +func (m *StdProposal) GetContent() StdProposal_Content { + if m != nil { + return m.Content + } + return StdProposal_Content{} +} + +type StdProposal_Content struct { + // Types that are valid to be assigned to Sum: + // *StdProposal_Content_Text + // *StdProposal_Content_ParameterChange + // *StdProposal_Content_SoftwareUpgrade + // *StdProposal_Content_CancelSoftwareUpgrade + // *StdProposal_Content_CommunityPoolSpend + Sum isStdProposal_Content_Sum `protobuf_oneof:"sum"` +} + +func (m *StdProposal_Content) Reset() { *m = StdProposal_Content{} } +func (m *StdProposal_Content) String() string { return proto.CompactTextString(m) } +func (*StdProposal_Content) ProtoMessage() {} +func (*StdProposal_Content) Descriptor() ([]byte, []int) { + return fileDescriptor_bfdf2c6f71a73b14, []int{0, 0} +} +func (m *StdProposal_Content) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StdProposal_Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StdProposal_Content.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 *StdProposal_Content) XXX_Merge(src proto.Message) { + xxx_messageInfo_StdProposal_Content.Merge(m, src) +} +func (m *StdProposal_Content) XXX_Size() int { + return m.Size() +} +func (m *StdProposal_Content) XXX_DiscardUnknown() { + xxx_messageInfo_StdProposal_Content.DiscardUnknown(m) +} + +var xxx_messageInfo_StdProposal_Content proto.InternalMessageInfo + +type isStdProposal_Content_Sum interface { + isStdProposal_Content_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type StdProposal_Content_Text struct { + Text *types.TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"` +} +type StdProposal_Content_ParameterChange struct { + ParameterChange *proposal.ParameterChangeProposal `protobuf:"bytes,2,opt,name=parameter_change,json=parameterChange,proto3,oneof" json:"parameter_change,omitempty"` +} +type StdProposal_Content_SoftwareUpgrade struct { + SoftwareUpgrade *types1.SoftwareUpgradeProposal `protobuf:"bytes,3,opt,name=software_upgrade,json=softwareUpgrade,proto3,oneof" json:"software_upgrade,omitempty"` +} +type StdProposal_Content_CancelSoftwareUpgrade struct { + CancelSoftwareUpgrade *types1.CancelSoftwareUpgradeProposal `protobuf:"bytes,4,opt,name=cancel_software_upgrade,json=cancelSoftwareUpgrade,proto3,oneof" json:"cancel_software_upgrade,omitempty"` +} +type StdProposal_Content_CommunityPoolSpend struct { + CommunityPoolSpend *types2.CommunityPoolSpendProposal `protobuf:"bytes,5,opt,name=community_pool_spend,json=communityPoolSpend,proto3,oneof" json:"community_pool_spend,omitempty"` +} + +func (*StdProposal_Content_Text) isStdProposal_Content_Sum() {} +func (*StdProposal_Content_ParameterChange) isStdProposal_Content_Sum() {} +func (*StdProposal_Content_SoftwareUpgrade) isStdProposal_Content_Sum() {} +func (*StdProposal_Content_CancelSoftwareUpgrade) isStdProposal_Content_Sum() {} +func (*StdProposal_Content_CommunityPoolSpend) isStdProposal_Content_Sum() {} + +func (m *StdProposal_Content) GetSum() isStdProposal_Content_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *StdProposal_Content) GetText() *types.TextProposal { + if x, ok := m.GetSum().(*StdProposal_Content_Text); ok { + return x.Text + } + return nil +} + +func (m *StdProposal_Content) GetParameterChange() *proposal.ParameterChangeProposal { + if x, ok := m.GetSum().(*StdProposal_Content_ParameterChange); ok { + return x.ParameterChange + } + return nil +} + +func (m *StdProposal_Content) GetSoftwareUpgrade() *types1.SoftwareUpgradeProposal { + if x, ok := m.GetSum().(*StdProposal_Content_SoftwareUpgrade); ok { + return x.SoftwareUpgrade + } + return nil +} + +func (m *StdProposal_Content) GetCancelSoftwareUpgrade() *types1.CancelSoftwareUpgradeProposal { + if x, ok := m.GetSum().(*StdProposal_Content_CancelSoftwareUpgrade); ok { + return x.CancelSoftwareUpgrade + } + return nil +} + +func (m *StdProposal_Content) GetCommunityPoolSpend() *types2.CommunityPoolSpendProposal { + if x, ok := m.GetSum().(*StdProposal_Content_CommunityPoolSpend); ok { + return x.CommunityPoolSpend + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*StdProposal_Content) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*StdProposal_Content_Text)(nil), + (*StdProposal_Content_ParameterChange)(nil), + (*StdProposal_Content_SoftwareUpgrade)(nil), + (*StdProposal_Content_CancelSoftwareUpgrade)(nil), + (*StdProposal_Content_CommunityPoolSpend)(nil), + } +} + +func init() { + proto.RegisterType((*StdProposal)(nil), "cosmos_sdk.x.v1.StdProposal") + proto.RegisterType((*StdProposal_Content)(nil), "cosmos_sdk.x.v1.StdProposal.Content") +} + +func init() { proto.RegisterFile("codec/std/std.proto", fileDescriptor_bfdf2c6f71a73b14) } + +var fileDescriptor_bfdf2c6f71a73b14 = []byte{ + // 492 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x13, 0x96, 0x32, 0xe4, 0x1d, 0x36, 0x05, 0xd0, 0xaa, 0x22, 0x65, 0xe3, 0x8f, 0x26, + 0x24, 0x34, 0x7b, 0x03, 0x04, 0x88, 0x0b, 0xa8, 0xe5, 0xc0, 0x71, 0xea, 0xe0, 0x82, 0x40, 0x91, + 0x6b, 0x9b, 0x34, 0x5a, 0x92, 0xd7, 0x8a, 0x9d, 0x92, 0x7e, 0x0b, 0x3e, 0x00, 0xdf, 0x02, 0x3e, + 0xc4, 0xc4, 0xa9, 0x47, 0x4e, 0x13, 0x6a, 0xbf, 0x08, 0xaa, 0xe3, 0x8c, 0x64, 0xdd, 0x76, 0x68, + 0x95, 0xf8, 0x7d, 0x9e, 0xdf, 0x63, 0xbf, 0xf1, 0x8b, 0x6e, 0x33, 0xe0, 0x82, 0x11, 0xa5, 0xf9, + 0xf2, 0x87, 0x65, 0x0e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, 0xa7, 0xbd, 0x6b, 0x91, 0xe7, 0x43, 0x3e, 0xba, 0x69, 0xae, 0xff, 0xb3, 0x7f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x30, 0x48, 0xf7, 0x0e, 0xf8, 0x03, 0x00, 0x00, +} + +func (this *StdProposal_Content) GetContent() github_com_cosmos_cosmos_sdk_x_gov_types.Content { + if x := this.GetText(); x != nil { + return x + } + if x := this.GetParameterChange(); x != nil { + return x + } + if x := this.GetSoftwareUpgrade(); x != nil { + return x + } + if x := this.GetCancelSoftwareUpgrade(); x != nil { + return x + } + if x := this.GetCommunityPoolSpend(); x != nil { + return x + } + return nil +} + +func (this *StdProposal_Content) SetContent(value github_com_cosmos_cosmos_sdk_x_gov_types.Content) error { + if value == nil { + this.Sum = nil + return nil + } + switch vt := value.(type) { + case *types.TextProposal: + this.Sum = &StdProposal_Content_Text{vt} + return nil + case types.TextProposal: + this.Sum = &StdProposal_Content_Text{&vt} + return nil + case *proposal.ParameterChangeProposal: + this.Sum = &StdProposal_Content_ParameterChange{vt} + return nil + case proposal.ParameterChangeProposal: + this.Sum = &StdProposal_Content_ParameterChange{&vt} + return nil + case *types1.SoftwareUpgradeProposal: + this.Sum = &StdProposal_Content_SoftwareUpgrade{vt} + return nil + case types1.SoftwareUpgradeProposal: + this.Sum = &StdProposal_Content_SoftwareUpgrade{&vt} + return nil + case *types1.CancelSoftwareUpgradeProposal: + this.Sum = &StdProposal_Content_CancelSoftwareUpgrade{vt} + return nil + case types1.CancelSoftwareUpgradeProposal: + this.Sum = &StdProposal_Content_CancelSoftwareUpgrade{&vt} + return nil + case *types2.CommunityPoolSpendProposal: + this.Sum = &StdProposal_Content_CommunityPoolSpend{vt} + return nil + case types2.CommunityPoolSpendProposal: + this.Sum = &StdProposal_Content_CommunityPoolSpend{&vt} + return nil + } + return fmt.Errorf("can't encode value of type %T as message StdProposal_Content", value) +} + +func (m *StdProposal) 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 *StdProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StdProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStd(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ProposalBase.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStd(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *StdProposal_Content) 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 *StdProposal_Content) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StdProposal_Content) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *StdProposal_Content_Text) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StdProposal_Content_Text) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Text != nil { + { + size, err := m.Text.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStd(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *StdProposal_Content_ParameterChange) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StdProposal_Content_ParameterChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ParameterChange != nil { + { + size, err := m.ParameterChange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStd(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *StdProposal_Content_SoftwareUpgrade) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StdProposal_Content_SoftwareUpgrade) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SoftwareUpgrade != nil { + { + size, err := m.SoftwareUpgrade.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStd(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *StdProposal_Content_CancelSoftwareUpgrade) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StdProposal_Content_CancelSoftwareUpgrade) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.CancelSoftwareUpgrade != nil { + { + size, err := m.CancelSoftwareUpgrade.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStd(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *StdProposal_Content_CommunityPoolSpend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StdProposal_Content_CommunityPoolSpend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.CommunityPoolSpend != nil { + { + size, err := m.CommunityPoolSpend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStd(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func encodeVarintStd(dAtA []byte, offset int, v uint64) int { + offset -= sovStd(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *StdProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ProposalBase.Size() + n += 1 + l + sovStd(uint64(l)) + l = m.Content.Size() + n += 1 + l + sovStd(uint64(l)) + return n +} + +func (m *StdProposal_Content) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *StdProposal_Content_Text) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Text != nil { + l = m.Text.Size() + n += 1 + l + sovStd(uint64(l)) + } + return n +} +func (m *StdProposal_Content_ParameterChange) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParameterChange != nil { + l = m.ParameterChange.Size() + n += 1 + l + sovStd(uint64(l)) + } + return n +} +func (m *StdProposal_Content_SoftwareUpgrade) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SoftwareUpgrade != nil { + l = m.SoftwareUpgrade.Size() + n += 1 + l + sovStd(uint64(l)) + } + return n +} +func (m *StdProposal_Content_CancelSoftwareUpgrade) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CancelSoftwareUpgrade != nil { + l = m.CancelSoftwareUpgrade.Size() + n += 1 + l + sovStd(uint64(l)) + } + return n +} +func (m *StdProposal_Content_CommunityPoolSpend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CommunityPoolSpend != nil { + l = m.CommunityPoolSpend.Size() + n += 1 + l + sovStd(uint64(l)) + } + return n +} + +func sovStd(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStd(x uint64) (n int) { + return sovStd(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *StdProposal) 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 ErrIntOverflowStd + } + 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: StdProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StdProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalBase", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStd + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStd + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProposalBase.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 ErrIntOverflowStd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStd + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStd + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStd(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStd + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStd + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StdProposal_Content) 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 ErrIntOverflowStd + } + 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: Content: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Content: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStd + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStd + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.TextProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &StdProposal_Content_Text{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterChange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStd + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStd + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &proposal.ParameterChangeProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &StdProposal_Content_ParameterChange{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SoftwareUpgrade", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStd + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStd + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types1.SoftwareUpgradeProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &StdProposal_Content_SoftwareUpgrade{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CancelSoftwareUpgrade", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStd + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStd + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types1.CancelSoftwareUpgradeProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &StdProposal_Content_CancelSoftwareUpgrade{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommunityPoolSpend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStd + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStd + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types2.CommunityPoolSpendProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &StdProposal_Content_CommunityPoolSpend{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStd(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStd + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStd + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStd(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, ErrIntOverflowStd + } + 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, ErrIntOverflowStd + } + 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, ErrIntOverflowStd + } + 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, ErrInvalidLengthStd + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStd + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStd + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStd = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStd = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStd = fmt.Errorf("proto: unexpected end of group") +) diff --git a/codec/std/std.proto b/codec/std/std.proto index 359580d30..a99d35fb4 100644 --- a/codec/std/std.proto +++ b/codec/std/std.proto @@ -1,17 +1,28 @@ syntax = "proto3"; package cosmos_sdk.x.v1; +import "third_party/proto/cosmos-proto/cosmos.proto"; +import "third_party/proto/gogoproto/gogo.proto"; import "x/gov/types/types.proto"; import "x/params/types/proposal/types.proto"; import "x/upgrade/types/types.proto"; import "x/distribution/types/types.proto"; +option go_package = "github.com/cosmos/cosmos-sdk/codec/std"; + message StdProposal { - oneof sum { - cosmos_sdk.x.gov.v1.TextProposal text = 1; - cosmos_sdk.x.params.v1.ParameterChangeProposal parameter_change = 2; - cosmos_sdk.x.upgrade.v1.SoftwareUpgradeProposal software_upgrade = 3; - cosmos_sdk.x.upgrade.v1.CancelSoftwareUpgradeProposal cancel_software_upgrade = 4; - cosmos_sdk.x.distribution.v1.CommunityPoolSpendProposal community_pool_spend = 5; + cosmos_sdk.x.gov.v1.ProposalBase base = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + Content content = 2 [(gogoproto.nullable) = false]; + + message Content { + option (cosmos_proto.interface_type) = "github.com/cosmos/cosmos-sdk/x/gov/types.Content"; + oneof sum { + cosmos_sdk.x.gov.v1.TextProposal text = 1; + cosmos_sdk.x.params.v1.ParameterChangeProposal parameter_change = 2; + cosmos_sdk.x.upgrade.v1.SoftwareUpgradeProposal software_upgrade = 3; + cosmos_sdk.x.upgrade.v1.CancelSoftwareUpgradeProposal cancel_software_upgrade = 4; + cosmos_sdk.x.distribution.v1.CommunityPoolSpendProposal community_pool_spend = 5; + } } } + diff --git a/simapp/app.go b/simapp/app.go index f8919cc99..bee46cb72 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -1,7 +1,6 @@ package simapp import ( - "github.com/cosmos/cosmos-sdk/x/gov/types" "io" "os" @@ -208,7 +207,7 @@ func NewSimApp( AddRoute(distr.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgrade.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) app.GovKeeper = gov.NewKeeper( - types.NewAminoGovCodec(app.cdc), keys[gov.StoreKey], app.subspaces[gov.ModuleName], app.SupplyKeeper, + appCodec, keys[gov.StoreKey], app.subspaces[gov.ModuleName], app.SupplyKeeper, &stakingKeeper, govRouter, ) diff --git a/simapp/codec/codec.go b/simapp/codec/codec.go index abcd8752d..0c9f910e6 100644 --- a/simapp/codec/codec.go +++ b/simapp/codec/codec.go @@ -2,6 +2,7 @@ package codec import ( "github.com/cosmos/cosmos-sdk/codec" + cosmos_sdk_x_v1 "github.com/cosmos/cosmos-sdk/codec/std" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" @@ -9,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/vesting" "github.com/cosmos/cosmos-sdk/x/evidence" eviexported "github.com/cosmos/cosmos-sdk/x/evidence/exported" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/supply" supplyexported "github.com/cosmos/cosmos-sdk/x/supply/exported" ) @@ -151,6 +153,26 @@ func (c *Codec) UnmarshalEvidenceJSON(bz []byte) (eviexported.Evidence, error) { return evidence.GetEvidence(), nil } +func (c *Codec) MarshalProposal(p types.Proposal) ([]byte, error) { + stdProposal := &cosmos_sdk_x_v1.StdProposal{ProposalBase: p.ProposalBase} + if err := stdProposal.Content.SetContent(p.Content); err != nil { + return nil, err + } + return c.Marshaler.MarshalBinaryBare(stdProposal) +} + +func (c *Codec) UnmarshalProposal(bz []byte) (types.Proposal, error) { + stdProposal := &cosmos_sdk_x_v1.StdProposal{} + if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, stdProposal); err != nil { + return nil, err + } + + return types.Proposal{ + //Content: stdProposal.Content.GetContent(), + ProposalBase: stdProposal.ProposalBase, + }, nil +} + // ---------------------------------------------------------------------------- // necessary types and interfaces registered. This codec is provided to all the // modules the application depends on. From feb8b0d4c382af83928aa5a8f8240b456f339de4 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Wed, 26 Feb 2020 20:15:32 -0500 Subject: [PATCH 09/31] Protogen fix --- codec/std/std.pb.go | 2 +- x/distribution/types/types.pb.go | 162 +++++++++++++++---------------- 2 files changed, 82 insertions(+), 82 deletions(-) diff --git a/codec/std/std.pb.go b/codec/std/std.pb.go index 985a5f8b5..f60238c77 100644 --- a/codec/std/std.pb.go +++ b/codec/std/std.pb.go @@ -5,7 +5,6 @@ package std import ( fmt "fmt" - types2 "github.com/cosmos/cosmos-sdk/x/distribution/types" github_com_cosmos_cosmos_sdk_x_gov_types "github.com/cosmos/cosmos-sdk/x/gov/types" types "github.com/cosmos/cosmos-sdk/x/gov/types" proposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" @@ -16,6 +15,7 @@ import ( io "io" math "math" math_bits "math/bits" + types2 "x/distribution/types" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/distribution/types/types.pb.go b/x/distribution/types/types.pb.go index 0571a985c..4bb5f5538 100644 --- a/x/distribution/types/types.pb.go +++ b/x/distribution/types/types.pb.go @@ -728,20 +728,20 @@ func (m *DelegatorStartingInfo) GetHeight() uint64 { } func init() { - proto.RegisterType((*MsgSetWithdrawAddress)(nil), "cosmos_sdk.x.ditribution.v1.MsgSetWithdrawAddress") - proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "cosmos_sdk.x.ditribution.v1.MsgWithdrawDelegatorReward") - proto.RegisterType((*MsgWithdrawValidatorCommission)(nil), "cosmos_sdk.x.ditribution.v1.MsgWithdrawValidatorCommission") - proto.RegisterType((*MsgFundCommunityPool)(nil), "cosmos_sdk.x.ditribution.v1.MsgFundCommunityPool") - proto.RegisterType((*Params)(nil), "cosmos_sdk.x.ditribution.v1.Params") - proto.RegisterType((*ValidatorHistoricalRewards)(nil), "cosmos_sdk.x.ditribution.v1.ValidatorHistoricalRewards") - proto.RegisterType((*ValidatorCurrentRewards)(nil), "cosmos_sdk.x.ditribution.v1.ValidatorCurrentRewards") - proto.RegisterType((*ValidatorAccumulatedCommission)(nil), "cosmos_sdk.x.ditribution.v1.ValidatorAccumulatedCommission") - proto.RegisterType((*ValidatorOutstandingRewards)(nil), "cosmos_sdk.x.ditribution.v1.ValidatorOutstandingRewards") - proto.RegisterType((*ValidatorSlashEvent)(nil), "cosmos_sdk.x.ditribution.v1.ValidatorSlashEvent") - proto.RegisterType((*ValidatorSlashEvents)(nil), "cosmos_sdk.x.ditribution.v1.ValidatorSlashEvents") - proto.RegisterType((*FeePool)(nil), "cosmos_sdk.x.ditribution.v1.FeePool") - proto.RegisterType((*CommunityPoolSpendProposal)(nil), "cosmos_sdk.x.ditribution.v1.CommunityPoolSpendProposal") - proto.RegisterType((*DelegatorStartingInfo)(nil), "cosmos_sdk.x.ditribution.v1.DelegatorStartingInfo") + proto.RegisterType((*MsgSetWithdrawAddress)(nil), "cosmos_sdk.x.distribution.v1.MsgSetWithdrawAddress") + proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "cosmos_sdk.x.distribution.v1.MsgWithdrawDelegatorReward") + proto.RegisterType((*MsgWithdrawValidatorCommission)(nil), "cosmos_sdk.x.distribution.v1.MsgWithdrawValidatorCommission") + proto.RegisterType((*MsgFundCommunityPool)(nil), "cosmos_sdk.x.distribution.v1.MsgFundCommunityPool") + proto.RegisterType((*Params)(nil), "cosmos_sdk.x.distribution.v1.Params") + proto.RegisterType((*ValidatorHistoricalRewards)(nil), "cosmos_sdk.x.distribution.v1.ValidatorHistoricalRewards") + proto.RegisterType((*ValidatorCurrentRewards)(nil), "cosmos_sdk.x.distribution.v1.ValidatorCurrentRewards") + proto.RegisterType((*ValidatorAccumulatedCommission)(nil), "cosmos_sdk.x.distribution.v1.ValidatorAccumulatedCommission") + proto.RegisterType((*ValidatorOutstandingRewards)(nil), "cosmos_sdk.x.distribution.v1.ValidatorOutstandingRewards") + proto.RegisterType((*ValidatorSlashEvent)(nil), "cosmos_sdk.x.distribution.v1.ValidatorSlashEvent") + proto.RegisterType((*ValidatorSlashEvents)(nil), "cosmos_sdk.x.distribution.v1.ValidatorSlashEvents") + proto.RegisterType((*FeePool)(nil), "cosmos_sdk.x.distribution.v1.FeePool") + proto.RegisterType((*CommunityPoolSpendProposal)(nil), "cosmos_sdk.x.distribution.v1.CommunityPoolSpendProposal") + proto.RegisterType((*DelegatorStartingInfo)(nil), "cosmos_sdk.x.distribution.v1.DelegatorStartingInfo") } func init() { proto.RegisterFile("x/distribution/types/types.proto", fileDescriptor_9fddf2a8e4a90b09) } @@ -749,75 +749,75 @@ func init() { proto.RegisterFile("x/distribution/types/types.proto", fileDescrip var fileDescriptor_9fddf2a8e4a90b09 = []byte{ // 1113 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0x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a3, 0x31, 0x46, 0xaa, 0xef, + 0xe7, 0x5e, 0x42, 0xdf, 0x5f, 0x1b, 0xff, 0xfc, 0xb1, 0x99, 0x89, 0xae, 0xea, 0x6f, 0x00, 0x0b, + 0xf1, 0x47, 0xe2, 0x9e, 0xc4, 0x5c, 0x52, 0xbf, 0xfe, 0x9e, 0x7f, 0x10, 0x55, 0xca, 0x80, 0x93, + 0x36, 0x65, 0x61, 0xfb, 0x49, 0xe7, 0x41, 0xaa, 0x52, 0xf6, 0x2d, 0x40, 0xd6, 0x54, 0x2f, 0xa2, + 0xb3, 0x60, 0x1f, 0x8e, 0x0a, 0x89, 0x0f, 0x89, 0x4e, 0x81, 0x77, 0x86, 0xee, 0x82, 0x93, 0x8a, + 0x28, 0x02, 0x41, 0x96, 0x02, 0x33, 0xb6, 0xe0, 0x58, 0x83, 0xd0, 0x7a, 0x43, 0x79, 0x9d, 0xab, + 0x2e, 0xff, 0xd5, 0x35, 0xa7, 0x1d, 0x4e, 0xc2, 0x0a, 0xef, 0xdb, 0x6a, 0x2a, 0x11, 0xd9, 0x37, + 0x81, 0x2c, 0xbd, 0xb9, 0xfa, 0xfa, 0x4f, 0x27, 0x25, 0xf0, 0xf4, 0xa4, 0x04, 0x9e, 0x9d, 0x94, + 0xc0, 0x9f, 0x27, 0x25, 0xf0, 0xcd, 0x69, 0x29, 0xf3, 0xec, 0xb4, 0x94, 0xf9, 0xfd, 0xb4, 0x94, + 0xf9, 0x78, 0x34, 0x92, 0x51, 0x1b, 0x8b, 0xfe, 0xcd, 0xb8, 0xf3, 0x6f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x9c, 0x88, 0x6a, 0xf1, 0xe3, 0x0c, 0x00, 0x00, } func (this *MsgSetWithdrawAddress) Equal(that interface{}) bool { From 333066efa8045edf0b844e891743490f0b4e1e66 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Wed, 26 Feb 2020 20:16:48 -0500 Subject: [PATCH 10/31] Fix distribution proto package --- codec/std/std.pb.go | 2 +- x/distribution/types/types.pb.go | 140 +++++++++++++++---------------- x/distribution/types/types.proto | 2 +- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/codec/std/std.pb.go b/codec/std/std.pb.go index f60238c77..985a5f8b5 100644 --- a/codec/std/std.pb.go +++ b/codec/std/std.pb.go @@ -5,6 +5,7 @@ package std import ( fmt "fmt" + types2 "github.com/cosmos/cosmos-sdk/x/distribution/types" github_com_cosmos_cosmos_sdk_x_gov_types "github.com/cosmos/cosmos-sdk/x/gov/types" types "github.com/cosmos/cosmos-sdk/x/gov/types" proposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" @@ -15,7 +16,6 @@ import ( io "io" math "math" math_bits "math/bits" - types2 "x/distribution/types" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/distribution/types/types.pb.go b/x/distribution/types/types.pb.go index 4bb5f5538..e8e131f3a 100644 --- a/x/distribution/types/types.pb.go +++ b/x/distribution/types/types.pb.go @@ -747,77 +747,77 @@ func init() { func init() { proto.RegisterFile("x/distribution/types/types.proto", fileDescriptor_9fddf2a8e4a90b09) } var fileDescriptor_9fddf2a8e4a90b09 = []byte{ - // 1113 bytes of a gzipped FileDescriptorProto + // 1116 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x38, 0x4e, 0x9a, 0x4c, 0xd3, 0xa4, 0xd9, 0xd8, 0x49, 0xe4, 0x14, 0xaf, 0x35, 0x88, - 0x2a, 0x12, 0x8a, 0x43, 0xe8, 0x2d, 0x07, 0xa4, 0x38, 0x3f, 0x04, 0xa8, 0xa1, 0xd1, 0x26, 0x14, - 0x09, 0x09, 0xad, 0xc6, 0xbb, 0x13, 0x7b, 0x94, 0xf5, 0xce, 0x6a, 0x66, 0x6c, 0x27, 0xbd, 0x20, - 0x71, 0x02, 0x01, 0x15,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0x62, 0x8e, 0x9b, + 0xc2, 0x38, 0x84, 0x37, 0x9d, 0xde, 0x5e, 0x6c, 0x89, 0x8f, 0x22, 0x2f, 0xc7, 0xab, 0x5b, 0xa1, + 0xd8, 0x3f, 0xbb, 0xe6, 0x9d, 0x4b, 0x70, 0x6c, 0x10, 0xe7, 0xac, 0x6b, 0xe6, 0x95, 0xf3, 0xe7, + 0xc0, 0x90, 0x35, 0x11, 0x3f, 0xef, 0xe3, 0x23, 0xe3, 0x33, 0x98, 0xaf, 0x61, 0x41, 0xec, 0x80, + 0xb3, 0x80, 0x09, 0xc2, 0x6d, 0x1e, 0xdd, 0xf7, 0x68, 0x4f, 0xe3, 0xd5, 0xed, 0xa1, 0x39, 0x17, + 0x14, 0xe7, 0x20, 0x4c, 0x64, 0x19, 0x61, 0x78, 0x57, 0x47, 0x75, 0x62, 0x7d, 0x0e, 0x60, 0xa1, + 0xc6, 0xfc, 0x96, 0xb8, 0x20, 0x61, 0x24, 0x92, 0xf0, 0xe1, 0xd0, 0x12, 0x6e, 0x6b, 0x09, 0x83, + 0x40, 0x91, 0x35, 0x13, 0xc5, 0xfb, 0x44, 0xec, 0xc3, 0xc2, 0xb9, 0x9a, 0x62, 0x13, 0x1f, 0xd7, + 0x3c, 0xe2, 0xce, 0xe7, 0xca, 0x60, 0x71, 0xac, 0x5a, 0x4e, 0x50, 0x07, 0x4e, 0x43, 0xd6, 0x4c, + 0xba, 0x9c, 0x6c, 0xaa, 0xe8, 0x6a, 0xee, 0xd1, 0x63, 0x33, 0x83, 0xbe, 0xcc, 0xc2, 0x62, 0x9c, + 0x36, 0xef, 0x51, 0x21, 0x19, 0xa7, 0x0e, 0xf6, 0x14, 0xb3, 0x30, 0x7e, 0x02, 0x70, 0xce, 0x69, + 0x35, 0x5b, 0x1e, 0x96, 0xb4, 0x4d, 0xb4, 0x4c, 0x9b, 0x63, 0x49, 0x99, 0xbe, 0xba, 0xb3, 0x7d, + 0x57, 0x77, 0x83, 0x38, 0xd1,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, 0xbf, 0x24, 0xee, 0x49, 0xcc, 0x25, 0xf5, 0xeb, 0xef, 0xfb, 0x07, 0x51, 0xa5, 0x0c, 0x38, + 0x69, 0x53, 0x16, 0xb6, 0x9f, 0x74, 0x1e, 0xa4, 0x2a, 0x65, 0xdf, 0x04, 0x64, 0x4d, 0xf6, 0x22, + 0x3a, 0x0b, 0xf6, 0xe1, 0x35, 0x21, 0xf1, 0x21, 0xd1, 0x29, 0xf0, 0xee, 0xd0, 0x5d, 0x70, 0x42, + 0x11, 0x45, 0x20, 0xc8, 0x52, 0x60, 0xc6, 0x26, 0x1c, 0x6d, 0x10, 0x5a, 0x6f, 0x28, 0xaf, 0x73, + 0xd5, 0xa5, 0xbf, 0xbb, 0xe6, 0x94, 0xc3, 0x49, 0x58, 0xe1, 0x7d, 0x5b, 0x0d, 0x25, 0x22, 0xfb, + 0x06, 0x90, 0xa5, 0x17, 0x57, 0x77, 0x7e, 0x3e, 0x29, 0x81, 0xa7, 0x27, 0x25, 0xf0, 0xec, 0xa4, + 0x04, 0xfe, 0x3a, 0x29, 0x81, 0x6f, 0x4f, 0x4b, 0x99, 0x67, 0xa7, 0xa5, 0xcc, 0x1f, 0xa7, 0xa5, + 0xcc, 0x27, 0x2b, 0x2f, 0xd4, 0x38, 0xe8, 0x83, 0xa7, 0x36, 0x1a, 0x7d, 0x92, 0xdc, 0xfd, 0x2f, + 0x00, 0x00, 0xff, 0xff, 0x34, 0x5a, 0x18, 0x60, 0x0f, 0x0d, 0x00, 0x00, } func (this *MsgSetWithdrawAddress) Equal(that interface{}) bool { diff --git a/x/distribution/types/types.proto b/x/distribution/types/types.proto index aade33d9d..db6c4e907 100644 --- a/x/distribution/types/types.proto +++ b/x/distribution/types/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package cosmos_sdk.x.distribution.v1; -option go_package = "types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; option (gogoproto.equal_all) = true; import "third_party/proto/gogoproto/gogo.proto"; From 81735debe58322dd4e5515d3fc63d1ec7a74fd7c Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Wed, 26 Feb 2020 20:47:45 -0500 Subject: [PATCH 11/31] Fix proposal marshaling, make Proposal extend ProposalBase --- simapp/codec/codec.go | 11 ++++++----- x/gov/types/proposal.go | 29 ++++++++++------------------- x/gov/types/types.proto | 27 +++++++++++++++++++-------- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/simapp/codec/codec.go b/simapp/codec/codec.go index 0c9f910e6..284e934e9 100644 --- a/simapp/codec/codec.go +++ b/simapp/codec/codec.go @@ -161,16 +161,17 @@ func (c *Codec) MarshalProposal(p types.Proposal) ([]byte, error) { return c.Marshaler.MarshalBinaryBare(stdProposal) } -func (c *Codec) UnmarshalProposal(bz []byte) (types.Proposal, error) { +func (c *Codec) UnmarshalProposal(bz []byte, p *types.Proposal) error { stdProposal := &cosmos_sdk_x_v1.StdProposal{} if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, stdProposal); err != nil { - return nil, err + return err } - return types.Proposal{ - //Content: stdProposal.Content.GetContent(), + *p = types.Proposal{ + Content: stdProposal.Content.GetContent(), ProposalBase: stdProposal.ProposalBase, - }, nil + } + return nil } // ---------------------------------------------------------------------------- diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index 66658cd67..15d23ddf7 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -17,29 +17,21 @@ const DefaultStartingProposalID uint64 = 1 // on network changes. type Proposal struct { Content `json:"content" yaml:"content"` // Proposal content interface - - ProposalID uint64 `json:"id" yaml:"id"` // ID of the proposal - Status ProposalStatus `json:"proposal_status" yaml:"proposal_status"` // Status of the Proposal {Pending, Active, Passed, Rejected} - FinalTallyResult TallyResult `json:"final_tally_result" yaml:"final_tally_result"` // Result of Tallys - - SubmitTime time.Time `json:"submit_time" yaml:"submit_time"` // Time of the block where TxGovSubmitProposal was included - DepositEndTime time.Time `json:"deposit_end_time" yaml:"deposit_end_time"` // Time that the Proposal would expire if deposit amount isn't met - TotalDeposit sdk.Coins `json:"total_deposit" yaml:"total_deposit"` // Current deposit on this proposal. Initial value is set at InitialDeposit - - VotingStartTime time.Time `json:"voting_start_time" yaml:"voting_start_time"` // Time of the block where MinDeposit was reached. -1 if MinDeposit is not reached - VotingEndTime time.Time `json:"voting_end_time" yaml:"voting_end_time"` // Time that the VotingPeriod for this proposal will end and votes will be tallied + ProposalBase } // NewProposal creates a new Proposal instance func NewProposal(content Content, id uint64, submitTime, depositEndTime time.Time) Proposal { return Proposal{ - Content: content, - ProposalID: id, - Status: StatusDepositPeriod, - FinalTallyResult: EmptyTallyResult(), - TotalDeposit: sdk.NewCoins(), - SubmitTime: submitTime, - DepositEndTime: depositEndTime, + Content: content, + ProposalBase: ProposalBase{ + ProposalID: id, + Status: StatusDepositPeriod, + FinalTallyResult: EmptyTallyResult(), + TotalDeposit: sdk.NewCoins(), + SubmitTime: submitTime, + DepositEndTime: depositEndTime, + }, } } @@ -78,7 +70,6 @@ func (p Proposals) String() string { type ( // ProposalQueue defines a queue for proposal ids ProposalQueue []uint64 - ) // ProposalStatusFromString turns a string into a ProposalStatus diff --git a/x/gov/types/types.proto b/x/gov/types/types.proto index 0eaa5c60b..967b847d5 100644 --- a/x/gov/types/types.proto +++ b/x/gov/types/types.proto @@ -69,14 +69,25 @@ message ProposalBase { option (gogoproto.goproto_stringer) = true; option (gogoproto.face) = true; uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" - ,(gogoproto.moretags) = "yaml:\"proposal_id\""]; - ProposalStatus status = 2; - TallyResult final_tally_result = 3 [(gogoproto.nullable) = false]; - google.protobuf.Timestamp submit_time = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp deposit_end_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - repeated cosmos_sdk.v1.Coin total_deposit = 6 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - google.protobuf.Timestamp voting_start_time = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp voting_end_time = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + ,(gogoproto.moretags) = "yaml:\"id\""]; + ProposalStatus status = 2 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; + TallyResult final_tally_result = 3 [(gogoproto.nullable) = false + ,(gogoproto.moretags) = "yaml:\"final_tally_result\""]; + google.protobuf.Timestamp submit_time = 4 [(gogoproto.stdtime) = true + ,(gogoproto.nullable) = false + ,(gogoproto.moretags) = "yaml:\"submit_time\""]; + google.protobuf.Timestamp deposit_end_time = 5 [(gogoproto.stdtime) = true + ,(gogoproto.nullable) = false + ,(gogoproto.moretags) = "yaml:\"deposit_end_time\""]; + repeated cosmos_sdk.v1.Coin total_deposit = 6 [(gogoproto.nullable) = false + ,(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ,(gogoproto.moretags) = "yaml:\"total_deposit\""]; + google.protobuf.Timestamp voting_start_time = 7 [(gogoproto.stdtime) = true + ,(gogoproto.nullable) = false + ,(gogoproto.moretags) = "yaml:\"voting_start_time\""]; + google.protobuf.Timestamp voting_end_time = 8 [(gogoproto.stdtime) = true + ,(gogoproto.nullable) = false + ,(gogoproto.moretags) = "yaml:\"voting_end_time\""]; } // ProposalStatus is a type alias that represents a proposal status as a byte From 8f131e2e0c8d0ef346b12e528fce45eae0cb1cef Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 09:14:17 -0500 Subject: [PATCH 12/31] Fix and updates gov proto types --- x/gov/types/types.pb.go | 718 ++++++---------------------------------- x/gov/types/types.proto | 185 ++++++----- 2 files changed, 208 insertions(+), 695 deletions(-) diff --git a/x/gov/types/types.pb.go b/x/gov/types/types.pb.go index 3f7a18cce..56bba9adf 100644 --- a/x/gov/types/types.pb.go +++ b/x/gov/types/types.pb.go @@ -12,7 +12,6 @@ import ( proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "github.com/golang/protobuf/ptypes/timestamp" - _ "github.com/regen-network/cosmos-proto" io "io" math "math" math_bits "math/bits" @@ -291,15 +290,18 @@ func (m *Deposit) XXX_DiscardUnknown() { var xxx_messageInfo_Deposit proto.InternalMessageInfo +// ProposalBase defines the core field members of a governance proposal. It includes +// all static fields (i.e fields excluding the dynamic Content). A full proposal +// extends the ProposalBase with Content. type ProposalBase struct { - ProposalID uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` - Status ProposalStatus `protobuf:"varint,2,opt,name=status,proto3,enum=cosmos_sdk.x.gov.v1.ProposalStatus" json:"status,omitempty"` - FinalTallyResult TallyResult `protobuf:"bytes,3,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"` - SubmitTime time.Time `protobuf:"bytes,4,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time"` - DepositEndTime time.Time `protobuf:"bytes,5,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time"` - TotalDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=total_deposit,json=totalDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total_deposit"` - VotingStartTime time.Time `protobuf:"bytes,7,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time"` - VotingEndTime time.Time `protobuf:"bytes,8,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time"` + ProposalID uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"id" yaml:"id"` + Status ProposalStatus `protobuf:"varint,2,opt,name=status,proto3,enum=cosmos_sdk.x.gov.v1.ProposalStatus" json:"status,omitempty" yaml:"proposal_status"` + FinalTallyResult TallyResult `protobuf:"bytes,3,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result" yaml:"final_tally_result"` + SubmitTime time.Time `protobuf:"bytes,4,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time" yaml:"submit_time"` + DepositEndTime time.Time `protobuf:"bytes,5,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,6,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,7,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time" yaml:"voting_start_time"` + VotingEndTime time.Time `protobuf:"bytes,8,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time" yaml:"voting_end_time"` } func (m *ProposalBase) Reset() { *m = ProposalBase{} } @@ -375,6 +377,8 @@ func (m *TallyResult) XXX_DiscardUnknown() { var xxx_messageInfo_TallyResult proto.InternalMessageInfo +// Vote defines a vote on a governance proposal. A vote corresponds to 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 github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=voter,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"voter,omitempty"` @@ -413,114 +417,6 @@ func (m *Vote) XXX_DiscardUnknown() { var xxx_messageInfo_Vote proto.InternalMessageInfo -type BasicProposal struct { - *ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base,omitempty"` - Content *BasicContent `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` -} - -func (m *BasicProposal) Reset() { *m = BasicProposal{} } -func (*BasicProposal) ProtoMessage() {} -func (*BasicProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_a5ae5e91b5b3fb03, []int{8} -} -func (m *BasicProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BasicProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BasicProposal.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 *BasicProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_BasicProposal.Merge(m, src) -} -func (m *BasicProposal) XXX_Size() int { - return m.Size() -} -func (m *BasicProposal) XXX_DiscardUnknown() { - xxx_messageInfo_BasicProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_BasicProposal proto.InternalMessageInfo - -type BasicContent struct { - // Types that are valid to be assigned to Sum: - // *BasicContent_Text - Sum isBasicContent_Sum `protobuf_oneof:"sum"` -} - -func (m *BasicContent) Reset() { *m = BasicContent{} } -func (*BasicContent) ProtoMessage() {} -func (*BasicContent) Descriptor() ([]byte, []int) { - return fileDescriptor_a5ae5e91b5b3fb03, []int{9} -} -func (m *BasicContent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BasicContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BasicContent.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 *BasicContent) XXX_Merge(src proto.Message) { - xxx_messageInfo_BasicContent.Merge(m, src) -} -func (m *BasicContent) XXX_Size() int { - return m.Size() -} -func (m *BasicContent) XXX_DiscardUnknown() { - xxx_messageInfo_BasicContent.DiscardUnknown(m) -} - -var xxx_messageInfo_BasicContent proto.InternalMessageInfo - -type isBasicContent_Sum interface { - isBasicContent_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type BasicContent_Text struct { - Text *TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"` -} - -func (*BasicContent_Text) isBasicContent_Sum() {} - -func (m *BasicContent) GetSum() isBasicContent_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *BasicContent) GetText() *TextProposal { - if x, ok := m.GetSum().(*BasicContent_Text); ok { - return x.Text - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*BasicContent) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*BasicContent_Text)(nil), - } -} - func init() { proto.RegisterEnum("cosmos_sdk.x.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos_sdk.x.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -532,90 +428,86 @@ func init() { proto.RegisterType((*ProposalBase)(nil), "cosmos_sdk.x.gov.v1.ProposalBase") proto.RegisterType((*TallyResult)(nil), "cosmos_sdk.x.gov.v1.TallyResult") proto.RegisterType((*Vote)(nil), "cosmos_sdk.x.gov.v1.Vote") - proto.RegisterType((*BasicProposal)(nil), "cosmos_sdk.x.gov.v1.BasicProposal") - proto.RegisterType((*BasicContent)(nil), "cosmos_sdk.x.gov.v1.BasicContent") } func init() { proto.RegisterFile("x/gov/types/types.proto", fileDescriptor_a5ae5e91b5b3fb03) } var fileDescriptor_a5ae5e91b5b3fb03 = []byte{ - // 1208 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcf, 0x8b, 0xdb, 0x46, - 0x1b, 0x96, 0x6c, 0xef, 0x7a, 0xf3, 0xfa, 0x47, 0x94, 0xd9, 0x7c, 0xc9, 0x22, 0x3e, 0x24, 0xd5, - 0x2d, 0x61, 0x9b, 0x10, 0x6d, 0xb3, 0x39, 0x04, 0x36, 0x50, 0x6a, 0xc5, 0x4a, 0xe2, 0x90, 0xb5, - 0x8d, 0x6c, 0x36, 0xa4, 0x50, 0x84, 0xd6, 0x52, 0xbc, 0x4a, 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, 0x7b, 0xf0, 0x44, 0x11, - 0x1e, 0x3d, 0x51, 0x84, 0xdb, 0xbb, 0x8a, 0xf0, 0x60, 0x57, 0x11, 0x1f, 0xee, 0x2a, 0xe2, 0x6f, - 0xbb, 0x8a, 0x78, 0xe7, 0xa9, 0x22, 0x3c, 0x7c, 0xaa, 0x08, 0x8f, 0x9e, 0x2a, 0xc2, 0xc7, 0xaf, - 0x4e, 0xea, 0xc4, 0xff, 0x1b, 0x9b, 0xf3, 0x2c, 0x28, 0xcf, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, - 0xaa, 0x0c, 0xd1, 0xcc, 0x85, 0x0c, 0x00, 0x00, + // 1181 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xc1, 0x6f, 0xd3, 0x56, + 0x18, 0xb7, 0x93, 0x36, 0x6d, 0x5f, 0xd2, 0x60, 0x5e, 0x3b, 0xc8, 0xac, 0xc9, 0x36, 0x06, 0xa1, + 0x8e, 0x09, 0x67, 0x94, 0xc3, 0x24, 0x0e, 0xd3, 0x62, 0x62, 0x20, 0x88, 0x26, 0x91, 0x13, 0x15, + 0xb1, 0x69, 0xb2, 0xdc, 0xd8, 0xb8, 0x1e, 0x8e, 0x5f, 0x96, 0xf7, 0x92, 0x91, 0x1b, 0xda, 0x61, + 0x9a, 0x72, 0x42, 0x3b, 0xed, 0x12, 0x09, 0x69, 0x1c, 0xd0, 0xb4, 0xc3, 0xfe, 0x86, 0x9d, 0x90, + 0x76, 0x18, 0x47, 0x34, 0x4d, 0x61, 0x94, 0xdb, 0xb4, 0x13, 0xd2, 0x2e, 0x3b, 0x4d, 0xf6, 0x7b, + 0xa6, 0x0e, 0x2d, 0x83, 0x8a, 0x4d, 0x93, 0x76, 0x69, 0xeb, 0xef, 0x7d, 0xdf, 0xef, 0xf7, 0xbe, + 0xdf, 0xfb, 0xde, 0xef, 0xa9, 0xe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0xdf, 0x47, 0x0e, 0x7c, 0x1b, 0x2c, 0x6f, 0x36, 0xda, + 0xb5, 0xfa, 0xc5, 0x24, 0x37, 0x23, 0x1e, 0x19, 0x4f, 0x14, 0x48, 0x73, 0x37, 0xe3, 0x3b, 0xc5, + 0x52, 0xdf, 0x02, 0xb9, 0x66, 0xa5, 0xd5, 0x32, 0xaa, 0x42, 0x56, 0x14, 0xc6, 0x13, 0xa5, 0x40, + 0x73, 0x9a, 0x36, 0xc6, 0xae, 0x03, 0x15, 0xb0, 0x68, 0x1a, 0x97, 0x8d, 0xf3, 0x6d, 0xa3, 0x2a, + 0xcc, 0x89, 0x70, 0x3c, 0x51, 0x8a, 0x74, 0xdd, 0x74, 0x3f, 0x71, 0x3b, 0xc4, 0x8d, 0xeb, 0x2f, + 0x54, 0x6a, 0x57, 0x8c, 0xaa, 0x30, 0x9f, 0xae, 0xbf, 0x60, 0xfb, 0x81, 0xeb, 0xcc, 0xb6, 0xab, + 0xd7, 0xef, 0x3f, 0x96, 0xb8, 0x87, 0x8f, 0x25, 0xee, 0xd6, 0x8e, 0xc4, 0xdd, 0xdf, 0x91, 0xf8, + 0x07, 0x3b, 0x12, 0xff, 0xeb, 0x8e, 0xc4, 0xdf, 0x7e, 0x22, 0x71, 0x0f, 0x9e, 0x48, 0xdc, 0xc3, + 0x27, 0x12, 0xf7, 0xe1, 0xdf, 0x5b, 0x5e, 0xea, 0x7f, 0x81, 0xad, 0x5c, 0xec, 0x2a, 0x67, 0xff, + 0x0a, 0x00, 0x00, 0xff, 0xff, 0x48, 0xe7, 0x6e, 0x7f, 0x21, 0x0c, 0x00, 0x00, } type ProposalBaseFace interface { @@ -683,29 +575,6 @@ func NewProposalBaseFromFace(that ProposalBaseFace) *ProposalBase { return this } -func (this *BasicContent) GetContent() Content { - if x := this.GetText(); x != nil { - return x - } - return nil -} - -func (this *BasicContent) SetContent(value Content) error { - if value == nil { - this.Sum = nil - return nil - } - switch vt := value.(type) { - case *TextProposal: - this.Sum = &BasicContent_Text{vt} - return nil - case TextProposal: - this.Sum = &BasicContent_Text{&vt} - return nil - } - return fmt.Errorf("can't encode value of type %T as message BasicContent", value) -} - func (m *MsgSubmitProposalBase) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1117,106 +986,6 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BasicProposal) 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 *BasicProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BasicProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Content != nil { - { - size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ProposalBase != nil { - { - size, err := m.ProposalBase.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BasicContent) 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 *BasicContent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BasicContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *BasicContent_Text) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BasicContent_Text) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Text != nil { - { - size, err := m.Text.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -1394,48 +1163,6 @@ func (m *Vote) Size() (n int) { return n } -func (m *BasicProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalBase != nil { - l = m.ProposalBase.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Content != nil { - l = m.Content.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *BasicContent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *BasicContent_Text) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Text != nil { - l = m.Text.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1458,26 +1185,6 @@ func (this *MsgSubmitProposalBase) String() string { }, "") return s } -func (this *BasicContent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&BasicContent{`, - `Sum:` + fmt.Sprintf("%v", this.Sum) + `,`, - `}`, - }, "") - return s -} -func (this *BasicContent_Text) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&BasicContent_Text{`, - `Text:` + strings.Replace(fmt.Sprintf("%v", this.Text), "TextProposal", "TextProposal", 1) + `,`, - `}`, - }, "") - return s -} func valueToStringTypes(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -2452,7 +2159,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Yes", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2462,15 +2169,16 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } @@ -2485,7 +2193,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Abstain", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2495,15 +2203,16 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } @@ -2518,7 +2227,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field No", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2528,15 +2237,16 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } @@ -2551,7 +2261,7 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NoWithVeto", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -2561,15 +2271,16 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTypes } @@ -2729,219 +2440,6 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } return nil } -func (m *BasicProposal) 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 ErrIntOverflowTypes - } - 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: BasicProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BasicProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalBase", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ProposalBase == nil { - m.ProposalBase = &ProposalBase{} - } - if err := m.ProposalBase.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Content == nil { - m.Content = &BasicContent{} - } - if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BasicContent) 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 ErrIntOverflowTypes - } - 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: BasicContent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BasicContent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TextProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &BasicContent_Text{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/types.proto b/x/gov/types/types.proto index 967b847d5..d590397ca 100644 --- a/x/gov/types/types.proto +++ b/x/gov/types/types.proto @@ -3,131 +3,146 @@ package cosmos_sdk.x.gov.v1; import "types/types.proto"; import "third_party/proto/gogoproto/gogo.proto"; -import "third_party/proto/cosmos-proto/cosmos.proto"; +// import "third_party/proto/cosmos-proto/cosmos.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; +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; +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; message MsgSubmitProposalBase { - option (gogoproto.stringer) = true; - repeated cosmos_sdk.v1.Coin intial_deposit = 1 [(gogoproto.nullable) = false - ,(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ,(gogoproto.moretags) = "yaml:\"initial_deposit\""]; - bytes proposer = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + option (gogoproto.stringer) = true; + + repeated cosmos_sdk.v1.Coin intial_deposit = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"initial_deposit\"" + ]; + bytes proposer = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; } // MsgDeposit defines a message to submit a deposit to an existing proposal message MsgDeposit { - uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" - ,(gogoproto.moretags) = "yaml:\"proposal_id\"" - ,(gogoproto.jsontag) = "proposal_id"]; - bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; - repeated cosmos_sdk.v1.Coin amount = 3 [(gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + uint64 proposal_id = 1 [ + (gogoproto.customname) = "ProposalID", + (gogoproto.moretags) = "yaml:\"proposal_id\"", + (gogoproto.jsontag) = "proposal_id" + ]; + bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + repeated cosmos_sdk.v1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } // VoteOption defines a vote option enum VoteOption { - option (gogoproto.enum_stringer) = false; - option (gogoproto.goproto_enum_stringer) = false; - option (gogoproto.goproto_enum_prefix) = false; - EMPTY = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; - YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; - ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; - NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; - NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; + option (gogoproto.enum_stringer) = false; + option (gogoproto.goproto_enum_stringer) = false; + option (gogoproto.goproto_enum_prefix) = false; + + EMPTY = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; + YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; + ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; + NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; + NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; } // MsgVote defines a message to cast a vote message MsgVote { - uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" - ,(gogoproto.moretags) = "yaml:\"proposal_id\"" - ,(gogoproto.jsontag) = "proposal_id"]; - bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; - VoteOption option = 3; + uint64 proposal_id = 1 [ + (gogoproto.customname) = "ProposalID", + (gogoproto.moretags) = "yaml:\"proposal_id\"", + (gogoproto.jsontag) = "proposal_id" + ]; + bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + VoteOption option = 3; } // TextProposal defines a standard text proposal whose changes need to be // manually updated in case of approval message TextProposal { - string title = 1; - string description = 2; + string title = 1; + string description = 2; } // Deposit defines an amount deposited by an account address to an active proposal message Deposit { - uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" - ,(gogoproto.moretags) = "yaml:\"proposal_id\""]; - bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; - repeated cosmos_sdk.v1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID", (gogoproto.moretags) = "yaml:\"proposal_id\""]; + bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + repeated cosmos_sdk.v1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } +// ProposalBase defines the core field members of a governance proposal. It includes +// all static fields (i.e fields excluding the dynamic Content). A full proposal +// extends the ProposalBase with Content. message ProposalBase { - option (gogoproto.goproto_stringer) = true; - option (gogoproto.face) = true; - uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" - ,(gogoproto.moretags) = "yaml:\"id\""]; - ProposalStatus status = 2 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; - TallyResult final_tally_result = 3 [(gogoproto.nullable) = false - ,(gogoproto.moretags) = "yaml:\"final_tally_result\""]; - google.protobuf.Timestamp submit_time = 4 [(gogoproto.stdtime) = true - ,(gogoproto.nullable) = false - ,(gogoproto.moretags) = "yaml:\"submit_time\""]; - google.protobuf.Timestamp deposit_end_time = 5 [(gogoproto.stdtime) = true - ,(gogoproto.nullable) = false - ,(gogoproto.moretags) = "yaml:\"deposit_end_time\""]; - repeated cosmos_sdk.v1.Coin total_deposit = 6 [(gogoproto.nullable) = false - ,(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ,(gogoproto.moretags) = "yaml:\"total_deposit\""]; - google.protobuf.Timestamp voting_start_time = 7 [(gogoproto.stdtime) = true - ,(gogoproto.nullable) = false - ,(gogoproto.moretags) = "yaml:\"voting_start_time\""]; - google.protobuf.Timestamp voting_end_time = 8 [(gogoproto.stdtime) = true - ,(gogoproto.nullable) = false - ,(gogoproto.moretags) = "yaml:\"voting_end_time\""]; + option (gogoproto.goproto_stringer) = true; + option (gogoproto.face) = true; + + uint64 proposal_id = 1 + [(gogoproto.customname) = "ProposalID", (gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; + ProposalStatus status = 2 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; + TallyResult final_tally_result = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; + google.protobuf.Timestamp submit_time = 4 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; + google.protobuf.Timestamp deposit_end_time = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_end_time\""]; + repeated cosmos_sdk.v1.Coin total_deposit = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"total_deposit\"" + ]; + google.protobuf.Timestamp voting_start_time = 7 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_start_time\""]; + google.protobuf.Timestamp voting_end_time = 8 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""]; } // ProposalStatus is a type alias that represents a proposal status as a byte enum ProposalStatus { - option (gogoproto.enum_stringer) = false; - option (gogoproto.goproto_enum_stringer) = false; - option (gogoproto.goproto_enum_prefix) = false; - NIL = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; - DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; - VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; - PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; - REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; - FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; + option (gogoproto.enum_stringer) = false; + option (gogoproto.goproto_enum_stringer) = false; + option (gogoproto.goproto_enum_prefix) = false; + + NIL = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; + DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; + VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; + PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; + REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; + FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; } // TallyResult defines a standard tally for a proposal message TallyResult { - bytes yes = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - bytes abstain = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - bytes no = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - bytes no_with_veto = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false - ,(gogoproto.moretags) = "yaml:\"no_with_veto\""]; + 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 no_with_veto = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"no_with_veto\"" + ]; } +// Vote defines a vote on a governance proposal. A vote corresponds to a proposal +// ID, the voter, and the vote option. message Vote { - uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID" - ,(gogoproto.moretags) = "yaml:\"proposal_id\""]; - bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; - VoteOption option = 3; + uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID", (gogoproto.moretags) = "yaml:\"proposal_id\""]; + bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + VoteOption option = 3; } -message BasicProposal { - ProposalBase base = 1 [(gogoproto.embed) = true]; - BasicContent content = 2; -} +// message BasicProposal { +// ProposalBase base = 1 [(gogoproto.embed) = true]; +// BasicContent content = 2; +// } -message BasicContent { - option (cosmos_proto.interface_type) = "Content"; - option (gogoproto.stringer) = true; - oneof sum { - TextProposal text = 1; - } -} +// message BasicContent { +// option (cosmos_proto.interface_type) = "Content"; +// option (gogoproto.stringer) = true; +// oneof sum { +// TextProposal text = 1; +// } +// } From 081e62cb2d25da06f2ba30e5a3ca1d77f97d63ee Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 11:54:43 -0500 Subject: [PATCH 13/31] Update codec --- x/evidence/types/codec.go | 2 +- x/gov/types/codec.go | 50 ++++++++++++++++----------------------- 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/x/evidence/types/codec.go b/x/evidence/types/codec.go index 6cfd762c3..d0a9d1a5e 100644 --- a/x/evidence/types/codec.go +++ b/x/evidence/types/codec.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/evidence/exported" ) -// EvidenceCodec defines the interface required to serialize evidence +// Codec defines the interface required to serialize evidence type Codec interface { codec.Marshaler diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index 5226877f9..a02491a12 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -4,6 +4,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" ) +// Codec defines the interface required to serialize custom x/gov types. type Codec interface { codec.Marshaler @@ -11,48 +12,39 @@ type Codec interface { UnmarshalProposal(bz []byte, ptr *Proposal) error } -// module codec -var ModuleCdc = codec.New() - -// RegisterCodec registers all the necessary types and interfaces for -// governance. +// RegisterCodec registers all the necessary types and interfaces for the +// governance module. func RegisterCodec(cdc *codec.Codec) { 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) - cdc.RegisterConcrete(TextProposal{}, "cosmos-sdk/TextProposal", nil) } // RegisterProposalTypeCodec registers an external proposal content type defined // in another module for the internal ModuleCdc. This allows the MsgSubmitProposal // to be correctly Amino encoded and decoded. +// +// NOTE: This should only be used for applications that are still using a concrete +// Amino codec for serialization. func RegisterProposalTypeCodec(o interface{}, name string) { - ModuleCdc.RegisterConcrete(o, name, nil) + amino.RegisterConcrete(o, name, nil) } -// TODO determine a good place to seal this codec +var ( + amino = codec.New() + + // ModuleCdc references the global x/gov module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding as Amino is + // still used for that purpose. + // + // The actual codec used for serialization should be provided to x/gov and + // defined at the application level. + ModuleCdc = codec.NewHybridCodec(amino) +) + func init() { - RegisterCodec(ModuleCdc) + RegisterCodec(amino) + codec.RegisterCrypto(amino) } - -type AminoGovCodec struct { - codec.Marshaler - amino *codec.Codec -} - -func NewAminoGovCodec(amino *codec.Codec) AminoGovCodec { - return AminoGovCodec{Marshaler: codec.NewHybridCodec(amino), amino: amino} -} - -func (a AminoGovCodec) MarshalProposal(p Proposal) ([]byte, error) { - return a.amino.MarshalBinaryBare(p) -} - -func (a AminoGovCodec) UnmarshalProposal(bz []byte, ptr *Proposal) error { - return a.amino.UnmarshalBinaryBare(bz, ptr) -} - -var _ Codec = AminoGovCodec{} From 725e2dc2b45ca3f8dba51f305837836147371f10 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 12:44:55 -0500 Subject: [PATCH 14/31] Update gov codec interface --- codec/std/std.pb.go | 1015 -------------------------------------- codec/std/std.proto | 28 -- simapp/codec/codec.go | 36 +- simapp/codec/codec.pb.go | 946 +++++++++++++++++++++++++++++++++-- simapp/codec/codec.proto | 25 + x/gov/alias.go | 1 + x/gov/types/codec.go | 4 +- x/gov/types/proposal.go | 18 +- x/gov/types/types.proto | 14 - 9 files changed, 960 insertions(+), 1127 deletions(-) delete mode 100644 codec/std/std.pb.go delete mode 100644 codec/std/std.proto diff --git a/codec/std/std.pb.go b/codec/std/std.pb.go deleted file mode 100644 index 985a5f8b5..000000000 --- a/codec/std/std.pb.go +++ /dev/null @@ -1,1015 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: codec/std/std.proto - -package std - -import ( - fmt "fmt" - types2 "github.com/cosmos/cosmos-sdk/x/distribution/types" - github_com_cosmos_cosmos_sdk_x_gov_types "github.com/cosmos/cosmos-sdk/x/gov/types" - types "github.com/cosmos/cosmos-sdk/x/gov/types" - proposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - types1 "github.com/cosmos/cosmos-sdk/x/upgrade/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/regen-network/cosmos-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 - -type StdProposal struct { - types.ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` - Content StdProposal_Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` -} - -func (m *StdProposal) Reset() { *m = StdProposal{} } -func (m *StdProposal) String() string { return proto.CompactTextString(m) } -func (*StdProposal) ProtoMessage() {} -func (*StdProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_bfdf2c6f71a73b14, []int{0} -} -func (m *StdProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StdProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StdProposal.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 *StdProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_StdProposal.Merge(m, src) -} -func (m *StdProposal) XXX_Size() int { - return m.Size() -} -func (m *StdProposal) XXX_DiscardUnknown() { - xxx_messageInfo_StdProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_StdProposal proto.InternalMessageInfo - -func (m *StdProposal) GetContent() StdProposal_Content { - if m != nil { - return m.Content - } - return StdProposal_Content{} -} - -type StdProposal_Content struct { - // Types that are valid to be assigned to Sum: - // *StdProposal_Content_Text - // *StdProposal_Content_ParameterChange - // *StdProposal_Content_SoftwareUpgrade - // *StdProposal_Content_CancelSoftwareUpgrade - // *StdProposal_Content_CommunityPoolSpend - Sum isStdProposal_Content_Sum `protobuf_oneof:"sum"` -} - -func (m *StdProposal_Content) Reset() { *m = StdProposal_Content{} } -func (m *StdProposal_Content) String() string { return proto.CompactTextString(m) } -func (*StdProposal_Content) ProtoMessage() {} -func (*StdProposal_Content) Descriptor() ([]byte, []int) { - return fileDescriptor_bfdf2c6f71a73b14, []int{0, 0} -} -func (m *StdProposal_Content) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StdProposal_Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StdProposal_Content.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 *StdProposal_Content) XXX_Merge(src proto.Message) { - xxx_messageInfo_StdProposal_Content.Merge(m, src) -} -func (m *StdProposal_Content) XXX_Size() int { - return m.Size() -} -func (m *StdProposal_Content) XXX_DiscardUnknown() { - xxx_messageInfo_StdProposal_Content.DiscardUnknown(m) -} - -var xxx_messageInfo_StdProposal_Content proto.InternalMessageInfo - -type isStdProposal_Content_Sum interface { - isStdProposal_Content_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type StdProposal_Content_Text struct { - Text *types.TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"` -} -type StdProposal_Content_ParameterChange struct { - ParameterChange *proposal.ParameterChangeProposal `protobuf:"bytes,2,opt,name=parameter_change,json=parameterChange,proto3,oneof" json:"parameter_change,omitempty"` -} -type StdProposal_Content_SoftwareUpgrade struct { - SoftwareUpgrade *types1.SoftwareUpgradeProposal `protobuf:"bytes,3,opt,name=software_upgrade,json=softwareUpgrade,proto3,oneof" json:"software_upgrade,omitempty"` -} -type StdProposal_Content_CancelSoftwareUpgrade struct { - CancelSoftwareUpgrade *types1.CancelSoftwareUpgradeProposal `protobuf:"bytes,4,opt,name=cancel_software_upgrade,json=cancelSoftwareUpgrade,proto3,oneof" json:"cancel_software_upgrade,omitempty"` -} -type StdProposal_Content_CommunityPoolSpend struct { - CommunityPoolSpend *types2.CommunityPoolSpendProposal `protobuf:"bytes,5,opt,name=community_pool_spend,json=communityPoolSpend,proto3,oneof" json:"community_pool_spend,omitempty"` -} - -func (*StdProposal_Content_Text) isStdProposal_Content_Sum() {} -func (*StdProposal_Content_ParameterChange) isStdProposal_Content_Sum() {} -func (*StdProposal_Content_SoftwareUpgrade) isStdProposal_Content_Sum() {} -func (*StdProposal_Content_CancelSoftwareUpgrade) isStdProposal_Content_Sum() {} -func (*StdProposal_Content_CommunityPoolSpend) isStdProposal_Content_Sum() {} - -func (m *StdProposal_Content) GetSum() isStdProposal_Content_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *StdProposal_Content) GetText() *types.TextProposal { - if x, ok := m.GetSum().(*StdProposal_Content_Text); ok { - return x.Text - } - return nil -} - -func (m *StdProposal_Content) GetParameterChange() *proposal.ParameterChangeProposal { - if x, ok := m.GetSum().(*StdProposal_Content_ParameterChange); ok { - return x.ParameterChange - } - return nil -} - -func (m *StdProposal_Content) GetSoftwareUpgrade() *types1.SoftwareUpgradeProposal { - if x, ok := m.GetSum().(*StdProposal_Content_SoftwareUpgrade); ok { - return x.SoftwareUpgrade - } - return nil -} - -func (m *StdProposal_Content) GetCancelSoftwareUpgrade() *types1.CancelSoftwareUpgradeProposal { - if x, ok := m.GetSum().(*StdProposal_Content_CancelSoftwareUpgrade); ok { - return x.CancelSoftwareUpgrade - } - return nil -} - -func (m *StdProposal_Content) GetCommunityPoolSpend() *types2.CommunityPoolSpendProposal { - if x, ok := m.GetSum().(*StdProposal_Content_CommunityPoolSpend); ok { - return x.CommunityPoolSpend - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*StdProposal_Content) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*StdProposal_Content_Text)(nil), - (*StdProposal_Content_ParameterChange)(nil), - (*StdProposal_Content_SoftwareUpgrade)(nil), - (*StdProposal_Content_CancelSoftwareUpgrade)(nil), - (*StdProposal_Content_CommunityPoolSpend)(nil), - } -} - -func init() { - proto.RegisterType((*StdProposal)(nil), "cosmos_sdk.x.v1.StdProposal") - proto.RegisterType((*StdProposal_Content)(nil), "cosmos_sdk.x.v1.StdProposal.Content") -} - -func init() { proto.RegisterFile("codec/std/std.proto", fileDescriptor_bfdf2c6f71a73b14) } - -var fileDescriptor_bfdf2c6f71a73b14 = []byte{ - // 492 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x4f, 0x6f, 0xd3, 0x30, - 0x18, 0xc6, 0x13, 0x96, 0x32, 0xe4, 0x1d, 0x36, 0x05, 0xd0, 0xaa, 0x22, 0x65, 0xe3, 0x8f, 0x26, - 0x24, 0x34, 0x7b, 0x03, 0x04, 0x88, 0x0b, 0xa8, 0xe5, 0xc0, 0x71, 0xea, 0xe0, 0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x67, 0x2b, 0xd5, 0xd7, 0xcf, 0x7f, - 0xff, 0xda, 0x3f, 0x88, 0x62, 0x3d, 0x2e, 0x46, 0x98, 0x41, 0x6a, 0x47, 0xa7, 0x1e, 0x27, 0xc5, - 0x4f, 0x48, 0x63, 0x2c, 0xce, 0xaf, 0x49, 0x07, 0xad, 0xa9, 0x22, 0xed, 0xbf, 0x3d, 0x9d, 0x07, - 0xee, 0x6c, 0x1e, 0xb8, 0x7f, 0xe7, 0x81, 0xfb, 0x7d, 0x11, 0x38, 0xb3, 0x45, 0xe0, 0xfc, 0x59, - 0x04, 0xce, 0xa7, 0xbd, 0x6b, 0x91, 0xe7, 0x43, 0x3e, 0xba, 0x69, 0xae, 0xff, 0xb3, 0x7f, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x30, 0x48, 0xf7, 0x0e, 0xf8, 0x03, 0x00, 0x00, -} - -func (this *StdProposal_Content) GetContent() github_com_cosmos_cosmos_sdk_x_gov_types.Content { - if x := this.GetText(); x != nil { - return x - } - if x := this.GetParameterChange(); x != nil { - return x - } - if x := this.GetSoftwareUpgrade(); x != nil { - return x - } - if x := this.GetCancelSoftwareUpgrade(); x != nil { - return x - } - if x := this.GetCommunityPoolSpend(); x != nil { - return x - } - return nil -} - -func (this *StdProposal_Content) SetContent(value github_com_cosmos_cosmos_sdk_x_gov_types.Content) error { - if value == nil { - this.Sum = nil - return nil - } - switch vt := value.(type) { - case *types.TextProposal: - this.Sum = &StdProposal_Content_Text{vt} - return nil - case types.TextProposal: - this.Sum = &StdProposal_Content_Text{&vt} - return nil - case *proposal.ParameterChangeProposal: - this.Sum = &StdProposal_Content_ParameterChange{vt} - return nil - case proposal.ParameterChangeProposal: - this.Sum = &StdProposal_Content_ParameterChange{&vt} - return nil - case *types1.SoftwareUpgradeProposal: - this.Sum = &StdProposal_Content_SoftwareUpgrade{vt} - return nil - case types1.SoftwareUpgradeProposal: - this.Sum = &StdProposal_Content_SoftwareUpgrade{&vt} - return nil - case *types1.CancelSoftwareUpgradeProposal: - this.Sum = &StdProposal_Content_CancelSoftwareUpgrade{vt} - return nil - case types1.CancelSoftwareUpgradeProposal: - this.Sum = &StdProposal_Content_CancelSoftwareUpgrade{&vt} - return nil - case *types2.CommunityPoolSpendProposal: - this.Sum = &StdProposal_Content_CommunityPoolSpend{vt} - return nil - case types2.CommunityPoolSpendProposal: - this.Sum = &StdProposal_Content_CommunityPoolSpend{&vt} - return nil - } - return fmt.Errorf("can't encode value of type %T as message StdProposal_Content", value) -} - -func (m *StdProposal) 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 *StdProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ProposalBase.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *StdProposal_Content) 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 *StdProposal_Content) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdProposal_Content) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *StdProposal_Content_Text) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdProposal_Content_Text) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Text != nil { - { - size, err := m.Text.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *StdProposal_Content_ParameterChange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdProposal_Content_ParameterChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ParameterChange != nil { - { - size, err := m.ParameterChange.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *StdProposal_Content_SoftwareUpgrade) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdProposal_Content_SoftwareUpgrade) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SoftwareUpgrade != nil { - { - size, err := m.SoftwareUpgrade.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *StdProposal_Content_CancelSoftwareUpgrade) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdProposal_Content_CancelSoftwareUpgrade) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.CancelSoftwareUpgrade != nil { - { - size, err := m.CancelSoftwareUpgrade.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *StdProposal_Content_CommunityPoolSpend) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StdProposal_Content_CommunityPoolSpend) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.CommunityPoolSpend != nil { - { - size, err := m.CommunityPoolSpend.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func encodeVarintStd(dAtA []byte, offset int, v uint64) int { - offset -= sovStd(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StdProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ProposalBase.Size() - n += 1 + l + sovStd(uint64(l)) - l = m.Content.Size() - n += 1 + l + sovStd(uint64(l)) - return n -} - -func (m *StdProposal_Content) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *StdProposal_Content_Text) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Text != nil { - l = m.Text.Size() - n += 1 + l + sovStd(uint64(l)) - } - return n -} -func (m *StdProposal_Content_ParameterChange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ParameterChange != nil { - l = m.ParameterChange.Size() - n += 1 + l + sovStd(uint64(l)) - } - return n -} -func (m *StdProposal_Content_SoftwareUpgrade) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SoftwareUpgrade != nil { - l = m.SoftwareUpgrade.Size() - n += 1 + l + sovStd(uint64(l)) - } - return n -} -func (m *StdProposal_Content_CancelSoftwareUpgrade) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CancelSoftwareUpgrade != nil { - l = m.CancelSoftwareUpgrade.Size() - n += 1 + l + sovStd(uint64(l)) - } - return n -} -func (m *StdProposal_Content_CommunityPoolSpend) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CommunityPoolSpend != nil { - l = m.CommunityPoolSpend.Size() - n += 1 + l + sovStd(uint64(l)) - } - return n -} - -func sovStd(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStd(x uint64) (n int) { - return sovStd(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *StdProposal) 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 ErrIntOverflowStd - } - 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: StdProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StdProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalBase", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProposalBase.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - 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 ErrIntOverflowStd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStd(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStd - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStd - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StdProposal_Content) 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 ErrIntOverflowStd - } - 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: Content: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Content: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.TextProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &StdProposal_Content_Text{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParameterChange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &proposal.ParameterChangeProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &StdProposal_Content_ParameterChange{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SoftwareUpgrade", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.SoftwareUpgradeProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &StdProposal_Content_SoftwareUpgrade{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CancelSoftwareUpgrade", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types1.CancelSoftwareUpgradeProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &StdProposal_Content_CancelSoftwareUpgrade{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommunityPoolSpend", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types2.CommunityPoolSpendProposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &StdProposal_Content_CommunityPoolSpend{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStd(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStd - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStd - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStd(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, ErrIntOverflowStd - } - 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, ErrIntOverflowStd - } - 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, ErrIntOverflowStd - } - 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, ErrInvalidLengthStd - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupStd - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthStd - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthStd = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStd = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupStd = fmt.Errorf("proto: unexpected end of group") -) diff --git a/codec/std/std.proto b/codec/std/std.proto deleted file mode 100644 index a99d35fb4..000000000 --- a/codec/std/std.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; -package cosmos_sdk.x.v1; - -import "third_party/proto/cosmos-proto/cosmos.proto"; -import "third_party/proto/gogoproto/gogo.proto"; -import "x/gov/types/types.proto"; -import "x/params/types/proposal/types.proto"; -import "x/upgrade/types/types.proto"; -import "x/distribution/types/types.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/codec/std"; - -message StdProposal { - cosmos_sdk.x.gov.v1.ProposalBase base = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - Content content = 2 [(gogoproto.nullable) = false]; - - message Content { - option (cosmos_proto.interface_type) = "github.com/cosmos/cosmos-sdk/x/gov/types.Content"; - oneof sum { - cosmos_sdk.x.gov.v1.TextProposal text = 1; - cosmos_sdk.x.params.v1.ParameterChangeProposal parameter_change = 2; - cosmos_sdk.x.upgrade.v1.SoftwareUpgradeProposal software_upgrade = 3; - cosmos_sdk.x.upgrade.v1.CancelSoftwareUpgradeProposal cancel_software_upgrade = 4; - cosmos_sdk.x.distribution.v1.CommunityPoolSpendProposal community_pool_spend = 5; - } - } -} - diff --git a/simapp/codec/codec.go b/simapp/codec/codec.go index 284e934e9..75dd59fb3 100644 --- a/simapp/codec/codec.go +++ b/simapp/codec/codec.go @@ -2,7 +2,6 @@ package codec import ( "github.com/cosmos/cosmos-sdk/codec" - cosmos_sdk_x_v1 "github.com/cosmos/cosmos-sdk/codec/std" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" @@ -10,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/vesting" "github.com/cosmos/cosmos-sdk/x/evidence" eviexported "github.com/cosmos/cosmos-sdk/x/evidence/exported" - "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/supply" supplyexported "github.com/cosmos/cosmos-sdk/x/supply/exported" ) @@ -19,6 +18,7 @@ var ( _ auth.Codec = (*Codec)(nil) _ supply.Codec = (*Codec)(nil) _ evidence.Codec = (*Codec)(nil) + _ gov.Codec = (*Codec)(nil) ) // Codec defines the application-level codec. This codec contains all the @@ -153,25 +153,31 @@ func (c *Codec) UnmarshalEvidenceJSON(bz []byte) (eviexported.Evidence, error) { return evidence.GetEvidence(), nil } -func (c *Codec) MarshalProposal(p types.Proposal) ([]byte, error) { - stdProposal := &cosmos_sdk_x_v1.StdProposal{ProposalBase: p.ProposalBase} - if err := stdProposal.Content.SetContent(p.Content); err != nil { +// MarshalProposal marshals a Proposal. It accepts a Proposal defined by the x/gov +// module and uses the application-level Proposal type which has the concrete +// Content implementation to serialize. +func (c *Codec) MarshalProposal(p gov.Proposal) ([]byte, error) { + proposal := &Proposal{ProposalBase: p.ProposalBase} + if err := proposal.Content.SetContent(p.Content); err != nil { return nil, err } - return c.Marshaler.MarshalBinaryBare(stdProposal) + + return c.Marshaler.MarshalBinaryLengthPrefixed(proposal) } -func (c *Codec) UnmarshalProposal(bz []byte, p *types.Proposal) error { - stdProposal := &cosmos_sdk_x_v1.StdProposal{} - if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, stdProposal); err != nil { - return err +// UnmarshalProposal decodes a Proposal defined by the x/gov module and uses the +// application-level Proposal type which has the concrete Content implementation +// to deserialize. +func (c *Codec) UnmarshalProposal(bz []byte) (gov.Proposal, error) { + proposal := &Proposal{} + if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, proposal); err != nil { + return gov.Proposal{}, err } - *p = types.Proposal{ - Content: stdProposal.Content.GetContent(), - ProposalBase: stdProposal.ProposalBase, - } - return nil + return gov.Proposal{ + Content: proposal.Content.GetContent(), + ProposalBase: proposal.ProposalBase, + }, nil } // ---------------------------------------------------------------------------- diff --git a/simapp/codec/codec.pb.go b/simapp/codec/codec.pb.go index b222403b4..d58635ad8 100644 --- a/simapp/codec/codec.pb.go +++ b/simapp/codec/codec.pb.go @@ -8,10 +8,15 @@ import ( github_com_cosmos_cosmos_sdk_x_auth_exported "github.com/cosmos/cosmos-sdk/x/auth/exported" types "github.com/cosmos/cosmos-sdk/x/auth/types" types1 "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + types6 "github.com/cosmos/cosmos-sdk/x/distribution/types" github_com_cosmos_cosmos_sdk_x_evidence_exported "github.com/cosmos/cosmos-sdk/x/evidence/exported" types3 "github.com/cosmos/cosmos-sdk/x/evidence/types" + github_com_cosmos_cosmos_sdk_x_gov_types "github.com/cosmos/cosmos-sdk/x/gov/types" + types4 "github.com/cosmos/cosmos-sdk/x/gov/types" + proposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" github_com_cosmos_cosmos_sdk_x_supply_exported "github.com/cosmos/cosmos-sdk/x/supply/exported" types2 "github.com/cosmos/cosmos-sdk/x/supply/types" + types5 "github.com/cosmos/cosmos-sdk/x/upgrade/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" @@ -351,55 +356,246 @@ func (m *MsgSubmitEvidence) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitEvidence proto.InternalMessageInfo +// Proposal defines the application-level concrete proposal type used in governance +// proposals. +type Proposal struct { + types4.ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` + Content Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` +} + +func (m *Proposal) Reset() { *m = Proposal{} } +func (m *Proposal) String() string { return proto.CompactTextString(m) } +func (*Proposal) ProtoMessage() {} +func (*Proposal) Descriptor() ([]byte, []int) { + return fileDescriptor_3c6d4085e4065f5a, []int{4} +} +func (m *Proposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Proposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proposal.Merge(m, src) +} +func (m *Proposal) XXX_Size() int { + return m.Size() +} +func (m *Proposal) XXX_DiscardUnknown() { + xxx_messageInfo_Proposal.DiscardUnknown(m) +} + +var xxx_messageInfo_Proposal proto.InternalMessageInfo + +func (m *Proposal) GetContent() Content { + if m != nil { + return m.Content + } + return Content{} +} + +// Content defines the application-level allowed Content to be included in a +// governance proposal. +type Content struct { + // Types that are valid to be assigned to Sum: + // *Content_Text + // *Content_ParameterChange + // *Content_SoftwareUpgrade + // *Content_CancelSoftwareUpgrade + // *Content_CommunityPoolSpend + Sum isContent_Sum `protobuf_oneof:"sum"` +} + +func (m *Content) Reset() { *m = Content{} } +func (m *Content) String() string { return proto.CompactTextString(m) } +func (*Content) ProtoMessage() {} +func (*Content) Descriptor() ([]byte, []int) { + return fileDescriptor_3c6d4085e4065f5a, []int{5} +} +func (m *Content) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Content.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 *Content) XXX_Merge(src proto.Message) { + xxx_messageInfo_Content.Merge(m, src) +} +func (m *Content) XXX_Size() int { + return m.Size() +} +func (m *Content) XXX_DiscardUnknown() { + xxx_messageInfo_Content.DiscardUnknown(m) +} + +var xxx_messageInfo_Content proto.InternalMessageInfo + +type isContent_Sum interface { + isContent_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type Content_Text struct { + Text *types4.TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"` +} +type Content_ParameterChange struct { + ParameterChange *proposal.ParameterChangeProposal `protobuf:"bytes,2,opt,name=parameter_change,json=parameterChange,proto3,oneof" json:"parameter_change,omitempty"` +} +type Content_SoftwareUpgrade struct { + SoftwareUpgrade *types5.SoftwareUpgradeProposal `protobuf:"bytes,3,opt,name=software_upgrade,json=softwareUpgrade,proto3,oneof" json:"software_upgrade,omitempty"` +} +type Content_CancelSoftwareUpgrade struct { + CancelSoftwareUpgrade *types5.CancelSoftwareUpgradeProposal `protobuf:"bytes,4,opt,name=cancel_software_upgrade,json=cancelSoftwareUpgrade,proto3,oneof" json:"cancel_software_upgrade,omitempty"` +} +type Content_CommunityPoolSpend struct { + CommunityPoolSpend *types6.CommunityPoolSpendProposal `protobuf:"bytes,5,opt,name=community_pool_spend,json=communityPoolSpend,proto3,oneof" json:"community_pool_spend,omitempty"` +} + +func (*Content_Text) isContent_Sum() {} +func (*Content_ParameterChange) isContent_Sum() {} +func (*Content_SoftwareUpgrade) isContent_Sum() {} +func (*Content_CancelSoftwareUpgrade) isContent_Sum() {} +func (*Content_CommunityPoolSpend) isContent_Sum() {} + +func (m *Content) GetSum() isContent_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *Content) GetText() *types4.TextProposal { + if x, ok := m.GetSum().(*Content_Text); ok { + return x.Text + } + return nil +} + +func (m *Content) GetParameterChange() *proposal.ParameterChangeProposal { + if x, ok := m.GetSum().(*Content_ParameterChange); ok { + return x.ParameterChange + } + return nil +} + +func (m *Content) GetSoftwareUpgrade() *types5.SoftwareUpgradeProposal { + if x, ok := m.GetSum().(*Content_SoftwareUpgrade); ok { + return x.SoftwareUpgrade + } + return nil +} + +func (m *Content) GetCancelSoftwareUpgrade() *types5.CancelSoftwareUpgradeProposal { + if x, ok := m.GetSum().(*Content_CancelSoftwareUpgrade); ok { + return x.CancelSoftwareUpgrade + } + return nil +} + +func (m *Content) GetCommunityPoolSpend() *types6.CommunityPoolSpendProposal { + if x, ok := m.GetSum().(*Content_CommunityPoolSpend); ok { + return x.CommunityPoolSpend + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Content) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Content_Text)(nil), + (*Content_ParameterChange)(nil), + (*Content_SoftwareUpgrade)(nil), + (*Content_CancelSoftwareUpgrade)(nil), + (*Content_CommunityPoolSpend)(nil), + } +} + func init() { proto.RegisterType((*Account)(nil), "cosmos_sdk.simapp.codec.v1.Account") proto.RegisterType((*Supply)(nil), "cosmos_sdk.simapp.codec.v1.Supply") proto.RegisterType((*Evidence)(nil), "cosmos_sdk.simapp.codec.v1.Evidence") proto.RegisterType((*MsgSubmitEvidence)(nil), "cosmos_sdk.simapp.codec.v1.MsgSubmitEvidence") + proto.RegisterType((*Proposal)(nil), "cosmos_sdk.simapp.codec.v1.Proposal") + proto.RegisterType((*Content)(nil), "cosmos_sdk.simapp.codec.v1.Content") } func init() { proto.RegisterFile("simapp/codec/codec.proto", fileDescriptor_3c6d4085e4065f5a) } var fileDescriptor_3c6d4085e4065f5a = []byte{ - // 593 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x4d, 0x6f, 0xd3, 0x3e, - 0x18, 0x4f, 0xfe, 0xeb, 0xfa, 0xaf, 0xbc, 0x81, 0x44, 0x24, 0xa0, 0xaa, 0x50, 0x3a, 0x26, 0x98, - 0x78, 0x51, 0x13, 0x8d, 0xf1, 0xb6, 0x5e, 0x60, 0x1d, 0x43, 0x45, 0xa2, 0x08, 0x75, 0x12, 0x07, - 0x2e, 0x55, 0x6a, 0x5b, 0xad, 0xb5, 0x26, 0x36, 0xb5, 0x1d, 0xb5, 0xdf, 0x00, 0x71, 0xe2, 0x23, - 0x4c, 0x7c, 0x00, 0x4e, 0x3b, 0xf2, 0x01, 0xa6, 0x9d, 0x7a, 0xe4, 0x34, 0xa1, 0xf6, 0xc2, 0xc7, - 0x40, 0x89, 0x9d, 0xb4, 0x55, 0xda, 0xee, 0x12, 0xd5, 0x7e, 0x7e, 0x6f, 0x76, 0x9f, 0xc7, 0xa0, - 0xc8, 0x89, 0xef, 0x31, 0xe6, 0x42, 0x8a, 0x30, 0x54, 0x5f, 0x87, 0xf5, 0xa9, 0xa0, 0x56, 0x09, - 0x52, 0xee, 0x53, 0xde, 0xe2, 0xe8, 0xc4, 0x51, 0x20, 0x47, 0x95, 0xc3, 0xdd, 0xd2, 0x63, 0xd1, - 0x25, 0x7d, 0xd4, 0x62, 0x5e, 0x5f, 0x0c, 0xdd, 0x18, 0xee, 0x2a, 0x74, 0x65, 0x76, 0xa1, 0x84, - 0x4a, 0x3b, 0x59, 0x70, 0x87, 0x76, 0xe8, 0xf4, 0x97, 0xc6, 0x15, 0x07, 0xae, 0x27, 0x45, 0xd7, - 0x15, 0x43, 0x86, 0xb9, 0xfa, 0xea, 0xca, 0x96, 0xae, 0x84, 0x98, 0x0b, 0x12, 0x74, 0x16, 0x20, - 0x4a, 0x03, 0x97, 0x4b, 0xc6, 0x7a, 0xc3, 0x05, 0xb5, 0x3b, 0x03, 0x17, 0x87, 0x04, 0xe1, 0x00, - 0xe2, 0x6c, 0x75, 0xfb, 0x57, 0x0e, 0xfc, 0x7f, 0x00, 0x21, 0x95, 0x81, 0xb0, 0xde, 0x82, 0xcd, - 0xb6, 0xc7, 0x71, 0xcb, 0x53, 0xeb, 0xa2, 0xb9, 0x65, 0x3e, 0xd8, 0x78, 0x72, 0xd7, 0x99, 0xb9, - 0x89, 0x81, 0x13, 0x25, 0x71, 0xc2, 0x5d, 0xa7, 0xe6, 0x71, 0xac, 0x89, 0x75, 0xa3, 0xb9, 0xd1, - 0x9e, 0x2e, 0xad, 0x10, 0x94, 0x20, 0x0d, 0x04, 0x09, 0x24, 0x95, 0xbc, 0xa5, 0x53, 0xa7, 0xaa, - 0xff, 0xc5, 0xaa, 0xcf, 0x17, 0xa9, 0x2a, 0x64, 0xa4, 0x7e, 0x98, 0xf2, 0x3f, 0xa9, 0xcd, 0xa9, - 0x55, 0x11, 0x2e, 0xa9, 0x59, 0x3e, 0xb8, 0x8d, 0x70, 0xcf, 0x1b, 0x62, 0x94, 0x31, 0x5d, 0x8b, - 0x4d, 0xf7, 0x56, 0x9b, 0xbe, 0x51, 0xe4, 0x8c, 0xe3, 0x4d, 0xb4, 0xa8, 0x60, 0x31, 0x50, 0x64, - 0xb8, 0x4f, 0x28, 0x22, 0x30, 0xe3,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d, 0x9f, 0x88, 0x34, 0xed, 0x6b, - 0x50, 0x48, 0xa8, 0x3a, 0xe9, 0x3d, 0x67, 0xf9, 0x03, 0x94, 0x8a, 0x36, 0x53, 0x96, 0xd5, 0x00, - 0xb9, 0x68, 0x06, 0xf5, 0x78, 0xb9, 0xcb, 0xcf, 0x99, 0x31, 0x8f, 0x26, 0xb9, 0x56, 0x38, 0xbf, - 0x2c, 0x1b, 0xa3, 0xcb, 0xb2, 0xd9, 0x8c, 0x65, 0xaa, 0x85, 0xaf, 0xa7, 0x65, 0x23, 0x3a, 0x74, - 0xed, 0xf0, 0x7c, 0x6c, 0x9b, 0xa3, 0xb1, 0x6d, 0xfe, 0x19, 0xdb, 0xe6, 0xf7, 0x89, 0x6d, 0x8c, - 0x26, 0xb6, 0xf1, 0x7b, 0x62, 0x1b, 0x9f, 0x1f, 0xae, 0xbc, 0x8c, 0xd9, 0x97, 0xb5, 0x9d, 0x8f, - 0x5f, 0x9b, 0xbd, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x57, 0xb9, 0x47, 0x37, 0x70, 0x05, 0x00, - 0x00, + // 850 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x56, 0xcf, 0x8e, 0xdb, 0x44, + 0x18, 0xb7, 0x69, 0xba, 0x1b, 0x4d, 0x0b, 0x94, 0x11, 0x65, 0xa3, 0x80, 0x92, 0x92, 0x42, 0xc5, + 0x1f, 0xc5, 0x6e, 0x69, 0xa1, 0x6d, 0x2e, 0xa5, 0x09, 0x8b, 0x82, 0xc4, 0xa2, 0x55, 0x16, 0x38, + 0x20, 0x90, 0xe5, 0x8c, 0x07, 0xc7, 0x5a, 0xdb, 0x33, 0x78, 0xc6, 0xc6, 0x79, 0x03, 0xc4, 0x69, + 0x1f, 0x80, 0xc3, 0x8a, 0x07, 0xe0, 0xb4, 0x47, 0x1e, 0x60, 0xb5, 0xa7, 0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d9, 0xd3, 0xcf, 0x2f, 0x7b, 0xfa, 0xbf, 0x97, 0x3d, 0xfd, 0xe8, 0xaa, 0xa7, 0x9d, + 0x5f, 0xf5, 0xb4, 0x7f, 0xae, 0x7a, 0xda, 0x0f, 0x1f, 0x6e, 0x94, 0x2c, 0xff, 0x11, 0x99, 0x6f, + 0x89, 0xef, 0xe3, 0xe3, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x17, 0x2b, 0x3f, 0x40, 0x9f, 0x08, + 0x00, 0x00, } func (this *Supply) Equal(that interface{}) bool { @@ -624,6 +820,65 @@ func (this *Evidence) SetEvidence(value github_com_cosmos_cosmos_sdk_x_evidence_ return fmt.Errorf("can't encode value of type %T as message Evidence", value) } +func (this *Content) GetContent() github_com_cosmos_cosmos_sdk_x_gov_types.Content { + if x := this.GetText(); x != nil { + return x + } + if x := this.GetParameterChange(); x != nil { + return x + } + if x := this.GetSoftwareUpgrade(); x != nil { + return x + } + if x := this.GetCancelSoftwareUpgrade(); x != nil { + return x + } + if x := this.GetCommunityPoolSpend(); x != nil { + return x + } + return nil +} + +func (this *Content) SetContent(value github_com_cosmos_cosmos_sdk_x_gov_types.Content) error { + if value == nil { + this.Sum = nil + return nil + } + switch vt := value.(type) { + case *types4.TextProposal: + this.Sum = &Content_Text{vt} + return nil + case types4.TextProposal: + this.Sum = &Content_Text{&vt} + return nil + case *proposal.ParameterChangeProposal: + this.Sum = &Content_ParameterChange{vt} + return nil + case proposal.ParameterChangeProposal: + this.Sum = &Content_ParameterChange{&vt} + return nil + case *types5.SoftwareUpgradeProposal: + this.Sum = &Content_SoftwareUpgrade{vt} + return nil + case types5.SoftwareUpgradeProposal: + this.Sum = &Content_SoftwareUpgrade{&vt} + return nil + case *types5.CancelSoftwareUpgradeProposal: + this.Sum = &Content_CancelSoftwareUpgrade{vt} + return nil + case types5.CancelSoftwareUpgradeProposal: + this.Sum = &Content_CancelSoftwareUpgrade{&vt} + return nil + case *types6.CommunityPoolSpendProposal: + this.Sum = &Content_CommunityPoolSpend{vt} + return nil + case types6.CommunityPoolSpendProposal: + this.Sum = &Content_CommunityPoolSpend{&vt} + return nil + } + return fmt.Errorf("can't encode value of type %T as message Content", value) +} + func (m *Account) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -912,6 +1167,186 @@ func (m *MsgSubmitEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ProposalBase.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Content) 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 *Content) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Content) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Content_Text) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Content_Text) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Text != nil { + { + size, err := m.Text.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Content_ParameterChange) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Content_ParameterChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ParameterChange != nil { + { + size, err := m.ParameterChange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Content_SoftwareUpgrade) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Content_SoftwareUpgrade) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SoftwareUpgrade != nil { + { + size, err := m.SoftwareUpgrade.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Content_CancelSoftwareUpgrade) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Content_CancelSoftwareUpgrade) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.CancelSoftwareUpgrade != nil { + { + size, err := m.CancelSoftwareUpgrade.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *Content_CommunityPoolSpend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Content_CommunityPoolSpend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.CommunityPoolSpend != nil { + { + size, err := m.CommunityPoolSpend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} func encodeVarintCodec(dAtA []byte, offset int, v uint64) int { offset -= sovCodec(v) base := offset @@ -1058,6 +1493,92 @@ func (m *MsgSubmitEvidence) Size() (n int) { return n } +func (m *Proposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ProposalBase.Size() + n += 1 + l + sovCodec(uint64(l)) + l = m.Content.Size() + n += 1 + l + sovCodec(uint64(l)) + return n +} + +func (m *Content) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *Content_Text) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Text != nil { + l = m.Text.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Content_ParameterChange) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParameterChange != nil { + l = m.ParameterChange.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Content_SoftwareUpgrade) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SoftwareUpgrade != nil { + l = m.SoftwareUpgrade.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Content_CancelSoftwareUpgrade) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CancelSoftwareUpgrade != nil { + l = m.CancelSoftwareUpgrade.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} +func (m *Content_CommunityPoolSpend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CommunityPoolSpend != nil { + l = m.CommunityPoolSpend.Size() + n += 1 + l + sovCodec(uint64(l)) + } + return n +} + func sovCodec(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1590,6 +2111,353 @@ func (m *MsgSubmitEvidence) Unmarshal(dAtA []byte) error { } 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 ErrIntOverflowCodec + } + 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 != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalBase", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProposalBase.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Content) 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 ErrIntOverflowCodec + } + 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: Content: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Content: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types4.TextProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Content_Text{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterChange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &proposal.ParameterChangeProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Content_ParameterChange{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SoftwareUpgrade", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types5.SoftwareUpgradeProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Content_SoftwareUpgrade{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CancelSoftwareUpgrade", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types5.CancelSoftwareUpgradeProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Content_CancelSoftwareUpgrade{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommunityPoolSpend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types6.CommunityPoolSpendProposal{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Content_CommunityPoolSpend{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipCodec(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/simapp/codec/codec.proto b/simapp/codec/codec.proto index 2b68c487a..bfa556004 100644 --- a/simapp/codec/codec.proto +++ b/simapp/codec/codec.proto @@ -7,6 +7,10 @@ import "x/auth/types/types.proto"; import "x/auth/vesting/types/types.proto"; import "x/supply/types/types.proto"; import "x/evidence/types/types.proto"; +import "x/gov/types/types.proto"; +import "x/params/types/proposal/types.proto"; +import "x/upgrade/types/types.proto"; +import "x/distribution/types/types.proto"; option go_package = "github.com/cosmos/cosmos-sdk/simapp/codec"; @@ -56,3 +60,24 @@ message MsgSubmitEvidence { Evidence evidence = 1; cosmos_sdk.x.evidence.v1.MsgSubmitEvidenceBase base = 2 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; } + +// Proposal defines the application-level concrete proposal type used in governance +// proposals. +message Proposal { + cosmos_sdk.x.gov.v1.ProposalBase base = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + Content content = 2 [(gogoproto.nullable) = false]; +} + +// Content defines the application-level allowed Content to be included in a +// governance proposal. +message Content { + option (cosmos_proto.interface_type) = "github.com/cosmos/cosmos-sdk/x/gov/types.Content"; + + oneof sum { + cosmos_sdk.x.gov.v1.TextProposal text = 1; + cosmos_sdk.x.params.v1.ParameterChangeProposal parameter_change = 2; + cosmos_sdk.x.upgrade.v1.SoftwareUpgradeProposal software_upgrade = 3; + cosmos_sdk.x.upgrade.v1.CancelSoftwareUpgradeProposal cancel_software_upgrade = 4; + cosmos_sdk.x.distribution.v1.CommunityPoolSpendProposal community_pool_spend = 5; + } +} diff --git a/x/gov/alias.go b/x/gov/alias.go index df5f2cb9c..c1f0a9808 100644 --- a/x/gov/alias.go +++ b/x/gov/alias.go @@ -152,4 +152,5 @@ type ( Vote = types.Vote Votes = types.Votes VoteOption = types.VoteOption + Codec = types.Codec ) diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index a02491a12..a892ddecd 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -8,8 +8,8 @@ import ( type Codec interface { codec.Marshaler - MarshalProposal(p Proposal) ([]byte, error) - UnmarshalProposal(bz []byte, ptr *Proposal) error + MarshalProposal(Proposal) ([]byte, error) + UnmarshalProposal([]byte) (Proposal, error) } // RegisterCodec registers all the necessary types and interfaces for the diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index 15d23ddf7..c67363f93 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -6,6 +6,8 @@ import ( "strings" "time" + "gopkg.in/yaml.v2" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -37,20 +39,8 @@ func NewProposal(content Content, id uint64, submitTime, depositEndTime time.Tim // String implements stringer interface func (p Proposal) String() string { - return fmt.Sprintf(`Proposal %d: - Title: %s - Type: %s - Status: %s - Submit Time: %s - Deposit End Time: %s - Total Deposit: %s - Voting Start Time: %s - Voting End Time: %s - Description: %s`, - p.ProposalID, p.GetTitle(), p.ProposalType(), - p.Status, p.SubmitTime, p.DepositEndTime, - p.TotalDeposit, p.VotingStartTime, p.VotingEndTime, p.GetDescription(), - ) + out, _ := yaml.Marshal(p) + return string(out) } // Proposals is an array of proposal diff --git a/x/gov/types/types.proto b/x/gov/types/types.proto index d590397ca..b22abea1e 100644 --- a/x/gov/types/types.proto +++ b/x/gov/types/types.proto @@ -3,7 +3,6 @@ package cosmos_sdk.x.gov.v1; import "types/types.proto"; import "third_party/proto/gogoproto/gogo.proto"; -// import "third_party/proto/cosmos-proto/cosmos.proto"; import "google/protobuf/timestamp.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; @@ -133,16 +132,3 @@ message Vote { bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; VoteOption option = 3; } - -// message BasicProposal { -// ProposalBase base = 1 [(gogoproto.embed) = true]; -// BasicContent content = 2; -// } - -// message BasicContent { -// option (cosmos_proto.interface_type) = "Content"; -// option (gogoproto.stringer) = true; -// oneof sum { -// TextProposal text = 1; -// } -// } From e2b72141bf0cbdfd3e71f2669a9ae3c367d5f550 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 12:49:32 -0500 Subject: [PATCH 15/31] Update keeper --- x/gov/keeper/proposal.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 5f795b62d..ca7826ad7 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -51,24 +51,29 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, content types.Content) (typ // GetProposal get proposal from store by ProposalID func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (proposal types.Proposal, ok bool) { store := ctx.KVStore(keeper.storeKey) + bz := store.Get(types.ProposalKey(proposalID)) if bz == nil { - return + return types.Proposal{}, false } - err := keeper.cdc.UnmarshalProposal(bz, &proposal) + + proposal, err := keeper.cdc.UnmarshalProposal(bz) if err != nil { panic(err) } + return proposal, true } // SetProposal set a proposal to store func (keeper Keeper) SetProposal(ctx sdk.Context, proposal types.Proposal) { store := ctx.KVStore(keeper.storeKey) + bz, err := keeper.cdc.MarshalProposal(proposal) if err != nil { panic(err) } + store.Set(types.ProposalKey(proposal.ProposalID), bz) } @@ -87,12 +92,12 @@ func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64) { // IterateProposals iterates over the all the proposals and performs a callback function func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Proposal) (stop bool)) { store := ctx.KVStore(keeper.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.ProposalsKeyPrefix) + iterator := sdk.KVStorePrefixIterator(store, types.ProposalsKeyPrefix) defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { - var proposal types.Proposal - err := keeper.cdc.UnmarshalProposal(iterator.Value(), &proposal) + proposal, err := keeper.cdc.UnmarshalProposal(iterator.Value()) if err != nil { panic(err) } From a89eb7784110c77c0ffed2fcdd1cfcc66ce82b8d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 14:10:27 -0500 Subject: [PATCH 16/31] Add equal option to upgrade proto types --- x/upgrade/types/types.pb.go | 104 ++++++++++++++++++++++++++++-------- x/upgrade/types/types.proto | 48 +++++++++-------- 2 files changed, 107 insertions(+), 45 deletions(-) diff --git a/x/upgrade/types/types.pb.go b/x/upgrade/types/types.pb.go index 8cc9e383b..e6c317700 100644 --- a/x/upgrade/types/types.pb.go +++ b/x/upgrade/types/types.pb.go @@ -164,32 +164,90 @@ func init() { func init() { proto.RegisterFile("x/upgrade/types/types.proto", fileDescriptor_2a308fd9dd71aff8) } var fileDescriptor_2a308fd9dd71aff8 = []byte{ - // 364 bytes of a gzipped FileDescriptorProto + // 376 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x31, 0x6f, 0xe2, 0x30, - 0x18, 0x8d, 0x8f, 0x1c, 0x3a, 0xcc, 0x66, 0x9d, 0x8e, 0x88, 0x13, 0x26, 0x62, 0xa8, 0x18, 0x5a, - 0x47, 0xa5, 0x43, 0x3b, 0xd3, 0xbd, 0x42, 0x69, 0xab, 0x4a, 0x5d, 0x90, 0x49, 0x4c, 0x62, 0x91, - 0xc4, 0x56, 0x6c, 0x5a, 0xd8, 0x3a, 0x77, 0xe2, 0x67, 0x31, 0x32, 0x32, 0xb5, 0x05, 0xfe, 0x48, - 0x95, 0x18, 0xd4, 0xaa, 0x52, 0xb7, 0x2e, 0xf6, 0xfb, 0xac, 0xf7, 0xbd, 0xf7, 0x3e, 0xdb, 0xf0, - 0xff, 0xcc, 0x9b, 0xca, 0x28, 0xa7, 0x21, 0xf3, 0xf4, 0x5c, 0x32, 0x65, 0x56, 0x22, 0x73, 0xa1, - 0x05, 0x6a, 0x04, 0x42, 0xa5, 0x42, 0x0d, 0x55, 0x38, 0x21, 0x33, 0xb2, 0xe7, 0x91, 0x87, 0xd3, - 0xe6, 0x91, 0x8e, 0x79, 0x1e, 0x0e, 0x25, 0xcd, 0xf5, 0xdc, 0x2b, 0xb9, 0x5e, 0x24, 0x22, 0xf1, - 0x81, 0x8c, 0x40, 0xb3, 0x1d, 0x09, 0x11, 0x25, 0xcc, 0x50, 0x46, 0xd3, 0xb1, 0xa7, 0x79, 0xca, - 0x94, 0xa6, 0xa9, 0x34, 0x84, 0xce, 0x13, 0x80, 0xf6, 0x20, 0xa1, 0x19, 0x42, 0xd0, 0xce, 0x68, - 0xca, 0x1c, 0xe0, 0x82, 0x6e, 0xcd, 0x2f, 0x31, 0xba, 0x80, 0x76, 0xc1, 0x77, 0x7e, 0xb9, 0xa0, - 0x5b, 0xef, 0x35, 0x89, 0x11, 0x23, 0x07, 0x31, 0x72, 0x73, 0x10, 0xeb, 0xff, 0x59, 0xbe, 0xb4, - 0xad, 0xc5, 0x6b, 0x1b, 0xf8, 0x65, 0x07, 0xfa, 0x07, 0xab, 0x31, 0xe3, 0x51, 0xac, 0x9d, 0x8a, - 0x0b, 0xba, 0x15, 0x7f, 0x5f, 0x15, 0x2e, 0x3c, 0x1b, 0x0b, 0xc7, 0x36, 0x2e, 0x05, 0xee, 0x3c, - 0x03, 0xd8, 0xb8, 0x16, 0x63, 0xfd, 0x48, 0x73, 0x76, 0x6b, 0x46, 0x1c, 0xe4, 0x42, 0x0a, 0x45, - 0x13, 0xf4, 0x17, 0xfe, 0xd6, 0x5c, 0x27, 0x87, 0x58, 0xa6, 0x40, 0x2e, 0xac, 0x87, 0x4c, 0x05, - 0x39, 0x97, 0x9a, 0x8b, 0xac, 0x8c, 0x57, 0xf3, 0x3f, 0x1f, 0xa1, 0x73, 0x68, 0xcb, 0x84, 0x66, - 0xa5, 0x7b, 0xbd, 0xd7, 0x22, 0xdf, 0xdc, 0x23, 0x29, 0x46, 0xef, 0xdb, 0x45, 0x78, 0xbf, 0x6c, - 0xe8, 0xdc, 0xc1, 0xd6, 0x25, 0xcd, 0x02, 0x96, 0xfc, 0x70, 0xa2, 0xfe, 0xd5, 0x72, 0x83, 0xad, - 0xf5, 0x06, 0x5b, 0xcb, 0x2d, 0x06, 0xab, 0x2d, 0x06, 0x6f, 0x5b, 0x0c, 0x16, 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, 0x5b, 0x9b, 0x3d, + 0xb6, 0x2e, 0x7f, 0xc6, 0x5c, 0x27, 0xb3, 0x31, 0x09, 0x45, 0xe6, 0x9b, 0xec, 0x87, 0xed, 0x97, + 0x8a, 0xa6, 0xfe, 0x9b, 0x2f, 0x33, 0xae, 0x57, 0x2f, 0xf2, 0xe7, 0x39, 0x00, 0x00, 0xff, 0xff, + 0x4f, 0x2c, 0xc2, 0xac, 0x4c, 0x02, 0x00, 0x00, } +func (this *SoftwareUpgradeProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SoftwareUpgradeProposal) + if !ok { + that2, ok := that.(SoftwareUpgradeProposal) + 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 + } + if !this.Plan.Equal(&that1.Plan) { + return false + } + return true +} +func (this *CancelSoftwareUpgradeProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CancelSoftwareUpgradeProposal) + if !ok { + that2, ok := that.(CancelSoftwareUpgradeProposal) + 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 (m *Plan) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) diff --git a/x/upgrade/types/types.proto b/x/upgrade/types/types.proto index 8770158c4..d020f4401 100644 --- a/x/upgrade/types/types.proto +++ b/x/upgrade/types/types.proto @@ -4,41 +4,45 @@ package cosmos_sdk.x.upgrade.v1; import "third_party/proto/gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; +option (gogoproto.goproto_getters_all) = false; // Plan specifies information about a planned upgrade and when it should occur message Plan { - // Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any - // special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used - // to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been - // set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height - // is reached and the software will exit. - string name = 1; + // Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any + // special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used + // to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been + // set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height + // is reached and the software will exit. + string name = 1; - // The time after which the upgrade must be performed. - // Leave set to its zero value to use a pre-defined Height instead. - google.protobuf.Timestamp time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // The time after which the upgrade must be performed. + // Leave set to its zero value to use a pre-defined Height instead. + google.protobuf.Timestamp time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - // The height at which the upgrade must be performed. - // Only used if Time is not set. - int64 height = 3; + // The height at which the upgrade must be performed. + // Only used if Time is not set. + int64 height = 3; - // Any application specific upgrade info to be included on-chain - // such as a git commit that validators could automatically upgrade to - string info = 4; + // Any application specific upgrade info to be included on-chain + // such as a git commit that validators could automatically upgrade to + string info = 4; } // SoftwareUpgradeProposal is a gov Content type for initiating a software upgrade message SoftwareUpgradeProposal { - string title = 1; - string description = 2; - Plan plan = 3 [(gogoproto.nullable) = false]; + option (gogoproto.equal) = true; + + string title = 1; + string description = 2; + Plan plan = 3 [(gogoproto.nullable) = false]; } // SoftwareUpgradeProposal is a gov Content type for cancelling a software upgrade message CancelSoftwareUpgradeProposal { - string title = 1; - string description = 2; + option (gogoproto.equal) = true; + + string title = 1; + string description = 2; } From 7562c2765a34d18f4216852a1d29f135f9fad7c2 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 14:13:42 -0500 Subject: [PATCH 17/31] Update gov types --- simapp/codec/codec.pb.go | 516 ++++++++++++++++++++--- simapp/codec/codec.proto | 11 + simapp/codec/msgs.go | 48 ++- x/gov/alias.go | 59 +-- x/gov/types/codec.go | 2 +- x/gov/types/deposit.go | 6 +- x/gov/types/genesis.go | 15 +- x/gov/types/msgs.go | 73 ++-- x/gov/types/params.go | 28 +- x/gov/types/proposal.go | 6 +- x/gov/types/tally.go | 9 +- x/gov/types/types.pb.go | 878 ++++++++++++++++++++++++--------------- x/gov/types/types.proto | 45 +- x/gov/types/vote.go | 5 +- 14 files changed, 1191 insertions(+), 510 deletions(-) diff --git a/simapp/codec/codec.pb.go b/simapp/codec/codec.pb.go index d58635ad8..17b252556 100644 --- a/simapp/codec/codec.pb.go +++ b/simapp/codec/codec.pb.go @@ -356,6 +356,46 @@ func (m *MsgSubmitEvidence) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitEvidence proto.InternalMessageInfo +// MsgSubmitProposal defines the application-level message type for handling +// governance proposals. +type MsgSubmitProposal struct { + Content *Content `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + types4.MsgSubmitProposalBase `protobuf:"bytes,2,opt,name=base,proto3,embedded=base" json:"base"` +} + +func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } +func (m *MsgSubmitProposal) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitProposal) ProtoMessage() {} +func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_3c6d4085e4065f5a, []int{4} +} +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 + // Proposal defines the application-level concrete proposal type used in governance // proposals. type Proposal struct { @@ -367,7 +407,7 @@ func (m *Proposal) Reset() { *m = Proposal{} } func (m *Proposal) String() string { return proto.CompactTextString(m) } func (*Proposal) ProtoMessage() {} func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_3c6d4085e4065f5a, []int{4} + return fileDescriptor_3c6d4085e4065f5a, []int{5} } func (m *Proposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -419,7 +459,7 @@ func (m *Content) Reset() { *m = Content{} } func (m *Content) String() string { return proto.CompactTextString(m) } func (*Content) ProtoMessage() {} func (*Content) Descriptor() ([]byte, []int) { - return fileDescriptor_3c6d4085e4065f5a, []int{5} + return fileDescriptor_3c6d4085e4065f5a, []int{6} } func (m *Content) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,6 +490,7 @@ var xxx_messageInfo_Content proto.InternalMessageInfo type isContent_Sum interface { isContent_Sum() + Equal(interface{}) bool MarshalTo([]byte) (int, error) Size() int } @@ -534,6 +575,7 @@ func init() { proto.RegisterType((*Supply)(nil), "cosmos_sdk.simapp.codec.v1.Supply") proto.RegisterType((*Evidence)(nil), "cosmos_sdk.simapp.codec.v1.Evidence") proto.RegisterType((*MsgSubmitEvidence)(nil), "cosmos_sdk.simapp.codec.v1.MsgSubmitEvidence") + proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos_sdk.simapp.codec.v1.MsgSubmitProposal") proto.RegisterType((*Proposal)(nil), "cosmos_sdk.simapp.codec.v1.Proposal") proto.RegisterType((*Content)(nil), "cosmos_sdk.simapp.codec.v1.Content") } @@ -541,61 +583,62 @@ func init() { func init() { proto.RegisterFile("simapp/codec/codec.proto", fileDescriptor_3c6d4085e4065f5a) } var fileDescriptor_3c6d4085e4065f5a = []byte{ - // 850 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x56, 0xcf, 0x8e, 0xdb, 0x44, - 0x18, 0xb7, 0x69, 0xba, 0x1b, 0x4d, 0x0b, 0x94, 0x11, 0x65, 0xa3, 0x80, 0x92, 0x92, 0x42, 0xc5, - 0x1f, 0xc5, 0x6e, 0x69, 0xa1, 0x6d, 0x2e, 0xa5, 0x09, 0x8b, 0x82, 0xc4, 0xa2, 0x55, 0x16, 0x38, - 0x20, 0x90, 0xe5, 0x8c, 0x07, 0xc7, 0x5a, 0xdb, 0x33, 0x78, 0xc6, 0xc6, 0x79, 0x03, 0xc4, 0x69, - 0x1f, 0x80, 0xc3, 0x8a, 0x07, 0xe0, 0xb4, 0x47, 0x1e, 0x60, 0xb5, 0xa7, 0x3d, 0x72, 0x5a, 0xa1, - 0xdd, 0x0b, 0x8f, 0x81, 0x3c, 0x33, 0x76, 0x6c, 0xd9, 0xc9, 0x5e, 0xac, 0x78, 0xbe, 0xdf, 0xbf, - 0xb1, 0xe7, 0xfb, 0x1c, 0xd0, 0x61, 0x5e, 0x60, 0x53, 0x6a, 0x22, 0xe2, 0x60, 0x24, 0xaf, 0x06, - 0x8d, 0x08, 0x27, 0xb0, 0x8b, 0x08, 0x0b, 0x08, 0xb3, 0x98, 0x73, 0x68, 0x48, 0x90, 0x21, 0xcb, - 0xc9, 0xa3, 0xee, 0xc7, 0x7c, 0xe1, 0x45, 0x8e, 0x45, 0xed, 0x88, 0x2f, 0x4d, 0x01, 0x37, 0x25, - 0x7a, 0x58, 0xbe, 0x91, 0x42, 0xdd, 0x07, 0x75, 0xb0, 0x4b, 0x5c, 0xb2, 0xfa, 0xa5, 0x70, 0x9d, - 0xd4, 0xb4, 0x63, 0xbe, 0x30, 0xf9, 0x92, 0x62, 0x26, 0xaf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0xbe, 0x93, 0x4b, 0x65, 0x79, 0x56, 0x2d, - 0x41, 0x0a, 0x76, 0x90, 0x1d, 0x22, 0xec, 0x5b, 0x35, 0x97, 0x56, 0xd3, 0x7c, 0x2d, 0xb9, 0x4c, - 0x04, 0x6f, 0xbd, 0xd7, 0x5d, 0xd4, 0x04, 0x80, 0x3e, 0x78, 0x13, 0x91, 0x20, 0x88, 0x43, 0x8f, - 0x2f, 0x2d, 0x4a, 0x88, 0x6f, 0x31, 0x8a, 0x43, 0x47, 0x4d, 0xa0, 0x67, 0x55, 0xbb, 0xf2, 0x47, - 0x47, 0xbe, 0x47, 0xc5, 0xdc, 0x27, 0xc4, 0x3f, 0xc8, 0x78, 0x25, 0x43, 0x88, 0x6a, 0xd5, 0xd1, - 0x93, 0xb3, 0x93, 0xe1, 0xc3, 0x6b, 0x7a, 0xad, 0xf8, 0x68, 0x16, 0xc7, 0x44, 0xb6, 0xd8, 0x78, - 0x72, 0x7a, 0xd9, 0xd3, 0xcf, 0x2f, 0x7b, 0xfa, 0xbf, 0x97, 0x3d, 0xfd, 0xe8, 0xaa, 0xa7, 0x9d, - 0x5f, 0xf5, 0xb4, 0x7f, 0xae, 0x7a, 0xda, 0x0f, 0x1f, 0x6e, 0x94, 0x2c, 0xff, 0x11, 0x99, 0x6f, - 0x89, 0xef, 0xe3, 0xe3, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x17, 0x2b, 0x3f, 0x40, 0x9f, 0x08, - 0x00, 0x00, + // 876 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0xb6, 0x77, 0xb3, 0x6d, 0x34, 0xbb, 0xc0, 0x32, 0x62, 0x69, 0x14, 0x50, 0xb2, 0x64, 0x61, + 0x05, 0x8b, 0x6a, 0xef, 0x52, 0xa0, 0x6d, 0x24, 0x54, 0x9a, 0x50,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0xfc, + 0xed, 0xac, 0xab, 0x24, 0x9b, 0xee, 0xfd, 0x59, 0x34, 0x7c, 0x24, 0x5b, 0x10, 0xfc, 0x0c, 0xac, + 0x27, 0x75, 0x88, 0xf3, 0x36, 0xf1, 0x64, 0x99, 0xdf, 0xa1, 0x80, 0x8e, 0xb3, 0x1c, 0x38, 0x2a, + 0xb9, 0x7d, 0x56, 0x76, 0x6b, 0x93, 0xa8, 0x64, 0x34, 0x13, 0x5d, 0x61, 0xf4, 0x54, 0x05, 0xcd, + 0xdc, 0xdf, 0x9e, 0x14, 0xa8, 0xed, 0x61, 0x52, 0x60, 0x19, 0x2f, 0x1c, 0xce, 0x37, 0x78, 0xe7, + 0xa5, 0x37, 0x38, 0x68, 0x24, 0x2c, 0xf9, 0x36, 0x7b, 0x67, 0x0d, 0xb0, 0x2e, 0x43, 0x70, 0x1b, + 0x34, 0x38, 0x8e, 0xf9, 0x52, 0x47, 0xdf, 0xe2, 0x38, 0xdf, 0xed, 0x48, 0x19, 0xa7, 0x09, 0xf0, + 0x47, 0xf0, 0x30, 0x1d, 0x03, 0x98, 0xe3, 0xc0, 0x40, 0x53, 0xd3, 0xb7, 0x17, 0x9c, 0xb2, 0x18, + 0x16, 0xe9, 0xce, 0x32, 0xfc, 0x30, 0x85, 0x17, 0x28, 0x5f, 0xa3, 0xe5, 0x10, 0xfc, 0x09, 0x3c, + 0x64, 0xe4, 0x67, 0xfe, 0xab, 0x19, 0x60, 0x43, 0x0e, 0x12, 0xd9, 0x2d, 0x9f, 0x97, 0xd9, 0x65, + 0x30, 0xad, 0x60, 0x99, 0xf0, 0x9d, 0x58, 0x2a, 0xd2, 0xb3, 0x72, 0x08, 0x52, 0xb0, 0x81, 0x4c, + 0x1f, 0x61, 0xd7, 0xa8, 0xa8, 0x34, 0xea, 0x06, 0x41, 0x41, 0x65, 0x98, 0xe6, 0x2d, 0xd6, 0x7a, + 0x84, 0xea, 0x00, 0xd0, 0x05, 0x6f, 0x20, 0xe2, 0x79, 0xa1, 0xef, 0xf0, 0x99, 0x41, 0x09, 0x71, + 0x0d, 0x46, 0xb1, 0x6f, 0xc9, 0x56, 0xb9, 0x53, 0x96, 0x2b, 0x4e, 0x47, 0x71, 0x8e, 0x32, 0xf3, + 0x88, 0x10, 0xf7, 0x38, 0xc9, 0x2b, 0x08, 0x42, 0x54, 0x89, 0xf6, 0x77, 0x64, 0x63, 0x78, 0xbe, + 0xa2, 0x31, 0xe4, 0x13, 0x3e, 0xbf, 0x2a, 0xa2, 0x1f, 0x0c, 0x86, 0x17, 0x37, 0x1d, 0xf5, 0xea, + 0xa6, 0xa3, 0xfe, 0x7b, 0xd3, 0x51, 0x4f, 0x6f, 0x3b, 0xca, 0xd5, 0x6d, 0x47, 0xf9, 0xe7, 0xb6, + 0xa3, 0xfc, 0xf0, 0xc1, 0x52, 0xca, 0xe2, 0xbf, 0xa6, 0xc9, 0x5a, 0x3a, 0xcc, 0xb7, 0xfe, 0x0f, + 0x00, 0x00, 0xff, 0xff, 0x22, 0x64, 0xee, 0x71, 0x4c, 0x09, 0x00, 0x00, } func (this *Supply) Equal(that interface{}) bool { @@ -733,6 +776,183 @@ func (this *MsgSubmitEvidence) Equal(that interface{}) bool { } return true } +func (this *MsgSubmitProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgSubmitProposal) + if !ok { + that2, ok := that.(MsgSubmitProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Content.Equal(that1.Content) { + return false + } + if !this.MsgSubmitProposalBase.Equal(&that1.MsgSubmitProposalBase) { + return false + } + return true +} +func (this *Content) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Content) + if !ok { + that2, ok := that.(Content) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Sum == nil { + if this.Sum != nil { + return false + } + } else if this.Sum == nil { + return false + } else if !this.Sum.Equal(that1.Sum) { + return false + } + return true +} +func (this *Content_Text) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Content_Text) + if !ok { + that2, ok := that.(Content_Text) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Text.Equal(that1.Text) { + return false + } + return true +} +func (this *Content_ParameterChange) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Content_ParameterChange) + if !ok { + that2, ok := that.(Content_ParameterChange) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.ParameterChange.Equal(that1.ParameterChange) { + return false + } + return true +} +func (this *Content_SoftwareUpgrade) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Content_SoftwareUpgrade) + if !ok { + that2, ok := that.(Content_SoftwareUpgrade) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.SoftwareUpgrade.Equal(that1.SoftwareUpgrade) { + return false + } + return true +} +func (this *Content_CancelSoftwareUpgrade) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Content_CancelSoftwareUpgrade) + if !ok { + that2, ok := that.(Content_CancelSoftwareUpgrade) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.CancelSoftwareUpgrade.Equal(that1.CancelSoftwareUpgrade) { + return false + } + return true +} +func (this *Content_CommunityPoolSpend) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Content_CommunityPoolSpend) + if !ok { + that2, ok := that.(Content_CommunityPoolSpend) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.CommunityPoolSpend.Equal(that1.CommunityPoolSpend) { + return false + } + return true +} func (this *Account) GetAccount() github_com_cosmos_cosmos_sdk_x_auth_exported.Account { if x := this.GetBaseAccount(); x != nil { return x @@ -1167,6 +1387,51 @@ func (m *MsgSubmitEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +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 + { + size, err := m.MsgSubmitProposalBase.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(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 = encodeVarintCodec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *Proposal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1493,6 +1758,21 @@ func (m *MsgSubmitEvidence) Size() (n int) { return n } +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 + sovCodec(uint64(l)) + } + l = m.MsgSubmitProposalBase.Size() + n += 1 + l + sovCodec(uint64(l)) + return n +} + func (m *Proposal) Size() (n int) { if m == nil { return 0 @@ -2111,6 +2391,128 @@ func (m *MsgSubmitEvidence) Unmarshal(dAtA []byte) error { } return nil } +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 ErrIntOverflowCodec + } + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Content == nil { + m.Content = &Content{} + } + 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 MsgSubmitProposalBase", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MsgSubmitProposalBase.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCodec(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCodec + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCodec + } + 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 diff --git a/simapp/codec/codec.proto b/simapp/codec/codec.proto index bfa556004..9b5d94991 100644 --- a/simapp/codec/codec.proto +++ b/simapp/codec/codec.proto @@ -61,6 +61,16 @@ message MsgSubmitEvidence { cosmos_sdk.x.evidence.v1.MsgSubmitEvidenceBase base = 2 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; } +// MsgSubmitProposal defines the application-level message type for handling +// governance proposals. +message MsgSubmitProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + Content content = 1; + cosmos_sdk.x.gov.v1.MsgSubmitProposalBase base = 2 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; +} + // Proposal defines the application-level concrete proposal type used in governance // proposals. message Proposal { @@ -71,6 +81,7 @@ message Proposal { // Content defines the application-level allowed Content to be included in a // governance proposal. message Content { + option (gogoproto.equal) = true; option (cosmos_proto.interface_type) = "github.com/cosmos/cosmos-sdk/x/gov/types.Content"; oneof sum { diff --git a/simapp/codec/msgs.go b/simapp/codec/msgs.go index 2ea6c3a3a..d34a07bec 100644 --- a/simapp/codec/msgs.go +++ b/simapp/codec/msgs.go @@ -5,9 +5,13 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/evidence" eviexported "github.com/cosmos/cosmos-sdk/x/evidence/exported" + "github.com/cosmos/cosmos-sdk/x/gov" ) -var _ eviexported.MsgSubmitEvidence = MsgSubmitEvidence{} +var ( + _ eviexported.MsgSubmitEvidence = MsgSubmitEvidence{} + _ gov.MsgSubmitProposal = MsgSubmitProposal{} +) // NewMsgSubmitEvidence returns a new MsgSubmitEvidence. func NewMsgSubmitEvidence(evidenceI eviexported.Evidence, s sdk.AccAddress) (MsgSubmitEvidence, error) { @@ -16,7 +20,10 @@ func NewMsgSubmitEvidence(evidenceI eviexported.Evidence, s sdk.AccAddress) (Msg return MsgSubmitEvidence{}, err } - return MsgSubmitEvidence{Evidence: e, MsgSubmitEvidenceBase: evidence.NewMsgSubmitEvidenceBase(s)}, nil + return MsgSubmitEvidence{ + Evidence: e, + MsgSubmitEvidenceBase: evidence.NewMsgSubmitEvidenceBase(s), + }, nil } // ValidateBasic performs basic (non-state-dependant) validation on a @@ -38,3 +45,40 @@ func (msg MsgSubmitEvidence) ValidateBasic() error { // nolint func (msg MsgSubmitEvidence) GetEvidence() eviexported.Evidence { return msg.Evidence.GetEvidence() } func (msg MsgSubmitEvidence) GetSubmitter() sdk.AccAddress { return msg.Submitter } + +// NewMsgSubmitProposal returns a new MsgSubmitProposal. +func NewMsgSubmitProposal(c gov.Content, d sdk.Coins, p sdk.AccAddress) (MsgSubmitProposal, error) { + content := &Content{} + if err := content.SetContent(c); err != nil { + return MsgSubmitProposal{}, err + } + + return MsgSubmitProposal{ + Content: content, + MsgSubmitProposalBase: gov.NewMsgSubmitProposalBase(d, p), + }, nil +} + +// ValidateBasic performs basic (non-state-dependant) validation on a +// MsgSubmitProposal. +func (msg MsgSubmitProposal) ValidateBasic() error { + if err := msg.MsgSubmitProposalBase.ValidateBasic(); err != nil { + return nil + } + if msg.Content == nil { + return sdkerrors.Wrap(gov.ErrInvalidProposalContent, "missing content") + } + if !gov.IsValidProposalType(msg.Content.GetContent().ProposalType()) { + return sdkerrors.Wrap(gov.ErrInvalidProposalType, msg.Content.GetContent().ProposalType()) + } + if err := msg.Content.GetContent().ValidateBasic(); err != nil { + return err + } + + return nil +} + +// nolint +func (msg MsgSubmitProposal) GetContent() gov.Content { return msg.Content.GetContent() } +func (msg MsgSubmitProposal) GetInitialDeposit() sdk.Coins { return msg.InitialDeposit } +func (msg MsgSubmitProposal) GetProposer() sdk.AccAddress { return msg.Proposer } diff --git a/x/gov/alias.go b/x/gov/alias.go index c1f0a9808..86828db77 100644 --- a/x/gov/alias.go +++ b/x/gov/alias.go @@ -82,7 +82,7 @@ var ( SplitInactiveProposalQueueKey = types.SplitInactiveProposalQueueKey SplitKeyDeposit = types.SplitKeyDeposit SplitKeyVote = types.SplitKeyVote - NewMsgSubmitProposal = types.NewMsgSubmitProposal + NewMsgSubmitProposalBase = types.NewMsgSubmitProposalBase NewMsgDeposit = types.NewMsgDeposit NewMsgVote = types.NewMsgVote ParamKeyTable = types.ParamKeyTable @@ -125,32 +125,33 @@ var ( ) type ( - Keeper = keeper.Keeper - Content = types.Content - Handler = types.Handler - Deposit = types.Deposit - Deposits = types.Deposits - GenesisState = types.GenesisState - MsgSubmitProposal = types.MsgSubmitProposal - MsgDeposit = types.MsgDeposit - MsgVote = types.MsgVote - DepositParams = types.DepositParams - TallyParams = types.TallyParams - VotingParams = types.VotingParams - Params = types.Params - Proposal = types.Proposal - Proposals = types.Proposals - ProposalQueue = types.ProposalQueue - ProposalStatus = types.ProposalStatus - TextProposal = types.TextProposal - QueryProposalParams = types.QueryProposalParams - QueryDepositParams = types.QueryDepositParams - QueryVoteParams = types.QueryVoteParams - QueryProposalsParams = types.QueryProposalsParams - ValidatorGovInfo = types.ValidatorGovInfo - TallyResult = types.TallyResult - Vote = types.Vote - Votes = types.Votes - VoteOption = types.VoteOption - Codec = types.Codec + Keeper = keeper.Keeper + Content = types.Content + Handler = types.Handler + Deposit = types.Deposit + Deposits = types.Deposits + GenesisState = types.GenesisState + MsgSubmitProposal = types.MsgSubmitProposal + MsgSubmitProposalBase = types.MsgSubmitProposalBase + MsgDeposit = types.MsgDeposit + MsgVote = types.MsgVote + DepositParams = types.DepositParams + TallyParams = types.TallyParams + VotingParams = types.VotingParams + Params = types.Params + Proposal = types.Proposal + Proposals = types.Proposals + ProposalQueue = types.ProposalQueue + ProposalStatus = types.ProposalStatus + TextProposal = types.TextProposal + QueryProposalParams = types.QueryProposalParams + QueryDepositParams = types.QueryDepositParams + QueryVoteParams = types.QueryVoteParams + QueryProposalsParams = types.QueryProposalsParams + ValidatorGovInfo = types.ValidatorGovInfo + TallyResult = types.TallyResult + Vote = types.Vote + Votes = types.Votes + VoteOption = types.VoteOption + Codec = types.Codec ) diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index a892ddecd..ba9e6827c 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -16,7 +16,7 @@ type Codec interface { // governance module. func RegisterCodec(cdc *codec.Codec) { cdc.RegisterInterface((*Content)(nil), nil) - cdc.RegisterConcrete(MsgSubmitProposal{}, "cosmos-sdk/MsgSubmitProposal", nil) + cdc.RegisterConcrete(MsgSubmitProposalBase{}, "cosmos-sdk/MsgSubmitProposalBase", nil) cdc.RegisterConcrete(MsgDeposit{}, "cosmos-sdk/MsgDeposit", nil) cdc.RegisterConcrete(MsgVote{}, "cosmos-sdk/MsgVote", nil) cdc.RegisterConcrete(TextProposal{}, "cosmos-sdk/TextProposal", nil) diff --git a/x/gov/types/deposit.go b/x/gov/types/deposit.go index 098bc9b2e..58d2540ec 100644 --- a/x/gov/types/deposit.go +++ b/x/gov/types/deposit.go @@ -3,6 +3,8 @@ package types import ( "fmt" + "gopkg.in/yaml.v2" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -12,8 +14,8 @@ func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) D } func (d Deposit) String() string { - return fmt.Sprintf("deposit by %s on Proposal %d is for the amount %s", - d.Depositor, d.ProposalID, d.Amount) + out, _ := yaml.Marshal(d) + return string(out) } // Deposits is a collection of Deposit objects diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 69f49fa68..858bc85f8 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -1,7 +1,6 @@ package types import ( - "bytes" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" @@ -38,16 +37,14 @@ func DefaultGenesisState() GenesisState { ) } -// Equal checks whether two gov GenesisState structs are equivalent -func (data GenesisState) Equal(data2 GenesisState) bool { - b1 := ModuleCdc.MustMarshalBinaryBare(data) - b2 := ModuleCdc.MustMarshalBinaryBare(data2) - return bytes.Equal(b1, b2) -} - // IsEmpty returns true if a GenesisState is empty func (data GenesisState) IsEmpty() bool { - return data.Equal(GenesisState{}) + return data.Deposits == nil && + data.Votes == nil && + data.Proposals == nil && + data.DepositParams.Equal(DepositParams{}) && + data.TallyParams.Equal(TallyParams{}) && + data.VotingParams.Equal(VotingParams{}) } // ValidateGenesis checks if parameters are within valid ranges diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index 56ea7614b..eb0343902 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -1,7 +1,7 @@ package types import ( - "fmt" + "gopkg.in/yaml.v2" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -14,32 +14,35 @@ const ( TypeMsgSubmitProposal = "submit_proposal" ) -var _, _, _ sdk.Msg = MsgSubmitProposal{}, MsgDeposit{}, MsgVote{} +var _, _, _ sdk.Msg = MsgSubmitProposalBase{}, MsgDeposit{}, MsgVote{} -// MsgSubmitProposal defines a message to create a governance proposal with a -// given content and initial deposit -type MsgSubmitProposal struct { - Content Content `json:"content" yaml:"content"` - InitialDeposit sdk.Coins `json:"initial_deposit" yaml:"initial_deposit"` // Initial deposit paid by sender. Must be strictly positive - Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` // Address of the proposer +// MsgSubmitProposal defines the specific interface a concrete message must +// implement in order to process governance proposals. The concrete MsgSubmitProposal +// must be defined at the application-level. +type MsgSubmitProposal interface { + sdk.Msg + + GetContent() Content + GetInitialDeposit() sdk.Coins + GetProposer() sdk.AccAddress } -// NewMsgSubmitProposal creates a new MsgSubmitProposal instance -func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sdk.AccAddress) MsgSubmitProposal { - return MsgSubmitProposal{content, initialDeposit, proposer} +// NewMsgSubmitProposalBase creates a new MsgSubmitProposalBase. +func NewMsgSubmitProposalBase(initialDeposit sdk.Coins, proposer sdk.AccAddress) MsgSubmitProposalBase { + return MsgSubmitProposalBase{ + InitialDeposit: initialDeposit, + Proposer: proposer, + } } // Route implements Msg -func (msg MsgSubmitProposal) Route() string { return RouterKey } +func (msg MsgSubmitProposalBase) Route() string { return RouterKey } // Type implements Msg -func (msg MsgSubmitProposal) Type() string { return TypeMsgSubmitProposal } +func (msg MsgSubmitProposalBase) Type() string { return TypeMsgSubmitProposal } // ValidateBasic implements Msg -func (msg MsgSubmitProposal) ValidateBasic() error { - if msg.Content == nil { - return sdkerrors.Wrap(ErrInvalidProposalContent, "missing content") - } +func (msg MsgSubmitProposalBase) ValidateBasic() error { if msg.Proposer.Empty() { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Proposer.String()) } @@ -49,32 +52,27 @@ func (msg MsgSubmitProposal) ValidateBasic() error { if msg.InitialDeposit.IsAnyNegative() { return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.InitialDeposit.String()) } - if !IsValidProposalType(msg.Content.ProposalType()) { - return sdkerrors.Wrap(ErrInvalidProposalType, msg.Content.ProposalType()) - } - return msg.Content.ValidateBasic() -} - -// String implements the Stringer interface -func (msg MsgSubmitProposal) String() string { - return fmt.Sprintf(`Submit Proposal Message: - Content: %s - Initial Deposit: %s -`, msg.Content.String(), msg.InitialDeposit) + return nil } // GetSignBytes implements Msg -func (msg MsgSubmitProposal) GetSignBytes() []byte { +func (msg MsgSubmitProposalBase) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } // GetSigners implements Msg -func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress { +func (msg MsgSubmitProposalBase) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.Proposer} } +// String implements the Stringer interface +func (msg MsgSubmitProposalBase) String() string { + out, _ := yaml.Marshal(msg) + return string(out) +} + // NewMsgDeposit creates a new MsgDeposit instance func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) MsgDeposit { return MsgDeposit{proposalID, depositor, amount} @@ -103,11 +101,8 @@ func (msg MsgDeposit) ValidateBasic() error { // String implements the Stringer interface func (msg MsgDeposit) String() string { - return fmt.Sprintf(`Deposit Message: - Depositer: %s - Proposal ID: %d - Amount: %s -`, msg.Depositor, msg.ProposalID, msg.Amount) + out, _ := yaml.Marshal(msg) + return string(out) } // GetSignBytes implements Msg @@ -146,10 +141,8 @@ func (msg MsgVote) ValidateBasic() error { // String implements the Stringer interface func (msg MsgVote) String() string { - return fmt.Sprintf(`Vote Message: - Proposal ID: %d - Option: %s -`, msg.ProposalID, msg.Option) + out, _ := yaml.Marshal(msg) + return string(out) } // GetSignBytes implements Msg diff --git a/x/gov/types/params.go b/x/gov/types/params.go index d15ae88b8..511485bfa 100644 --- a/x/gov/types/params.go +++ b/x/gov/types/params.go @@ -4,6 +4,8 @@ import ( "fmt" "time" + "gopkg.in/yaml.v2" + sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -61,9 +63,8 @@ func DefaultDepositParams() DepositParams { // String implements stringer insterface func (dp DepositParams) String() string { - return fmt.Sprintf(`Deposit Params: - Min Deposit: %s - Max Deposit Period: %s`, dp.MinDeposit, dp.MaxDepositPeriod) + out, _ := yaml.Marshal(dp) + return string(out) } // Equal checks equality of DepositParams @@ -108,13 +109,15 @@ func DefaultTallyParams() TallyParams { return NewTallyParams(DefaultQuorum, DefaultThreshold, DefaultVeto) } +// Equal checks equality of TallyParams +func (tp TallyParams) Equal(other TallyParams) bool { + return tp.Quorum.Equal(other.Quorum) && tp.Threshold.Equal(other.Threshold) && tp.Veto.Equal(other.Veto) +} + // String implements stringer insterface func (tp TallyParams) String() string { - return fmt.Sprintf(`Tally Params: - Quorum: %s - Threshold: %s - Veto: %s`, - tp.Quorum, tp.Threshold, tp.Veto) + out, _ := yaml.Marshal(tp) + return string(out) } func validateTallyParams(i interface{}) error { @@ -162,10 +165,15 @@ func DefaultVotingParams() VotingParams { return NewVotingParams(DefaultPeriod) } +// 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 { - return fmt.Sprintf(`Voting Params: - Voting Period: %s`, vp.VotingPeriod) + out, _ := yaml.Marshal(vp) + return string(out) } func validateVotingParams(i interface{}) error { diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index c67363f93..e734ad59a 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -199,10 +199,8 @@ func (tp TextProposal) ValidateBasic() error { return ValidateAbstract(tp) } // String implements Stringer interface func (tp TextProposal) String() string { - return fmt.Sprintf(`Text Proposal: - Title: %s - Description: %s -`, tp.Title, tp.Description) + out, _ := yaml.Marshal(tp) + return string(out) } var validProposalTypes = map[string]struct{}{ diff --git a/x/gov/types/tally.go b/x/gov/types/tally.go index 6020abe5b..d8acbeacd 100644 --- a/x/gov/types/tally.go +++ b/x/gov/types/tally.go @@ -1,7 +1,7 @@ package types import ( - "fmt" + "gopkg.in/yaml.v2" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -63,9 +63,6 @@ func (tr TallyResult) Equals(comp TallyResult) bool { // String implements stringer interface func (tr TallyResult) String() string { - return fmt.Sprintf(`Tally Result: - Yes: %s - Abstain: %s - No: %s - NoWithVeto: %s`, tr.Yes, tr.Abstain, tr.No, tr.NoWithVeto) + out, _ := yaml.Marshal(tr) + return string(out) } diff --git a/x/gov/types/types.pb.go b/x/gov/types/types.pb.go index 56bba9adf..607ac5e8e 100644 --- a/x/gov/types/types.pb.go +++ b/x/gov/types/types.pb.go @@ -4,6 +4,7 @@ package types import ( + bytes "bytes" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" @@ -15,8 +16,6 @@ import ( io "io" math "math" math_bits "math/bits" - reflect "reflect" - strings "strings" time "time" ) @@ -97,9 +96,16 @@ func (ProposalStatus) EnumDescriptor() ([]byte, []int) { return fileDescriptor_a5ae5e91b5b3fb03, []int{1} } +// MsgSubmitProposalBase defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +// +// Note, this message type provides the basis for which a true MsgSubmitProposal +// can be constructed. Since the Content submitted in the message can be arbitrary, +// assuming it fulfills the Content interface, it must be defined at the +// application-level and extend MsgSubmitProposalBase. type MsgSubmitProposalBase struct { - IntialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=intial_deposit,json=intialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"intial_deposit" yaml:"initial_deposit"` - Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty"` + InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit" yaml:"initial_deposit"` + Proposer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=proposer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"proposer,omitempty"` } func (m *MsgSubmitProposalBase) Reset() { *m = MsgSubmitProposalBase{} } @@ -134,45 +140,6 @@ func (m *MsgSubmitProposalBase) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitProposalBase 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" yaml:"proposal_id"` - Depositor github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=depositor,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"depositor,omitempty"` - 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_a5ae5e91b5b3fb03, []int{1} -} -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 - // 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"` @@ -183,7 +150,7 @@ type MsgVote struct { func (m *MsgVote) Reset() { *m = MsgVote{} } func (*MsgVote) ProtoMessage() {} func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_a5ae5e91b5b3fb03, []int{2} + return fileDescriptor_a5ae5e91b5b3fb03, []int{1} } func (m *MsgVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -212,6 +179,45 @@ func (m *MsgVote) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVote 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" yaml:"proposal_id"` + Depositor github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=depositor,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"depositor,omitempty"` + 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_a5ae5e91b5b3fb03, []int{2} +} +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 + // TextProposal defines a standard text proposal whose changes need to be // manually updated in case of approval type TextProposal struct { @@ -421,8 +427,8 @@ func init() { proto.RegisterEnum("cosmos_sdk.x.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos_sdk.x.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) proto.RegisterType((*MsgSubmitProposalBase)(nil), "cosmos_sdk.x.gov.v1.MsgSubmitProposalBase") - proto.RegisterType((*MsgDeposit)(nil), "cosmos_sdk.x.gov.v1.MsgDeposit") proto.RegisterType((*MsgVote)(nil), "cosmos_sdk.x.gov.v1.MsgVote") + proto.RegisterType((*MsgDeposit)(nil), "cosmos_sdk.x.gov.v1.MsgDeposit") proto.RegisterType((*TextProposal)(nil), "cosmos_sdk.x.gov.v1.TextProposal") proto.RegisterType((*Deposit)(nil), "cosmos_sdk.x.gov.v1.Deposit") proto.RegisterType((*ProposalBase)(nil), "cosmos_sdk.x.gov.v1.ProposalBase") @@ -433,81 +439,305 @@ func init() { func init() { proto.RegisterFile("x/gov/types/types.proto", fileDescriptor_a5ae5e91b5b3fb03) } var fileDescriptor_a5ae5e91b5b3fb03 = []byte{ - // 1181 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xc1, 0x6f, 0xd3, 0x56, - 0x18, 0xb7, 0x93, 0x36, 0x6d, 0x5f, 0xd2, 0x60, 0x5e, 0x3b, 0xc8, 0xac, 0xc9, 0x36, 0x06, 0xa1, - 0x8e, 0x09, 0x67, 0x94, 0xc3, 0x24, 0x0e, 0xd3, 0x62, 0x62, 0x20, 0x88, 0x26, 0x91, 0x13, 0x15, - 0xb1, 0x69, 0xb2, 0xdc, 0xd8, 0xb8, 0x1e, 0x8e, 0x5f, 0x96, 0xf7, 0x92, 0x91, 0x1b, 0xda, 0x61, - 0x9a, 0x72, 0x42, 0x3b, 0xed, 0x12, 0x09, 0x69, 0x1c, 0xd0, 0xb4, 0xc3, 0xfe, 0x86, 0x9d, 0x90, - 0x76, 0x18, 0x47, 0x34, 0x4d, 0x61, 0x94, 0xdb, 0xb4, 0x13, 0xd2, 0x2e, 0x3b, 0x4d, 0xf6, 0x7b, - 0xa6, 0x0e, 0x2d, 0x83, 0x8a, 0x4d, 0x93, 0x76, 0x69, 0xeb, 0xef, 0x7d, 0xdf, 0xef, 0xf7, 0xbe, - 0xdf, 0xfb, 0xde, 0xef, 0xa9, 0xe0, 0xe8, 0xcd, 0xb2, 0x87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x1b, 0x2c, 0x6f, 0x36, 0xda, - 0xb5, 0xfa, 0xc5, 0x24, 0x37, 0x23, 0x1e, 0x19, 0x4f, 0x14, 0x48, 0x73, 0x37, 0xe3, 0x3b, 0xc5, - 0x52, 0xdf, 0x02, 0xb9, 0x66, 0xa5, 0xd5, 0x32, 0xaa, 0x42, 0x56, 0x14, 0xc6, 0x13, 0xa5, 0x40, - 0x73, 0x9a, 0x36, 0xc6, 0xae, 0x03, 0x15, 0xb0, 0x68, 0x1a, 0x97, 0x8d, 0xf3, 0x6d, 0xa3, 0x2a, - 0xcc, 0x89, 0x70, 0x3c, 0x51, 0x8a, 0x74, 0xdd, 0x74, 0x3f, 0x71, 0x3b, 0xc4, 0x8d, 0xeb, 0x2f, - 0x54, 0x6a, 0x57, 0x8c, 0xaa, 0x30, 0x9f, 0xae, 0xbf, 0x60, 0xfb, 0x81, 0xeb, 0xcc, 0xb6, 0xab, - 0xd7, 0xef, 0x3f, 0x96, 0xb8, 0x87, 0x8f, 0x25, 0xee, 0xd6, 0x8e, 0xc4, 0xdd, 0xdf, 0x91, 0xf8, - 0x07, 0x3b, 0x12, 0xff, 0xeb, 0x8e, 0xc4, 0xdf, 0x7e, 0x22, 0x71, 0x0f, 0x9e, 0x48, 0xdc, 0xc3, - 0x27, 0x12, 0xf7, 0xe1, 0xdf, 0x5b, 0x5e, 0xea, 0x7f, 0x81, 0xad, 0x5c, 0xec, 0x2a, 0x67, 0xff, - 0x0a, 0x00, 0x00, 0xff, 0xff, 0x48, 0xe7, 0x6e, 0x7f, 0x21, 0x0c, 0x00, 0x00, + // 1185 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xc1, 0x6b, 0xdb, 0x56, + 0x18, 0x97, 0x6c, 0xc7, 0x49, 0x9e, 0x1d, 0x57, 0x7d, 0xc9, 0x5a, 0x4f, 0x0c, 0x49, 0x75, 0x4b, + 0xc9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 0xdd, 0x7c, 0x29, 0x71, 0xcf, 0x5f, 0x4a, 0xdc, 0x97, 0x5b, 0x12, + 0xb7, 0xb9, 0x25, 0xf1, 0xcf, 0xb6, 0x24, 0xfe, 0xe7, 0x2d, 0x89, 0x7f, 0xb8, 0x2d, 0x71, 0xcf, + 0xb6, 0x25, 0xee, 0xf9, 0xb6, 0xc4, 0x7d, 0xfc, 0xf7, 0xf6, 0x37, 0xf1, 0x1f, 0xc3, 0x7a, 0x3a, + 0x72, 0x98, 0xcb, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x41, 0x42, 0x32, 0xc2, 0x47, 0x0c, 0x00, + 0x00, +} + +func (this *MsgSubmitProposalBase) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgSubmitProposalBase) + if !ok { + that2, ok := that.(MsgSubmitProposalBase) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.InitialDeposit) != len(that1.InitialDeposit) { + return false + } + for i := range this.InitialDeposit { + if !this.InitialDeposit[i].Equal(&that1.InitialDeposit[i]) { + return false + } + } + if !bytes.Equal(this.Proposer, that1.Proposer) { + return false + } + return true +} +func (this *MsgVote) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgVote) + if !ok { + that2, ok := that.(MsgVote) + 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 !bytes.Equal(this.Voter, that1.Voter) { + return false + } + if this.Option != that1.Option { + return false + } + return true +} +func (this *MsgDeposit) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgDeposit) + if !ok { + that2, ok := that.(MsgDeposit) + 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 !bytes.Equal(this.Depositor, that1.Depositor) { + return false + } + if len(this.Amount) != len(that1.Amount) { + return false + } + for i := range this.Amount { + if !this.Amount[i].Equal(&that1.Amount[i]) { + return false + } + } + return true +} +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 *Deposit) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Deposit) + if !ok { + that2, ok := that.(Deposit) + 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 !bytes.Equal(this.Depositor, that1.Depositor) { + return false + } + if len(this.Amount) != len(that1.Amount) { + return false + } + for i := range this.Amount { + if !this.Amount[i].Equal(&that1.Amount[i]) { + 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 (this *Vote) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Vote) + if !ok { + that2, ok := that.(Vote) + 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 !bytes.Equal(this.Voter, that1.Voter) { + return false + } + if this.Option != that1.Option { + return false + } + return true } type ProposalBaseFace interface { @@ -602,10 +832,10 @@ func (m *MsgSubmitProposalBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.IntialDeposit) > 0 { - for iNdEx := len(m.IntialDeposit) - 1; iNdEx >= 0; iNdEx-- { + if len(m.InitialDeposit) > 0 { + for iNdEx := len(m.InitialDeposit) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.IntialDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.InitialDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -619,6 +849,46 @@ func (m *MsgSubmitProposalBase) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 = encodeVarintTypes(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x18 + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalID != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ProposalID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *MsgDeposit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -668,46 +938,6 @@ func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 = encodeVarintTypes(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x18 - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalID != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ProposalID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *TextProposal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1003,8 +1233,8 @@ func (m *MsgSubmitProposalBase) Size() (n int) { } var l int _ = l - if len(m.IntialDeposit) > 0 { - for _, e := range m.IntialDeposit { + if len(m.InitialDeposit) > 0 { + for _, e := range m.InitialDeposit { l = e.Size() n += 1 + l + sovTypes(uint64(l)) } @@ -1016,6 +1246,25 @@ func (m *MsgSubmitProposalBase) Size() (n int) { return n } +func (m *MsgVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalID != 0 { + n += 1 + sovTypes(uint64(m.ProposalID)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Option != 0 { + n += 1 + sovTypes(uint64(m.Option)) + } + return n +} + func (m *MsgDeposit) Size() (n int) { if m == nil { return 0 @@ -1038,25 +1287,6 @@ func (m *MsgDeposit) Size() (n int) { return n } -func (m *MsgVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalID != 0 { - n += 1 + sovTypes(uint64(m.ProposalID)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Option != 0 { - n += 1 + sovTypes(uint64(m.Option)) - } - return n -} - func (m *TextProposal) Size() (n int) { if m == nil { return 0 @@ -1169,30 +1399,6 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (this *MsgSubmitProposalBase) String() string { - if this == nil { - return "nil" - } - repeatedStringForIntialDeposit := "[]Coin{" - for _, f := range this.IntialDeposit { - repeatedStringForIntialDeposit += fmt.Sprintf("%v", f) + "," - } - repeatedStringForIntialDeposit += "}" - s := strings.Join([]string{`&MsgSubmitProposalBase{`, - `IntialDeposit:` + repeatedStringForIntialDeposit + `,`, - `Proposer:` + fmt.Sprintf("%v", this.Proposer) + `,`, - `}`, - }, "") - return s -} -func valueToStringTypes(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1224,7 +1430,7 @@ func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IntialDeposit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitialDeposit", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1251,8 +1457,8 @@ func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IntialDeposit = append(m.IntialDeposit, types.Coin{}) - if err := m.IntialDeposit[len(m.IntialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.InitialDeposit = append(m.InitialDeposit, types.Coin{}) + if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1314,6 +1520,131 @@ func (m *MsgSubmitProposalBase) Unmarshal(dAtA []byte) error { } 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 ErrIntOverflowTypes + } + 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = append(m.Voter[:0], dAtA[iNdEx:postIndex]...) + if m.Voter == nil { + m.Voter = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 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 ErrIntOverflowTypes + } + 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 := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + 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 @@ -1454,131 +1785,6 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { } 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 ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Voter = append(m.Voter[:0], dAtA[iNdEx:postIndex]...) - if m.Voter == nil { - m.Voter = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 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 ErrIntOverflowTypes - } - 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 := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - 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 diff --git a/x/gov/types/types.proto b/x/gov/types/types.proto index b22abea1e..6b8b50944 100644 --- a/x/gov/types/types.proto +++ b/x/gov/types/types.proto @@ -10,10 +10,17 @@ option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = false; option (gogoproto.goproto_getters_all) = false; +// MsgSubmitProposalBase defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +// +// Note, this message type provides the basis for which a true MsgSubmitProposal +// can be constructed. Since the Content submitted in the message can be arbitrary, +// assuming it fulfills the Content interface, it must be defined at the +// application-level and extend MsgSubmitProposalBase. message MsgSubmitProposalBase { - option (gogoproto.stringer) = true; + option (gogoproto.equal) = true; - repeated cosmos_sdk.v1.Coin intial_deposit = 1 [ + repeated cosmos_sdk.v1.Coin initial_deposit = 1 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.moretags) = "yaml:\"initial_deposit\"" @@ -21,8 +28,23 @@ message MsgSubmitProposalBase { bytes proposer = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; } +// MsgVote defines a message to cast a vote +message MsgVote { + option (gogoproto.equal) = true; + + uint64 proposal_id = 1 [ + (gogoproto.customname) = "ProposalID", + (gogoproto.moretags) = "yaml:\"proposal_id\"", + (gogoproto.jsontag) = "proposal_id" + ]; + bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + VoteOption option = 3; +} + // MsgDeposit defines a message to submit a deposit to an existing proposal message MsgDeposit { + option (gogoproto.equal) = true; + uint64 proposal_id = 1 [ (gogoproto.customname) = "ProposalID", (gogoproto.moretags) = "yaml:\"proposal_id\"", @@ -46,26 +68,19 @@ enum VoteOption { NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; } -// MsgVote defines a message to cast a vote -message MsgVote { - uint64 proposal_id = 1 [ - (gogoproto.customname) = "ProposalID", - (gogoproto.moretags) = "yaml:\"proposal_id\"", - (gogoproto.jsontag) = "proposal_id" - ]; - bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; - VoteOption option = 3; -} - // TextProposal defines a standard text proposal whose changes need to be // manually updated in case of approval message TextProposal { + option (gogoproto.equal) = true; + string title = 1; string description = 2; } // Deposit defines an amount deposited by an account address to an active proposal message Deposit { + option (gogoproto.equal) = true; + uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID", (gogoproto.moretags) = "yaml:\"proposal_id\""]; bytes depositor = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; repeated cosmos_sdk.v1.Coin amount = 3 @@ -115,6 +130,8 @@ enum ProposalStatus { // TallyResult defines a standard tally for a proposal 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]; @@ -128,6 +145,8 @@ message TallyResult { // Vote defines a vote on a governance proposal. A vote corresponds to a proposal // ID, the voter, and the vote option. message Vote { + option (gogoproto.equal) = true; + uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID", (gogoproto.moretags) = "yaml:\"proposal_id\""]; bytes voter = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; VoteOption option = 3; diff --git a/x/gov/types/vote.go b/x/gov/types/vote.go index f74f27ef2..8a2f0df71 100644 --- a/x/gov/types/vote.go +++ b/x/gov/types/vote.go @@ -4,6 +4,8 @@ import ( "encoding/json" "fmt" + "gopkg.in/yaml.v2" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -13,7 +15,8 @@ func NewVote(proposalID uint64, voter sdk.AccAddress, option VoteOption) Vote { } func (v Vote) String() string { - return fmt.Sprintf("voter %s voted with option %s on proposal %d", v.Voter, v.Option, v.ProposalID) + out, _ := yaml.Marshal(v) + return string(out) } // Votes is a collection of Vote objects From fb42f8b2a0f4e787e51dd6b7dfb1beb7131667c6 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 15:50:20 -0500 Subject: [PATCH 18/31] types updates --- x/gov/common_test.go | 6 ----- x/gov/genesis_test.go | 4 +-- x/gov/keeper/common_test.go | 12 ++------- x/gov/keeper/proposal_test.go | 23 +++++++--------- x/gov/keeper/querier_test.go | 50 ++++++++++++++++++++--------------- x/gov/types/deposit.go | 22 ++++++++++----- x/gov/types/genesis.go | 16 ++++++----- x/gov/types/proposal.go | 15 +++++++++++ x/gov/types/vote.go | 24 +++++++++++------ 9 files changed, 99 insertions(+), 73 deletions(-) diff --git a/x/gov/common_test.go b/x/gov/common_test.go index 31d4dd168..acb8e8cec 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -94,9 +94,3 @@ func createValidators(t *testing.T, stakingHandler sdk.Handler, ctx sdk.Context, require.NotNil(t, res) } } - -// ProposalEqual checks if two proposals are equal (note: slow, for tests only) -func ProposalEqual(proposalA types.Proposal, proposalB types.Proposal) bool { - return bytes.Equal(types.ModuleCdc.MustMarshalBinaryBare(proposalA), - types.ModuleCdc.MustMarshalBinaryBare(proposalB)) -} diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 52ee0c0e1..91cddf795 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -124,7 +124,7 @@ func TestEqualProposals(t *testing.T) { // They are similar but their IDs should be different require.NotEqual(t, proposal1, proposal2) - require.False(t, ProposalEqual(proposal1, proposal2)) + require.NotEqual(t, proposal1, proposal2) // Now create two genesis blocks state1 := gov.GenesisState{Proposals: []gov.Proposal{proposal1}} @@ -136,7 +136,7 @@ func TestEqualProposals(t *testing.T) { proposal1.ProposalID = 55 proposal2.ProposalID = 55 require.Equal(t, proposal1, proposal1) - require.True(t, ProposalEqual(proposal1, proposal2)) + require.Equal(t, proposal1, proposal2) // Reassign proposals into state state1.Proposals[0] = proposal1 diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 24ae48992..e7e9747a0 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -1,10 +1,8 @@ package keeper_test import ( - "bytes" - "github.com/cosmos/cosmos-sdk/simapp" - "github.com/cosmos/cosmos-sdk/simapp/codec" + simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/staking" @@ -14,18 +12,12 @@ var ( TestProposal = types.NewTextProposal("Test", "description") ) -// ProposalEqual checks if two proposals are equal (note: slow, for tests only) -func ProposalEqual(proposalA types.Proposal, proposalB types.Proposal) bool { - return bytes.Equal(types.ModuleCdc.MustMarshalBinaryBare(proposalA), - types.ModuleCdc.MustMarshalBinaryBare(proposalB)) -} - func createValidators(ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) pks := simapp.CreateTestPubKeys(5) - appCodec := codec.NewAppCodec(app.Codec()) + appCodec := simappcodec.NewAppCodec(app.Codec()) app.StakingKeeper = staking.NewKeeper( appCodec, app.GetKey(staking.StoreKey), diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 0ae4c50a2..54ef390c8 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -9,7 +9,6 @@ import ( "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -27,7 +26,7 @@ func TestGetSetProposal(t *testing.T) { gotProposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) - require.True(t, ProposalEqual(proposal, gotProposal)) + require.Equal(t, proposal.String(), gotProposal.String()) } func TestActivateVotingPeriod(t *testing.T) { @@ -90,22 +89,20 @@ func (invalidProposalValidation) ValidateBasic() error { return errors.New("invalid proposal") } -func registerTestCodec(cdc *codec.Codec) { - cdc.RegisterConcrete(validProposal{}, "test/validproposal", nil) - cdc.RegisterConcrete(invalidProposalTitle1{}, "test/invalidproposalt1", nil) - cdc.RegisterConcrete(invalidProposalTitle2{}, "test/invalidproposalt2", nil) - cdc.RegisterConcrete(invalidProposalDesc1{}, "test/invalidproposald1", nil) - cdc.RegisterConcrete(invalidProposalDesc2{}, "test/invalidproposald2", nil) - cdc.RegisterConcrete(invalidProposalRoute{}, "test/invalidproposalr", nil) - cdc.RegisterConcrete(invalidProposalValidation{}, "test/invalidproposalv", nil) -} +// func registerTestCodec(cdc *codec.Codec) { +// cdc.RegisterConcrete(validProposal{}, "test/validproposal", nil) +// cdc.RegisterConcrete(invalidProposalTitle1{}, "test/invalidproposalt1", nil) +// cdc.RegisterConcrete(invalidProposalTitle2{}, "test/invalidproposalt2", nil) +// cdc.RegisterConcrete(invalidProposalDesc1{}, "test/invalidproposald1", nil) +// cdc.RegisterConcrete(invalidProposalDesc2{}, "test/invalidproposald2", nil) +// cdc.RegisterConcrete(invalidProposalRoute{}, "test/invalidproposalr", nil) +// cdc.RegisterConcrete(invalidProposalValidation{}, "test/invalidproposalv", nil) +// } func TestSubmitProposal(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) - registerTestCodec(app.Codec()) - testCases := []struct { content types.Content expectedErr error diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index c4745b1ea..27a1e7275 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -7,10 +7,11 @@ import ( "time" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermit/abci/types" + abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simapp" + simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -146,6 +147,7 @@ func getQueriedVotes(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier func TestQueries(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) + appCodec := simappcodec.NewAppCodec(app.Codec()) querier := keeper.NewQuerier(app.GovKeeper) @@ -156,7 +158,7 @@ func TestQueries(t *testing.T) { tp := TestProposal - depositParams, _, _ := getQueriedParams(t, ctx, app.Codec(), querier) + depositParams, _, _ := getQueriedParams(t, ctx, appCodec, querier) // TestAddrs[0] proposes (and deposits) proposals #1 and #2 proposal1, err := app.GovKeeper.SubmitProposal(ctx, tp) @@ -204,35 +206,35 @@ func TestQueries(t *testing.T) { deposit5.Amount = deposit5.Amount.Add(deposit3.Amount...) // check deposits on proposal1 match individual deposits - deposits := getQueriedDeposits(t, ctx, app.Codec(), querier, proposal1.ProposalID) + deposits := getQueriedDeposits(t, ctx, appCodec, querier, proposal1.ProposalID) require.Len(t, deposits, 1) require.Equal(t, deposit1, deposits[0]) - deposit := getQueriedDeposit(t, ctx, app.Codec(), querier, proposal1.ProposalID, TestAddrs[0]) + deposit := getQueriedDeposit(t, ctx, appCodec, querier, proposal1.ProposalID, TestAddrs[0]) require.Equal(t, deposit1, deposit) // check deposits on proposal2 match individual deposits - deposits = getQueriedDeposits(t, ctx, app.Codec(), querier, proposal2.ProposalID) + deposits = getQueriedDeposits(t, ctx, appCodec, querier, proposal2.ProposalID) require.Len(t, deposits, 2) // NOTE order of deposits is determined by the addresses require.Equal(t, deposit2, deposits[0]) require.Equal(t, deposit4, deposits[1]) // check deposits on proposal3 match individual deposits - deposits = getQueriedDeposits(t, ctx, app.Codec(), querier, proposal3.ProposalID) + deposits = getQueriedDeposits(t, ctx, appCodec, querier, proposal3.ProposalID) require.Len(t, deposits, 1) require.Equal(t, deposit5, deposits[0]) - deposit = getQueriedDeposit(t, ctx, app.Codec(), querier, proposal3.ProposalID, TestAddrs[1]) + deposit = getQueriedDeposit(t, ctx, appCodec, querier, proposal3.ProposalID, TestAddrs[1]) require.Equal(t, deposit5, deposit) // Only proposal #1 should be in types.Deposit Period - proposals := getQueriedProposals(t, ctx, app.Codec(), querier, nil, nil, types.StatusDepositPeriod, 1, 0) + proposals := getQueriedProposals(t, ctx, appCodec, querier, nil, nil, types.StatusDepositPeriod, 1, 0) require.Len(t, proposals, 1) require.Equal(t, proposal1, proposals[0]) // Only proposals #2 and #3 should be in Voting Period - proposals = getQueriedProposals(t, ctx, app.Codec(), querier, nil, nil, types.StatusVotingPeriod, 1, 0) + proposals = getQueriedProposals(t, ctx, appCodec, querier, nil, nil, types.StatusVotingPeriod, 1, 0) require.Len(t, proposals, 2) require.Equal(t, proposal2, proposals[0]) require.Equal(t, proposal3, proposals[1]) @@ -248,56 +250,60 @@ func TestQueries(t *testing.T) { app.GovKeeper.SetVote(ctx, vote3) // Test query voted by TestAddrs[0] - proposals = getQueriedProposals(t, ctx, app.Codec(), querier, nil, TestAddrs[0], types.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, appCodec, querier, nil, TestAddrs[0], types.StatusNil, 1, 0) require.Equal(t, proposal2, proposals[0]) require.Equal(t, proposal3, proposals[1]) // Test query votes on types.Proposal 2 - votes := getQueriedVotes(t, ctx, app.Codec(), querier, proposal2.ProposalID, 1, 0) + votes := getQueriedVotes(t, ctx, appCodec, querier, proposal2.ProposalID, 1, 0) require.Len(t, votes, 1) require.Equal(t, vote1, votes[0]) - vote := getQueriedVote(t, ctx, app.Codec(), querier, proposal2.ProposalID, TestAddrs[0]) + vote := getQueriedVote(t, ctx, appCodec, querier, proposal2.ProposalID, TestAddrs[0]) require.Equal(t, vote1, vote) // Test query votes on types.Proposal 3 - votes = getQueriedVotes(t, ctx, app.Codec(), querier, proposal3.ProposalID, 1, 0) + votes = getQueriedVotes(t, ctx, appCodec, querier, proposal3.ProposalID, 1, 0) require.Len(t, votes, 2) require.Equal(t, vote2, votes[0]) require.Equal(t, vote3, votes[1]) // Test query all proposals - proposals = getQueriedProposals(t, ctx, app.Codec(), querier, nil, nil, types.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, appCodec, querier, nil, nil, types.StatusNil, 1, 0) require.Equal(t, proposal1, proposals[0]) require.Equal(t, proposal2, proposals[1]) require.Equal(t, proposal3, proposals[2]) // Test query voted by TestAddrs[1] - proposals = getQueriedProposals(t, ctx, app.Codec(), querier, nil, TestAddrs[1], types.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, appCodec, querier, nil, TestAddrs[1], types.StatusNil, 1, 0) require.Equal(t, proposal3.ProposalID, proposals[0].ProposalID) // Test query deposited by TestAddrs[0] - proposals = getQueriedProposals(t, ctx, app.Codec(), querier, TestAddrs[0], nil, types.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, appCodec, querier, TestAddrs[0], nil, types.StatusNil, 1, 0) require.Equal(t, proposal1.ProposalID, proposals[0].ProposalID) // Test query deposited by addr2 - proposals = getQueriedProposals(t, ctx, app.Codec(), querier, TestAddrs[1], nil, types.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, appCodec, querier, TestAddrs[1], nil, types.StatusNil, 1, 0) require.Equal(t, proposal2.ProposalID, proposals[0].ProposalID) require.Equal(t, proposal3.ProposalID, proposals[1].ProposalID) // Test query voted AND deposited by addr1 - proposals = getQueriedProposals(t, ctx, app.Codec(), querier, TestAddrs[0], TestAddrs[0], types.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, appCodec, querier, TestAddrs[0], TestAddrs[0], types.StatusNil, 1, 0) require.Equal(t, proposal2.ProposalID, proposals[0].ProposalID) } func TestPaginatedVotesQuery(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) + appCodec := simappcodec.NewAppCodec(app.Codec()) proposal := types.Proposal{ - ProposalID: 100, - Status: types.StatusVotingPeriod, + ProposalBase: types.ProposalBase{ + ProposalID: 100, + Status: types.StatusVotingPeriod, + }, } + app.GovKeeper.SetProposal(ctx, proposal) votes := make([]types.Vote, 20) @@ -317,7 +323,7 @@ func TestPaginatedVotesQuery(t *testing.T) { querier := keeper.NewQuerier(app.GovKeeper) // keeper preserves consistent order for each query, but this is not the insertion order - all := getQueriedVotes(t, ctx, app.Codec(), querier, proposal.ProposalID, 1, 0) + all := getQueriedVotes(t, ctx, appCodec, querier, proposal.ProposalID, 1, 0) require.Equal(t, len(all), len(votes)) type testCase struct { @@ -351,7 +357,7 @@ func TestPaginatedVotesQuery(t *testing.T) { } { tc := tc t.Run(tc.description, func(t *testing.T) { - votes := getQueriedVotes(t, ctx, app.Codec(), querier, proposal.ProposalID, tc.page, tc.limit) + votes := getQueriedVotes(t, ctx, appCodec, querier, proposal.ProposalID, tc.page, tc.limit) require.Equal(t, len(tc.votes), len(votes)) for i := range votes { require.Equal(t, tc.votes[i], votes[i]) diff --git a/x/gov/types/deposit.go b/x/gov/types/deposit.go index 58d2540ec..d9f72a83f 100644 --- a/x/gov/types/deposit.go +++ b/x/gov/types/deposit.go @@ -21,6 +21,21 @@ func (d Deposit) String() string { // 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.Equal(other[i]) { + return false + } + } + + return true +} + func (d Deposits) String() string { if len(d) == 0 { return "[]" @@ -32,12 +47,7 @@ func (d Deposits) String() string { return out } -// Equals returns whether two deposits are equal. -func (d Deposit) Equals(comp Deposit) bool { - return d.Depositor.Equals(comp.Depositor) && d.ProposalID == comp.ProposalID && d.Amount.IsEqual(comp.Amount) -} - // Empty returns whether a deposit is empty. func (d Deposit) Empty() bool { - return d.Equals(Deposit{}) + return d.Equal(Deposit{}) } diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index 858bc85f8..e38b0213e 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -37,14 +37,18 @@ func DefaultGenesisState() GenesisState { ) } +func (data GenesisState) Equal(other GenesisState) bool { + return data.Deposits.Equal(other.Deposits) && + data.Votes.Equal(other.Votes) && + data.Proposals.Equal(other.Proposals) && + data.DepositParams.Equal(other.DepositParams) && + data.TallyParams.Equal(other.TallyParams) && + data.VotingParams.Equal(other.VotingParams) +} + // IsEmpty returns true if a GenesisState is empty func (data GenesisState) IsEmpty() bool { - return data.Deposits == nil && - data.Votes == nil && - data.Proposals == nil && - data.DepositParams.Equal(DepositParams{}) && - data.TallyParams.Equal(TallyParams{}) && - data.VotingParams.Equal(VotingParams{}) + return data.Equal(GenesisState{}) } // ValidateGenesis checks if parameters are within valid ranges diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index e734ad59a..2ba08980e 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -46,6 +46,21 @@ func (p Proposal) String() string { // Proposals is an array of proposal type Proposals []Proposal +// Equal returns true if two slices (order-dependant) of proposals are equal. +func (p Proposals) Equal(other Proposals) bool { + if len(p) != len(other) { + return false + } + + for i, proposal := range p { + if !proposal.Equal(other[i]) { + return false + } + } + + return true +} + // String implements stringer interface func (p Proposals) String() string { out := "ID - (Status) [Type] Title\n" diff --git a/x/gov/types/vote.go b/x/gov/types/vote.go index 8a2f0df71..13eb41f75 100644 --- a/x/gov/types/vote.go +++ b/x/gov/types/vote.go @@ -22,6 +22,21 @@ func (v Vote) String() string { // Votes is a collection of Vote objects type Votes []Vote +// Equal returns true if two slices (order-dependant) of votes are equal. +func (v Votes) Equal(other Votes) bool { + if len(v) != len(other) { + return false + } + + for i, vote := range v { + if !vote.Equal(other[i]) { + return false + } + } + + return true +} + func (v Votes) String() string { if len(v) == 0 { return "[]" @@ -33,16 +48,9 @@ func (v Votes) String() string { return out } -// Equals returns whether two votes are equal. -func (v Vote) Equals(comp Vote) bool { - return v.Voter.Equals(comp.Voter) && - v.ProposalID == comp.ProposalID && - v.Option == comp.Option -} - // Empty returns whether a vote is empty. func (v Vote) Empty() bool { - return v.Equals(Vote{}) + return v.Equal(Vote{}) } // VoteOptionFromString returns a VoteOption from a string. It returns an error From fe7b02231e4ad95f9e39e7ac04a8dca98df7fb4f Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 16:06:35 -0500 Subject: [PATCH 19/31] Update handler --- x/gov/abci_test.go | 16 +++++++++++----- x/gov/handler.go | 8 ++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 79db8f81a..c82019be7 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -8,6 +8,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/simapp" + simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/staking" @@ -27,11 +28,12 @@ func TestTickExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg := gov.NewMsgSubmitProposal( + newProposalMsg, err := simappcodec.NewMsgSubmitProposal( gov.ContentFromProposalType("test", "test", gov.ProposalTypeText), sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) + require.NoError(t, err) res, err := govHandler(ctx, newProposalMsg) require.NoError(t, err) @@ -78,11 +80,12 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg := gov.NewMsgSubmitProposal( + newProposalMsg, err := simappcodec.NewMsgSubmitProposal( gov.ContentFromProposalType("test", "test", gov.ProposalTypeText), sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) + require.NoError(t, err) res, err := govHandler(ctx, newProposalMsg) require.NoError(t, err) @@ -100,11 +103,12 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg2 := gov.NewMsgSubmitProposal( + newProposalMsg2, err := simappcodec.NewMsgSubmitProposal( gov.ContentFromProposalType("test2", "test2", gov.ProposalTypeText), sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) + require.NoError(t, err) res, err = govHandler(ctx, newProposalMsg2) require.NoError(t, err) @@ -156,11 +160,12 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.False(t, activeQueue.Valid()) activeQueue.Close() - newProposalMsg := gov.NewMsgSubmitProposal( + newProposalMsg, err := simappcodec.NewMsgSubmitProposal( gov.ContentFromProposalType("test2", "test2", gov.ProposalTypeText), sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) + require.NoError(t, err) res, err := govHandler(ctx, newProposalMsg) require.NoError(t, err) @@ -211,7 +216,8 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, sdk.TokensFromConsensusPower(5))} - newProposalMsg := gov.NewMsgSubmitProposal(TestProposal, proposalCoins, addrs[0]) + newProposalMsg, err := simappcodec.NewMsgSubmitProposal(TestProposal, proposalCoins, addrs[0]) + require.NoError(t, err) res, err := govHandler(ctx, newProposalMsg) require.NoError(t, err) diff --git a/x/gov/handler.go b/x/gov/handler.go index 4e4aee2c5..27945d928 100644 --- a/x/gov/handler.go +++ b/x/gov/handler.go @@ -30,12 +30,12 @@ func NewHandler(keeper Keeper) sdk.Handler { } func handleMsgSubmitProposal(ctx sdk.Context, keeper Keeper, msg MsgSubmitProposal) (*sdk.Result, error) { - proposal, err := keeper.SubmitProposal(ctx, msg.Content) + proposal, err := keeper.SubmitProposal(ctx, msg.GetContent()) if err != nil { return nil, err } - votingStarted, err := keeper.AddDeposit(ctx, proposal.ProposalID, msg.Proposer, msg.InitialDeposit) + votingStarted, err := keeper.AddDeposit(ctx, proposal.ProposalID, msg.GetProposer(), msg.GetInitialDeposit()) if err != nil { return nil, err } @@ -44,11 +44,11 @@ func handleMsgSubmitProposal(ctx sdk.Context, keeper Keeper, msg MsgSubmitPropos sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Proposer.String()), + sdk.NewAttribute(sdk.AttributeKeySender, msg.GetProposer().String()), ), ) - submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalType, msg.Content.ProposalType())) + submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalType, msg.GetContent().ProposalType())) if votingStarted { submitEvent = submitEvent.AppendAttributes( sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalID)), From 833368cc7484bf8d40153181429e28f074ae2011 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 16:29:10 -0500 Subject: [PATCH 20/31] reintroduce old MsgSubmitProposal type --- x/gov/alias.go | 2 + x/gov/handler.go | 4 +- x/gov/keeper/querier_test.go | 12 +++--- x/gov/types/msgs.go | 63 ++++++++++++++++++++++++++- x/upgrade/types/types.pb.go | 83 +++++++++++++++++++++++++----------- x/upgrade/types/types.proto | 2 + 6 files changed, 131 insertions(+), 35 deletions(-) diff --git a/x/gov/alias.go b/x/gov/alias.go index 86828db77..aad984c2c 100644 --- a/x/gov/alias.go +++ b/x/gov/alias.go @@ -83,6 +83,7 @@ var ( SplitKeyDeposit = types.SplitKeyDeposit SplitKeyVote = types.SplitKeyVote NewMsgSubmitProposalBase = types.NewMsgSubmitProposalBase + NewMsgSubmitProposal = types.NewMsgSubmitProposal NewMsgDeposit = types.NewMsgDeposit NewMsgVote = types.NewMsgVote ParamKeyTable = types.ParamKeyTable @@ -131,6 +132,7 @@ type ( Deposit = types.Deposit Deposits = types.Deposits GenesisState = types.GenesisState + MsgSubmitProposalI = types.MsgSubmitProposalI MsgSubmitProposal = types.MsgSubmitProposal MsgSubmitProposalBase = types.MsgSubmitProposalBase MsgDeposit = types.MsgDeposit diff --git a/x/gov/handler.go b/x/gov/handler.go index 27945d928..21693d943 100644 --- a/x/gov/handler.go +++ b/x/gov/handler.go @@ -17,7 +17,7 @@ func NewHandler(keeper Keeper) sdk.Handler { case MsgDeposit: return handleMsgDeposit(ctx, keeper, msg) - case MsgSubmitProposal: + case MsgSubmitProposalI: return handleMsgSubmitProposal(ctx, keeper, msg) case MsgVote: @@ -29,7 +29,7 @@ func NewHandler(keeper Keeper) sdk.Handler { } } -func handleMsgSubmitProposal(ctx sdk.Context, keeper Keeper, msg MsgSubmitProposal) (*sdk.Result, error) { +func handleMsgSubmitProposal(ctx sdk.Context, keeper Keeper, msg MsgSubmitProposalI) (*sdk.Result, error) { proposal, err := keeper.SubmitProposal(ctx, msg.GetContent()) if err != nil { return nil, err diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 27a1e7275..918f054a7 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -19,7 +19,7 @@ import ( const custom = "custom" -func getQueriedParams(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier) (types.DepositParams, types.VotingParams, types.TallyParams) { +func getQueriedParams(t *testing.T, ctx sdk.Context, cdc codec.JSONMarshaler, querier sdk.Querier) (types.DepositParams, types.VotingParams, types.TallyParams) { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryParams, types.ParamDeposit}, "/"), Data: []byte{}, @@ -60,7 +60,7 @@ func getQueriedParams(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querie } func getQueriedProposals( - t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, + t *testing.T, ctx sdk.Context, cdc codec.JSONMarshaler, querier sdk.Querier, depositor, voter sdk.AccAddress, status types.ProposalStatus, page, limit int, ) []types.Proposal { @@ -79,7 +79,7 @@ func getQueriedProposals( return proposals } -func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, proposalID uint64, depositor sdk.AccAddress) types.Deposit { +func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc codec.JSONMarshaler, querier sdk.Querier, proposalID uint64, depositor sdk.AccAddress) types.Deposit { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryDeposit}, "/"), Data: cdc.MustMarshalJSON(types.NewQueryDepositParams(proposalID, depositor)), @@ -95,7 +95,7 @@ func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, queri return deposit } -func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, proposalID uint64) []types.Deposit { +func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc codec.JSONMarshaler, querier sdk.Querier, proposalID uint64) []types.Deposit { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryDeposits}, "/"), Data: cdc.MustMarshalJSON(types.NewQueryProposalParams(proposalID)), @@ -111,7 +111,7 @@ func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, quer return deposits } -func getQueriedVote(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, proposalID uint64, voter sdk.AccAddress) types.Vote { +func getQueriedVote(t *testing.T, ctx sdk.Context, cdc codec.JSONMarshaler, querier sdk.Querier, proposalID uint64, voter sdk.AccAddress) types.Vote { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryVote}, "/"), Data: cdc.MustMarshalJSON(types.NewQueryVoteParams(proposalID, voter)), @@ -127,7 +127,7 @@ func getQueriedVote(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier return vote } -func getQueriedVotes(t *testing.T, ctx sdk.Context, cdc codec.Marshaler, querier sdk.Querier, +func getQueriedVotes(t *testing.T, ctx sdk.Context, cdc codec.JSONMarshaler, querier sdk.Querier, proposalID uint64, page, limit int) []types.Vote { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryVote}, "/"), diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index eb0343902..55e19e675 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -16,10 +16,10 @@ const ( var _, _, _ sdk.Msg = MsgSubmitProposalBase{}, MsgDeposit{}, MsgVote{} -// MsgSubmitProposal defines the specific interface a concrete message must +// MsgSubmitProposalI defines the specific interface a concrete message must // implement in order to process governance proposals. The concrete MsgSubmitProposal // must be defined at the application-level. -type MsgSubmitProposal interface { +type MsgSubmitProposalI interface { sdk.Msg GetContent() Content @@ -155,3 +155,62 @@ func (msg MsgVote) GetSignBytes() []byte { func (msg MsgVote) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.Voter} } + +// --------------------------------------------------------------------------- +// Deprecated +// +// TODO: Remove once client-side Protobuf migration has been completed. +// --------------------------------------------------------------------------- + +// MsgSubmitProposal defines a (deprecated) message to create/submit a governance +// proposal. +// +// TODO: Remove once client-side Protobuf migration has been completed. +type MsgSubmitProposal struct { + Content Content `json:"content" yaml:"content"` + InitialDeposit sdk.Coins `json:"initial_deposit" yaml:"initial_deposit"` // Initial deposit paid by sender. Must be strictly positive + Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` // Address of the proposer +} + +// NewMsgSubmitProposal returns a (deprecated) MsgSubmitProposal message. +// +// TODO: Remove once client-side Protobuf migration has been completed. +func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sdk.AccAddress) MsgSubmitProposal { + return MsgSubmitProposal{content, initialDeposit, proposer} +} + +// ValidateBasic implements Msg +func (msg MsgSubmitProposal) ValidateBasic() error { + if msg.Content == nil { + return sdkerrors.Wrap(ErrInvalidProposalContent, "missing content") + } + if msg.Proposer.Empty() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Proposer.String()) + } + if !msg.InitialDeposit.IsValid() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.InitialDeposit.String()) + } + if msg.InitialDeposit.IsAnyNegative() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.InitialDeposit.String()) + } + if !IsValidProposalType(msg.Content.ProposalType()) { + return sdkerrors.Wrap(ErrInvalidProposalType, msg.Content.ProposalType()) + } + + return msg.Content.ValidateBasic() +} + +// GetSignBytes implements Msg +func (msg MsgSubmitProposal) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements Msg +func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{msg.Proposer} +} + +// nolint +func (msg MsgSubmitProposal) Route() string { return RouterKey } +func (msg MsgSubmitProposal) Type() string { return TypeMsgSubmitProposal } diff --git a/x/upgrade/types/types.pb.go b/x/upgrade/types/types.pb.go index e6c317700..f8c8f1ffd 100644 --- a/x/upgrade/types/types.pb.go +++ b/x/upgrade/types/types.pb.go @@ -164,33 +164,66 @@ func init() { func init() { proto.RegisterFile("x/upgrade/types/types.proto", fileDescriptor_2a308fd9dd71aff8) } var fileDescriptor_2a308fd9dd71aff8 = []byte{ - // 376 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x31, 0x6f, 0xe2, 0x30, - 0x18, 0x8d, 0x8f, 0x1c, 0x3a, 0xcc, 0x66, 0x9d, 0x8e, 0x88, 0x13, 0x4e, 0xc4, 0x70, 0x62, 0xb8, - 0x73, 0x74, 0xdc, 0x70, 0xa7, 0x1b, 0xe9, 0x5e, 0xa1, 0xb4, 0x5d, 0x2a, 0x55, 0xc8, 0x24, 0x26, - 0xb1, 0x48, 0x62, 0x2b, 0x36, 0x2d, 0x6c, 0xfd, 0x09, 0xfc, 0x84, 0xfe, 0x1c, 0x46, 0x46, 0xa6, - 0xb6, 0xc0, 0xd2, 0x9f, 0x51, 0x25, 0x06, 0xb5, 0xaa, 0xd4, 0xad, 0x8b, 0xfd, 0x3e, 0xeb, 0x7d, - 0xef, 0x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x73, 0x91, 0x57, 0xf1, 0x1a, 0xc1, 0xeb, 0x23, 0xf4, - 0x17, 0xda, 0x32, 0xa5, 0x79, 0xe5, 0xde, 0xec, 0x77, 0xc8, 0x3b, 0xf7, 0x48, 0xca, 0xd1, 0x07, - 0x76, 0x19, 0x3e, 0xa8, 0x1a, 0xfe, 0xdb, 0x4f, 0x77, 0x2e, 0xe8, 0x5e, 0xc1, 0xce, 0x09, 0xcd, - 0x43, 0x96, 0x7e, 0x70, 0x2e, 0x23, 0x3f, 0x38, 0x5d, 0x6d, 0xb1, 0xb5, 0xd9, 0x62, 0x6b, 0xb5, - 0xc3, 0x60, 0xbd, 0xc3, 0xe0, 0x71, 0x87, 0xc1, 0x72, 0x8f, 0xad, 0xf5, 0x1e, 0x5b, 0x9b, 0x3d, - 0xb6, 0x2e, 0x7f, 0xc6, 0x5c, 0x27, 0xb3, 0x31, 0x09, 0x45, 0xe6, 0x9b, 0xec, 0x87, 0xed, 0x97, - 0x8a, 0xa6, 0xfe, 0x9b, 0x2f, 0x33, 0xae, 0x57, 0x2f, 0xf2, 0xe7, 0x39, 0x00, 0x00, 0xff, 0xff, - 0x4f, 0x2c, 0xc2, 0xac, 0x4c, 0x02, 0x00, 0x00, + // 379 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x41, 0x6f, 0xda, 0x30, + 0x14, 0xc7, 0xe3, 0x91, 0xa1, 0x61, 0x6e, 0xd6, 0x34, 0x22, 0x26, 0x9c, 0x88, 0xc3, 0xc4, 0x61, + 0x73, 0x34, 0x76, 0xd8, 0xb4, 0x23, 0xbb, 0x4f, 0x28, 0x5b, 0x2f, 0x95, 0x2a, 0x64, 0x12, 0x93, + 0x58, 0x24, 0xb1, 0x15, 0x9b, 0x16, 0xbe, 0x40, 0xcf, 0x7c, 0x84, 0x7e, 0x1c, 0x8e, 0x1c, 0x39, + 0xb5, 0x05, 0x2e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x2e, 0x84, 0x14, 0x8a, 0xa6, 0xe8, 0x23, 0x7c, + 0xaf, 0xb9, 0x4e, 0x4f, 0x70, 0x26, 0x41, 0x1e, 0x6c, 0x47, 0x4c, 0x85, 0x05, 0x97, 0x9a, 0x8b, + 0xbc, 0x82, 0x6c, 0x05, 0xcf, 0x8f, 0xd0, 0x4f, 0x68, 0xcb, 0x94, 0xe6, 0x15, 0x43, 0x7b, 0xd8, + 0x23, 0xaf, 0x6c, 0x93, 0x94, 0x0b, 0x18, 0xd9, 0xe5, 0x08, 0x41, 0x55, 0x50, 0x23, 0x5d, 0xc0, + 0xde, 0x1f, 0x9a, 0x87, 0x2c, 0x7d, 0x63, 0x2e, 0x63, 0x3f, 0xfa, 0xbb, 0xd9, 0x63, 0x6b, 0xb7, + 0xc7, 0xd6, 0xe6, 0x80, 0xc1, 0xf6, 0x80, 0xc1, 0xfd, 0x01, 0x83, 0xf5, 0x11, 0x5b, 0xdb, 0x23, + 0xb6, 0x76, 0x47, 0x6c, 0x9d, 0x7f, 0x8d, 0xb9, 0x4e, 0x16, 0x53, 0x12, 0x8a, 0xcc, 0x37, 0xec, + 0xf5, 0xef, 0x9b, 0x8a, 0xe6, 0xfe, 0x8b, 0x87, 0x33, 0x6d, 0x56, 0xf7, 0xf2, 0xe3, 0x31, 0x00, + 0x00, 0xff, 0xff, 0x45, 0x05, 0x01, 0x90, 0x52, 0x02, 0x00, 0x00, } +func (this *Plan) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Plan) + if !ok { + that2, ok := that.(Plan) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if !this.Time.Equal(that1.Time) { + return false + } + if this.Height != that1.Height { + return false + } + if this.Info != that1.Info { + return false + } + return true +} func (this *SoftwareUpgradeProposal) Equal(that interface{}) bool { if that == nil { return this == nil diff --git a/x/upgrade/types/types.proto b/x/upgrade/types/types.proto index d020f4401..3b0fffb8f 100644 --- a/x/upgrade/types/types.proto +++ b/x/upgrade/types/types.proto @@ -10,6 +10,8 @@ option (gogoproto.goproto_getters_all) = false; // Plan specifies information about a planned upgrade and when it should occur message Plan { + option (gogoproto.equal) = true; + // Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any // special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used // to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been From 5f0c53da174c507baf668c695c5bc9a8a8c440c9 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 16:46:28 -0500 Subject: [PATCH 21/31] update tests --- simapp/codec/codec.pb.go | 139 +++++++++++++---------- simapp/codec/codec.proto | 2 + simapp/codec/msgs.go | 2 +- x/gov/keeper/keeper_test.go | 8 +- x/gov/keeper/proposal_test.go | 55 +-------- x/gov/types/genesis.go | 3 +- x/gov/types/types.pb.go | 202 +++++++++++++++++++++------------- x/gov/types/types.proto | 1 + 8 files changed, 223 insertions(+), 189 deletions(-) diff --git a/simapp/codec/codec.pb.go b/simapp/codec/codec.pb.go index 17b252556..7ef14c916 100644 --- a/simapp/codec/codec.pb.go +++ b/simapp/codec/codec.pb.go @@ -583,62 +583,62 @@ func init() { func init() { proto.RegisterFile("simapp/codec/codec.proto", fileDescriptor_3c6d4085e4065f5a) } var fileDescriptor_3c6d4085e4065f5a = []byte{ - // 876 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0xb6, 0x77, 0xb3, 0x6d, 0x34, 0xbb, 0xc0, 0x32, 0x62, 0x69, 0x14, 0x50, 0xb2, 0x64, 0x61, - 0x05, 0x8b, 0x6a, 0xef, 0x52, 0xa0, 0x6d, 0x24, 0x54, 0x9a, 0x50, 0x14, 0x24, 0x8a, 0xaa, 0x14, - 0x38, 0x20, 0x90, 0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x59, 0x34, 0x7c, 0x24, 0x5b, 0x10, 0xfc, 0x0c, 0xac, - 0x27, 0x75, 0x88, 0xf3, 0x36, 0xf1, 0x64, 0x99, 0xdf, 0xa1, 0x80, 0x8e, 0xb3, 0x1c, 0x38, 0x2a, - 0xb9, 0x7d, 0x56, 0x76, 0x6b, 0x93, 0xa8, 0x64, 0x34, 0x13, 0x5d, 0x61, 0xf4, 0x54, 0x05, 0xcd, - 0xdc, 0xdf, 0x9e, 0x14, 0xa8, 0xed, 0x61, 0x52, 0x60, 0x19, 0x2f, 0x1c, 0xce, 0x37, 0x78, 0xe7, - 0xa5, 0x37, 0x38, 0x68, 0x24, 0x2c, 0xf9, 0x36, 0x7b, 0x67, 0x0d, 0xb0, 0x2e, 0x43, 0x70, 0x1b, - 0x34, 0x38, 0x8e, 0xf9, 0x52, 0x47, 0xdf, 0xe2, 0x38, 0xdf, 0xed, 0x48, 0x19, 0xa7, 0x09, 0xf0, - 0x47, 0xf0, 0x30, 0x1d, 0x03, 0x98, 0xe3, 0xc0, 0x40, 0x53, 0xd3, 0xb7, 0x17, 0x9c, 0xb2, 0x18, - 0x16, 0xe9, 0xce, 0x32, 0xfc, 0x30, 0x85, 0x17, 0x28, 0x5f, 0xa3, 0xe5, 0x10, 0xfc, 0x09, 0x3c, - 0x64, 0xe4, 0x67, 0xfe, 0xab, 0x19, 0x60, 0x43, 0x0e, 0x12, 0xd9, 0x2d, 0x9f, 0x97, 0xd9, 0x65, - 0x30, 0xad, 0x60, 0x99, 0xf0, 0x9d, 0x58, 0x2a, 0xd2, 0xb3, 0x72, 0x08, 0x52, 0xb0, 0x81, 0x4c, - 0x1f, 0x61, 0xd7, 0xa8, 0xa8, 0x34, 0xea, 0x06, 0x41, 0x41, 0x65, 0x98, 0xe6, 0x2d, 0xd6, 0x7a, - 0x84, 0xea, 0x00, 0xd0, 0x05, 0x6f, 0x20, 0xe2, 0x79, 0xa1, 0xef, 0xf0, 0x99, 0x41, 0x09, 0x71, - 0x0d, 0x46, 0xb1, 0x6f, 0xc9, 0x56, 0xb9, 0x53, 0x96, 0x2b, 0x4e, 0x47, 0x71, 0x8e, 0x32, 0xf3, - 0x88, 0x10, 0xf7, 0x38, 0xc9, 0x2b, 0x08, 0x42, 0x54, 0x89, 0xf6, 0x77, 0x64, 0x63, 0x78, 0xbe, - 0xa2, 0x31, 0xe4, 0x13, 0x3e, 0xbf, 0x2a, 0xa2, 0x1f, 0x0c, 0x86, 0x17, 0x37, 0x1d, 0xf5, 0xea, - 0xa6, 0xa3, 0xfe, 0x7b, 0xd3, 0x51, 0x4f, 0x6f, 0x3b, 0xca, 0xd5, 0x6d, 0x47, 0xf9, 0xe7, 0xb6, - 0xa3, 0xfc, 0xf0, 0xc1, 0x52, 0xca, 0xe2, 0xbf, 0xa6, 0xc9, 0x5a, 0x3a, 0xcc, 0xb7, 0xfe, 0x0f, - 0x00, 0x00, 0xff, 0xff, 0x22, 0x64, 0xee, 0x71, 0x4c, 0x09, 0x00, 0x00, + // 880 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x8f, 0xdb, 0x44, + 0x14, 0xb6, 0x5b, 0x77, 0x37, 0x9a, 0x16, 0x28, 0x23, 0xca, 0x46, 0x01, 0x25, 0x65, 0x0b, 0x15, + 0x14, 0xad, 0xdd, 0x52, 0xa0, 0xdb, 0x48, 0xa8, 0x34, 0xa1, 0x28, 0x48, 0x2c, 0x5a, 0x65, 0x81, + 0x03, 0x02, 0x59, 0xce, 0x78, 0x70, 0xac, 0xda, 0x9e, 0xc1, 0x33, 0x36, 0xce, 0x3f, 0x40, 0x9c, + 0x38, 0x71, 0x5e, 0x71, 0xe0, 0xc8, 0xa9, 0x47, 0x7e, 0x40, 0xb5, 0xa7, 0x3d, 0x72, 0x5a, 0xa1, + 0xdd, 0x0b, 0x3f, 0x03, 0x79, 0x66, 0xec, 0xd8, 0xb2, 0x93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d1, 0x42, 0x74, 0x83, 0xd1, 0xdf, 0x75, + 0xd0, 0x29, 0xfd, 0x3d, 0x52, 0x02, 0xad, 0x3d, 0x4c, 0x09, 0xac, 0xe3, 0x85, 0xe3, 0xe5, 0x06, + 0x2f, 0xbd, 0xf0, 0x06, 0x47, 0x46, 0xce, 0x52, 0x6e, 0x73, 0x68, 0x08, 0x63, 0xc7, 0x06, 0xd8, + 0x56, 0x00, 0xf8, 0x00, 0x18, 0x1c, 0x67, 0x7c, 0xad, 0xaf, 0xaf, 0x71, 0x56, 0xee, 0x79, 0xa2, + 0x4d, 0x45, 0x02, 0xfc, 0x1e, 0x5c, 0x17, 0xc3, 0x00, 0x73, 0x1c, 0xdb, 0x68, 0xee, 0x44, 0xde, + 0x8a, 0xb3, 0x96, 0x23, 0x43, 0xec, 0xaf, 0xc0, 0x8f, 0x05, 0xbc, 0x42, 0xf9, 0x0a, 0xad, 0x87, + 0xe0, 0x0f, 0xe0, 0x3a, 0x23, 0x3f, 0xf2, 0x9f, 0x9d, 0x18, 0xdb, 0x6a, 0x9c, 0xa8, 0x9e, 0x79, + 0xb7, 0xce, 0xae, 0x82, 0xa2, 0x8e, 0x55, 0xc2, 0x37, 0x72, 0xa9, 0x4a, 0xcf, 0xea, 0x21, 0x48, + 0xc1, 0x0e, 0x72, 0x22, 0x84, 0x03, 0xbb, 0xa1, 0x62, 0xb4, 0x8d, 0x83, 0x8a, 0xca, 0x58, 0xe4, + 0xad, 0xd6, 0xba, 0x81, 0xda, 0x00, 0x30, 0x00, 0xaf, 0x21, 0x12, 0x86, 0x49, 0xe4, 0xf3, 0x85, + 0x4d, 0x09, 0x09, 0x6c, 0x46, 0x71, 0xe4, 0xaa, 0x86, 0xb9, 0x5f, 0x97, 0xab, 0xce, 0x48, 0x79, + 0x9a, 0x2a, 0xf3, 0x90, 0x90, 0xe0, 0x28, 0xcf, 0xab, 0x08, 0x42, 0xd4, 0x88, 0x0e, 0xf7, 0x55, + 0x7b, 0xb8, 0xbb, 0xa1, 0x3d, 0x94, 0x73, 0xbe, 0xbc, 0x30, 0xb2, 0x2b, 0x8c, 0xc6, 0xcf, 0xcf, + 0xfb, 0xfa, 0xe9, 0x79, 0x5f, 0xff, 0xf7, 0xbc, 0xaf, 0xff, 0x76, 0xd1, 0xd7, 0x4e, 0x2f, 0xfa, + 0xda, 0x3f, 0x17, 0x7d, 0xed, 0xbb, 0xf7, 0xd6, 0x52, 0x56, 0xff, 0x3b, 0xcd, 0xb6, 0xc4, 0x48, + 0xbf, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x44, 0x7b, 0x22, 0xdc, 0x52, 0x09, 0x00, 0x00, } func (this *Supply) Equal(that interface{}) bool { @@ -803,6 +803,33 @@ func (this *MsgSubmitProposal) Equal(that interface{}) bool { } 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.ProposalBase.Equal(&that1.ProposalBase) { + return false + } + if !this.Content.Equal(&that1.Content) { + return false + } + return true +} func (this *Content) Equal(that interface{}) bool { if that == nil { return this == nil diff --git a/simapp/codec/codec.proto b/simapp/codec/codec.proto index 9b5d94991..c59061ab7 100644 --- a/simapp/codec/codec.proto +++ b/simapp/codec/codec.proto @@ -74,6 +74,8 @@ message MsgSubmitProposal { // Proposal defines the application-level concrete proposal type used in governance // proposals. message Proposal { + option (gogoproto.equal) = true; + cosmos_sdk.x.gov.v1.ProposalBase base = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; Content content = 2 [(gogoproto.nullable) = false]; } diff --git a/simapp/codec/msgs.go b/simapp/codec/msgs.go index d34a07bec..5c4599d8d 100644 --- a/simapp/codec/msgs.go +++ b/simapp/codec/msgs.go @@ -10,7 +10,7 @@ import ( var ( _ eviexported.MsgSubmitEvidence = MsgSubmitEvidence{} - _ gov.MsgSubmitProposal = MsgSubmitProposal{} + _ gov.MsgSubmitProposalI = MsgSubmitProposal{} ) // NewMsgSubmitEvidence returns a new MsgSubmitEvidence. diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index ec1a69679..7bf2899c3 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -3,12 +3,10 @@ package keeper_test import ( "testing" - proto "github.com/gogo/protobuf/types" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/simapp" - simappcodec "github.com/cosmos/cosmos-sdk/simapp/codec" "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -31,7 +29,6 @@ func TestIncrementProposalNumber(t *testing.T) { func TestProposalQueues(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) - appCodec := simappcodec.NewAppCodec(app.Codec()) // create test proposals tp := TestProposal @@ -53,9 +50,8 @@ func TestProposalQueues(t *testing.T) { activeIterator := app.GovKeeper.ActiveProposalQueueIterator(ctx, proposal.VotingEndTime) require.True(t, activeIterator.Valid()) - var propIDValue proto.UInt64Value - appCodec.UnmarshalBinaryLengthPrefixed(activeIterator.Value(), &propIDValue) + proposalID, _ = types.SplitActiveProposalQueueKey(activeIterator.Key()) + require.Equal(t, proposalID, proposal.ProposalID) - require.Equal(t, propIDValue.Value, proposal.ProposalID) activeIterator.Close() } diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 54ef390c8..99169d176 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -54,51 +54,10 @@ func TestActivateVotingPeriod(t *testing.T) { activeIterator.Close() } -type validProposal struct{} - -func (validProposal) GetTitle() string { return "title" } -func (validProposal) GetDescription() string { return "description" } -func (validProposal) ProposalRoute() string { return types.RouterKey } -func (validProposal) ProposalType() string { return types.ProposalTypeText } -func (validProposal) String() string { return "" } -func (validProposal) ValidateBasic() error { return nil } - -type invalidProposalTitle1 struct{ validProposal } - -func (invalidProposalTitle1) GetTitle() string { return "" } - -type invalidProposalTitle2 struct{ validProposal } - -func (invalidProposalTitle2) GetTitle() string { return strings.Repeat("1234567890", 100) } - -type invalidProposalDesc1 struct{ validProposal } - -func (invalidProposalDesc1) GetDescription() string { return "" } - -type invalidProposalDesc2 struct{ validProposal } - -func (invalidProposalDesc2) GetDescription() string { return strings.Repeat("1234567890", 1000) } - -type invalidProposalRoute struct{ validProposal } +type invalidProposalRoute struct{ types.TextProposal } func (invalidProposalRoute) ProposalRoute() string { return "nonexistingroute" } -type invalidProposalValidation struct{ validProposal } - -func (invalidProposalValidation) ValidateBasic() error { - return errors.New("invalid proposal") -} - -// func registerTestCodec(cdc *codec.Codec) { -// cdc.RegisterConcrete(validProposal{}, "test/validproposal", nil) -// cdc.RegisterConcrete(invalidProposalTitle1{}, "test/invalidproposalt1", nil) -// cdc.RegisterConcrete(invalidProposalTitle2{}, "test/invalidproposalt2", nil) -// cdc.RegisterConcrete(invalidProposalDesc1{}, "test/invalidproposald1", nil) -// cdc.RegisterConcrete(invalidProposalDesc2{}, "test/invalidproposald2", nil) -// cdc.RegisterConcrete(invalidProposalRoute{}, "test/invalidproposalr", nil) -// cdc.RegisterConcrete(invalidProposalValidation{}, "test/invalidproposalv", nil) -// } - func TestSubmitProposal(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, abci.Header{}) @@ -107,16 +66,14 @@ func TestSubmitProposal(t *testing.T) { content types.Content expectedErr error }{ - {validProposal{}, nil}, + {types.TextProposal{Title: "title", Description: "description"}, nil}, // Keeper does not check the validity of title and description, no error - {invalidProposalTitle1{}, nil}, - {invalidProposalTitle2{}, nil}, - {invalidProposalDesc1{}, nil}, - {invalidProposalDesc2{}, nil}, + {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}, - // Keeper does not call ValidateBasic, msg.ValidateBasic does - {invalidProposalValidation{}, nil}, } for i, tc := range testCases { diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index e38b0213e..7099cb959 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -38,7 +38,8 @@ func DefaultGenesisState() GenesisState { } func (data GenesisState) Equal(other GenesisState) bool { - return data.Deposits.Equal(other.Deposits) && + return data.StartingProposalID == other.StartingProposalID && + data.Deposits.Equal(other.Deposits) && data.Votes.Equal(other.Votes) && data.Proposals.Equal(other.Proposals) && data.DepositParams.Equal(other.DepositParams) && diff --git a/x/gov/types/types.pb.go b/x/gov/types/types.pb.go index 607ac5e8e..f97a1c0dd 100644 --- a/x/gov/types/types.pb.go +++ b/x/gov/types/types.pb.go @@ -439,82 +439,82 @@ func init() { func init() { proto.RegisterFile("x/gov/types/types.proto", fileDescriptor_a5ae5e91b5b3fb03) } var fileDescriptor_a5ae5e91b5b3fb03 = []byte{ - // 1185 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xc1, 0x6b, 0xdb, 0x56, - 0x18, 0x97, 0x6c, 0xc7, 0x49, 0x9e, 0x1d, 0x57, 0x7d, 0xc9, 0x5a, 0x4f, 0x0c, 0x49, 0x75, 0x4b, - 0xc9, 0x3a, 0x2a, 0xaf, 0xe9, 0x61, 0xd0, 0xc3, 0x98, 0x55, 0xab, 0xad, 0x4b, 0x63, 0x1b, 0xd9, - 0xa4, 0x74, 0x63, 0x08, 0xc5, 0x52, 0x15, 0xad, 0xb2, 0x9e, 0xe7, 0xf7, 0xec, 0xd5, 0xb7, 0xb1, - 0xc3, 0x28, 0x3e, 0xf5, 0xd8, 0x8b, 0xa1, 0xb0, 0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0d, 0xef, 0x71, 0xc0, 0x4f, 0x41, 0xda, 0x6a, 0xa3, 0x5e, 0x40, 0xf2, 0xc9, - 0x57, 0x4f, 0xdd, 0xfb, 0xe1, 0xd4, 0x1d, 0x6b, 0xb6, 0x18, 0x29, 0x93, 0xe6, 0x16, 0xc8, 0x36, - 0x9d, 0xfb, 0xbb, 0x83, 0x0f, 0x97, 0xc0, 0x0c, 0xf1, 0x88, 0xef, 0x44, 0xaa, 0xcc, 0x1b, 0xf4, - 0x03, 0x2a, 0x20, 0x63, 0x3b, 0xb8, 0xd5, 0xf5, 0xe8, 0x21, 0x24, 0xa2, 0xb5, 0xc9, 0x10, 0x63, - 0xfb, 0x3a, 0x01, 0x66, 0x63, 0x95, 0xf5, 0xc3, 0x54, 0x3e, 0x37, 0xad, 0xf2, 0xff, 0x56, 0xd6, - 0x1f, 0xd2, 0x20, 0x3b, 0x65, 0x26, 0xda, 0x61, 0x6a, 0x9c, 0x39, 0x30, 0x73, 0x89, 0x68, 0xd4, - 0xe6, 0x99, 0x85, 0xec, 0x93, 0xe2, 0x36, 0x48, 0x63, 0x62, 0x91, 0x1e, 0x8e, 0x74, 0xc8, 0xad, - 0x9c, 0x3d, 0xf4, 0x16, 0xc4, 0x7c, 0x8d, 0x08, 0xaa, 0x89, 0x7b, 0x96, 0xb4, 0xbb, 0x01, 0xca, - 0x52, 0x30, 0x18, 0x1d, 0xfc, 0x1c, 0xc0, 0xbb, 0x5e, 0x60, 0xf9, 0x26, 0xb1, 0x7c, 0x7f, 0x60, - 0x76, 0x1d, 0xdc, 0xf3, 0x49, 0x74, 0xd5, 0x32, 0x2b, 0xca, 0xa1, 0x45, 0x9a, 0x21, 0xd0, 0x88, - 0x70, 0xda, 0x19, 0x66, 0x7c, 0x6f, 0xd3, 0x2a, 0x07, 0x99, 0x0a, 0x86, 0x10, 0x05, 0x27, 0x92, - 0xe0, 0x27, 0x20, 0x83, 0x23, 0xcb, 0x35, 0x43, 0x43, 0xce, 0xa7, 0xa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 0x1f, 0xc3, 0x7a, 0x3a, - 0x72, 0x98, 0xcb, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x41, 0x42, 0x32, 0xc2, 0x47, 0x0c, 0x00, - 0x00, + // 1187 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x31, 0x6f, 0xdb, 0x46, + 0x14, 0x26, 0x25, 0x59, 0xb6, 0x4f, 0xb2, 0xc2, 0x9c, 0xdd, 0x44, 0x25, 0x0a, 0x92, 0x51, 0x82, + 0xc0, 0x4d, 0x11, 0xaa, 0x71, 0x86, 0x02, 0x19, 0x8a, 0x8a, 0x11, 0x93, 0x28, 0x88, 0x25, 0x81, + 0x12, 0x1c, 0xb8, 0x45, 0x41, 0xd0, 0x22, 0x4d, 0xb3, 0xa1, 0x78, 0xaa, 0xee, 0xa4, 0x5a, 0x5b, + 0xd1, 0xa1, 0x08, 0x34, 0x65, 0xcc, 0x22, 0xc0, 0x40, 0x33, 0x04, 0x45, 0x87, 0xfe, 0x0c, 0x6f, + 0xcd, 0x52, 0x20, 0xe8, 0xa0, 0x34, 0xf6, 0xd0, 0xa2, 0xe8, 0xe4, 0xa5, 0x40, 0xa7, 0x42, 0xbc, + 0xa3, 0x2d, 0xd9, 0x4e, 0x1d, 0x23, 0x2d, 0x50, 0x74, 0xb1, 0xcd, 0x77, 0xdf, 0xfb, 0xde, 0xbd, + 0xef, 0xde, 0x7d, 0x07, 0x83, 0xf3, 0x9b, 0x79, 0x17, 0x75, 0xf3, 0xa4, 0xd7, 0x72, 0x30, 0xfd, + 0xa9, 0xb6, 0xda, 0x88, 0x20, 0x38, 0xdf, 0x40, 0xb8, 0x89, 0xb0, 0x89, 0xed, 0x07, 0xea, 0xa6, + 0xea, 0xa2, 0xae, 0xda, 0xbd, 0x26, 0x9e, 0x3d, 0x82, 0x13, 0x2f, 0x93, 0x0d, 0xaf, 0x6d, 0x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1, 0x70, 0xd4, 0x66, + 0x99, 0x85, 0x1c, 0x92, 0xe2, 0x3e, 0x48, 0x62, 0x62, 0x91, 0x0e, 0x0e, 0x75, 0xc8, 0x2c, 0x5d, + 0x3c, 0xf6, 0x16, 0x44, 0x7c, 0xb5, 0x10, 0xaa, 0x89, 0x07, 0x96, 0xb4, 0xbf, 0x01, 0xca, 0x92, + 0x33, 0x18, 0x1d, 0xfc, 0x1c, 0xc0, 0x75, 0x2f, 0xb0, 0x7c, 0x93, 0x58, 0xbe, 0xdf, 0x33, 0xdb, + 0x0e, 0xee, 0xf8, 0x24, 0xbc, 0x6a, 0xa9, 0x25, 0xe5, 0xd8, 0x22, 0xf5, 0x11, 0xd0, 0x08, 0x71, + 0xda, 0x05, 0x66, 0x7c, 0x6f, 0xd3, 0x2a, 0x47, 0x99, 0x72, 0x86, 0x10, 0x06, 0xc7, 0x92, 0xe0, + 0x27, 0x20, 0x85, 0x43, 0xcb, 0x35, 0x47, 0x86, 0x9c, 0x4d, 0x84, 0xb5, 0x44, 0x95, 0xba, 0xb5, + 0x1a, 0xb9, 0xb5, 0x5a, 0x8f, 0xdc, 0x5a, 0x93, 0x58, 0x15, 0x36, 0x2f, 0x63, 0xc9, 0xb9, 0x47, + 0x2f, 0x64, 0xde, 0x00, 0x34, 0x32, 0x4a, 0x80, 0x1e, 0x10, 0xd8, 0x79, 0x9b, 0x4e, 0x60, 0xd3, + 0x0a, 0x53, 0x27, 0x56, 0xb8, 0xc8, 0x2a, 0x9c, 0xa7, 0x15, 0x0e, 0x33, 0xd0, 0x32, 0x19, 0x16, + 0xd6, 0x03, 0x3b, 0x2c, 0xf5, 0x15, 0x0f, 0xe6, 0x08, 0x22, 0x63, 0x4f, 0x44, 0xf2, 0xd5, 0x53, + 0x75, 0x87, 0x55, 0x58, 0xa0, 0x15, 0x26, 0xf2, 0x4e, 0xf7, 0x40, 0xa4, 0xc3, 0xdc, 0xe8, 0xaa, + 0xf9, 0xe0, 0x6c, 0x17, 0x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x14, 0xfa, 0x03, 0x25, 0x4d, 0x31, 0x55, 0x0b, 0x63, 0xc7, 0x86, 0x0a, 0x98, 0x31, 0xf4, + 0xbb, 0xfa, 0xcd, 0xba, 0x5e, 0x14, 0x12, 0x22, 0xec, 0x0f, 0x94, 0x0c, 0x5d, 0x37, 0x9c, 0xcf, + 0x9c, 0x06, 0x71, 0xc2, 0xfc, 0x5b, 0x85, 0xd2, 0x3d, 0xbd, 0x28, 0x4c, 0x8d, 0xe7, 0xdf, 0xb2, + 0x3c, 0xdf, 0xb1, 0x27, 0xdb, 0xd5, 0xca, 0xdb, 0x2f, 0x25, 0xee, 0xf9, 0x4b, 0x89, 0xfb, 0x72, + 0x47, 0xe2, 0xb6, 0x77, 0x24, 0xfe, 0xd9, 0x8e, 0xc4, 0xff, 0xbc, 0x23, 0xf1, 0x8f, 0x76, 0x25, + 0xee, 0xd9, 0xae, 0xc4, 0x3d, 0xdf, 0x95, 0xb8, 0x8f, 0xff, 0xde, 0x02, 0xc7, 0xfe, 0x6b, 0x58, + 0x4b, 0x86, 0x2e, 0x73, 0xfd, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe0, 0x2e, 0x55, 0x4b, + 0x0c, 0x00, 0x00, } func (this *MsgSubmitProposalBase) Equal(that interface{}) bool { @@ -676,6 +676,56 @@ func (this *Deposit) Equal(that interface{}) bool { } return true } +func (this *ProposalBase) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ProposalBase) + if !ok { + that2, ok := that.(ProposalBase) + 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.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 diff --git a/x/gov/types/types.proto b/x/gov/types/types.proto index 6b8b50944..855826516 100644 --- a/x/gov/types/types.proto +++ b/x/gov/types/types.proto @@ -91,6 +91,7 @@ message Deposit { // all static fields (i.e fields excluding the dynamic Content). A full proposal // extends the ProposalBase with Content. message ProposalBase { + option (gogoproto.equal) = true; option (gogoproto.goproto_stringer) = true; option (gogoproto.face) = true; From 1a25cdae6f9e035876b1509009ab9e708f9901bc Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 17:21:00 -0500 Subject: [PATCH 22/31] Update tests --- x/gov/keeper/proposal_test.go | 2 +- x/gov/types/proposal.go | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 99169d176..a02b6da72 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -26,7 +26,7 @@ func TestGetSetProposal(t *testing.T) { gotProposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) - require.Equal(t, proposal.String(), gotProposal.String()) + require.True(t, proposal.Equal(gotProposal)) } func TestActivateVotingPeriod(t *testing.T) { diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index 2ba08980e..9e65ec3c9 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -37,6 +37,11 @@ func NewProposal(content Content, id uint64, submitTime, depositEndTime time.Tim } } +// Equal returns true if two Proposal types are equal. +func (p Proposal) Equal(other Proposal) bool { + return p.ProposalBase.Equal(other.ProposalBase) && p.Content.String() == other.Content.String() +} + // String implements stringer interface func (p Proposal) String() string { out, _ := yaml.Marshal(p) @@ -189,14 +194,14 @@ 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} } -// Implements Content Interface -var _ Content = TextProposal{} - // GetTitle returns the proposal title func (tp TextProposal) GetTitle() string { return tp.Title } From 05cef02b4d98d6aacc20796296ec375adb172c28 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 2 Mar 2020 17:24:10 -0500 Subject: [PATCH 23/31] Add MsgSubmitProposal back to codec --- x/gov/types/codec.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index ba9e6827c..e4d7e16a3 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -17,6 +17,7 @@ type Codec interface { func RegisterCodec(cdc *codec.Codec) { cdc.RegisterInterface((*Content)(nil), nil) cdc.RegisterConcrete(MsgSubmitProposalBase{}, "cosmos-sdk/MsgSubmitProposalBase", nil) + cdc.RegisterConcrete(MsgSubmitProposal{}, "cosmos-sdk/MsgSubmitProposal", nil) cdc.RegisterConcrete(MsgDeposit{}, "cosmos-sdk/MsgDeposit", nil) cdc.RegisterConcrete(MsgVote{}, "cosmos-sdk/MsgVote", nil) cdc.RegisterConcrete(TextProposal{}, "cosmos-sdk/TextProposal", nil) From eedc6f61903fa9464f6d6ba45446ea2f55765e93 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 3 Mar 2020 09:40:11 -0500 Subject: [PATCH 24/31] Fulfill MsgSubmitProposalI interface --- x/gov/handler.go | 1 + x/gov/types/msgs.go | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x/gov/handler.go b/x/gov/handler.go index 21693d943..b50644a51 100644 --- a/x/gov/handler.go +++ b/x/gov/handler.go @@ -54,6 +54,7 @@ func handleMsgSubmitProposal(ctx sdk.Context, keeper Keeper, msg MsgSubmitPropos sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalID)), ) } + ctx.EventManager().EmitEvent(submitEvent) return &sdk.Result{ diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index 55e19e675..559a343e5 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -206,11 +206,10 @@ func (msg MsgSubmitProposal) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// GetSigners implements Msg -func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress { - return []sdk.AccAddress{msg.Proposer} -} - // nolint -func (msg MsgSubmitProposal) Route() string { return RouterKey } -func (msg MsgSubmitProposal) Type() string { return TypeMsgSubmitProposal } +func (msg MsgSubmitProposal) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.Proposer} } +func (msg MsgSubmitProposal) Route() string { return RouterKey } +func (msg MsgSubmitProposal) Type() string { return TypeMsgSubmitProposal } +func (msg MsgSubmitProposal) GetContent() Content { return msg.Content } +func (msg MsgSubmitProposal) GetInitialDeposit() sdk.Coins { return msg.InitialDeposit } +func (msg MsgSubmitProposal) GetProposer() sdk.AccAddress { return msg.Proposer } From 00180faa151713015a71e8aad96bfb1ac39964c6 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 3 Mar 2020 09:59:05 -0500 Subject: [PATCH 25/31] Proto lint & gen --- simapp/codec/codec.pb.go | 2 + simapp/codec/codec.proto | 1 + x/gov/types/types.pb.go | 227 +++++++++++++++++++++------------------ x/gov/types/types.proto | 33 ++++-- 4 files changed, 145 insertions(+), 118 deletions(-) diff --git a/simapp/codec/codec.pb.go b/simapp/codec/codec.pb.go index 7ef14c916..cb065e4e1 100644 --- a/simapp/codec/codec.pb.go +++ b/simapp/codec/codec.pb.go @@ -446,6 +446,8 @@ func (m *Proposal) GetContent() Content { // Content defines the application-level allowed Content to be included in a // governance proposal. type Content struct { + // sum defines a set of all acceptable concrete governance proposal Content types. + // // Types that are valid to be assigned to Sum: // *Content_Text // *Content_ParameterChange diff --git a/simapp/codec/codec.proto b/simapp/codec/codec.proto index c59061ab7..4383fc029 100644 --- a/simapp/codec/codec.proto +++ b/simapp/codec/codec.proto @@ -86,6 +86,7 @@ message Content { option (gogoproto.equal) = true; option (cosmos_proto.interface_type) = "github.com/cosmos/cosmos-sdk/x/gov/types.Content"; + // sum defines a set of all acceptable concrete governance proposal Content types. oneof sum { cosmos_sdk.x.gov.v1.TextProposal text = 1; cosmos_sdk.x.params.v1.ParameterChangeProposal parameter_change = 2; diff --git a/x/gov/types/types.pb.go b/x/gov/types/types.pb.go index f97a1c0dd..038f3297d 100644 --- a/x/gov/types/types.pb.go +++ b/x/gov/types/types.pb.go @@ -35,27 +35,32 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type VoteOption int32 const ( - OptionEmpty VoteOption = 0 - OptionYes VoteOption = 1 - OptionAbstain VoteOption = 2 - OptionNo VoteOption = 3 + // 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: "EMPTY", - 1: "YES", - 2: "ABSTAIN", - 3: "NO", - 4: "NO_WITH_VETO", + 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{ - "EMPTY": 0, - "YES": 1, - "ABSTAIN": 2, - "NO": 3, - "NO_WITH_VETO": 4, + "VOTE_OPTION_UNSPECIFIED": 0, + "VOTE_OPTION_YES": 1, + "VOTE_OPTION_ABSTAIN": 2, + "VOTE_OPTION_NO": 3, + "VOTE_OPTION_NO_WITH_VETO": 4, } func (VoteOption) EnumDescriptor() ([]byte, []int) { @@ -66,30 +71,36 @@ func (VoteOption) EnumDescriptor() ([]byte, []int) { type ProposalStatus int32 const ( - StatusNil ProposalStatus = 0 + // 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 - StatusVotingPeriod ProposalStatus = 2 - StatusPassed ProposalStatus = 3 - StatusRejected ProposalStatus = 4 - StatusFailed ProposalStatus = 5 + // 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: "NIL", - 1: "DEPOSIT_PERIOD", - 2: "VOTING_PERIOD", - 3: "PASSED", - 4: "REJECTED", - 5: "FAILED", + 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{ - "NIL": 0, - "DEPOSIT_PERIOD": 1, - "VOTING_PERIOD": 2, - "PASSED": 3, - "REJECTED": 4, - "FAILED": 5, + "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 (ProposalStatus) EnumDescriptor() ([]byte, []int) { @@ -439,82 +450,84 @@ func init() { func init() { proto.RegisterFile("x/gov/types/types.proto", fileDescriptor_a5ae5e91b5b3fb03) } var fileDescriptor_a5ae5e91b5b3fb03 = []byte{ - // 1187 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x31, 0x6f, 0xdb, 0x46, - 0x14, 0x26, 0x25, 0x59, 0xb6, 0x4f, 0xb2, 0xc2, 0x9c, 0xdd, 0x44, 0x25, 0x0a, 0x92, 0x51, 0x82, - 0xc0, 0x4d, 0x11, 0xaa, 0x71, 0x86, 0x02, 0x19, 0x8a, 0x8a, 0x11, 0x93, 0x28, 0x88, 0x25, 0x81, - 0x12, 0x1c, 0xb8, 0x45, 0x41, 0xd0, 0x22, 0x4d, 0xb3, 0xa1, 0x78, 0xaa, 0xee, 0xa4, 0x5a, 0x5b, - 0xd1, 0xa1, 0x08, 0x34, 0x65, 0xcc, 0x22, 0xc0, 0x40, 0x33, 0x04, 0x45, 0x87, 0xfe, 0x0c, 0x6f, - 0xcd, 0x52, 0x20, 0xe8, 0xa0, 0x34, 0xf6, 0xd0, 0xa2, 0xe8, 0xe4, 0xa5, 0x40, 0xa7, 0x42, 0xbc, - 0xa3, 0x2d, 0xd9, 0x4e, 0x1d, 0x23, 0x2d, 0x50, 0x74, 0xb1, 0xcd, 0x77, 0xdf, 0xfb, 0xde, 0xbd, - 0xef, 0xde, 0x7d, 0x07, 0x83, 0xf3, 0x9b, 0x79, 0x17, 0x75, 0xf3, 0xa4, 0xd7, 0x72, 0x30, 0xfd, - 0xa9, 0xb6, 0xda, 0x88, 0x20, 0x38, 0xdf, 0x40, 0xb8, 0x89, 0xb0, 0x89, 0xed, 0x07, 0xea, 0xa6, - 0x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x56, 0xd6, 0x1f, - 0x92, 0x20, 0x3d, 0x61, 0x26, 0xda, 0x71, 0x6a, 0x5c, 0x38, 0x32, 0x73, 0xb1, 0x70, 0xd4, 0x66, - 0x99, 0x85, 0x1c, 0x92, 0xe2, 0x3e, 0x48, 0x62, 0x62, 0x91, 0x0e, 0x0e, 0x75, 0xc8, 0x2c, 0x5d, - 0x3c, 0xf6, 0x16, 0x44, 0x7c, 0xb5, 0x10, 0xaa, 0x89, 0x07, 0x96, 0xb4, 0xbf, 0x01, 0xca, 0x92, - 0x33, 0x18, 0x1d, 0xfc, 0x1c, 0xc0, 0x75, 0x2f, 0xb0, 0x7c, 0x93, 0x58, 0xbe, 0xdf, 0x33, 0xdb, - 0x0e, 0xee, 0xf8, 0x24, 0xbc, 0x6a, 0xa9, 0x25, 0xe5, 0xd8, 0x22, 0xf5, 0x11, 0xd0, 0x08, 0x71, - 0xda, 0x05, 0x66, 0x7c, 0x6f, 0xd3, 0x2a, 0x47, 0x99, 0x72, 0x86, 0x10, 0x06, 0xc7, 0x92, 0xe0, - 0x27, 0x20, 0x85, 0x43, 0xcb, 0x35, 0x47, 0x86, 0x9c, 0x4d, 0x84, 0xb5, 0x44, 0x95, 0xba, 0xb5, - 0x1a, 0xb9, 0xb5, 0x5a, 0x8f, 0xdc, 0x5a, 0x93, 0x58, 0x15, 0x36, 0x2f, 0x63, 0xc9, 0xb9, 0x47, - 0x2f, 0x64, 0xde, 0x00, 0x34, 0x32, 0x4a, 0x80, 0x1e, 0x10, 0xd8, 0x79, 0x9b, 0x4e, 0x60, 0xd3, - 0x0a, 0x53, 0x27, 0x56, 0xb8, 0xc8, 0x2a, 0x9c, 0xa7, 0x15, 0x0e, 0x33, 0xd0, 0x32, 0x19, 0x16, - 0xd6, 0x03, 0x3b, 0x2c, 0xf5, 0x15, 0x0f, 0xe6, 0x08, 0x22, 0x63, 0x4f, 0x44, 0xf2, 0xd5, 0x53, - 0x75, 0x87, 0x55, 0x58, 0xa0, 0x15, 0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ae, 0x84, 0x77, 0x8c, 0x41, 0xdf, 0x01, 0xc9, 0x6a, 0xa1, 0x56, 0xd3, 0x8b, 0x42, - 0x5c, 0x14, 0xfa, 0x03, 0x25, 0x4d, 0x31, 0x55, 0x0b, 0x63, 0xc7, 0x86, 0x0a, 0x98, 0x31, 0xf4, - 0xbb, 0xfa, 0xcd, 0xba, 0x5e, 0x14, 0x12, 0x22, 0xec, 0x0f, 0x94, 0x0c, 0x5d, 0x37, 0x9c, 0xcf, - 0x9c, 0x06, 0x71, 0xc2, 0xfc, 0x5b, 0x85, 0xd2, 0x3d, 0xbd, 0x28, 0x4c, 0x8d, 0xe7, 0xdf, 0xb2, - 0x3c, 0xdf, 0xb1, 0x27, 0xdb, 0xd5, 0xca, 0xdb, 0x2f, 0x25, 0xee, 0xf9, 0x4b, 0x89, 0xfb, 0x72, - 0x47, 0xe2, 0xb6, 0x77, 0x24, 0xfe, 0xd9, 0x8e, 0xc4, 0xff, 0xbc, 0x23, 0xf1, 0x8f, 0x76, 0x25, - 0xee, 0xd9, 0xae, 0xc4, 0x3d, 0xdf, 0x95, 0xb8, 0x8f, 0xff, 0xde, 0x02, 0xc7, 0xfe, 0x6b, 0x58, - 0x4b, 0x86, 0x2e, 0x73, 0xfd, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe0, 0x2e, 0x55, 0x4b, - 0x0c, 0x00, 0x00, + // 1230 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcf, 0x8f, 0xd3, 0x46, + 0x14, 0x8e, 0xb3, 0xbf, 0xd8, 0x49, 0x36, 0x6b, 0x66, 0x29, 0x9b, 0xba, 0xaa, 0x6d, 0x02, 0x42, + 0x2b, 0x04, 0x5e, 0x58, 0x0e, 0x55, 0xa9, 0x54, 0x35, 0x26, 0x06, 0x8c, 0xd8, 0x38, 0xb2, 0xcd, + 0x22, 0x5a, 0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, 0x58, 0x9a, 0x53, 0x32, 0xab, 0xec, + 0x9c, 0x53, 0x2e, 0xa2, 0x30, 0x56, 0xaf, 0x6e, 0xf5, 0xa5, 0xdc, 0x8b, 0xbe, 0x74, 0x74, 0xd3, + 0x6d, 0x46, 0x17, 0x2a, 0x23, 0xcc, 0xca, 0xb7, 0x4f, 0xa5, 0x85, 0x20, 0x24, 0xeb, 0x1b, 0xab, + 0xca, 0x1a, 0x6a, 0x2e, 0x52, 0x01, 0xf6, 0x75, 0x06, 0x7b, 0xb7, 0x59, 0x75, 0x03, 0x29, 0x6c, + 0x96, 0x18, 0xbb, 0x46, 0xc9, 0x70, 0x19, 0x1c, 0x6a, 0x25, 0x4b, 0xf3, 0xdb, 0xe5, 0xbc, 0xcc, + 0x2d, 0x14, 0xd5, 0x73, 0x7f, 0xf6, 0xa5, 0x33, 0xaf, 0xa1, 0x57, 0x5d, 0x5b, 0xab, 0x7a, 0x5e, + 0xdb, 0xc7, 0xd8, 0x7c, 0x29, 0x71, 0x61, 0xfc, 0xd7, 0x07, 0x12, 0x57, 0xf9, 0x85, 0x03, 0x53, + 0xcb, 0x38, 0x58, 0x41, 0xc4, 0x87, 0x36, 0x28, 0xb4, 0x58, 0xed, 0x4e, 0xe8, 0x95, 0x39, 0x99, + 0x5b, 0x18, 0x57, 0xcf, 0x6f, 0xf7, 0x25, 0x90, 0xb6, 0x44, 0xaf, 0xfd, 0xd6, 0x97, 0xb2, 0xa0, + 0x17, 0x7d, 0x09, 0xd2, 0x52, 0x33, 0xc1, 0x8a, 0x09, 0xd2, 0x27, 0xdd, 0x83, 0x97, 0xc1, 0x44, + 0x07, 0x91, 0x37, 0x59, 0x33, 0xe5, 0xc3, 0xf7, 0xc0, 0x24, 0x6a, 0x91, 0x10, 0xc5, 0xe5, 0x31, + 0x99, 0x5b, 0x28, 0x2d, 0x49, 0xca, 0x1e, 0x63, 0xa2, 0x0c, 0x2a, 0x31, 0x12, 0x98, 0xc9, 0xe0, + 0xac, 0xd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b, 0xfc, 0x98, 0x50, 0xec, 0xf6, 0xe4, 0x43, 0x14, 0x56, 0x47, + 0x70, 0x09, 0x94, 0x87, 0x11, 0xce, 0x0d, 0xdd, 0xbe, 0xe2, 0xac, 0x68, 0xb6, 0xc1, 0x8f, 0x0b, + 0x47, 0xba, 0x3d, 0x99, 0x4f, 0xb1, 0xe9, 0x06, 0x0a, 0xc5, 0xbb, 0xdf, 0x88, 0xb9, 0x47, 0x0f, + 0xc5, 0xdc, 0x77, 0x0f, 0xc5, 0xdc, 0xa9, 0x1f, 0xf2, 0xa0, 0x34, 0x6c, 0xf7, 0x50, 0x01, 0xef, + 0x34, 0x4c, 0xa3, 0x61, 0x58, 0xd5, 0x6b, 0x8e, 0x65, 0x57, 0xed, 0xeb, 0xd6, 0x48, 0xe1, 0x49, + 0x49, 0x14, 0x5c, 0x0f, 0x23, 0xf8, 0x01, 0x10, 0x47, 0xf1, 0x35, 0xad, 0x61, 0x58, 0xba, 0xed, + 0x34, 0x34, 0x53, 0x37, 0x6a, 0x3c, 0x27, 0xcc, 0x77, 0x7b, 0xf2, 0x1c, 0xa5, 0x30, 0xc7, 0x69, + 0xf8, 0xed, 0x10, 0x79, 0xf0, 0x7d, 0xf0, 0xee, 0x28, 0x79, 0xc5, 0xb0, 0xf5, 0xfa, 0xe5, 0x94, + 0x9b, 0x17, 0x8e, 0x76, 0x7b, 0x32, 0xa4, 0xdc, 0x95, 0xe4, 0x74, 0x33, 0xea, 0x69, 0x70, 0x74, + 0x94, 0xda, 0xa8, 0x5a, 0x96, 0x56, 0xe3, 0xc7, 0x04, 0xbe, 0xdb, 0x93, 0x8b, 0x94, 0xd3, 0x70, + 0x31, 0xf6, 0x3d, 0x78, 0x16, 0x94, 0x47, 0xd1, 0xa6, 0x76, 0x55, 0xbb, 0x68, 0x6b, 0x35, 0x7e, + 0x5c, 0x80, 0xdd, 0x9e, 0x5c, 0xa2, 0x78, 0xd3, 0xff, 0xcc, 0x5f, 0x23, 0xfe, 0x9e, 0xfa, 0x97, + 0xaa, 0xfa, 0x35, 0xad, 0xc6, 0x4f, 0x64, 0xf5, 0x2f, 0xb9, 0x61, 0xe4, 0x7b, 0xc3, 0x6d, 0x55, + 0xeb, 0x5b, 0xcf, 0xc4, 0xdc, 0x93, 0x67, 0x62, 0xee, 0xcb, 0x6d, 0x31, 0xb7, 0xb5, 0x2d, 0x72, + 0x8f, 0xb7, 0x45, 0xee, 0xe7, 0x6d, 0x91, 0xbb, 0xf7, 0x5c, 0xcc, 0x3d, 0x7e, 0x2e, 0xe6, 0x9e, + 0x3c, 0x17, 0x73, 0x1f, 0xff, 0xbd, 0x59, 0x67, 0xfe, 0xdf, 0xac, 0x4e, 0x26, 0x7e, 0x78, 0xfe, + 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x53, 0x05, 0xd1, 0xf5, 0x0c, 0x00, 0x00, } func (this *MsgSubmitProposalBase) Equal(that interface{}) bool { diff --git a/x/gov/types/types.proto b/x/gov/types/types.proto index 855826516..ea6da041a 100644 --- a/x/gov/types/types.proto +++ b/x/gov/types/types.proto @@ -61,11 +61,16 @@ enum VoteOption { option (gogoproto.goproto_enum_stringer) = false; option (gogoproto.goproto_enum_prefix) = false; - EMPTY = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; - YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; - ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; - NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; - NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; + // 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"]; } // TextProposal defines a standard text proposal whose changes need to be @@ -121,12 +126,18 @@ enum ProposalStatus { option (gogoproto.goproto_enum_stringer) = false; option (gogoproto.goproto_enum_prefix) = false; - NIL = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; - DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; - VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; - PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; - REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; - FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; + // 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 proposal From 04cf635c72c1fad30caf12c3530e29964896b930 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 3 Mar 2020 10:32:43 -0500 Subject: [PATCH 26/31] Add changelog entries --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f2efc89f..8d5b7b5ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -135,6 +135,13 @@ serialization instead of Amino. Buffers for state serialization instead of Amino. * The `internal` sub-package has been removed in order to expose the types proto file. * The `x/upgrade` module now accepts a `codec.Marshaler` interface. +* (x/upgrade) [\#5737](https://github.com/cosmos/cosmos-sdk/pull/5737) Migrate the `x/gov` module to use Protocol +Buffers for state serialization instead of Amino. + * `MsgSubmitProposal` will be removed in favor of the application-level proto-defined `MsgSubmitProposal` which + implements the `MsgSubmitProposalI` interface. Applications should extend the `NewMsgSubmitProposalBase` type + to define their own concrete `MsgSubmitProposal` types. + * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by + requiring a concrete codec to know how to serialize `Proposal` types. ### Improvements From 9aa2581dc5461170a337d1d3e58f19b789f07466 Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Tue, 3 Mar 2020 13:22:29 -0500 Subject: [PATCH 27/31] Update CHANGELOG.md Co-Authored-By: Aaron Craelius --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c4a97d2a..19934bee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -136,7 +136,7 @@ serialization instead of Amino. Buffers for state serialization instead of Amino. * The `internal` sub-package has been removed in order to expose the types proto file. * The `x/upgrade` module now accepts a `codec.Marshaler` interface. -* (x/upgrade) [\#5737](https://github.com/cosmos/cosmos-sdk/pull/5737) Migrate the `x/gov` module to use Protocol +* (x/gov) [\#5737](https://github.com/cosmos/cosmos-sdk/pull/5737) Migrate the `x/gov` module to use Protocol Buffers for state serialization instead of Amino. * `MsgSubmitProposal` will be removed in favor of the application-level proto-defined `MsgSubmitProposal` which implements the `MsgSubmitProposalI` interface. Applications should extend the `NewMsgSubmitProposalBase` type From 3b8772725f4acba13a449b9bf34dc22bbe924832 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 3 Mar 2020 13:24:54 -0500 Subject: [PATCH 28/31] Address feedback --- simapp/codec/codec.pb.go | 215 +++++++++++++++++++-------------------- simapp/codec/codec.proto | 4 +- 2 files changed, 106 insertions(+), 113 deletions(-) diff --git a/simapp/codec/codec.pb.go b/simapp/codec/codec.pb.go index cb065e4e1..d0c66f7bd 100644 --- a/simapp/codec/codec.pb.go +++ b/simapp/codec/codec.pb.go @@ -359,8 +359,8 @@ var xxx_messageInfo_MsgSubmitEvidence proto.InternalMessageInfo // MsgSubmitProposal defines the application-level message type for handling // governance proposals. type MsgSubmitProposal struct { - Content *Content `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` - types4.MsgSubmitProposalBase `protobuf:"bytes,2,opt,name=base,proto3,embedded=base" json:"base"` + types4.MsgSubmitProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` + Content Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` } func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } @@ -585,62 +585,62 @@ func init() { func init() { proto.RegisterFile("simapp/codec/codec.proto", fileDescriptor_3c6d4085e4065f5a) } var fileDescriptor_3c6d4085e4065f5a = []byte{ - // 880 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x8f, 0xdb, 0x44, - 0x14, 0xb6, 0x5b, 0x77, 0x37, 0x9a, 0x16, 0x28, 0x23, 0xca, 0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0x22, 0x84, 0x03, 0xbb, 0xa1, 0x62, 0xb4, 0x8d, 0x83, 0x8a, 0xca, 0x58, 0xe4, - 0xad, 0xd6, 0xba, 0x81, 0xda, 0x00, 0x30, 0x00, 0xaf, 0x21, 0x12, 0x86, 0x49, 0xe4, 0xf3, 0x85, - 0x4d, 0x09, 0x09, 0x6c, 0x46, 0x71, 0xe4, 0xaa, 0x86, 0xb9, 0x5f, 0x97, 0xab, 0xce, 0x48, 0x79, - 0x9a, 0x2a, 0xf3, 0x90, 0x90, 0xe0, 0x28, 0xcf, 0xab, 0x08, 0x42, 0xd4, 0x88, 0x0e, 0xf7, 0x55, - 0x7b, 0xb8, 0xbb, 0xa1, 0x3d, 0x94, 0x73, 0xbe, 0xbc, 0x30, 0xb2, 0x2b, 0x8c, 0xc6, 0xcf, 0xcf, - 0xfb, 0xfa, 0xe9, 0x79, 0x5f, 0xff, 0xf7, 0xbc, 0xaf, 0xff, 0x76, 0xd1, 0xd7, 0x4e, 0x2f, 0xfa, - 0xda, 0x3f, 0x17, 0x7d, 0xed, 0xbb, 0xf7, 0xd6, 0x52, 0x56, 0xff, 0x3b, 0xcd, 0xb6, 0xc4, 0x48, - 0xbf, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x44, 0x7b, 0x22, 0xdc, 0x52, 0x09, 0x00, 0x00, + // 872 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x6f, 0xdc, 0x44, + 0x14, 0xb6, 0xa9, 0x9b, 0xac, 0xa6, 0x05, 0xca, 0x88, 0x92, 0xd5, 0x82, 0x76, 0xdb, 0x14, 0x2a, + 0x28, 0x8a, 0xdd, 0x52, 0xa0, 0xe9, 0x5e, 0x4a, 0x77, 0x29, 0x5a, 0x24, 0x82, 0xa2, 0x0d, 0x70, + 0x40, 0x20, 0xcb, 0x3b, 0x1e, 0xbc, 0x56, 0x6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0x6d, 0x73, 0xb7, 0x2e, 0x57, 0x9d, 0x94, 0xf2, 0x34, 0x15, 0x73, 0x9f, 0x90, 0xe0, 0x20, 0xe7, + 0x55, 0x04, 0x21, 0x6a, 0x44, 0x87, 0xbb, 0xaa, 0x49, 0x3c, 0xbc, 0xa2, 0x49, 0x94, 0xd3, 0xbe, + 0xbc, 0x30, 0xb2, 0x37, 0x8c, 0xc6, 0x27, 0x17, 0x7d, 0xfd, 0xec, 0xa2, 0xaf, 0xff, 0x73, 0xd1, + 0xd7, 0x7f, 0xbd, 0xec, 0x6b, 0x67, 0x97, 0x7d, 0xed, 0xef, 0xcb, 0xbe, 0xf6, 0xed, 0x7b, 0x6b, + 0x53, 0x56, 0xff, 0x41, 0xcd, 0x36, 0xc4, 0x60, 0x7f, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xd0, 0xbe, 0x24, 0xd5, 0x58, 0x09, 0x00, 0x00, } func (this *Supply) Equal(that interface{}) bool { @@ -797,10 +797,10 @@ func (this *MsgSubmitProposal) Equal(that interface{}) bool { } else if this == nil { return false } - if !this.Content.Equal(that1.Content) { + if !this.MsgSubmitProposalBase.Equal(&that1.MsgSubmitProposalBase) { return false } - if !this.MsgSubmitProposalBase.Equal(&that1.MsgSubmitProposalBase) { + if !this.Content.Equal(&that1.Content) { return false } return true @@ -1437,7 +1437,7 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size, err := m.MsgSubmitProposalBase.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1446,18 +1446,16 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - if m.Content != nil { - { - size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + { + size, err := m.MsgSubmitProposalBase.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1793,12 +1791,10 @@ func (m *MsgSubmitProposal) Size() (n int) { } var l int _ = l - if m.Content != nil { - l = m.Content.Size() - n += 1 + l + sovCodec(uint64(l)) - } l = m.MsgSubmitProposalBase.Size() n += 1 + l + sovCodec(uint64(l)) + l = m.Content.Size() + n += 1 + l + sovCodec(uint64(l)) return n } @@ -2450,42 +2446,6 @@ 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) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCodec - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCodec - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCodec - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Content == nil { - m.Content = &Content{} - } - 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 MsgSubmitProposalBase", wireType) } @@ -2518,6 +2478,39 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + 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 ErrIntOverflowCodec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCodec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCodec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCodec(dAtA[iNdEx:]) diff --git a/simapp/codec/codec.proto b/simapp/codec/codec.proto index 4383fc029..27142c18b 100644 --- a/simapp/codec/codec.proto +++ b/simapp/codec/codec.proto @@ -67,8 +67,8 @@ message MsgSubmitProposal { option (gogoproto.equal) = true; option (gogoproto.goproto_getters) = false; - Content content = 1; - cosmos_sdk.x.gov.v1.MsgSubmitProposalBase base = 2 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; + cosmos_sdk.x.gov.v1.MsgSubmitProposalBase base = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; + Content content = 2 [(gogoproto.nullable) = false]; } // Proposal defines the application-level concrete proposal type used in governance From d256e5a56f267a74510b80604f819545a43d8401 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 3 Mar 2020 13:30:21 -0500 Subject: [PATCH 29/31] Address feedback --- simapp/codec/codec.pb.go | 141 ++++++++++++++++++++------------------- simapp/codec/codec.proto | 2 +- 2 files changed, 75 insertions(+), 68 deletions(-) diff --git a/simapp/codec/codec.pb.go b/simapp/codec/codec.pb.go index d0c66f7bd..1fff6fa81 100644 --- a/simapp/codec/codec.pb.go +++ b/simapp/codec/codec.pb.go @@ -360,7 +360,7 @@ var xxx_messageInfo_MsgSubmitEvidence proto.InternalMessageInfo // governance proposals. type MsgSubmitProposal struct { types4.MsgSubmitProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"` - Content Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` + Content *Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` } func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } @@ -585,62 +585,62 @@ func init() { func init() { proto.RegisterFile("simapp/codec/codec.proto", fileDescriptor_3c6d4085e4065f5a) } var fileDescriptor_3c6d4085e4065f5a = []byte{ - // 872 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x6f, 0xdc, 0x44, + // 878 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x41, 0x6f, 0xdc, 0x44, 0x14, 0xb6, 0xa9, 0x9b, 0xac, 0xa6, 0x05, 0xca, 0x88, 0x92, 0xd5, 0x82, 0x76, 0xdb, 0x14, 0x2a, - 0x28, 0x8a, 0xdd, 0x52, 0xa0, 0xe9, 0x5e, 0x4a, 0x77, 0x29, 0x5a, 0x24, 0x82, 0xa2, 0x0d, 0x70, - 0x40, 0x20, 0xcb, 0x3b, 0x1e, 0xbc, 0x56, 0x6c, 0xcf, 0xe0, 0x19, 0x1b, 0xef, 0x3f, 0x40, 0x9c, - 0x38, 0x71, 0x8e, 0x38, 0x23, 0x4e, 0x39, 0xf2, 0x03, 0xa2, 0x9c, 0x72, 0xe4, 0x14, 0xa1, 0xe4, - 0xc2, 0xcf, 0x40, 0x9e, 0x19, 0x7b, 0x6d, 0xd9, 0xbb, 0x39, 0x71, 0xb1, 0xd6, 0xf3, 0xbe, 0xef, - 0x7d, 0xdf, 0x78, 0xe6, 0xbd, 0xb7, 0xa0, 0xcb, 0xfc, 0xd0, 0xa1, 0xd4, 0x42, 0xc4, 0xc5, 0x48, - 0x3e, 0x4d, 0x1a, 0x13, 0x4e, 0x60, 0x0f, 0x11, 0x16, 0x12, 0x66, 0x33, 0xf7, 0xd0, 0x94, 0x20, - 0x53, 0x86, 0xd3, 0x47, 0xbd, 0xf7, 0xf9, 0xdc, 0x8f, 0x5d, 0x9b, 0x3a, 0x31, 0x5f, 0x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0x73, 0x1c, 0xdb, 0x68, 0xee, 0x44, 0xde, 0x8a, 0x13, 0x97, 0x83, 0x43, 0xec, 0xaf, 0xc0, - 0x8f, 0x05, 0xbc, 0x92, 0xf2, 0x55, 0x5a, 0x0f, 0xc1, 0xef, 0xc1, 0x2d, 0x46, 0x7e, 0xe0, 0x3f, - 0x39, 0x31, 0xb6, 0xd5, 0x50, 0x51, 0x9d, 0xf3, 0x61, 0x3d, 0xbb, 0x0a, 0x8a, 0x6a, 0x56, 0x84, - 0xaf, 0xe5, 0x52, 0x35, 0x3d, 0xab, 0x87, 0x20, 0x05, 0x5b, 0xc8, 0x89, 0x10, 0x0e, 0xec, 0x86, - 0x8a, 0xd1, 0x36, 0x14, 0x2a, 0x2a, 0x63, 0xc1, 0x5b, 0xad, 0x75, 0x1b, 0xb5, 0x01, 0x60, 0x00, - 0x5e, 0x47, 0x24, 0x0c, 0x93, 0xc8, 0xe7, 0x0b, 0x9b, 0x12, 0x12, 0xd8, 0x8c, 0xe2, 0xc8, 0x55, - 0x6d, 0x73, 0xb7, 0x2e, 0x57, 0x9d, 0x94, 0xf2, 0x34, 0x15, 0x73, 0x9f, 0x90, 0xe0, 0x20, 0xe7, - 0x55, 0x04, 0x21, 0x6a, 0x44, 0x87, 0xbb, 0xaa, 0x49, 0x3c, 0xbc, 0xa2, 0x49, 0x94, 0xd3, 0xbe, - 0xbc, 0x30, 0xb2, 0x37, 0x8c, 0xc6, 0x27, 0x17, 0x7d, 0xfd, 0xec, 0xa2, 0xaf, 0xff, 0x73, 0xd1, - 0xd7, 0x7f, 0xbd, 0xec, 0x6b, 0x67, 0x97, 0x7d, 0xed, 0xef, 0xcb, 0xbe, 0xf6, 0xed, 0x7b, 0x6b, - 0x53, 0x56, 0xff, 0x41, 0xcd, 0x36, 0xc4, 0x60, 0x7f, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xd0, 0xbe, 0x24, 0xd5, 0x58, 0x09, 0x00, 0x00, + 0x28, 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, 0x18, 0x6d, 0xe3, 0xa0, 0xa2, 0x32, 0x16, 0xbc, 0xd5, + 0x5a, 0x37, 0x51, 0x1b, 0x00, 0x06, 0xe0, 0x75, 0x44, 0xc2, 0x30, 0x89, 0x7c, 0xbe, 0xb0, 0x29, + 0x21, 0x81, 0xcd, 0x28, 0x8e, 0x5c, 0xd5, 0x30, 0x77, 0xeb, 0x72, 0xd5, 0x19, 0x29, 0x4f, 0x53, + 0x31, 0xf7, 0x09, 0x09, 0x0e, 0x72, 0x5e, 0x45, 0x10, 0xa2, 0x46, 0x74, 0xb8, 0xab, 0xda, 0xc3, + 0xfd, 0x4b, 0xda, 0x43, 0x39, 0xe7, 0xcb, 0x0b, 0x23, 0xbb, 0xc2, 0x68, 0x7c, 0x7c, 0xde, 0xd7, + 0x4f, 0xcf, 0xfb, 0xfa, 0xbf, 0xe7, 0x7d, 0xfd, 0xb7, 0x8b, 0xbe, 0x76, 0x7a, 0xd1, 0xd7, 0xfe, + 0xb9, 0xe8, 0x6b, 0xdf, 0xbd, 0xb7, 0x36, 0x65, 0xf5, 0xbf, 0xd3, 0x6c, 0x43, 0x8c, 0xf4, 0x87, + 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x70, 0x52, 0xf3, 0x25, 0x52, 0x09, 0x00, 0x00, } func (this *Supply) Equal(that interface{}) bool { @@ -800,7 +800,7 @@ func (this *MsgSubmitProposal) Equal(that interface{}) bool { if !this.MsgSubmitProposalBase.Equal(&that1.MsgSubmitProposalBase) { return false } - if !this.Content.Equal(&that1.Content) { + if !this.Content.Equal(that1.Content) { return false } return true @@ -1436,16 +1436,18 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Content != nil { + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCodec(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintCodec(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 { size, err := m.MsgSubmitProposalBase.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1793,8 +1795,10 @@ func (m *MsgSubmitProposal) Size() (n int) { _ = l l = m.MsgSubmitProposalBase.Size() n += 1 + l + sovCodec(uint64(l)) - l = m.Content.Size() - n += 1 + l + sovCodec(uint64(l)) + if m.Content != nil { + l = m.Content.Size() + n += 1 + l + sovCodec(uint64(l)) + } return n } @@ -2507,6 +2511,9 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Content == nil { + m.Content = &Content{} + } if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/simapp/codec/codec.proto b/simapp/codec/codec.proto index 27142c18b..620370d34 100644 --- a/simapp/codec/codec.proto +++ b/simapp/codec/codec.proto @@ -68,7 +68,7 @@ message MsgSubmitProposal { option (gogoproto.goproto_getters) = false; cosmos_sdk.x.gov.v1.MsgSubmitProposalBase base = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; - Content content = 2 [(gogoproto.nullable) = false]; + Content content = 2; } // Proposal defines the application-level concrete proposal type used in governance From 430739c2b8e3050e4e3f89d0e5a765dfda4f7890 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 3 Mar 2020 20:29:34 -0500 Subject: [PATCH 30/31] Remove named return --- x/gov/keeper/proposal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 020ec08a3..3055af875 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -49,7 +49,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, content types.Content) (typ } // GetProposal get proposal from store by ProposalID -func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (proposal types.Proposal, ok bool) { +func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (types.Proposal, bool) { store := ctx.KVStore(keeper.storeKey) bz := store.Get(types.ProposalKey(proposalID)) From 0cbe4e55324b247ddf0d549340de7a0e45216b12 Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Wed, 4 Mar 2020 09:27:50 -0500 Subject: [PATCH 31/31] Update x/upgrade/types/types.proto Co-Authored-By: Anil Kumar Kammari --- x/upgrade/types/types.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/upgrade/types/types.proto b/x/upgrade/types/types.proto index 3b0fffb8f..ba1191773 100644 --- a/x/upgrade/types/types.proto +++ b/x/upgrade/types/types.proto @@ -41,7 +41,7 @@ message SoftwareUpgradeProposal { Plan plan = 3 [(gogoproto.nullable) = false]; } -// SoftwareUpgradeProposal is a gov Content type for cancelling a software upgrade +// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software upgrade message CancelSoftwareUpgradeProposal { option (gogoproto.equal) = true;