From b301574559f8ebeefec5a6352dee81a2d29118bc Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Fri, 13 Sep 2024 14:07:43 +0200 Subject: [PATCH 01/43] tally prototype with governors Only sketching out how the tally would work for now. Lots of stuff is left undefined but the strategy is the one outlined in https://gist.github.com/giunatale/95e9b43f6e265ba32b29e2769f7b8a37?permalink_comment_id=5067400#gistcomment-5067400 but with the restriction of being able to delegate a percentage of its bonded tokens to at most one governor (https://gist.github.com/giunatale/95e9b43f6e265ba32b29e2769f7b8a37?permalink_comment_id=5187246#gistcomment-5187246) It assumes that every time someone redelegates, undelegates or adds to its delegations a hook is called to check if there is a governor delegated to in x/gov, and the governor's total shares updated accordingly. The governor's total shares are a collection of share amounts for different validators. --- x/gov/keeper/tally.go | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 9c335f527..84e0a4a54 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -22,6 +22,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, totalVotingPower := math.LegacyZeroDec() currValidators := make(map[string]stakingtypes.ValidatorI) + currGovernors := make(map[string]v1.GovernorI) // fetch all the bonded validators, insert them into currValidators keeper.sk.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) (stop bool) { @@ -29,8 +30,31 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, return false }) + // fetch all the governors, insert them into currGovernors + keeper.IterateGovernorsByPower(ctx, func(index int64, governor v1.GovernorI) (stop bool) { + currGovernors[governor.GetAddress().String()] = governor + return false + }) + keeper.IterateVotes(ctx, proposal.Id, func(vote v1.Vote) bool { + var governor v1.GovernorI = nil + voter := sdk.MustAccAddressFromBech32(vote.Voter) + + // if voter is a governor record it in the map + govAddrStr := v1.GovAddress(voter.Bytes()).String() + if gov, ok := currGovernors[govAddrStr]; ok { + gov.Vote = vote.Options + currGovernors[govAddrStr] = gov + } + + g, governorDelegationPercentage := keeper.GetGovernor(ctx, voter) + if g != nil { + if g, ok := currGovernors[g.GetAddress().String()]; ok { + governor = g + } + } + // iterate over all delegations from voter keeper.sk.IterateDelegations(ctx, voter, func(index int64, delegation stakingtypes.DelegationI) (stop bool) { valAddrStr := delegation.GetValidatorAddr().String() @@ -45,6 +69,13 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, results[option.Option] = results[option.Option].Add(subPower) } totalVotingPower = totalVotingPower.Add(votingPower) + + // remove the delegation shares from the governor + if governor != nil { + d := governor.GetDelegatorDeductions(delegation.GetValidatorAddr()) + d = d.Add(delegation.GetShares().Mul(governorDelegationPercentage)) + governor.SetDelegatorDeductions(delegation.GetValidatorAddr(), d) + } } return false @@ -73,6 +104,32 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, } */ + // iterate over the governors again to tally their voting power + for _, gov := range currGovernors { + if len(gov.Vote) == 0 { + continue + } + + // Calculate the voting power of governors that have voted. + // Iterate over all validators the governor has delegation shares assigned to. + // As governor are simply voters that need to have 100% of their bonded tokens + // delegated to them and their shares were deducted when iterating over votes + // we don't need to handle special cases. + for valAddrStr, shares := range gov.GetDelegations() { + if val, ok := currValidators[valAddrStr]; ok { + sharesAfterDeductions := shares.Sub(gov.GetDelegatorDeductions(val.GetOperator())) + votingPower := sharesAfterDeductions.MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares()) + + for _, option := range gov.Vote { + weight, _ := sdk.NewDecFromStr(option.Weight) + subPower := votingPower.Mul(weight) + results[option.Option] = results[option.Option].Add(subPower) + } + totalVotingPower = totalVotingPower.Add(votingPower) + } + } + } + params := keeper.GetParams(ctx) tallyResults = v1.NewTallyResultFromMap(results) From 8cb99c25e89d80d77ff8d4e9564725441e0c3a2b Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:22:51 +0200 Subject: [PATCH 02/43] add protos --- proto/atomone/gov/v1/gov.proto | 64 + proto/atomone/gov/v1/tx.proto | 78 ++ x/gov/types/v1/gov.pb.go | 1202 +++++++++++++++-- x/gov/types/v1/tx.pb.go | 2232 +++++++++++++++++++++++++++----- 4 files changed, 3163 insertions(+), 413 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 6ab8bea43..017d749cc 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -218,3 +218,67 @@ message Params { // burn deposits if quorum with vote type no_veto is met bool burn_vote_veto = 15; } + + +// Governor defines a governor, together with the total amount of delegated +// validator's bond shares for a set amount of validators. When a delegator +// delegates a percentage of its x/gov power to a governor, the resulting +// shares from each delegators delegations in x/staking are added to the +// governor's total shares. +message Governor { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // governor_address defines the address of the governor; bech encoded in JSON. + string governor_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // status is the status of the governor (active/inactive). + GovernorStatus status = 2; + // description defines the description terms for the governor. + GovernorDescription description = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // delegations define the validator delegations for the governor. + repeated ValidatorDelegation delegations = 4; +} + +// GovernorStatus is the status of a governor. +enum GovernorStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // UNSPECIFIED defines an invalid governor status. + GOVERNOR_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; + // ACTIVE defines a governor that is active. + GOVERNOR_STATUS_ACTIVE = 1 [(gogoproto.enumvalue_customname) = "Active"]; + // INACTIVE defines a governor that is inactive. + GOVERNOR_STATUS_INACTIVE = 2 [(gogoproto.enumvalue_customname) = "Inactive"]; +} + +// Description defines a governor description. +message GovernorDescription { + option (gogoproto.equal) = true; + + // moniker defines a human-readable name for the governor. + string moniker = 1; + // identity defines an optional identity signature (ex. UPort or Keybase). + string identity = 2; + // website defines an optional website link. + string website = 3; + // security_contact defines an optional email for security contact. + string security_contact = 4; + // details define other optional details. + string details = 5; +} + +// ValidatorDelegation holds the number of shares from the specified validator +// a governor can use to vote on proposals. +message ValidatorDelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string governor_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + // shares define the delegation shares available from this validator. + string shares = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/proto/atomone/gov/v1/tx.proto b/proto/atomone/gov/v1/tx.proto index da89a6a38..b4ba930c3 100644 --- a/proto/atomone/gov/v1/tx.proto +++ b/proto/atomone/gov/v1/tx.proto @@ -37,6 +37,20 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // CreateGovernor defines a method to create a new governor. + rpc CreateGovernor(MsgCreateGovernor) returns (MsgCreateGovernorResponse); + + // EditGovernor defines a method to edit an existing governor. + // It also sets its status. + rpc EditGovernor(MsgEditGovernor) returns (MsgEditGovernorResponse); + + // DelegateGovernor defines a method to delegate a non-zero percentange of + // governance voting power from a delegator to a governor. + rpc DelegateGovernor(MsgDelegateGovernor) returns (MsgDelegateGovernorResponse); + + // UndelegateGovernor defines a method to undelegate governance voting power + rpc UndelegateGovernor(MsgUndelegateGovernor) returns (MsgUndelegateGovernorResponse); } // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -170,3 +184,67 @@ message MsgUpdateParams { // // Since: cosmos-sdk 0.47 message MsgUpdateParamsResponse {} + +// MsgCreateGovernor defines a SDK message for creating a new governor. +message MsgCreateGovernor { + option (cosmos.msg.v1.signer) = "governor_address"; + option (amino.name) = "atomone/MsgCreateGovernor"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string governor_address = 2 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; + google.protobuf.Any pubkey = 3 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; +} + +// MsgCreateGovernorrResponse defines the Msg/CreateGovernor response type. +message MsgCreateGovernorResponse {} + +// MsgEditGovernor defines a SDK message for editing an existing governor. +message MsgEditGovernor { + option (cosmos.msg.v1.signer) = "governor_address"; + option (amino.name) = "cosmos-sdk/MsgEditGovernor"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + GovernorStatus status = 2; + string governor_address = 3 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; +} + +// MsgEditGovernorResponse defines the Msg/EditGovernor response type. +message MsgEditGovernorResponse {} + +// MsgDelegateGovernor defines a SDK message for performing a delegation of governance voting power +// from a delegator to a governor. +message MsgDelegateGovernor { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "atomone/MsgDelegateGovernor"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string governor_address = 2 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; + // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. + string percentage = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} + +// MsgDelegateGovernorResponse defines the Msg/Delegate response type. +message MsgDelegateGovernorResponse {} + +// MsgUndelegateGovernor defines a SDK message for undelegating governance voting power +message MsgUndelegateGovernor { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgUndelegateGovernor"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUndelegateGovernorResponse defines the Msg/UndelegateGovernor response type. +message MsgUndelegateGovernorResponse {} diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 1856e8440..b1a72a199 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -4,6 +4,7 @@ package v1 import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" types1 "github.com/cosmos/cosmos-sdk/codec/types" @@ -121,6 +122,38 @@ func (ProposalStatus) EnumDescriptor() ([]byte, []int) { return fileDescriptor_ecf0f9950ff6986c, []int{1} } +// GovernorStatus is the status of a governor. +type GovernorStatus int32 + +const ( + // UNSPECIFIED defines an invalid governor status. + Unspecified GovernorStatus = 0 + // ACTIVE defines a governor that is active. + Active GovernorStatus = 1 + // INACTIVE defines a governor that is inactive. + Inactive GovernorStatus = 2 +) + +var GovernorStatus_name = map[int32]string{ + 0: "GOVERNOR_STATUS_UNSPECIFIED", + 1: "GOVERNOR_STATUS_ACTIVE", + 2: "GOVERNOR_STATUS_INACTIVE", +} + +var GovernorStatus_value = map[string]int32{ + "GOVERNOR_STATUS_UNSPECIFIED": 0, + "GOVERNOR_STATUS_ACTIVE": 1, + "GOVERNOR_STATUS_INACTIVE": 2, +} + +func (x GovernorStatus) String() string { + return proto.EnumName(GovernorStatus_name, int32(x)) +} + +func (GovernorStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_ecf0f9950ff6986c, []int{2} +} + // WeightedVoteOption defines a unit of vote for vote split. type WeightedVoteOption struct { // option defines the valid vote options, it must not contain duplicate vote options. @@ -850,9 +883,183 @@ func (m *Params) GetBurnVoteVeto() bool { return false } +// Governor defines a governor, together with the total amount of delegated +// validator's bond shares for a set amount of validators. When a delegator +// delegates a percentage of its x/gov power to a governor, the resulting +// shares from each delegators delegations in x/staking are added to the +// governor's total shares. +type Governor struct { + // governor_address defines the address of the governor; bech encoded in JSON. + GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` + // status is the status of the governor (active/inactive). + Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` + // description defines the description terms for the governor. + Description GovernorDescription `protobuf:"bytes,3,opt,name=description,proto3" json:"description"` + // delegations define the validator delegations for the governor. + Delegations []*ValidatorDelegation `protobuf:"bytes,4,rep,name=delegations,proto3" json:"delegations,omitempty"` +} + +func (m *Governor) Reset() { *m = Governor{} } +func (m *Governor) String() string { return proto.CompactTextString(m) } +func (*Governor) ProtoMessage() {} +func (*Governor) Descriptor() ([]byte, []int) { + return fileDescriptor_ecf0f9950ff6986c, []int{9} +} +func (m *Governor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Governor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Governor.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 *Governor) XXX_Merge(src proto.Message) { + xxx_messageInfo_Governor.Merge(m, src) +} +func (m *Governor) XXX_Size() int { + return m.Size() +} +func (m *Governor) XXX_DiscardUnknown() { + xxx_messageInfo_Governor.DiscardUnknown(m) +} + +var xxx_messageInfo_Governor proto.InternalMessageInfo + +// Description defines a governor description. +type GovernorDescription struct { + // moniker defines a human-readable name for the governor. + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + // identity defines an optional identity signature (ex. UPort or Keybase). + Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` + // website defines an optional website link. + Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` + // security_contact defines an optional email for security contact. + SecurityContact string `protobuf:"bytes,4,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty"` + // details define other optional details. + Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` +} + +func (m *GovernorDescription) Reset() { *m = GovernorDescription{} } +func (m *GovernorDescription) String() string { return proto.CompactTextString(m) } +func (*GovernorDescription) ProtoMessage() {} +func (*GovernorDescription) Descriptor() ([]byte, []int) { + return fileDescriptor_ecf0f9950ff6986c, []int{10} +} +func (m *GovernorDescription) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GovernorDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GovernorDescription.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 *GovernorDescription) XXX_Merge(src proto.Message) { + xxx_messageInfo_GovernorDescription.Merge(m, src) +} +func (m *GovernorDescription) XXX_Size() int { + return m.Size() +} +func (m *GovernorDescription) XXX_DiscardUnknown() { + xxx_messageInfo_GovernorDescription.DiscardUnknown(m) +} + +var xxx_messageInfo_GovernorDescription proto.InternalMessageInfo + +func (m *GovernorDescription) GetMoniker() string { + if m != nil { + return m.Moniker + } + return "" +} + +func (m *GovernorDescription) GetIdentity() string { + if m != nil { + return m.Identity + } + return "" +} + +func (m *GovernorDescription) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *GovernorDescription) GetSecurityContact() string { + if m != nil { + return m.SecurityContact + } + return "" +} + +func (m *GovernorDescription) GetDetails() string { + if m != nil { + return m.Details + } + return "" +} + +// ValidatorDelegation holds the number of shares from the specified validator +// a governor can use to vote on proposals. +type ValidatorDelegation struct { + GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // shares define the delegation shares available from this validator. + Shares cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"shares"` +} + +func (m *ValidatorDelegation) Reset() { *m = ValidatorDelegation{} } +func (m *ValidatorDelegation) String() string { return proto.CompactTextString(m) } +func (*ValidatorDelegation) ProtoMessage() {} +func (*ValidatorDelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_ecf0f9950ff6986c, []int{11} +} +func (m *ValidatorDelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorDelegation.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 *ValidatorDelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorDelegation.Merge(m, src) +} +func (m *ValidatorDelegation) XXX_Size() int { + return m.Size() +} +func (m *ValidatorDelegation) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorDelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorDelegation proto.InternalMessageInfo + func init() { proto.RegisterEnum("atomone.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("atomone.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) + proto.RegisterEnum("atomone.gov.v1.GovernorStatus", GovernorStatus_name, GovernorStatus_value) proto.RegisterType((*WeightedVoteOption)(nil), "atomone.gov.v1.WeightedVoteOption") proto.RegisterType((*Deposit)(nil), "atomone.gov.v1.Deposit") proto.RegisterType((*Proposal)(nil), "atomone.gov.v1.Proposal") @@ -862,95 +1069,156 @@ func init() { proto.RegisterType((*VotingParams)(nil), "atomone.gov.v1.VotingParams") proto.RegisterType((*TallyParams)(nil), "atomone.gov.v1.TallyParams") proto.RegisterType((*Params)(nil), "atomone.gov.v1.Params") + proto.RegisterType((*Governor)(nil), "atomone.gov.v1.Governor") + proto.RegisterType((*GovernorDescription)(nil), "atomone.gov.v1.GovernorDescription") + proto.RegisterType((*ValidatorDelegation)(nil), "atomone.gov.v1.ValidatorDelegation") } func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4f, 0x73, 0xd3, 0x46, - 0x14, 0x8f, 0x6c, 0xd9, 0x71, 0x9e, 0x13, 0xc7, 0x2c, 0x29, 0x28, 0x06, 0xec, 0xd4, 0xc3, 0x30, - 0x29, 0x25, 0x76, 0x13, 0x5a, 0x2e, 0xe5, 0xe2, 0xc4, 0x02, 0xc4, 0xd0, 0xd8, 0x95, 0x45, 0x18, - 0x7a, 0xd1, 0xc8, 0xd1, 0x62, 0xef, 0x8c, 0xa5, 0x75, 0xa5, 0xb5, 0xc1, 0x1f, 0xa1, 0x37, 0x8e, - 0x9d, 0x9e, 0x7a, 0xec, 0xb1, 0x07, 0x66, 0xfa, 0x01, 0x7a, 0xe1, 0xd4, 0x32, 0x5c, 0xda, 0x5e, - 0x68, 0x07, 0x0e, 0x9d, 0xe1, 0x53, 0x74, 0x76, 0xb5, 0xb2, 0x1d, 0xc7, 0x9d, 0x24, 0x5c, 0x12, - 0xe9, 0xbd, 0xdf, 0xef, 0xbd, 0xb7, 0xef, 0xdf, 0xca, 0xa0, 0x39, 0x8c, 0x7a, 0xd4, 0xc7, 0xd5, - 0x0e, 0x1d, 0x56, 0x87, 0xdb, 0xfc, 0x5f, 0xa5, 0x1f, 0x50, 0x46, 0x51, 0x4e, 0x6a, 0x2a, 0x5c, - 0x34, 0xdc, 0x2e, 0x14, 0x0f, 0x69, 0xe8, 0xd1, 0xb0, 0xda, 0x76, 0x42, 0x5c, 0x1d, 0x6e, 0xb7, - 0x31, 0x73, 0xb6, 0xab, 0x87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a2, 0xdb, 0x90, 0x76, 0x3c, - 0x3a, 0xf0, 0x99, 0x96, 0xdc, 0x48, 0x6e, 0x66, 0x77, 0xd6, 0x2b, 0x92, 0xc1, 0xeb, 0x54, 0x91, - 0x75, 0xaa, 0xec, 0x51, 0xe2, 0xef, 0x2e, 0xbd, 0x7c, 0x53, 0x5a, 0xf8, 0xe9, 0xdf, 0x9f, 0xaf, - 0x2b, 0xa6, 0xe4, 0x94, 0x7f, 0x4d, 0x41, 0xa6, 0x29, 0x83, 0x40, 0x39, 0x48, 0x8c, 0x43, 0x4b, - 0x10, 0x17, 0x7d, 0x06, 0x19, 0x0f, 0x87, 0xa1, 0xd3, 0xc1, 0xa1, 0x96, 0x10, 0xc6, 0xd7, 0x2a, - 0x51, 0x49, 0x2a, 0x71, 0x49, 0x2a, 0x35, 0x7f, 0x64, 0x8e, 0x51, 0xe8, 0x16, 0xa4, 0x43, 0xe6, - 0xb0, 0x41, 0xa8, 0x25, 0x45, 0x36, 0x8b, 0xb3, 0xd9, 0x8c, 0x7d, 0xb5, 0x04, 0xca, 0x94, 0x68, - 0x64, 0x00, 0x7a, 0x42, 0x7c, 0xa7, 0x67, 0x33, 0xa7, 0xd7, 0x1b, 0xd9, 0x01, 0x0e, 0x07, 0x3d, - 0xa6, 0xa9, 0x1b, 0xca, 0x66, 0x76, 0xe7, 0xd2, 0xac, 0x0d, 0x8b, 0x63, 0x4c, 0x01, 0x31, 0xf3, - 0x82, 0x36, 0x25, 0x41, 0x35, 0xc8, 0x86, 0x83, 0xb6, 0x47, 0x98, 0xcd, 0x3b, 0x4d, 0x4b, 0x09, - 0x1b, 0x85, 0x63, 0x71, 0x5b, 0x71, 0x1b, 0xee, 0xaa, 0xcf, 0xff, 0x2e, 0x29, 0x26, 0x44, 0x24, - 0x2e, 0x46, 0xf7, 0x21, 0x2f, 0xf3, 0x6b, 0x63, 0xdf, 0x8d, 0xec, 0xa4, 0x4f, 0x69, 0x27, 0x27, - 0x99, 0xba, 0xef, 0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0x52, 0xaf, 0x2a, 0x17, 0xfe, - 0x56, 0x77, 0xd0, 0x8e, 0x9f, 0xab, 0xcf, 0xc4, 0x2f, 0x01, 0x36, 0xea, 0xe3, 0x90, 0x7f, 0xe5, - 0xa7, 0xc5, 0xdc, 0xdc, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x04, 0x79, 0x98, 0x28, 0x0c, + // 1634 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4d, 0x6f, 0x1b, 0xc7, + 0x19, 0xd6, 0x52, 0x14, 0x45, 0xbd, 0x94, 0xa8, 0xf5, 0xd8, 0x75, 0xd6, 0x54, 0x4c, 0x2a, 0x6c, + 0x10, 0x28, 0x6a, 0x44, 0x46, 0x4e, 0x9b, 0x43, 0x9a, 0x0b, 0x25, 0x32, 0xce, 0x1a, 0xae, 0xc8, + 0x2e, 0x69, 0x1a, 0xe9, 0x65, 0x31, 0xe4, 0x8e, 0xc9, 0x41, 0xb8, 0x3b, 0xec, 0xee, 0x90, 0x36, + 0xff, 0x41, 0xea, 0x53, 0x8e, 0x45, 0x51, 0x03, 0x06, 0x7a, 0x29, 0x7a, 0xca, 0xc1, 0x40, 0x7f, + 0x40, 0x2f, 0x39, 0xb5, 0x81, 0x2f, 0xfd, 0x38, 0xa8, 0x85, 0x7d, 0x68, 0x90, 0x3f, 0xd1, 0x62, + 0x3e, 0x96, 0xa4, 0x28, 0x1a, 0x92, 0x83, 0x5c, 0xa4, 0x9d, 0x77, 0x9e, 0xe7, 0x79, 0x67, 0xe6, + 0xfd, 0x98, 0x21, 0x58, 0x98, 0x33, 0x9f, 0x05, 0xa4, 0xdc, 0x63, 0xe3, 0xf2, 0xf8, 0x50, 0xfc, + 0x2b, 0x0d, 0x43, 0xc6, 0x19, 0xca, 0xea, 0x99, 0x92, 0x30, 0x8d, 0x0f, 0x73, 0xf9, 0x2e, 0x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x35, 0xad, 0x5b, 0xf1, 0xbc, 0x90, 0x44, 0x51, 0x93, 0x87, 0x34, + 0xe8, 0x39, 0x33, 0x28, 0xfa, 0x18, 0x52, 0xd8, 0x67, 0xa3, 0x80, 0x5b, 0xab, 0xbb, 0xab, 0x7b, + 0x99, 0x5b, 0x37, 0x4a, 0x9a, 0x21, 0xe2, 0x54, 0xd2, 0x71, 0x2a, 0x1d, 0x33, 0x1a, 0x1c, 0x6d, + 0x7c, 0x7d, 0x5a, 0x58, 0xf9, 0xe3, 0x7f, 0xbf, 0xda, 0x37, 0x1c, 0xcd, 0x29, 0xfe, 0x65, 0x0d, + 0xd2, 0x0d, 0xbd, 0x08, 0x94, 0x85, 0xc4, 0x74, 0x69, 0x09, 0xea, 0xa1, 0xf7, 0x21, 0xed, 0x93, + 0x28, 0xc2, 0x3d, 0x12, 0x59, 0x09, 0x29, 0x7e, 0xad, 0xa4, 0x42, 0x52, 0x8a, 0x43, 0x52, 0xaa, + 0x04, 0x13, 0x67, 0x8a, 0x42, 0x1f, 0x42, 0x2a, 0xe2, 0x98, 0x8f, 0x22, 0x6b, 0x55, 0x9e, 0x66, + 0x7e, 0xf1, 0x34, 0x63, 0x5f, 0x4d, 0x89, 0x72, 0x34, 0x1a, 0xd9, 0x80, 0x1e, 0xd0, 0x00, 0x0f, + 0x5c, 0x8e, 0x07, 0x83, 0x89, 0x1b, 0x92, 0x68, 0x34, 0xe0, 0x56, 0x72, 0xd7, 0xd8, 0xcb, 0xdc, + 0xda, 0x59, 0xd4, 0x68, 0x09, 0x8c, 0x23, 0x21, 0x8e, 0x29, 0x69, 0x73, 0x16, 0x54, 0x81, 0x4c, + 0x34, 0xea, 0xf8, 0x94, 0xbb, 0x22, 0xd3, 0xac, 0x35, 0xa9, 0x91, 0x3b, 0xb7, 0xee, 0x56, 0x9c, + 0x86, 0x47, 0xc9, 0x2f, 0xff, 0x5d, 0x30, 0x1c, 0x50, 0x24, 0x61, 0x46, 0x77, 0xc0, 0xd4, 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x1f, 0x75, 0xe2, 0xef, 0xf2, 0x23, 0xf9, 0x53, 0x9c, 0x4f, 0x86, 0x24, 0x12, 0x3f, 0xb3, 0x53, + 0xf2, 0xe2, 0xfa, 0xe0, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x59, 0x74, 0x69, 0xa9, 0x0f, 0x00, 0x00, } +func (this *GovernorDescription) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GovernorDescription) + if !ok { + that2, ok := that.(GovernorDescription) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Moniker != that1.Moniker { + return false + } + if this.Identity != that1.Identity { + return false + } + if this.Website != that1.Website { + return false + } + if this.SecurityContact != that1.SecurityContact { + return false + } + if this.Details != that1.Details { + return false + } + return true +} func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1522,6 +1790,170 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Governor) 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 *Governor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Governor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Delegations) > 0 { + for iNdEx := len(m.Delegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Delegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Status != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintGov(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GovernorDescription) 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 *GovernorDescription) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GovernorDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = encodeVarintGov(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x2a + } + if len(m.SecurityContact) > 0 { + i -= len(m.SecurityContact) + copy(dAtA[i:], m.SecurityContact) + i = encodeVarintGov(dAtA, i, uint64(len(m.SecurityContact))) + i-- + dAtA[i] = 0x22 + } + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintGov(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x1a + } + if len(m.Identity) > 0 { + i -= len(m.Identity) + copy(dAtA[i:], m.Identity) + i = encodeVarintGov(dAtA, i, uint64(len(m.Identity))) + i-- + dAtA[i] = 0x12 + } + if len(m.Moniker) > 0 { + i -= len(m.Moniker) + copy(dAtA[i:], m.Moniker) + i = encodeVarintGov(dAtA, i, uint64(len(m.Moniker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorDelegation) 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 *ValidatorDelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Shares.Size() + i -= size + if _, err := m.Shares.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGov(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintGov(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintGov(dAtA []byte, offset int, v uint64) int { offset -= sovGov(v) base := offset @@ -1786,13 +2218,85 @@ func (m *Params) Size() (n int) { return n } -func sovGov(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *Governor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovGov(uint64(m.Status)) + } + l = m.Description.Size() + n += 1 + l + sovGov(uint64(l)) + if len(m.Delegations) > 0 { + for _, e := range m.Delegations { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + return n } -func sozGov(x uint64) (n int) { - return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *GovernorDescription) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Identity) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.SecurityContact) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Details) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n } -func (m *WeightedVoteOption) Unmarshal(dAtA []byte) error { + +func (m *ValidatorDelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.Shares.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func sovGov(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGov(x uint64) (n int) { + return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *WeightedVoteOption) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3533,6 +4037,532 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } +func (m *Governor) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Governor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Governor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= GovernorStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Delegations = append(m.Delegations, &ValidatorDelegation{}) + if err := m.Delegations[len(m.Delegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GovernorDescription) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GovernorDescription: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GovernorDescription: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Identity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContact", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SecurityContact = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Details = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorDelegation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorDelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Shares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGov(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index b95851620..628840e7a 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -688,6 +688,314 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgCreateGovernor defines a SDK message for creating a new governor. +type MsgCreateGovernor struct { + Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` + GovernorAddress string `protobuf:"bytes,2,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` + Pubkey *types.Any `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"` +} + +func (m *MsgCreateGovernor) Reset() { *m = MsgCreateGovernor{} } +func (m *MsgCreateGovernor) String() string { return proto.CompactTextString(m) } +func (*MsgCreateGovernor) ProtoMessage() {} +func (*MsgCreateGovernor) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{12} +} +func (m *MsgCreateGovernor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateGovernor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateGovernor.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 *MsgCreateGovernor) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateGovernor.Merge(m, src) +} +func (m *MsgCreateGovernor) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateGovernor) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateGovernor.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateGovernor proto.InternalMessageInfo + +// MsgCreateGovernorrResponse defines the Msg/CreateGovernor response type. +type MsgCreateGovernorResponse struct { +} + +func (m *MsgCreateGovernorResponse) Reset() { *m = MsgCreateGovernorResponse{} } +func (m *MsgCreateGovernorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateGovernorResponse) ProtoMessage() {} +func (*MsgCreateGovernorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{13} +} +func (m *MsgCreateGovernorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateGovernorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateGovernorResponse.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 *MsgCreateGovernorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateGovernorResponse.Merge(m, src) +} +func (m *MsgCreateGovernorResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateGovernorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateGovernorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateGovernorResponse proto.InternalMessageInfo + +// MsgEditGovernor defines a SDK message for editing an existing governor. +type MsgEditGovernor struct { + Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` + Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` + GovernorAddress string `protobuf:"bytes,3,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` +} + +func (m *MsgEditGovernor) Reset() { *m = MsgEditGovernor{} } +func (m *MsgEditGovernor) String() string { return proto.CompactTextString(m) } +func (*MsgEditGovernor) ProtoMessage() {} +func (*MsgEditGovernor) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{14} +} +func (m *MsgEditGovernor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditGovernor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditGovernor.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 *MsgEditGovernor) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditGovernor.Merge(m, src) +} +func (m *MsgEditGovernor) XXX_Size() int { + return m.Size() +} +func (m *MsgEditGovernor) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditGovernor.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditGovernor proto.InternalMessageInfo + +// MsgEditGovernorResponse defines the Msg/EditGovernor response type. +type MsgEditGovernorResponse struct { +} + +func (m *MsgEditGovernorResponse) Reset() { *m = MsgEditGovernorResponse{} } +func (m *MsgEditGovernorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgEditGovernorResponse) ProtoMessage() {} +func (*MsgEditGovernorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{15} +} +func (m *MsgEditGovernorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditGovernorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditGovernorResponse.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 *MsgEditGovernorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditGovernorResponse.Merge(m, src) +} +func (m *MsgEditGovernorResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgEditGovernorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditGovernorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditGovernorResponse proto.InternalMessageInfo + +// MsgDelegateGovernor defines a SDK message for performing a delegation of governance voting power +// from a delegator to a governor. +type MsgDelegateGovernor struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + GovernorAddress string `protobuf:"bytes,2,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` + // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. + Percentage string `protobuf:"bytes,6,opt,name=percentage,proto3" json:"percentage,omitempty"` +} + +func (m *MsgDelegateGovernor) Reset() { *m = MsgDelegateGovernor{} } +func (m *MsgDelegateGovernor) String() string { return proto.CompactTextString(m) } +func (*MsgDelegateGovernor) ProtoMessage() {} +func (*MsgDelegateGovernor) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{16} +} +func (m *MsgDelegateGovernor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDelegateGovernor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDelegateGovernor.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 *MsgDelegateGovernor) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDelegateGovernor.Merge(m, src) +} +func (m *MsgDelegateGovernor) XXX_Size() int { + return m.Size() +} +func (m *MsgDelegateGovernor) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDelegateGovernor.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDelegateGovernor proto.InternalMessageInfo + +// MsgDelegateGovernorResponse defines the Msg/Delegate response type. +type MsgDelegateGovernorResponse struct { +} + +func (m *MsgDelegateGovernorResponse) Reset() { *m = MsgDelegateGovernorResponse{} } +func (m *MsgDelegateGovernorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDelegateGovernorResponse) ProtoMessage() {} +func (*MsgDelegateGovernorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{17} +} +func (m *MsgDelegateGovernorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDelegateGovernorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDelegateGovernorResponse.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 *MsgDelegateGovernorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDelegateGovernorResponse.Merge(m, src) +} +func (m *MsgDelegateGovernorResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDelegateGovernorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDelegateGovernorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDelegateGovernorResponse proto.InternalMessageInfo + +// MsgUndelegateGovernor defines a SDK message for undelegating governance voting power +type MsgUndelegateGovernor struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` +} + +func (m *MsgUndelegateGovernor) Reset() { *m = MsgUndelegateGovernor{} } +func (m *MsgUndelegateGovernor) String() string { return proto.CompactTextString(m) } +func (*MsgUndelegateGovernor) ProtoMessage() {} +func (*MsgUndelegateGovernor) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{18} +} +func (m *MsgUndelegateGovernor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUndelegateGovernor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUndelegateGovernor.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 *MsgUndelegateGovernor) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUndelegateGovernor.Merge(m, src) +} +func (m *MsgUndelegateGovernor) XXX_Size() int { + return m.Size() +} +func (m *MsgUndelegateGovernor) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUndelegateGovernor.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUndelegateGovernor proto.InternalMessageInfo + +// MsgUndelegateGovernorResponse defines the Msg/UndelegateGovernor response type. +type MsgUndelegateGovernorResponse struct { +} + +func (m *MsgUndelegateGovernorResponse) Reset() { *m = MsgUndelegateGovernorResponse{} } +func (m *MsgUndelegateGovernorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUndelegateGovernorResponse) ProtoMessage() {} +func (*MsgUndelegateGovernorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{19} +} +func (m *MsgUndelegateGovernorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUndelegateGovernorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUndelegateGovernorResponse.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 *MsgUndelegateGovernorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUndelegateGovernorResponse.Merge(m, src) +} +func (m *MsgUndelegateGovernorResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUndelegateGovernorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUndelegateGovernorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUndelegateGovernorResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSubmitProposal)(nil), "atomone.gov.v1.MsgSubmitProposal") proto.RegisterType((*MsgSubmitProposalResponse)(nil), "atomone.gov.v1.MsgSubmitProposalResponse") @@ -701,69 +1009,100 @@ func init() { proto.RegisterType((*MsgDepositResponse)(nil), "atomone.gov.v1.MsgDepositResponse") proto.RegisterType((*MsgUpdateParams)(nil), "atomone.gov.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "atomone.gov.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgCreateGovernor)(nil), "atomone.gov.v1.MsgCreateGovernor") + proto.RegisterType((*MsgCreateGovernorResponse)(nil), "atomone.gov.v1.MsgCreateGovernorResponse") + proto.RegisterType((*MsgEditGovernor)(nil), "atomone.gov.v1.MsgEditGovernor") + proto.RegisterType((*MsgEditGovernorResponse)(nil), "atomone.gov.v1.MsgEditGovernorResponse") + proto.RegisterType((*MsgDelegateGovernor)(nil), "atomone.gov.v1.MsgDelegateGovernor") + proto.RegisterType((*MsgDelegateGovernorResponse)(nil), "atomone.gov.v1.MsgDelegateGovernorResponse") + proto.RegisterType((*MsgUndelegateGovernor)(nil), "atomone.gov.v1.MsgUndelegateGovernor") + proto.RegisterType((*MsgUndelegateGovernorResponse)(nil), "atomone.gov.v1.MsgUndelegateGovernorResponse") } func init() { proto.RegisterFile("atomone/gov/v1/tx.proto", fileDescriptor_f6c84786701fca8d) } var fileDescriptor_f6c84786701fca8d = []byte{ - // 912 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4d, 0x6f, 0xe3, 0x44, - 0x18, 0xae, 0xfb, 0x91, 0x6c, 0xa7, 0xa8, 0xab, 0x8e, 0x02, 0x75, 0x4d, 0x95, 0x74, 0x2d, 0x24, - 0xba, 0x15, 0xb5, 0x49, 0x16, 0x90, 0x88, 0x7a, 0x60, 0xb3, 0x20, 0xb4, 0x12, 0xd1, 0xae, 0xbc, - 0xe2, 0x43, 0x1c, 0xa8, 0x26, 0xf1, 0x30, 0xb5, 0x54, 0x7b, 0x2c, 0xcf, 0x24, 0x6a, 0x6e, 0x88, - 0x23, 0x27, 0x4e, 0xfc, 0x06, 0x8e, 0x3d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- 0xfe, 0xeb, 0x12, 0x4c, 0x80, 0xf3, 0xee, 0x82, 0x80, 0x1c, 0xf9, 0x31, 0xa8, 0x9b, 0xd9, 0x71, - 0x2a, 0x72, 0xb4, 0xcf, 0x71, 0xaf, 0xf7, 0xcd, 0x16, 0x59, 0x68, 0xc5, 0xaa, 0x22, 0x67, 0x03, - 0x2a, 0x8b, 0xac, 0xea, 0x08, 0x67, 0xed, 0x07, 0xd1, 0x70, 0xbd, 0xcf, 0x5f, 0x5e, 0x34, 0xad, - 0x57, 0x17, 0x4d, 0xeb, 0xaf, 0x8b, 0xa6, 0xf5, 0xf3, 0x65, 0x73, 0xe9, 0xd5, 0x65, 0x73, 0xe9, - 0xcf, 0xcb, 0xe6, 0xd2, 0xb7, 0x87, 0x24, 0xe2, 0x27, 0xa3, 0x81, 0x37, 0xa4, 0xb1, 0xaf, 0x31, - 0x0f, 0x4f, 0x46, 0x03, 0xbf, 0xd8, 0x86, 0x7c, 0x92, 0x62, 0x26, 0xfe, 0x4d, 0xd5, 0xe4, 0x27, - 0xef, 0xc1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x70, 0x13, 0x4d, 0x50, 0x8f, 0x09, 0x00, 0x00, + // 1268 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xf7, 0x26, 0x8d, 0xdd, 0x4c, 0xbe, 0x72, 0x9b, 0xfd, 0xba, 0x64, 0xb3, 0x69, 0xec, 0x64, + 0x0b, 0x22, 0x0d, 0x78, 0x97, 0xb8, 0x50, 0x09, 0x13, 0x21, 0xea, 0x24, 0x54, 0x15, 0xb5, 0x1a, + 0x39, 0xe2, 0x87, 0x38, 0x10, 0xad, 0xbd, 0xc3, 0x66, 0x69, 0x76, 0x67, 0xb5, 0x33, 0xb6, 0xe2, + 0x1b, 0xe2, 0x84, 0x38, 0x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f, 0x25, 0x50, 0x6a, 0x62, 0x7b, 0xeb, 0x00, 0x76, 0xee, 0x43, 0xdb, 0xec, 0xf4, 0x37, 0x90, + 0x47, 0xa0, 0x47, 0xe4, 0x07, 0xa0, 0xd0, 0x61, 0x9f, 0x34, 0x6a, 0xc4, 0x42, 0x34, 0x2a, 0x4f, + 0x8f, 0xaa, 0x0b, 0xc9, 0x66, 0x14, 0x42, 0xd3, 0xe0, 0x96, 0xc8, 0x22, 0x5f, 0x07, 0xd3, 0x66, + 0x97, 0xec, 0xa1, 0xc0, 0x21, 0x7d, 0x65, 0x82, 0xd6, 0x3c, 0x30, 0xd4, 0x6b, 0x61, 0xd5, 0x83, + 0x71, 0x58, 0x76, 0x25, 0x59, 0x76, 0x8a, 0xa2, 0x56, 0x06, 0xd7, 0xb3, 0xec, 0xa2, 0x78, 0xed, + 0x54, 0x02, 0x85, 0x26, 0xb6, 0x3f, 0x41, 0x04, 0xca, 0xef, 0x64, 0x08, 0xd1, 0x28, 0xfd, 0xf5, + 0xbc, 0x12, 0x37, 0xb3, 0x96, 0x88, 0xc9, 0x23, 0xeb, 0x60, 0xaa, 0x87, 0x08, 0x0c, 0x18, 0xe1, + 0x73, 0x7a, 0x81, 0xc1, 0xe4, 0x1a, 0xc8, 0x23, 0x9f, 0x38, 0xc8, 0xa3, 0xcd, 0x53, 0xac, 0xa9, + 0x7a, 0x52, 0x1b, 0x3d, 0x24, 0xf3, 0x80, 0x22, 0x5a, 0x1c, 0x79, 0x5e, 0xf3, 0xd4, 0x97, 0x43, + 0x59, 0x58, 0xee, 0x50, 0x12, 0x39, 0x29, 0x49, 0x98, 0x4c, 0x9b, 0x05, 0x57, 0xf8, 0x67, 0x54, + 0xf8, 0xdf, 0x52, 0x64, 0xfb, 0x14, 0x3a, 0xf6, 0x1e, 0x81, 0xd6, 0x7f, 0x25, 0xc0, 0x3a, 0x28, + 0xb0, 0xb2, 0xb0, 0x32, 0x49, 0xb7, 0xa1, 0x36, 0xac, 0x80, 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51, 0x76, 0x23, 0x53, + 0xcb, 0x24, 0x48, 0x7d, 0xe3, 0x02, 0xa0, 0x68, 0x96, 0xaf, 0x80, 0x9c, 0xb1, 0xe9, 0x5f, 0xcb, + 0x92, 0x37, 0x05, 0x53, 0xab, 0x17, 0x82, 0x89, 0xb9, 0xd4, 0xa9, 0xaf, 0xc3, 0x3b, 0xa9, 0x71, + 0xf7, 0xc9, 0x49, 0x59, 0x7a, 0x76, 0x52, 0x96, 0xfe, 0x38, 0x29, 0x4b, 0xdf, 0x9f, 0x96, 0x73, + 0xcf, 0x4e, 0xcb, 0xb9, 0xdf, 0x4f, 0xcb, 0xb9, 0xcf, 0xab, 0xb6, 0x43, 0xf6, 0xba, 0x6d, 0xbd, + 0x83, 0x5c, 0x83, 0x67, 0xae, 0xee, 0x75, 0xdb, 0x46, 0xf2, 0xc9, 0x42, 0xfa, 0x3e, 0xc4, 0xe1, + 0x3f, 0xef, 0x3c, 0xbd, 0xbf, 0x6f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x3e, 0xf0, 0xd5, + 0xbb, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -794,6 +1133,16 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // CreateGovernor defines a method to create a new governor. + CreateGovernor(ctx context.Context, in *MsgCreateGovernor, opts ...grpc.CallOption) (*MsgCreateGovernorResponse, error) + // EditGovernor defines a method to edit an existing governor. + // It also sets its status. + EditGovernor(ctx context.Context, in *MsgEditGovernor, opts ...grpc.CallOption) (*MsgEditGovernorResponse, error) + // DelegateGovernor defines a method to delegate a non-zero percentange of + // governance voting power from a delegator to a governor. + DelegateGovernor(ctx context.Context, in *MsgDelegateGovernor, opts ...grpc.CallOption) (*MsgDelegateGovernorResponse, error) + // UndelegateGovernor defines a method to undelegate governance voting power + UndelegateGovernor(ctx context.Context, in *MsgUndelegateGovernor, opts ...grpc.CallOption) (*MsgUndelegateGovernorResponse, error) } type msgClient struct { @@ -858,6 +1207,42 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) CreateGovernor(ctx context.Context, in *MsgCreateGovernor, opts ...grpc.CallOption) (*MsgCreateGovernorResponse, error) { + out := new(MsgCreateGovernorResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Msg/CreateGovernor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) EditGovernor(ctx context.Context, in *MsgEditGovernor, opts ...grpc.CallOption) (*MsgEditGovernorResponse, error) { + out := new(MsgEditGovernorResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Msg/EditGovernor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DelegateGovernor(ctx context.Context, in *MsgDelegateGovernor, opts ...grpc.CallOption) (*MsgDelegateGovernorResponse, error) { + out := new(MsgDelegateGovernorResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Msg/DelegateGovernor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UndelegateGovernor(ctx context.Context, in *MsgUndelegateGovernor, opts ...grpc.CallOption) (*MsgUndelegateGovernorResponse, error) { + out := new(MsgUndelegateGovernorResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Msg/UndelegateGovernor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // SubmitProposal defines a method to create new proposal given the messages. @@ -876,6 +1261,16 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // CreateGovernor defines a method to create a new governor. + CreateGovernor(context.Context, *MsgCreateGovernor) (*MsgCreateGovernorResponse, error) + // EditGovernor defines a method to edit an existing governor. + // It also sets its status. + EditGovernor(context.Context, *MsgEditGovernor) (*MsgEditGovernorResponse, error) + // DelegateGovernor defines a method to delegate a non-zero percentange of + // governance voting power from a delegator to a governor. + DelegateGovernor(context.Context, *MsgDelegateGovernor) (*MsgDelegateGovernorResponse, error) + // UndelegateGovernor defines a method to undelegate governance voting power + UndelegateGovernor(context.Context, *MsgUndelegateGovernor) (*MsgUndelegateGovernorResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -900,6 +1295,18 @@ func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*M func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) CreateGovernor(ctx context.Context, req *MsgCreateGovernor) (*MsgCreateGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGovernor not implemented") +} +func (*UnimplementedMsgServer) EditGovernor(ctx context.Context, req *MsgEditGovernor) (*MsgEditGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditGovernor not implemented") +} +func (*UnimplementedMsgServer) DelegateGovernor(ctx context.Context, req *MsgDelegateGovernor) (*MsgDelegateGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegateGovernor not implemented") +} +func (*UnimplementedMsgServer) UndelegateGovernor(ctx context.Context, req *MsgUndelegateGovernor) (*MsgUndelegateGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UndelegateGovernor not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1013,6 +1420,78 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_CreateGovernor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateGovernor) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateGovernor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Msg/CreateGovernor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateGovernor(ctx, req.(*MsgCreateGovernor)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_EditGovernor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEditGovernor) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EditGovernor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Msg/EditGovernor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EditGovernor(ctx, req.(*MsgEditGovernor)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DelegateGovernor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDelegateGovernor) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DelegateGovernor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Msg/DelegateGovernor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DelegateGovernor(ctx, req.(*MsgDelegateGovernor)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UndelegateGovernor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUndelegateGovernor) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UndelegateGovernor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Msg/UndelegateGovernor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UndelegateGovernor(ctx, req.(*MsgUndelegateGovernor)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "atomone.gov.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -1041,6 +1520,22 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "CreateGovernor", + Handler: _Msg_CreateGovernor_Handler, + }, + { + MethodName: "EditGovernor", + Handler: _Msg_EditGovernor_Handler, + }, + { + MethodName: "DelegateGovernor", + Handler: _Msg_DelegateGovernor_Handler, + }, + { + MethodName: "UndelegateGovernor", + Handler: _Msg_UndelegateGovernor_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "atomone/gov/v1/tx.proto", @@ -1502,6 +1997,269 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgCreateGovernor) 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 *MsgCreateGovernor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pubkey != nil { + { + size, err := m.Pubkey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgCreateGovernorResponse) 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 *MsgCreateGovernorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateGovernorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgEditGovernor) 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 *MsgEditGovernor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0x1a + } + if m.Status != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgEditGovernorResponse) 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 *MsgEditGovernorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditGovernorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDelegateGovernor) 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 *MsgDelegateGovernor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDelegateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Percentage) > 0 { + i -= len(m.Percentage) + copy(dAtA[i:], m.Percentage) + i = encodeVarintTx(dAtA, i, uint64(len(m.Percentage))) + i-- + dAtA[i] = 0x32 + } + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDelegateGovernorResponse) 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 *MsgDelegateGovernorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDelegateGovernorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUndelegateGovernor) 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 *MsgUndelegateGovernor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUndelegateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUndelegateGovernorResponse) 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 *MsgUndelegateGovernorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUndelegateGovernorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1696,27 +2454,819 @@ func (m *MsgUpdateParams) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateGovernor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Description.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Pubkey != nil { + l = m.Pubkey.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateGovernorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgEditGovernor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Description.Size() + n += 1 + l + sovTx(uint64(l)) + if m.Status != 0 { + n += 1 + sovTx(uint64(m.Status)) + } + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgEditGovernorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDelegateGovernor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Percentage) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgDelegateGovernorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUndelegateGovernor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUndelegateGovernorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Messages = append(m.Messages, &types.Any{}) + if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) + if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Summary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitProposalResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExecLegacyContent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgExecLegacyContent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecLegacyContent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Content == nil { + m.Content = &types.Any{} + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExecLegacyContentResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgExecLegacyContentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecLegacyContentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgVote) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) + } + m.Option = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Option |= VoteOption(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgVoteResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { +func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1739,17 +3289,36 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitProposal: wiretype end group for non-group") + return fmt.Errorf("proto: MsgVoteWeighted: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgVoteWeighted: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1759,29 +3328,27 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Messages = append(m.Messages, &types.Any{}) - if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Voter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialDeposit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1808,14 +3375,14 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) - if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Options = append(m.Options, &WeightedVoteOption{}) + if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1843,13 +3410,113 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Proposer = string(dAtA[iNdEx:postIndex]) + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - var stringLen uint64 + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgVoteWeightedResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgVoteWeightedResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteWeightedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDeposit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1859,27 +3526,14 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.ProposalId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1907,13 +3561,13 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Title = string(dAtA[iNdEx:postIndex]) + m.Depositor = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1923,23 +3577,25 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Summary = string(dAtA[iNdEx:postIndex]) + m.Amount = append(m.Amount, types1.Coin{}) + if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1962,7 +3618,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitProposalResponse) Unmarshal(dAtA []byte) error { +func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1985,31 +3641,12 @@ func (m *MsgSubmitProposalResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitProposalResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgDepositResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } + return fmt.Errorf("proto: MsgDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2031,7 +3668,7 @@ func (m *MsgSubmitProposalResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgExecLegacyContent) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2054,17 +3691,17 @@ func (m *MsgExecLegacyContent) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgExecLegacyContent: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecLegacyContent: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParams: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2074,33 +3711,29 @@ func (m *MsgExecLegacyContent) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Content == nil { - m.Content = &types.Any{} - } - if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2110,23 +3743,24 @@ func (m *MsgExecLegacyContent) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -2149,7 +3783,7 @@ func (m *MsgExecLegacyContent) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgExecLegacyContentResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2172,10 +3806,10 @@ func (m *MsgExecLegacyContentResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgExecLegacyContentResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecLegacyContentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2199,7 +3833,7 @@ func (m *MsgExecLegacyContentResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgVote) Unmarshal(dAtA []byte) error { +func (m *MsgCreateGovernor) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2222,17 +3856,17 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgVote: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVote: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateGovernor: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - m.ProposalId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2242,14 +3876,28 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2277,32 +3925,13 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Voter = string(dAtA[iNdEx:postIndex]) + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2312,23 +3941,27 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = string(dAtA[iNdEx:postIndex]) + if m.Pubkey == nil { + m.Pubkey = &types.Any{} + } + if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -2351,7 +3984,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgVoteResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCreateGovernorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2374,10 +4007,10 @@ func (m *MsgVoteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgVoteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateGovernorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2401,7 +4034,7 @@ func (m *MsgVoteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error { +func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2424,36 +4057,17 @@ func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgVoteWeighted: wiretype end group for non-group") + return fmt.Errorf("proto: MsgEditGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteWeighted: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgEditGovernor: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2463,29 +4077,30 @@ func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Voter = string(dAtA[iNdEx:postIndex]) + if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var msglen int + m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2495,29 +4110,14 @@ func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Status |= GovernorStatus(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &WeightedVoteOption{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2545,7 +4145,7 @@ func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = string(dAtA[iNdEx:postIndex]) + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2568,7 +4168,7 @@ func (m *MsgVoteWeighted) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgVoteWeightedResponse) Unmarshal(dAtA []byte) error { +func (m *MsgEditGovernorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2591,10 +4191,10 @@ func (m *MsgVoteWeightedResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgVoteWeightedResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgEditGovernorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteWeightedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgEditGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2618,7 +4218,7 @@ func (m *MsgVoteWeightedResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgDeposit) Unmarshal(dAtA []byte) error { +func (m *MsgDelegateGovernor) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2641,17 +4241,17 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgDeposit: wiretype end group for non-group") + return fmt.Errorf("proto: MsgDelegateGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgDelegateGovernor: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) } - m.ProposalId = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2661,14 +4261,27 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2696,13 +4309,13 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Depositor = string(dAtA[iNdEx:postIndex]) + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Percentage", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2712,25 +4325,23 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types1.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Percentage = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2753,7 +4364,7 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { +func (m *MsgDelegateGovernorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2776,10 +4387,10 @@ func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgDepositResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgDelegateGovernorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgDelegateGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2803,7 +4414,7 @@ func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { +func (m *MsgUndelegateGovernor) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2826,15 +4437,15 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUndelegateGovernor: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUndelegateGovernor: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2862,40 +4473,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2918,7 +4496,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUndelegateGovernorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2941,10 +4519,10 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUndelegateGovernorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUndelegateGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: From 41b042ffe018fc3aafdea323c782045be06e879a Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Fri, 13 Sep 2024 18:18:32 +0200 Subject: [PATCH 03/43] governor object started (copy from Validator) --- x/gov/keeper/tally.go | 19 +- x/gov/types/v1/exported.go | 14 ++ x/gov/types/v1/governor.go | 476 +++++++++++++++++++++++++++++++++++++ x/gov/types/v1/tally.go | 30 +-- 4 files changed, 516 insertions(+), 23 deletions(-) create mode 100644 x/gov/types/v1/exported.go create mode 100644 x/gov/types/v1/governor.go diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 84e0a4a54..3d89a5587 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -22,7 +22,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, totalVotingPower := math.LegacyZeroDec() currValidators := make(map[string]stakingtypes.ValidatorI) - currGovernors := make(map[string]v1.GovernorI) + currGovernors := make(map[string]v1.GovernorGovInfo) // fetch all the bonded validators, insert them into currValidators keeper.sk.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) (stop bool) { @@ -32,7 +32,12 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, // fetch all the governors, insert them into currGovernors keeper.IterateGovernorsByPower(ctx, func(index int64, governor v1.GovernorI) (stop bool) { - currGovernors[governor.GetAddress().String()] = governor + currGovernors[governor.GetAddress().String()] = v1.NewGovernorGovInfo( + governor.GetAddress(), + governor.GetDelegations(), + []v1.ValidatorDelegation{}, + v1.WeightedVoteOptions{}, + ) return false }) @@ -42,7 +47,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, voter := sdk.MustAccAddressFromBech32(vote.Voter) // if voter is a governor record it in the map - govAddrStr := v1.GovAddress(voter.Bytes()).String() + govAddrStr := v1.GovernorAddress(voter.Bytes()).String() if gov, ok := currGovernors[govAddrStr]; ok { gov.Vote = vote.Options currGovernors[govAddrStr] = gov @@ -72,7 +77,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, // remove the delegation shares from the governor if governor != nil { - d := governor.GetDelegatorDeductions(delegation.GetValidatorAddr()) + d := governor.GetDelegationDeductions(delegation.GetValidatorAddr()) d = d.Add(delegation.GetShares().Mul(governorDelegationPercentage)) governor.SetDelegatorDeductions(delegation.GetValidatorAddr(), d) } @@ -115,9 +120,11 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, // As governor are simply voters that need to have 100% of their bonded tokens // delegated to them and their shares were deducted when iterating over votes // we don't need to handle special cases. - for valAddrStr, shares := range gov.GetDelegations() { + for _, d := range gov.Delegations { + valAddrStr := d.ValidatorAddress + shares := d.Shares if val, ok := currValidators[valAddrStr]; ok { - sharesAfterDeductions := shares.Sub(gov.GetDelegatorDeductions(val.GetOperator())) + sharesAfterDeductions := shares.Sub(gov.GetDelegationDeductions(val.GetOperator())) votingPower := sharesAfterDeductions.MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares()) for _, option := range gov.Vote { diff --git a/x/gov/types/v1/exported.go b/x/gov/types/v1/exported.go new file mode 100644 index 000000000..f5a738edc --- /dev/null +++ b/x/gov/types/v1/exported.go @@ -0,0 +1,14 @@ +package v1 + +import sdk "github.com/cosmos/cosmos-sdk/types" + +type GovernorI interface { + GetMoniker() string // moniker of the governor + GetStatus() GovernorStatus // status of the governor + IsActive() bool // check if has a active status + IsInactive() bool // check if has status inactive + GetAddress() GovernorAddress // governor address to receive/return governors delegations + GetDescription() GovernorDescription // description of the governor + GetDelegations() []ValidatorDelegation // get all the x/staking shares delegated to the governor + GetDelegationShares(valAddr sdk.ValAddress) sdk.Dec // get the x/staking shares delegated to the governor for a specific validator +} diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go new file mode 100644 index 000000000..23db45a45 --- /dev/null +++ b/x/gov/types/v1/governor.go @@ -0,0 +1,476 @@ +package v1 + +import ( + "bytes" + "fmt" + "sort" + "strings" + + gogoprotoany "github.com/cosmos/gogoproto/types/any" + + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/errors" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const ( + MaxMonikerLength = 70 + MaxIdentityLength = 3000 + MaxWebsiteLength = 140 + MaxSecurityContactLength = 140 + MaxDetailsLength = 280 +) + +var ( + GovernorStatusUnspecified = GovernorStatus_name[int32(Unspecified)] + GovernorStatusActive = GovernorStatus_name[int32(Active)] + GovernorStatusInactive = GovernorStatus_name[int32(Inactive)] +) + +var _ GovernorI = Governor{} + +// NewGovernor constructs a new Governor +func NewGovernor(address string, description GovernorDescription) (Governor, error) { + return Governor{ + GovernorAddress: address, + Description: description, + Delegations: make([]*ValidatorDelegation, 0), + Status: Active, + }, nil +} + +// Governors is a collection of Governor +type Governors struct { + Governors []Governor + GovernorCodec address.Codec +} + +func (g Governors) String() (out string) { + for _, gov := range g.Governors { + out += gov.String() + "\n" + } + + return strings.TrimSpace(out) +} + +// Sort Governors sorts governor array in ascending operator address order +func (g Governors) Sort() { + sort.Sort(g) +} + +// Implements sort interface +func (g Governors) Len() int { + return len(g.Governors) +} + +// Implements sort interface +func (g Governors) Less(i, j int) bool { + gi, err := g.GovernorCodec.StringToBytes(g.Governors[i].GetAddress()) + if err != nil { + panic(err) + } + gj, err := g.GovernorCodec.StringToBytes(g.Governors[j].GetAddress()) + if err != nil { + panic(err) + } + + return bytes.Compare(gi, gj) == -1 +} + +// Implements sort interface +func (g Governors) Swap(i, j int) { + g.Governors[i], g.Governors[j] = g.Governors[j], g.Governors[i] +} + +// GovernorsByVotingPower implements sort.Interface for []Governor based on +// the VotingPower and Address fields. +// The validators are sorted first by their voting power (descending). Secondary index - Address (ascending). +// Copied from tendermint/types/validator_set.go +type GovernorsByVotingPower []Governor + +func (valz ValidatorsByVotingPower) Len() int { return len(valz) } + +func (valz ValidatorsByVotingPower) Less(i, j int, r math.Int) bool { + if valz[i].ConsensusPower(r) == valz[j].ConsensusPower(r) { + addrI, errI := valz[i].GetConsAddr() + addrJ, errJ := valz[j].GetConsAddr() + // If either returns error, then return false + if errI != nil || errJ != nil { + return false + } + return bytes.Compare(addrI, addrJ) == -1 + } + return valz[i].ConsensusPower(r) > valz[j].ConsensusPower(r) +} + +func (valz ValidatorsByVotingPower) Swap(i, j int) { + valz[i], valz[j] = valz[j], valz[i] +} + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (v Validators) UnpackInterfaces(c gogoprotoany.AnyUnpacker) error { + for i := range v.Validators { + if err := v.Validators[i].UnpackInterfaces(c); err != nil { + return err + } + } + return nil +} + +// return the redelegation +func MustMarshalValidator(cdc codec.BinaryCodec, validator *Validator) []byte { + return cdc.MustMarshal(validator) +} + +// unmarshal a redelegation from a store value +func MustUnmarshalValidator(cdc codec.BinaryCodec, value []byte) Validator { + validator, err := UnmarshalValidator(cdc, value) + if err != nil { + panic(err) + } + + return validator +} + +// unmarshal a redelegation from a store value +func UnmarshalValidator(cdc codec.BinaryCodec, value []byte) (v Validator, err error) { + err = cdc.Unmarshal(value, &v) + return v, err +} + +// IsBonded checks if the validator status equals Bonded +func (v Validator) IsBonded() bool { + return v.GetStatus() == sdk.Bonded +} + +// IsUnbonded checks if the validator status equals Unbonded +func (v Validator) IsUnbonded() bool { + return v.GetStatus() == sdk.Unbonded +} + +// IsUnbonding checks if the validator status equals Unbonding +func (v Validator) IsUnbonding() bool { + return v.GetStatus() == sdk.Unbonding +} + +// constant used in flags to indicate that description field should not be updated +const DoNotModifyDesc = "[do-not-modify]" + +func NewDescription(moniker, identity, website, securityContact, details string) Description { + return Description{ + Moniker: moniker, + Identity: identity, + Website: website, + SecurityContact: securityContact, + Details: details, + } +} + +// UpdateDescription updates the fields of a given description. An error is +// returned if the resulting description contains an invalid length. +func (d Description) UpdateDescription(d2 Description) (Description, error) { + if d2.Moniker == DoNotModifyDesc { + d2.Moniker = d.Moniker + } + + if d2.Identity == DoNotModifyDesc { + d2.Identity = d.Identity + } + + if d2.Website == DoNotModifyDesc { + d2.Website = d.Website + } + + if d2.SecurityContact == DoNotModifyDesc { + d2.SecurityContact = d.SecurityContact + } + + if d2.Details == DoNotModifyDesc { + d2.Details = d.Details + } + + return NewDescription( + d2.Moniker, + d2.Identity, + d2.Website, + d2.SecurityContact, + d2.Details, + ).EnsureLength() +} + +// EnsureLength ensures the length of a validator's description. +func (d Description) EnsureLength() (Description, error) { + if len(d.Moniker) > MaxMonikerLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid moniker length; got: %d, max: %d", len(d.Moniker), MaxMonikerLength) + } + + if len(d.Identity) > MaxIdentityLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid identity length; got: %d, max: %d", len(d.Identity), MaxIdentityLength) + } + + if len(d.Website) > MaxWebsiteLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid website length; got: %d, max: %d", len(d.Website), MaxWebsiteLength) + } + + if len(d.SecurityContact) > MaxSecurityContactLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid security contact length; got: %d, max: %d", len(d.SecurityContact), MaxSecurityContactLength) + } + + if len(d.Details) > MaxDetailsLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid details length; got: %d, max: %d", len(d.Details), MaxDetailsLength) + } + + return d, nil +} + +// ModuleValidatorUpdate returns a appmodule.ValidatorUpdate from a staking validator type +// with the full validator power. +// It replaces the previous ABCIValidatorUpdate function. +func (v Validator) ModuleValidatorUpdate(r math.Int) appmodule.ValidatorUpdate { + consPk, err := v.ConsPubKey() + if err != nil { + panic(err) + } + + return appmodule.ValidatorUpdate{ + PubKey: consPk.Bytes(), + PubKeyType: consPk.Type(), + Power: v.ConsensusPower(r), + } +} + +// ModuleValidatorUpdateZero returns a appmodule.ValidatorUpdate from a staking validator type +// with zero power used for validator updates. +// It replaces the previous ABCIValidatorUpdateZero function. +func (v Validator) ModuleValidatorUpdateZero() appmodule.ValidatorUpdate { + consPk, err := v.ConsPubKey() + if err != nil { + panic(err) + } + + return appmodule.ValidatorUpdate{ + PubKey: consPk.Bytes(), + PubKeyType: consPk.Type(), + Power: 0, + } +} + +// SetInitialCommission attempts to set a validator's initial commission. An +// error is returned if the commission is invalid. +func (v Validator) SetInitialCommission(commission Commission) (Validator, error) { + if err := commission.Validate(); err != nil { + return v, err + } + + v.Commission = commission + + return v, nil +} + +// In some situations, the exchange rate becomes invalid, e.g. if +// Validator loses all tokens due to slashing. In this case, +// make all future delegations invalid. +func (v Validator) InvalidExRate() bool { + return v.Tokens.IsZero() && v.DelegatorShares.IsPositive() +} + +// calculate the token worth of provided shares +func (v Validator) TokensFromShares(shares math.LegacyDec) math.LegacyDec { + return (shares.MulInt(v.Tokens)).Quo(v.DelegatorShares) +} + +// calculate the token worth of provided shares, truncated +func (v Validator) TokensFromSharesTruncated(shares math.LegacyDec) math.LegacyDec { + return (shares.MulInt(v.Tokens)).QuoTruncate(v.DelegatorShares) +} + +// TokensFromSharesRoundUp returns the token worth of provided shares, rounded +// up. +func (v Validator) TokensFromSharesRoundUp(shares math.LegacyDec) math.LegacyDec { + return (shares.MulInt(v.Tokens)).QuoRoundUp(v.DelegatorShares) +} + +// SharesFromTokens returns the shares of a delegation given a bond amount. It +// returns an error if the validator has no tokens. +func (v Validator) SharesFromTokens(amt math.Int) (math.LegacyDec, error) { + if v.Tokens.IsZero() { + return math.LegacyZeroDec(), ErrInsufficientShares + } + + return v.GetDelegatorShares().MulInt(amt).QuoInt(v.GetTokens()), nil +} + +// SharesFromTokensTruncated returns the truncated shares of a delegation given +// a bond amount. It returns an error if the validator has no tokens. +func (v Validator) SharesFromTokensTruncated(amt math.Int) (math.LegacyDec, error) { + if v.Tokens.IsZero() { + return math.LegacyZeroDec(), ErrInsufficientShares + } + + return v.GetDelegatorShares().MulInt(amt).QuoTruncate(math.LegacyNewDecFromInt(v.GetTokens())), nil +} + +// get the bonded tokens which the validator holds +func (v Validator) BondedTokens() math.Int { + if v.IsBonded() { + return v.Tokens + } + + return math.ZeroInt() +} + +// ConsensusPower gets the consensus-engine power. Aa reduction of 10^6 from +// validator tokens is applied +func (v Validator) ConsensusPower(r math.Int) int64 { + if v.IsBonded() { + return v.PotentialConsensusPower(r) + } + + return 0 +} + +// PotentialConsensusPower returns the potential consensus-engine power. +func (v Validator) PotentialConsensusPower(r math.Int) int64 { + return sdk.TokensToConsensusPower(v.Tokens, r) +} + +// UpdateStatus updates the location of the shares within a validator +// to reflect the new status +func (v Validator) UpdateStatus(newStatus BondStatus) Validator { + v.Status = newStatus + return v +} + +// AddTokensFromDel adds tokens to a validator +func (v Validator) AddTokensFromDel(amount math.Int) (Validator, math.LegacyDec) { + // calculate the shares to issue + var issuedShares math.LegacyDec + if v.DelegatorShares.IsZero() { + // the first delegation to a validator sets the exchange rate to one + issuedShares = math.LegacyNewDecFromInt(amount) + } else { + shares, err := v.SharesFromTokens(amount) + if err != nil { + panic(err) + } + + issuedShares = shares + } + + v.Tokens = v.Tokens.Add(amount) + v.DelegatorShares = v.DelegatorShares.Add(issuedShares) + + return v, issuedShares +} + +// RemoveTokens removes tokens from a validator +func (v Validator) RemoveTokens(tokens math.Int) Validator { + if tokens.IsNegative() { + panic(fmt.Sprintf("should not happen: trying to remove negative tokens %v", tokens)) + } + + if v.Tokens.LT(tokens) { + panic(fmt.Sprintf("should not happen: only have %v tokens, trying to remove %v", v.Tokens, tokens)) + } + + v.Tokens = v.Tokens.Sub(tokens) + + return v +} + +// RemoveDelShares removes delegator shares from a validator. +// NOTE: because token fractions are left in the valiadator, +// +// the exchange rate of future shares of this validator can increase. +func (v Validator) RemoveDelShares(delShares math.LegacyDec) (Validator, math.Int) { + remainingShares := v.DelegatorShares.Sub(delShares) + + var issuedTokens math.Int + if remainingShares.IsZero() { + // last delegation share gets any trimmings + issuedTokens = v.Tokens + v.Tokens = math.ZeroInt() + } else { + // leave excess tokens in the validator + // however fully use all the delegator shares + issuedTokens = v.TokensFromShares(delShares).TruncateInt() + v.Tokens = v.Tokens.Sub(issuedTokens) + + if v.Tokens.IsNegative() { + panic("attempting to remove more tokens than available in validator") + } + } + + v.DelegatorShares = remainingShares + + return v, issuedTokens +} + +// MinEqual defines a more minimum set of equality conditions when comparing two +// validators. +func (v *Validator) MinEqual(other *Validator) bool { + return v.OperatorAddress == other.OperatorAddress && + v.Status == other.Status && + v.Tokens.Equal(other.Tokens) && + v.DelegatorShares.Equal(other.DelegatorShares) && + v.Description.Equal(other.Description) && + v.Commission.Equal(other.Commission) && + v.Jailed == other.Jailed && + v.MinSelfDelegation.Equal(other.MinSelfDelegation) && + v.ConsensusPubkey.Equal(other.ConsensusPubkey) +} + +// Equal checks if the receiver equals the parameter +func (v *Validator) Equal(v2 *Validator) bool { + return v.MinEqual(v2) && + v.UnbondingHeight == v2.UnbondingHeight && + v.UnbondingTime.Equal(v2.UnbondingTime) +} + +func (v Validator) IsJailed() bool { return v.Jailed } +func (v Validator) GetMoniker() string { return v.Description.Moniker } +func (v Validator) GetStatus() sdk.BondStatus { return sdk.BondStatus(v.Status) } +func (v Validator) GetOperator() string { + return v.OperatorAddress +} + +// ConsPubKey returns the validator PubKey as a cryptotypes.PubKey. +func (v Validator) ConsPubKey() (cryptotypes.PubKey, error) { + pk, ok := v.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) + if !ok { + return nil, errors.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", pk) + } + + return pk, nil +} + +// GetConsAddr extracts Consensus key address +func (v Validator) GetConsAddr() ([]byte, error) { + pk, ok := v.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) + if !ok { + return nil, errors.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", pk) + } + + return pk.Address().Bytes(), nil +} + +func (v Validator) GetTokens() math.Int { return v.Tokens } +func (v Validator) GetBondedTokens() math.Int { return v.BondedTokens() } +func (v Validator) GetConsensusPower(r math.Int) int64 { + return v.ConsensusPower(r) +} +func (v Validator) GetCommission() math.LegacyDec { return v.Commission.Rate } +func (v Validator) GetMinSelfDelegation() math.Int { return v.MinSelfDelegation } +func (v Validator) GetDelegatorShares() math.LegacyDec { return v.DelegatorShares } + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (v Validator) UnpackInterfaces(unpacker gogoprotoany.AnyUnpacker) error { + var pk cryptotypes.PubKey + return unpacker.UnpackAny(v.ConsensusPubkey, &pk) +} diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index a134a43de..bef21da80 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -6,25 +6,21 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// ValidatorGovInfo used for tallying -type ValidatorGovInfo struct { - Address sdk.ValAddress // address of the validator operator - BondedTokens math.Int // Power of a Validator - DelegatorShares math.LegacyDec // Total outstanding delegator shares - DelegatorDeductions math.LegacyDec // Delegator deductions from validator's delegators voting independently - Vote WeightedVoteOptions // Vote of the validator +// GovernorGovInfo used for tallying +type GovernorGovInfo struct { + Address GovernorAddress // address of the governor + Delegations []ValidatorDelegation // Delegations of the governor + DelegationsDeductions []ValidatorDelegation // Delegator deductions from validator's delegators voting independently + Vote WeightedVoteOptions // Vote of the validator } -// NewValidatorGovInfo creates a ValidatorGovInfo instance -func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens math.Int, delegatorShares, - delegatorDeductions sdk.Dec, options WeightedVoteOptions, -) ValidatorGovInfo { - return ValidatorGovInfo{ - Address: address, - BondedTokens: bondedTokens, - DelegatorShares: delegatorShares, - DelegatorDeductions: delegatorDeductions, - Vote: options, +// NewGovernorGovInfo creates a GovernorGovInfo instance +func NewGovernorGovInfo(address GovernorAddress, delegations []ValidatorDelegation, deductions []ValidatorDelegation, options WeightedVoteOptions) GovernorGovInfo { + return GovernorGovInfo{ + Address: address, + Delegations: delegations, + DelegationsDeductions: deductions, + Vote: options, } } From d4a8c03b5f31d10d8bffa65e477252b82837b3b7 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Fri, 13 Sep 2024 19:16:32 +0200 Subject: [PATCH 04/43] wip --- proto/atomone/gov/v1/gov.proto | 18 +- x/gov/keeper/tally.go | 2 +- x/gov/types/v1/address.go | 11 + x/gov/types/v1/exported.go | 2 +- x/gov/types/v1/gov.pb.go | 529 ++++++++++++++++++++++++--------- x/gov/types/v1/governor.go | 334 ++++----------------- x/gov/types/v1/tally.go | 10 +- 7 files changed, 477 insertions(+), 429 deletions(-) create mode 100644 x/gov/types/v1/address.go diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 017d749cc..5e4bfc549 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -236,7 +236,7 @@ message Governor { // description defines the description terms for the governor. GovernorDescription description = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // delegations define the validator delegations for the governor. - repeated ValidatorDelegation delegations = 4; + repeated ValidatorGovDelegation delegatedShares = 4; } // GovernorStatus is the status of a governor. @@ -267,9 +267,9 @@ message GovernorDescription { string details = 5; } -// ValidatorDelegation holds the number of shares from the specified validator +// ValidatorGovDelegation holds the number of shares from the specified validator // a governor can use to vote on proposals. -message ValidatorDelegation { +message ValidatorGovDelegation { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -281,4 +281,16 @@ message ValidatorDelegation { (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; +} + +// GovernanceDelegation defines a delegation of governance voting power from a +// delegator to a governor. +message GovernanceDelegation { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string governor_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. + string percentage = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; } \ No newline at end of file diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 3d89a5587..d65634c98 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -35,7 +35,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, currGovernors[governor.GetAddress().String()] = v1.NewGovernorGovInfo( governor.GetAddress(), governor.GetDelegations(), - []v1.ValidatorDelegation{}, + make([]v1.ValidatorGovDelegation, 0), v1.WeightedVoteOptions{}, ) return false diff --git a/x/gov/types/v1/address.go b/x/gov/types/v1/address.go new file mode 100644 index 000000000..ca1af36f9 --- /dev/null +++ b/x/gov/types/v1/address.go @@ -0,0 +1,11 @@ +package v1 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + _ sdk.Address = GovernorAddress{} +) + +type GovernorAddress []byte diff --git a/x/gov/types/v1/exported.go b/x/gov/types/v1/exported.go index f5a738edc..554dedea3 100644 --- a/x/gov/types/v1/exported.go +++ b/x/gov/types/v1/exported.go @@ -9,6 +9,6 @@ type GovernorI interface { IsInactive() bool // check if has status inactive GetAddress() GovernorAddress // governor address to receive/return governors delegations GetDescription() GovernorDescription // description of the governor - GetDelegations() []ValidatorDelegation // get all the x/staking shares delegated to the governor + GetDelegations() []*ValidatorGovDelegation // get all the x/staking shares delegated to the governor GetDelegationShares(valAddr sdk.ValAddress) sdk.Dec // get the x/staking shares delegated to the governor for a specific validator } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index b1a72a199..553a01d58 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -896,7 +896,7 @@ type Governor struct { // description defines the description terms for the governor. Description GovernorDescription `protobuf:"bytes,3,opt,name=description,proto3" json:"description"` // delegations define the validator delegations for the governor. - Delegations []*ValidatorDelegation `protobuf:"bytes,4,rep,name=delegations,proto3" json:"delegations,omitempty"` + DelegatedShares []*ValidatorGovDelegation `protobuf:"bytes,4,rep,name=delegatedShares,proto3" json:"delegatedShares,omitempty"` } func (m *Governor) Reset() { *m = Governor{} } @@ -1014,27 +1014,27 @@ func (m *GovernorDescription) GetDetails() string { return "" } -// ValidatorDelegation holds the number of shares from the specified validator +// ValidatorGovDelegation holds the number of shares from the specified validator // a governor can use to vote on proposals. -type ValidatorDelegation struct { +type ValidatorGovDelegation struct { GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // shares define the delegation shares available from this validator. Shares cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"shares"` } -func (m *ValidatorDelegation) Reset() { *m = ValidatorDelegation{} } -func (m *ValidatorDelegation) String() string { return proto.CompactTextString(m) } -func (*ValidatorDelegation) ProtoMessage() {} -func (*ValidatorDelegation) Descriptor() ([]byte, []int) { +func (m *ValidatorGovDelegation) Reset() { *m = ValidatorGovDelegation{} } +func (m *ValidatorGovDelegation) String() string { return proto.CompactTextString(m) } +func (*ValidatorGovDelegation) ProtoMessage() {} +func (*ValidatorGovDelegation) Descriptor() ([]byte, []int) { return fileDescriptor_ecf0f9950ff6986c, []int{11} } -func (m *ValidatorDelegation) XXX_Unmarshal(b []byte) error { +func (m *ValidatorGovDelegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ValidatorDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ValidatorGovDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ValidatorDelegation.Marshal(b, m, deterministic) + return xxx_messageInfo_ValidatorGovDelegation.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1044,17 +1044,59 @@ func (m *ValidatorDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *ValidatorDelegation) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorDelegation.Merge(m, src) +func (m *ValidatorGovDelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorGovDelegation.Merge(m, src) } -func (m *ValidatorDelegation) XXX_Size() int { +func (m *ValidatorGovDelegation) XXX_Size() int { return m.Size() } -func (m *ValidatorDelegation) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorDelegation.DiscardUnknown(m) +func (m *ValidatorGovDelegation) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorGovDelegation.DiscardUnknown(m) } -var xxx_messageInfo_ValidatorDelegation proto.InternalMessageInfo +var xxx_messageInfo_ValidatorGovDelegation proto.InternalMessageInfo + +// GovernanceDelegation defines a delegation of governance voting power from a +// delegator to a governor. +type GovernanceDelegation struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + GovernorAddress string `protobuf:"bytes,2,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` + // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. + Percentage string `protobuf:"bytes,3,opt,name=percentage,proto3" json:"percentage,omitempty"` +} + +func (m *GovernanceDelegation) Reset() { *m = GovernanceDelegation{} } +func (m *GovernanceDelegation) String() string { return proto.CompactTextString(m) } +func (*GovernanceDelegation) ProtoMessage() {} +func (*GovernanceDelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_ecf0f9950ff6986c, []int{12} +} +func (m *GovernanceDelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GovernanceDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GovernanceDelegation.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 *GovernanceDelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_GovernanceDelegation.Merge(m, src) +} +func (m *GovernanceDelegation) XXX_Size() int { + return m.Size() +} +func (m *GovernanceDelegation) XXX_DiscardUnknown() { + xxx_messageInfo_GovernanceDelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_GovernanceDelegation proto.InternalMessageInfo func init() { proto.RegisterEnum("atomone.gov.v1.VoteOption", VoteOption_name, VoteOption_value) @@ -1071,116 +1113,120 @@ func init() { proto.RegisterType((*Params)(nil), "atomone.gov.v1.Params") proto.RegisterType((*Governor)(nil), "atomone.gov.v1.Governor") proto.RegisterType((*GovernorDescription)(nil), "atomone.gov.v1.GovernorDescription") - proto.RegisterType((*ValidatorDelegation)(nil), "atomone.gov.v1.ValidatorDelegation") + proto.RegisterType((*ValidatorGovDelegation)(nil), "atomone.gov.v1.ValidatorGovDelegation") + proto.RegisterType((*GovernanceDelegation)(nil), "atomone.gov.v1.GovernanceDelegation") } func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1634 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4d, 0x6f, 0x1b, 0xc7, - 0x19, 0xd6, 0x52, 0x14, 0x45, 0xbd, 0x94, 0xa8, 0xf5, 0xd8, 0x75, 0xd6, 0x54, 0x4c, 0x2a, 0x6c, - 0x10, 0x28, 0x6a, 0x44, 0x46, 0x4e, 0x9b, 0x43, 0x9a, 0x0b, 0x25, 0x32, 0xce, 0x1a, 0xae, 0xc8, - 0x2e, 0x69, 0x1a, 0xe9, 0x65, 0x31, 0xe4, 0x8e, 0xc9, 0x41, 0xb8, 0x3b, 0xec, 0xee, 0x90, 0x36, - 0xff, 0x41, 0xea, 0x53, 0x8e, 0x45, 0x51, 0x03, 0x06, 0x7a, 0x29, 0x7a, 0xca, 0xc1, 0x40, 0x7f, - 0x40, 0x2f, 0x39, 0xb5, 0x81, 0x2f, 0xfd, 0x38, 0xa8, 0x85, 0x7d, 0x68, 0x90, 0x3f, 0xd1, 0x62, - 0x3e, 0x96, 0xa4, 0x28, 0x1a, 0x92, 0x83, 0x5c, 0xa4, 0x9d, 0x77, 0x9e, 0xe7, 0x79, 0x67, 0xe6, - 0xfd, 0x98, 0x21, 0x58, 0x98, 0x33, 0x9f, 0x05, 0xa4, 0xdc, 0x63, 0xe3, 0xf2, 0xf8, 0x50, 0xfc, - 0x2b, 0x0d, 0x43, 0xc6, 0x19, 0xca, 0xea, 0x99, 0x92, 0x30, 0x8d, 0x0f, 0x73, 0xf9, 0x2e, 0x8b, - 0x7c, 0x16, 0x95, 0x3b, 0x38, 0x22, 0xe5, 0xf1, 0x61, 0x87, 0x70, 0x7c, 0x58, 0xee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 0xfa, 0x18, 0x52, 0xd8, 0x67, 0xa3, 0x80, 0x5b, 0xab, 0xbb, 0xab, 0x7b, - 0x99, 0x5b, 0x37, 0x4a, 0x9a, 0x21, 0xe2, 0x54, 0xd2, 0x71, 0x2a, 0x1d, 0x33, 0x1a, 0x1c, 0x6d, - 0x7c, 0x7d, 0x5a, 0x58, 0xf9, 0xe3, 0x7f, 0xbf, 0xda, 0x37, 0x1c, 0xcd, 0x29, 0xfe, 0x65, 0x0d, - 0xd2, 0x0d, 0xbd, 0x08, 0x94, 0x85, 0xc4, 0x74, 0x69, 0x09, 0xea, 0xa1, 0xf7, 0x21, 0xed, 0x93, - 0x28, 0xc2, 0x3d, 0x12, 0x59, 0x09, 0x29, 0x7e, 0xad, 0xa4, 0x42, 0x52, 0x8a, 0x43, 0x52, 0xaa, - 0x04, 0x13, 0x67, 0x8a, 0x42, 0x1f, 0x42, 0x2a, 0xe2, 0x98, 0x8f, 0x22, 0x6b, 0x55, 0x9e, 0x66, - 0x7e, 0xf1, 0x34, 0x63, 0x5f, 0x4d, 0x89, 0x72, 0x34, 0x1a, 0xd9, 0x80, 0x1e, 0xd0, 0x00, 0x0f, - 0x5c, 0x8e, 0x07, 0x83, 0x89, 0x1b, 0x92, 0x68, 0x34, 0xe0, 0x56, 0x72, 0xd7, 0xd8, 0xcb, 0xdc, - 0xda, 0x59, 0xd4, 0x68, 0x09, 0x8c, 0x23, 0x21, 0x8e, 0x29, 0x69, 0x73, 0x16, 0x54, 0x81, 0x4c, - 0x34, 0xea, 0xf8, 0x94, 0xbb, 0x22, 0xd3, 0xac, 0x35, 0xa9, 0x91, 0x3b, 0xb7, 0xee, 0x56, 0x9c, - 0x86, 0x47, 0xc9, 0x2f, 0xff, 0x5d, 0x30, 0x1c, 0x50, 0x24, 0x61, 0x46, 0x77, 0xc0, 0xd4, 0xe7, - 0xeb, 0x92, 0xc0, 0x53, 0x3a, 0xa9, 0x4b, 0xea, 0x64, 0x35, 0xb3, 0x16, 0x78, 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b3, 0x53, - 0xf2, 0xe2, 0xfa, 0xe0, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x59, 0x74, 0x69, 0xa9, 0x0f, - 0x00, 0x00, + // 1690 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x6f, 0x1b, 0xc7, + 0x15, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x4a, 0xd4, 0x7a, 0xa2, 0x3a, 0x6b, 0x2a, 0x26, 0x15, 0x36, + 0x30, 0x14, 0x35, 0x22, 0x23, 0xa7, 0xcd, 0x21, 0xcd, 0x85, 0x12, 0x37, 0xca, 0x1a, 0xae, 0xc8, + 0x2e, 0x69, 0x19, 0xe9, 0x65, 0x31, 0xe4, 0x8e, 0xc9, 0x41, 0xb8, 0x3b, 0xec, 0xee, 0x90, 0x36, + 0xaf, 0x3d, 0xa5, 0x3e, 0xe5, 0x58, 0x14, 0x35, 0x60, 0xa0, 0x97, 0x1e, 0x73, 0x70, 0xd1, 0x0f, + 0xd0, 0x4b, 0x4e, 0x6d, 0xe0, 0x4b, 0xff, 0xa0, 0x70, 0x0b, 0xfb, 0xd0, 0x20, 0x9f, 0xa2, 0x98, + 0x9d, 0x59, 0x92, 0x5a, 0xd1, 0x90, 0x14, 0xf4, 0x62, 0xef, 0xbc, 0xf9, 0xfd, 0xde, 0xbc, 0xff, + 0x33, 0x14, 0x18, 0x98, 0x33, 0x8f, 0xf9, 0xa4, 0xda, 0x63, 0xe3, 0xea, 0xf8, 0x40, 0xfc, 0x57, + 0x19, 0x06, 0x8c, 0x33, 0x94, 0x57, 0x3b, 0x15, 0x21, 0x1a, 0x1f, 0x14, 0x8a, 0x5d, 0x16, 0x7a, + 0x2c, 0xac, 0x76, 0x70, 0x48, 0xaa, 0xe3, 0x83, 0x0e, 0xe1, 0xf8, 0xa0, 0xda, 0x65, 0xd4, 0x97, + 0xf8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, 0xd2, 0x65, + 0xc1, 0x06, 0x67, 0x1c, 0x0f, 0x1c, 0x25, 0x37, 0x56, 0xaf, 0x90, 0xa5, 0xf5, 0x88, 0x1a, 0x97, + 0xd0, 0x5d, 0xb8, 0x36, 0x66, 0x9c, 0xfa, 0x3d, 0x27, 0xe4, 0x38, 0x50, 0xfe, 0x65, 0x2f, 0x69, + 0xd7, 0xa6, 0xa4, 0xb6, 0x04, 0x33, 0x32, 0xec, 0x53, 0x50, 0xa2, 0x99, 0x8f, 0x6b, 0x97, 0xd4, + 0xb5, 0x21, 0x89, 0xb1, 0x8b, 0x05, 0x51, 0x26, 0x1c, 0xbb, 0x98, 0x63, 0x03, 0x44, 0xe1, 0xda, + 0xd3, 0x35, 0xda, 0x82, 0x15, 0x4e, 0xf9, 0x80, 0x18, 0xb9, 0x68, 0x43, 0x2e, 0x90, 0x01, 0xab, + 0xe1, 0xc8, 0xf3, 0x70, 0x30, 0x31, 0xd6, 0x23, 0x79, 0xbc, 0x44, 0x3f, 0x86, 0xac, 0xec, 0x09, + 0x12, 0x18, 0x1b, 0x17, 0x34, 0xc1, 0x14, 0x59, 0xfe, 0x9b, 0x06, 0xb9, 0xf9, 0x1a, 0xf8, 0x11, + 0xac, 0x4d, 0x48, 0xe8, 0x74, 0xa3, 0xb6, 0xd0, 0xce, 0xf5, 0xa8, 0xe5, 0x73, 0x3b, 0x3b, 0x21, + 0xe1, 0x91, 0xd8, 0x47, 0x1f, 0xc0, 0x06, 0xee, 0x84, 0x1c, 0x53, 0x5f, 0x11, 0x52, 0x0b, 0x09, + 0xeb, 0x0a, 0x24, 0x49, 0xef, 0x42, 0xd6, 0x67, 0x0a, 0xbf, 0xbc, 0x10, 0xbf, 0xea, 0x33, 0x09, + 0xfd, 0x29, 0x20, 0x9f, 0x39, 0x0f, 0x29, 0xef, 0x3b, 0x63, 0xc2, 0x63, 0x52, 0x7a, 0x21, 0x69, + 0xd3, 0x67, 0xf7, 0x29, 0xef, 0x9f, 0x12, 0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x45, 0xef, 0xc1, + 0x1a, 0xef, 0x07, 0x24, 0xec, 0xb3, 0x81, 0xfb, 0x9a, 0x1b, 0x69, 0x06, 0x40, 0x3f, 0x81, 0x7c, + 0x54, 0x86, 0x33, 0xca, 0xf2, 0x42, 0xca, 0x86, 0x40, 0xb5, 0x63, 0x50, 0xf9, 0xaf, 0x69, 0xc8, + 0x28, 0xbb, 0xcc, 0x2b, 0xe6, 0x71, 0x6e, 0xa0, 0xcd, 0xe7, 0xec, 0x67, 0xdf, 0x2f, 0x67, 0xe9, + 0xc5, 0x39, 0x39, 0x9f, 0x83, 0xe5, 0xef, 0x91, 0x83, 0xb9, 0x98, 0xa7, 0x2f, 0x1f, 0xf3, 0x95, + 0xab, 0xc7, 0x3c, 0x73, 0x89, 0x98, 0x23, 0x0b, 0x6e, 0x88, 0x40, 0x53, 0x9f, 0x72, 0x3a, 0xbb, + 0x41, 0x9c, 0xc8, 0x7c, 0x63, 0x75, 0xa1, 0x86, 0xeb, 0x1e, 0xf5, 0x2d, 0x89, 0x57, 0xe1, 0xb1, + 0x05, 0x1a, 0xed, 0x82, 0xde, 0x19, 0x05, 0xbe, 0x23, 0x7a, 0xdf, 0x51, 0x1e, 0x8a, 0xf9, 0x9a, + 0xb5, 0xf3, 0x42, 0x2e, 0x5a, 0xfc, 0xe7, 0xd2, 0xb3, 0x1a, 0xdc, 0x8c, 0x90, 0xd3, 0x69, 0x33, + 0x4d, 0x50, 0x40, 0x04, 0xdb, 0xc8, 0x47, 0xb4, 0x82, 0x00, 0xc5, 0xb7, 0x79, 0x9c, 0x09, 0x89, + 0x40, 0xef, 0x40, 0x7e, 0x76, 0x98, 0x70, 0xc9, 0xd8, 0x8c, 0x38, 0xeb, 0xf1, 0x51, 0x62, 0xbe, + 0x95, 0xff, 0x98, 0x82, 0xec, 0x31, 0x1b, 0x93, 0xc0, 0x67, 0x01, 0x3a, 0x02, 0xbd, 0xa7, 0xbe, + 0x1d, 0x2c, 0xc7, 0x95, 0xaa, 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 0x7f, 0x5e, 0x16, 0xb5, 0x2f, 0x5f, 0x15, 0x97, 0xbe, + 0x79, 0x55, 0x5c, 0xfa, 0xfb, 0xab, 0xe2, 0xd2, 0x2f, 0xf6, 0x7b, 0x94, 0xf7, 0x47, 0x9d, 0x4a, + 0x97, 0x79, 0x55, 0x35, 0xf9, 0xf6, 0xfb, 0xa3, 0x4e, 0xfc, 0x5d, 0x7d, 0x14, 0xfd, 0xdd, 0x81, + 0x4f, 0x86, 0x24, 0xac, 0x8e, 0x0f, 0x3a, 0x99, 0xe8, 0x96, 0xfe, 0xe0, 0x7f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x22, 0x3c, 0x5b, 0xd8, 0x96, 0x10, 0x00, 0x00, } func (this *GovernorDescription) Equal(that interface{}) bool { @@ -1810,10 +1856,10 @@ func (m *Governor) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Delegations) > 0 { - for iNdEx := len(m.Delegations) - 1; iNdEx >= 0; iNdEx-- { + if len(m.DelegatedShares) > 0 { + for iNdEx := len(m.DelegatedShares) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Delegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DelegatedShares[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1907,7 +1953,7 @@ func (m *GovernorDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ValidatorDelegation) Marshal() (dAtA []byte, err error) { +func (m *ValidatorGovDelegation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1917,12 +1963,12 @@ func (m *ValidatorDelegation) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ValidatorDelegation) MarshalTo(dAtA []byte) (int, error) { +func (m *ValidatorGovDelegation) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ValidatorDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ValidatorGovDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1954,6 +2000,50 @@ func (m *ValidatorDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GovernanceDelegation) 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 *GovernanceDelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GovernanceDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Percentage) > 0 { + i -= len(m.Percentage) + copy(dAtA[i:], m.Percentage) + i = encodeVarintGov(dAtA, i, uint64(len(m.Percentage))) + i-- + dAtA[i] = 0x1a + } + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintGov(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintGov(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintGov(dAtA []byte, offset int, v uint64) int { offset -= sovGov(v) base := offset @@ -2233,8 +2323,8 @@ func (m *Governor) Size() (n int) { } l = m.Description.Size() n += 1 + l + sovGov(uint64(l)) - if len(m.Delegations) > 0 { - for _, e := range m.Delegations { + if len(m.DelegatedShares) > 0 { + for _, e := range m.DelegatedShares { l = e.Size() n += 1 + l + sovGov(uint64(l)) } @@ -2271,7 +2361,7 @@ func (m *GovernorDescription) Size() (n int) { return n } -func (m *ValidatorDelegation) Size() (n int) { +func (m *ValidatorGovDelegation) Size() (n int) { if m == nil { return 0 } @@ -2290,6 +2380,27 @@ func (m *ValidatorDelegation) Size() (n int) { return n } +func (m *GovernanceDelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Percentage) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + func sovGov(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4152,7 +4263,7 @@ func (m *Governor) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Delegations", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatedShares", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4179,8 +4290,8 @@ func (m *Governor) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Delegations = append(m.Delegations, &ValidatorDelegation{}) - if err := m.Delegations[len(m.Delegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.DelegatedShares = append(m.DelegatedShares, &ValidatorGovDelegation{}) + if err := m.DelegatedShares[len(m.DelegatedShares)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4415,7 +4526,7 @@ func (m *GovernorDescription) Unmarshal(dAtA []byte) error { } return nil } -func (m *ValidatorDelegation) Unmarshal(dAtA []byte) error { +func (m *ValidatorGovDelegation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4438,10 +4549,10 @@ func (m *ValidatorDelegation) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ValidatorDelegation: wiretype end group for non-group") + return fmt.Errorf("proto: ValidatorGovDelegation: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ValidatorGovDelegation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4563,6 +4674,152 @@ func (m *ValidatorDelegation) Unmarshal(dAtA []byte) error { } return nil } +func (m *GovernanceDelegation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GovernanceDelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GovernanceDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Percentage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Percentage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGov(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 23db45a45..5b1e445ca 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -2,19 +2,14 @@ package v1 import ( "bytes" - "fmt" "sort" "strings" - gogoprotoany "github.com/cosmos/gogoproto/types/any" - "cosmossdk.io/core/address" - "cosmossdk.io/core/appmodule" "cosmossdk.io/errors" "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -40,7 +35,7 @@ func NewGovernor(address string, description GovernorDescription) (Governor, err return Governor{ GovernorAddress: address, Description: description, - Delegations: make([]*ValidatorDelegation, 0), + DelegatedShares: make([]*ValidatorGovDelegation, 0), Status: Active, }, nil } @@ -71,11 +66,11 @@ func (g Governors) Len() int { // Implements sort interface func (g Governors) Less(i, j int) bool { - gi, err := g.GovernorCodec.StringToBytes(g.Governors[i].GetAddress()) + gi, err := g.GovernorCodec.StringToBytes(g.Governors[i].GetAddress().String()) if err != nil { panic(err) } - gj, err := g.GovernorCodec.StringToBytes(g.Governors[j].GetAddress()) + gj, err := g.GovernorCodec.StringToBytes(g.Governors[j].GetAddress().String()) if err != nil { panic(err) } @@ -90,13 +85,13 @@ func (g Governors) Swap(i, j int) { // GovernorsByVotingPower implements sort.Interface for []Governor based on // the VotingPower and Address fields. -// The validators are sorted first by their voting power (descending). Secondary index - Address (ascending). -// Copied from tendermint/types/validator_set.go +// The vovernors are sorted first by their voting power (descending). Secondary index - Address (ascending). +// Copied from tendermint/types/vovernor_set.go type GovernorsByVotingPower []Governor -func (valz ValidatorsByVotingPower) Len() int { return len(valz) } +func (govs GovernorsByVotingPower) Len() int { return len(govs) } -func (valz ValidatorsByVotingPower) Less(i, j int, r math.Int) bool { +func (govs GovernorsByVotingPower) Less(i, j int, r math.Int) bool { if valz[i].ConsensusPower(r) == valz[j].ConsensusPower(r) { addrI, errI := valz[i].GetConsAddr() addrJ, errJ := valz[j].GetConsAddr() @@ -109,61 +104,44 @@ func (valz ValidatorsByVotingPower) Less(i, j int, r math.Int) bool { return valz[i].ConsensusPower(r) > valz[j].ConsensusPower(r) } -func (valz ValidatorsByVotingPower) Swap(i, j int) { - valz[i], valz[j] = valz[j], valz[i] -} - -// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (v Validators) UnpackInterfaces(c gogoprotoany.AnyUnpacker) error { - for i := range v.Validators { - if err := v.Validators[i].UnpackInterfaces(c); err != nil { - return err - } - } - return nil +func (govs GovernorsByVotingPower) Swap(i, j int) { + govs[i], govs[j] = govs[j], govs[i] } -// return the redelegation -func MustMarshalValidator(cdc codec.BinaryCodec, validator *Validator) []byte { - return cdc.MustMarshal(validator) +func MustMarshalGovernor(cdc codec.BinaryCodec, governor *Governor) []byte { + return cdc.MustMarshal(governor) } -// unmarshal a redelegation from a store value -func MustUnmarshalValidator(cdc codec.BinaryCodec, value []byte) Validator { - validator, err := UnmarshalValidator(cdc, value) +func MustUnmarshalGovernor(cdc codec.BinaryCodec, value []byte) Governor { + governor, err := UnmarshalGovernor(cdc, value) if err != nil { panic(err) } - return validator + return governor } // unmarshal a redelegation from a store value -func UnmarshalValidator(cdc codec.BinaryCodec, value []byte) (v Validator, err error) { - err = cdc.Unmarshal(value, &v) - return v, err -} - -// IsBonded checks if the validator status equals Bonded -func (v Validator) IsBonded() bool { - return v.GetStatus() == sdk.Bonded +func UnmarshalGovernor(cdc codec.BinaryCodec, value []byte) (g Governor, err error) { + err = cdc.Unmarshal(value, &g) + return g, err } -// IsUnbonded checks if the validator status equals Unbonded -func (v Validator) IsUnbonded() bool { - return v.GetStatus() == sdk.Unbonded +// IsActive checks if the governor status equals Active +func (g Governor) IsActive() bool { + return g.GetStatus() == Active } -// IsUnbonding checks if the validator status equals Unbonding -func (v Validator) IsUnbonding() bool { - return v.GetStatus() == sdk.Unbonding +// IsInactive checks if the governor status equals Inactive +func (g Governor) IsInactive() bool { + return g.GetStatus() == Inactive } // constant used in flags to indicate that description field should not be updated const DoNotModifyDesc = "[do-not-modify]" -func NewDescription(moniker, identity, website, securityContact, details string) Description { - return Description{ +func NewGovernorDescription(moniker, identity, website, securityContact, details string) GovernorDescription { + return GovernorDescription{ Moniker: moniker, Identity: identity, Website: website, @@ -174,7 +152,7 @@ func NewDescription(moniker, identity, website, securityContact, details string) // UpdateDescription updates the fields of a given description. An error is // returned if the resulting description contains an invalid length. -func (d Description) UpdateDescription(d2 Description) (Description, error) { +func (d GovernorDescription) UpdateDescription(d2 GovernorDescription) (GovernorDescription, error) { if d2.Moniker == DoNotModifyDesc { d2.Moniker = d.Moniker } @@ -195,7 +173,7 @@ func (d Description) UpdateDescription(d2 Description) (Description, error) { d2.Details = d.Details } - return NewDescription( + return NewGovernorDescription( d2.Moniker, d2.Identity, d2.Website, @@ -204,8 +182,8 @@ func (d Description) UpdateDescription(d2 Description) (Description, error) { ).EnsureLength() } -// EnsureLength ensures the length of a validator's description. -func (d Description) EnsureLength() (Description, error) { +// EnsureLength ensures the length of a vovernor's description. +func (d GovernorDescription) EnsureLength() (GovernorDescription, error) { if len(d.Moniker) > MaxMonikerLength { return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid moniker length; got: %d, max: %d", len(d.Moniker), MaxMonikerLength) } @@ -229,248 +207,38 @@ func (d Description) EnsureLength() (Description, error) { return d, nil } -// ModuleValidatorUpdate returns a appmodule.ValidatorUpdate from a staking validator type -// with the full validator power. -// It replaces the previous ABCIValidatorUpdate function. -func (v Validator) ModuleValidatorUpdate(r math.Int) appmodule.ValidatorUpdate { - consPk, err := v.ConsPubKey() - if err != nil { - panic(err) - } - - return appmodule.ValidatorUpdate{ - PubKey: consPk.Bytes(), - PubKeyType: consPk.Type(), - Power: v.ConsensusPower(r), - } -} - -// ModuleValidatorUpdateZero returns a appmodule.ValidatorUpdate from a staking validator type -// with zero power used for validator updates. -// It replaces the previous ABCIValidatorUpdateZero function. -func (v Validator) ModuleValidatorUpdateZero() appmodule.ValidatorUpdate { - consPk, err := v.ConsPubKey() - if err != nil { - panic(err) - } - - return appmodule.ValidatorUpdate{ - PubKey: consPk.Bytes(), - PubKeyType: consPk.Type(), - Power: 0, - } -} - -// SetInitialCommission attempts to set a validator's initial commission. An -// error is returned if the commission is invalid. -func (v Validator) SetInitialCommission(commission Commission) (Validator, error) { - if err := commission.Validate(); err != nil { - return v, err - } - - v.Commission = commission - - return v, nil -} - -// In some situations, the exchange rate becomes invalid, e.g. if -// Validator loses all tokens due to slashing. In this case, -// make all future delegations invalid. -func (v Validator) InvalidExRate() bool { - return v.Tokens.IsZero() && v.DelegatorShares.IsPositive() -} - -// calculate the token worth of provided shares -func (v Validator) TokensFromShares(shares math.LegacyDec) math.LegacyDec { - return (shares.MulInt(v.Tokens)).Quo(v.DelegatorShares) -} - -// calculate the token worth of provided shares, truncated -func (v Validator) TokensFromSharesTruncated(shares math.LegacyDec) math.LegacyDec { - return (shares.MulInt(v.Tokens)).QuoTruncate(v.DelegatorShares) -} - -// TokensFromSharesRoundUp returns the token worth of provided shares, rounded -// up. -func (v Validator) TokensFromSharesRoundUp(shares math.LegacyDec) math.LegacyDec { - return (shares.MulInt(v.Tokens)).QuoRoundUp(v.DelegatorShares) -} - -// SharesFromTokens returns the shares of a delegation given a bond amount. It -// returns an error if the validator has no tokens. -func (v Validator) SharesFromTokens(amt math.Int) (math.LegacyDec, error) { - if v.Tokens.IsZero() { - return math.LegacyZeroDec(), ErrInsufficientShares - } - - return v.GetDelegatorShares().MulInt(amt).QuoInt(v.GetTokens()), nil -} - -// SharesFromTokensTruncated returns the truncated shares of a delegation given -// a bond amount. It returns an error if the validator has no tokens. -func (v Validator) SharesFromTokensTruncated(amt math.Int) (math.LegacyDec, error) { - if v.Tokens.IsZero() { - return math.LegacyZeroDec(), ErrInsufficientShares - } - - return v.GetDelegatorShares().MulInt(amt).QuoTruncate(math.LegacyNewDecFromInt(v.GetTokens())), nil -} - -// get the bonded tokens which the validator holds -func (v Validator) BondedTokens() math.Int { - if v.IsBonded() { - return v.Tokens - } - - return math.ZeroInt() -} - -// ConsensusPower gets the consensus-engine power. Aa reduction of 10^6 from -// validator tokens is applied -func (v Validator) ConsensusPower(r math.Int) int64 { - if v.IsBonded() { - return v.PotentialConsensusPower(r) - } - - return 0 -} - -// PotentialConsensusPower returns the potential consensus-engine power. -func (v Validator) PotentialConsensusPower(r math.Int) int64 { - return sdk.TokensToConsensusPower(v.Tokens, r) -} - -// UpdateStatus updates the location of the shares within a validator -// to reflect the new status -func (v Validator) UpdateStatus(newStatus BondStatus) Validator { - v.Status = newStatus - return v -} - -// AddTokensFromDel adds tokens to a validator -func (v Validator) AddTokensFromDel(amount math.Int) (Validator, math.LegacyDec) { - // calculate the shares to issue - var issuedShares math.LegacyDec - if v.DelegatorShares.IsZero() { - // the first delegation to a validator sets the exchange rate to one - issuedShares = math.LegacyNewDecFromInt(amount) - } else { - shares, err := v.SharesFromTokens(amount) - if err != nil { - panic(err) - } - - issuedShares = shares - } - - v.Tokens = v.Tokens.Add(amount) - v.DelegatorShares = v.DelegatorShares.Add(issuedShares) - - return v, issuedShares -} - -// RemoveTokens removes tokens from a validator -func (v Validator) RemoveTokens(tokens math.Int) Validator { - if tokens.IsNegative() { - panic(fmt.Sprintf("should not happen: trying to remove negative tokens %v", tokens)) - } - - if v.Tokens.LT(tokens) { - panic(fmt.Sprintf("should not happen: only have %v tokens, trying to remove %v", v.Tokens, tokens)) - } - - v.Tokens = v.Tokens.Sub(tokens) - - return v +// GetDelegations returns the delegations of the governor +func (g Governor) GetDelegations() []*ValidatorGovDelegation { + return g.DelegatedShares } -// RemoveDelShares removes delegator shares from a validator. -// NOTE: because token fractions are left in the valiadator, -// -// the exchange rate of future shares of this validator can increase. -func (v Validator) RemoveDelShares(delShares math.LegacyDec) (Validator, math.Int) { - remainingShares := v.DelegatorShares.Sub(delShares) - - var issuedTokens math.Int - if remainingShares.IsZero() { - // last delegation share gets any trimmings - issuedTokens = v.Tokens - v.Tokens = math.ZeroInt() - } else { - // leave excess tokens in the validator - // however fully use all the delegator shares - issuedTokens = v.TokensFromShares(delShares).TruncateInt() - v.Tokens = v.Tokens.Sub(issuedTokens) - - if v.Tokens.IsNegative() { - panic("attempting to remove more tokens than available in validator") +// GetDelegationShares returns the shares delegated to the governor for a specific validator +func (g Governor) GetDelegationShares(valAddr sdk.ValAddress) sdk.Dec { + valAddrStr := valAddr.String() + for _, del := range g.DelegatedShares { + if del.ValidatorAddress == valAddrStr { + return del.Shares } } - v.DelegatorShares = remainingShares - - return v, issuedTokens + return sdk.ZeroDec() } // MinEqual defines a more minimum set of equality conditions when comparing two -// validators. -func (v *Validator) MinEqual(other *Validator) bool { - return v.OperatorAddress == other.OperatorAddress && - v.Status == other.Status && - v.Tokens.Equal(other.Tokens) && - v.DelegatorShares.Equal(other.DelegatorShares) && - v.Description.Equal(other.Description) && - v.Commission.Equal(other.Commission) && - v.Jailed == other.Jailed && - v.MinSelfDelegation.Equal(other.MinSelfDelegation) && - v.ConsensusPubkey.Equal(other.ConsensusPubkey) +// governors. +func (g *Governor) MinEqual(other *Governor) bool { + return g.GovernorAddress == other.GovernorAddress && + g.Status == other.Status && + g.DelegatedShares.Equal(other.DelegatedShares) && + g.Description.Equal(other.Description) } // Equal checks if the receiver equals the parameter -func (v *Validator) Equal(v2 *Validator) bool { - return v.MinEqual(v2) && - v.UnbondingHeight == v2.UnbondingHeight && - v.UnbondingTime.Equal(v2.UnbondingTime) -} - -func (v Validator) IsJailed() bool { return v.Jailed } -func (v Validator) GetMoniker() string { return v.Description.Moniker } -func (v Validator) GetStatus() sdk.BondStatus { return sdk.BondStatus(v.Status) } -func (v Validator) GetOperator() string { - return v.OperatorAddress +func (g *Governor) Equal(v2 *Governor) bool { + return g.MinEqual(v2) } -// ConsPubKey returns the validator PubKey as a cryptotypes.PubKey. -func (v Validator) ConsPubKey() (cryptotypes.PubKey, error) { - pk, ok := v.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) - if !ok { - return nil, errors.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", pk) - } - - return pk, nil -} - -// GetConsAddr extracts Consensus key address -func (v Validator) GetConsAddr() ([]byte, error) { - pk, ok := v.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) - if !ok { - return nil, errors.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", pk) - } - - return pk.Address().Bytes(), nil -} - -func (v Validator) GetTokens() math.Int { return v.Tokens } -func (v Validator) GetBondedTokens() math.Int { return v.BondedTokens() } -func (v Validator) GetConsensusPower(r math.Int) int64 { - return v.ConsensusPower(r) -} -func (v Validator) GetCommission() math.LegacyDec { return v.Commission.Rate } -func (v Validator) GetMinSelfDelegation() math.Int { return v.MinSelfDelegation } -func (v Validator) GetDelegatorShares() math.LegacyDec { return v.DelegatorShares } - -// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (v Validator) UnpackInterfaces(unpacker gogoprotoany.AnyUnpacker) error { - var pk cryptotypes.PubKey - return unpacker.UnpackAny(v.ConsensusPubkey, &pk) -} +func (g Governor) GetMoniker() string { return g.Description.Moniker } +func (g Governor) GetStatus() GovernorStatus { return g.Status } +func (g Governor) GetAddress() GovernorAddress { return GovernorAddressFromBech32(g.GovernorAddress) } +func (g Governor) GetDescription() GovernorDescription { return g.Description } diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index bef21da80..313c15f01 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -8,14 +8,14 @@ import ( // GovernorGovInfo used for tallying type GovernorGovInfo struct { - Address GovernorAddress // address of the governor - Delegations []ValidatorDelegation // Delegations of the governor - DelegationsDeductions []ValidatorDelegation // Delegator deductions from validator's delegators voting independently - Vote WeightedVoteOptions // Vote of the validator + Address GovernorAddress // address of the governor + Delegations []*ValidatorGovDelegation // Delegations of the governor + DelegationsDeductions []ValidatorGovDelegation // Delegator deductions from validator's delegators voting independently + Vote WeightedVoteOptions // Vote of the validator } // NewGovernorGovInfo creates a GovernorGovInfo instance -func NewGovernorGovInfo(address GovernorAddress, delegations []ValidatorDelegation, deductions []ValidatorDelegation, options WeightedVoteOptions) GovernorGovInfo { +func NewGovernorGovInfo(address GovernorAddress, delegations []*ValidatorGovDelegation, deductions []ValidatorGovDelegation, options WeightedVoteOptions) GovernorGovInfo { return GovernorGovInfo{ Address: address, Delegations: delegations, From 96abd4ca66d9cdccfe58a752b6a79963056f722d Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sat, 14 Sep 2024 08:55:44 +0200 Subject: [PATCH 05/43] wip --- proto/atomone/gov/v1/gov.proto | 8 +- proto/atomone/gov/v1/tx.proto | 8 +- x/gov/keeper/tally.go | 25 ++- x/gov/types/v1/address.go | 158 ++++++++++++++++ x/gov/types/v1/exported.go | 16 +- x/gov/types/v1/gov.pb.go | 317 ++++++++++++++------------------- x/gov/types/v1/governor.go | 28 +-- x/gov/types/v1/tally.go | 23 ++- 8 files changed, 332 insertions(+), 251 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 5e4bfc549..03a4a5c2b 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -235,8 +235,6 @@ message Governor { GovernorStatus status = 2; // description defines the description terms for the governor. GovernorDescription description = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // delegations define the validator delegations for the governor. - repeated ValidatorGovDelegation delegatedShares = 4; } // GovernorStatus is the status of a governor. @@ -267,9 +265,9 @@ message GovernorDescription { string details = 5; } -// ValidatorGovDelegation holds the number of shares from the specified validator -// a governor can use to vote on proposals. -message ValidatorGovDelegation { +// GovernorValShares holds the number of shares from the specific validator +// that a governor can use to vote on proposals. +message GovernorValShares { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; diff --git a/proto/atomone/gov/v1/tx.proto b/proto/atomone/gov/v1/tx.proto index b4ba930c3..f9002c0a0 100644 --- a/proto/atomone/gov/v1/tx.proto +++ b/proto/atomone/gov/v1/tx.proto @@ -209,9 +209,9 @@ message MsgEditGovernor { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - GovernorStatus status = 2; - string governor_address = 3 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; + GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + GovernorStatus status = 2; + string governor_address = 3 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; } // MsgEditGovernorResponse defines the Msg/EditGovernor response type. @@ -229,7 +229,7 @@ message MsgDelegateGovernor { string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string governor_address = 2 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. - string percentage = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string percentage = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; } // MsgDelegateGovernorResponse defines the Msg/Delegate response type. diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index d65634c98..c2b7f8d84 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -34,15 +34,14 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, keeper.IterateGovernorsByPower(ctx, func(index int64, governor v1.GovernorI) (stop bool) { currGovernors[governor.GetAddress().String()] = v1.NewGovernorGovInfo( governor.GetAddress(), - governor.GetDelegations(), - make([]v1.ValidatorGovDelegation, 0), + keeper.GovernorValShares(ctx, governor.GetAddress()), v1.WeightedVoteOptions{}, ) return false }) keeper.IterateVotes(ctx, proposal.Id, func(vote v1.Vote) bool { - var governor v1.GovernorI = nil + var governor v1.GovernorGovInfo voter := sdk.MustAccAddressFromBech32(vote.Voter) @@ -53,10 +52,10 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, currGovernors[govAddrStr] = gov } - g, governorDelegationPercentage := keeper.GetGovernor(ctx, voter) - if g != nil { - if g, ok := currGovernors[g.GetAddress().String()]; ok { - governor = g + g, governorDelegationPercentage, hasGovernor := keeper.GetDelegatorGovernor(ctx, voter) + if hasGovernor { + if gi, ok := currGovernors[g.GetAddress().String()]; ok { + governor = gi } } @@ -76,10 +75,8 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, totalVotingPower = totalVotingPower.Add(votingPower) // remove the delegation shares from the governor - if governor != nil { - d := governor.GetDelegationDeductions(delegation.GetValidatorAddr()) - d = d.Add(delegation.GetShares().Mul(governorDelegationPercentage)) - governor.SetDelegatorDeductions(delegation.GetValidatorAddr(), d) + if hasGovernor { + governor.ValSharesDeductions[valAddrStr] = governor.ValSharesDeductions[valAddrStr].Add(delegation.GetShares().Mul(governorDelegationPercentage)) } } @@ -120,11 +117,9 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, // As governor are simply voters that need to have 100% of their bonded tokens // delegated to them and their shares were deducted when iterating over votes // we don't need to handle special cases. - for _, d := range gov.Delegations { - valAddrStr := d.ValidatorAddress - shares := d.Shares + for valAddrStr, shares := range gov.ValShares { if val, ok := currValidators[valAddrStr]; ok { - sharesAfterDeductions := shares.Sub(gov.GetDelegationDeductions(val.GetOperator())) + sharesAfterDeductions := shares.Sub(gov.ValSharesDeductions[valAddrStr]) votingPower := sharesAfterDeductions.MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares()) for _, option := range gov.Vote { diff --git a/x/gov/types/v1/address.go b/x/gov/types/v1/address.go index ca1af36f9..943f94f46 100644 --- a/x/gov/types/v1/address.go +++ b/x/gov/types/v1/address.go @@ -1,11 +1,169 @@ package v1 import ( + "bytes" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "strings" + sdk "github.com/cosmos/cosmos-sdk/types" + "gopkg.in/yaml.v2" ) var ( _ sdk.Address = GovernorAddress{} ) +const ( + // Prefix for governor addresses + // Full prefix is defined as `bech32AccountPrefix + PrefixGovernor` + PrefixGovernor = "gov" +) + type GovernorAddress []byte + +// GovernorAddressFromHex creates a GovernorAddress from a hex string. +func GovernorAddressFromHex(address string) (addr GovernorAddress, err error) { + bz, err := addressBytesFromHexString(address) + return GovernorAddress(bz), err +} + +// GovernorAddressFromBech32 creates a GovernorAddress from a Bech32 string. +func GovernorAddressFromBech32(address string) (addr GovernorAddress, err error) { + if len(strings.TrimSpace(address)) == 0 { + return GovernorAddress{}, errors.New("empty address string is not allowed") + } + + bech32PrefixGovAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() + PrefixGovernor + + bz, err := sdk.GetFromBech32(address, bech32PrefixGovAddr) + if err != nil { + return nil, err + } + + err = sdk.VerifyAddressFormat(bz) + if err != nil { + return nil, err + } + + return GovernorAddress(bz), nil +} + +// Returns boolean for whether two GovernorAddresses are Equal +func (ga GovernorAddress) Equals(ga2 sdk.Address) bool { + if ga.Empty() && ga2.Empty() { + return true + } + + return bytes.Equal(ga.Bytes(), ga2.Bytes()) +} + +// Returns boolean for whether a GovernorAddress is empty +func (ga GovernorAddress) Empty() bool { + return len(ga) == 0 +} + +// Marshal returns the raw address bytes. It is needed for protobuf +// compatibility. +func (ga GovernorAddress) Marshal() ([]byte, error) { + return ga, nil +} + +// Unmarshal sets the address to the given data. It is needed for protobuf +// compatibility. +func (ga *GovernorAddress) Unmarshal(data []byte) error { + *ga = data + return nil +} + +// MarshalJSON marshals to JSON using Bech32. +func (ga GovernorAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(ga.String()) +} + +// MarshalYAML marshals to YAML using Bech32. +func (ga GovernorAddress) MarshalYAML() (interface{}, error) { + return ga.String(), nil +} + +// UnmarshalJSON unmarshals from JSON assuming Bech32 encoding. +func (ga *GovernorAddress) UnmarshalJSON(data []byte) error { + var s string + err := json.Unmarshal(data, &s) + if err != nil { + return err + } + if s == "" { + *ga = GovernorAddress{} + return nil + } + + ga2, err := GovernorAddressFromBech32(s) + if err != nil { + return err + } + + *ga = ga2 + return nil +} + +// UnmarshalYAML unmarshals from YAML assuming Bech32 encoding. +func (ga *GovernorAddress) UnmarshalYAML(data []byte) error { + var s string + err := yaml.Unmarshal(data, &s) + if err != nil { + return err + } + if s == "" { + *ga = GovernorAddress{} + return nil + } + + ga2, err := GovernorAddressFromBech32(s) + if err != nil { + return err + } + + *ga = ga2 + return nil +} + +// Bytes returns the raw address bytes. +func (ga GovernorAddress) Bytes() []byte { + return ga +} + +// String implements the Stringer interface. +func (ga GovernorAddress) String() string { + if ga.Empty() { + return "" + } + + bech32Addr, err := sdk.Bech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix()+PrefixGovernor, ga.Bytes()) + if err != nil { + panic(err) + } + return bech32Addr +} + +// Format implements the fmt.Formatter interface. +func (ga GovernorAddress) Format(s fmt.State, verb rune) { + switch verb { + case 's': + s.Write([]byte(ga.String())) + case 'p': + s.Write([]byte(fmt.Sprintf("%p", ga))) + default: + s.Write([]byte(fmt.Sprintf("%X", []byte(ga)))) + } +} + +func addressBytesFromHexString(address string) ([]byte, error) { + if len(address) == 0 { + return nil, sdk.ErrEmptyHexAddress + } + + return hex.DecodeString(address) +} diff --git a/x/gov/types/v1/exported.go b/x/gov/types/v1/exported.go index 554dedea3..c6926770a 100644 --- a/x/gov/types/v1/exported.go +++ b/x/gov/types/v1/exported.go @@ -1,14 +1,10 @@ package v1 -import sdk "github.com/cosmos/cosmos-sdk/types" - type GovernorI interface { - GetMoniker() string // moniker of the governor - GetStatus() GovernorStatus // status of the governor - IsActive() bool // check if has a active status - IsInactive() bool // check if has status inactive - GetAddress() GovernorAddress // governor address to receive/return governors delegations - GetDescription() GovernorDescription // description of the governor - GetDelegations() []*ValidatorGovDelegation // get all the x/staking shares delegated to the governor - GetDelegationShares(valAddr sdk.ValAddress) sdk.Dec // get the x/staking shares delegated to the governor for a specific validator + GetMoniker() string // moniker of the governor + GetStatus() GovernorStatus // status of the governor + IsActive() bool // check if has a active status + IsInactive() bool // check if has status inactive + GetAddress() GovernorAddress // governor address to receive/return governors delegations + GetDescription() GovernorDescription // description of the governor } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 553a01d58..44aed8a28 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -895,8 +895,6 @@ type Governor struct { Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` // description defines the description terms for the governor. Description GovernorDescription `protobuf:"bytes,3,opt,name=description,proto3" json:"description"` - // delegations define the validator delegations for the governor. - DelegatedShares []*ValidatorGovDelegation `protobuf:"bytes,4,rep,name=delegatedShares,proto3" json:"delegatedShares,omitempty"` } func (m *Governor) Reset() { *m = Governor{} } @@ -1014,27 +1012,27 @@ func (m *GovernorDescription) GetDetails() string { return "" } -// ValidatorGovDelegation holds the number of shares from the specified validator -// a governor can use to vote on proposals. -type ValidatorGovDelegation struct { +// GovernorValShares holds the number of shares from the specific validator +// that a governor can use to vote on proposals. +type GovernorValShares struct { GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // shares define the delegation shares available from this validator. Shares cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"shares"` } -func (m *ValidatorGovDelegation) Reset() { *m = ValidatorGovDelegation{} } -func (m *ValidatorGovDelegation) String() string { return proto.CompactTextString(m) } -func (*ValidatorGovDelegation) ProtoMessage() {} -func (*ValidatorGovDelegation) Descriptor() ([]byte, []int) { +func (m *GovernorValShares) Reset() { *m = GovernorValShares{} } +func (m *GovernorValShares) String() string { return proto.CompactTextString(m) } +func (*GovernorValShares) ProtoMessage() {} +func (*GovernorValShares) Descriptor() ([]byte, []int) { return fileDescriptor_ecf0f9950ff6986c, []int{11} } -func (m *ValidatorGovDelegation) XXX_Unmarshal(b []byte) error { +func (m *GovernorValShares) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ValidatorGovDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GovernorValShares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ValidatorGovDelegation.Marshal(b, m, deterministic) + return xxx_messageInfo_GovernorValShares.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1044,17 +1042,17 @@ func (m *ValidatorGovDelegation) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *ValidatorGovDelegation) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorGovDelegation.Merge(m, src) +func (m *GovernorValShares) XXX_Merge(src proto.Message) { + xxx_messageInfo_GovernorValShares.Merge(m, src) } -func (m *ValidatorGovDelegation) XXX_Size() int { +func (m *GovernorValShares) XXX_Size() int { return m.Size() } -func (m *ValidatorGovDelegation) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorGovDelegation.DiscardUnknown(m) +func (m *GovernorValShares) XXX_DiscardUnknown() { + xxx_messageInfo_GovernorValShares.DiscardUnknown(m) } -var xxx_messageInfo_ValidatorGovDelegation proto.InternalMessageInfo +var xxx_messageInfo_GovernorValShares proto.InternalMessageInfo // GovernanceDelegation defines a delegation of governance voting power from a // delegator to a governor. @@ -1113,120 +1111,119 @@ func init() { proto.RegisterType((*Params)(nil), "atomone.gov.v1.Params") proto.RegisterType((*Governor)(nil), "atomone.gov.v1.Governor") proto.RegisterType((*GovernorDescription)(nil), "atomone.gov.v1.GovernorDescription") - proto.RegisterType((*ValidatorGovDelegation)(nil), "atomone.gov.v1.ValidatorGovDelegation") + proto.RegisterType((*GovernorValShares)(nil), "atomone.gov.v1.GovernorValShares") proto.RegisterType((*GovernanceDelegation)(nil), "atomone.gov.v1.GovernanceDelegation") } func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1690 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x4a, 0xd4, 0x7a, 0xa2, 0x3a, 0x6b, 0x2a, 0x26, 0x15, 0x36, - 0x30, 0x14, 0x35, 0x22, 0x23, 0xa7, 0xcd, 0x21, 0xcd, 0x85, 0x12, 0x37, 0xca, 0x1a, 0xae, 0xc8, - 0x2e, 0x69, 0x19, 0xe9, 0x65, 0x31, 0xe4, 0x8e, 0xc9, 0x41, 0xb8, 0x3b, 0xec, 0xee, 0x90, 0x36, - 0xaf, 0x3d, 0xa5, 0x3e, 0xe5, 0x58, 0x14, 0x35, 0x60, 0xa0, 0x97, 0x1e, 0x73, 0x70, 0xd1, 0x0f, - 0xd0, 0x4b, 0x4e, 0x6d, 0xe0, 0x4b, 0xff, 0xa0, 0x70, 0x0b, 0xfb, 0xd0, 0x20, 0x9f, 0xa2, 0x98, - 0x9d, 0x59, 0x92, 0x5a, 0xd1, 0x90, 0x14, 0xf4, 0x62, 0xef, 0xbc, 0xf9, 0xfd, 0xde, 0xbc, 0xff, - 0x33, 0x14, 0x18, 0x98, 0x33, 0x8f, 0xf9, 0xa4, 0xda, 0x63, 0xe3, 0xea, 0xf8, 0x40, 0xfc, 0x57, - 0x19, 0x06, 0x8c, 0x33, 0x94, 0x57, 0x3b, 0x15, 0x21, 0x1a, 0x1f, 0x14, 0x8a, 0x5d, 0x16, 0x7a, - 0x2c, 0xac, 0x76, 0x70, 0x48, 0xaa, 0xe3, 0x83, 0x0e, 0xe1, 0xf8, 0xa0, 0xda, 0x65, 0xd4, 0x97, - 0xf8, 0xc2, 0x56, 0x8f, 0xf5, 0x58, 0xf4, 0x59, 0x15, 0x5f, 0x4a, 0x5a, 0xea, 0x31, 0xd6, 0x1b, - 0x90, 0x6a, 0xb4, 0xea, 0x8c, 0x1e, 0x54, 0x39, 0xf5,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 0xfa, 0x3d, 0x27, 0xe4, 0x38, 0x50, 0xfe, 0x65, 0x2f, 0x69, - 0xd7, 0xa6, 0xa4, 0xb6, 0x04, 0x33, 0x32, 0xec, 0x53, 0x50, 0xa2, 0x99, 0x8f, 0x6b, 0x97, 0xd4, - 0xb5, 0x21, 0x89, 0xb1, 0x8b, 0x05, 0x51, 0x26, 0x1c, 0xbb, 0x98, 0x63, 0x03, 0x44, 0xe1, 0xda, - 0xd3, 0x35, 0xda, 0x82, 0x15, 0x4e, 0xf9, 0x80, 0x18, 0xb9, 0x68, 0x43, 0x2e, 0x90, 0x01, 0xab, - 0xe1, 0xc8, 0xf3, 0x70, 0x30, 0x31, 0xd6, 0x23, 0x79, 0xbc, 0x44, 0x3f, 0x86, 0xac, 0xec, 0x09, - 0x12, 0x18, 0x1b, 0x17, 0x34, 0xc1, 0x14, 0x59, 0xfe, 0x9b, 0x06, 0xb9, 0xf9, 0x1a, 0xf8, 0x11, - 0xac, 0x4d, 0x48, 0xe8, 0x74, 0xa3, 0xb6, 0xd0, 0xce, 0xf5, 0xa8, 0xe5, 0x73, 0x3b, 0x3b, 0x21, - 0xe1, 0x91, 0xd8, 0x47, 0x1f, 0xc0, 0x06, 0xee, 0x84, 0x1c, 0x53, 0x5f, 0x11, 0x52, 0x0b, 0x09, - 0xeb, 0x0a, 0x24, 0x49, 0xef, 0x42, 0xd6, 0x67, 0x0a, 0xbf, 0xbc, 0x10, 0xbf, 0xea, 0x33, 0x09, - 0xfd, 0x29, 0x20, 0x9f, 0x39, 0x0f, 0x29, 0xef, 0x3b, 0x63, 0xc2, 0x63, 0x52, 0x7a, 0x21, 0x69, - 0xd3, 0x67, 0xf7, 0x29, 0xef, 0x9f, 0x12, 0x2e, 0xc9, 0xe5, 0x3f, 0x69, 0x90, 0x16, 0x13, 0xe8, - 0xe2, 0xf9, 0x51, 0x81, 0x95, 0x31, 0xe3, 0xe4, 0xe2, 0xd9, 0x21, 0x61, 0xe8, 0x63, 0x58, 0x95,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, 0x4a, - 0x97, 0x79, 0x55, 0x35, 0xf9, 0xf6, 0xfb, 0xa3, 0x4e, 0xfc, 0x5d, 0x7d, 0x14, 0xfd, 0xdd, 0x81, - 0x4f, 0x86, 0x24, 0xac, 0x8e, 0x0f, 0x3a, 0x99, 0xe8, 0x96, 0xfe, 0xe0, 0x7f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x22, 0x3c, 0x5b, 0xd8, 0x96, 0x10, 0x00, 0x00, + // 1668 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4d, 0x6f, 0x1b, 0xc7, + 0x19, 0xd6, 0x52, 0x14, 0x45, 0xbd, 0x92, 0xa8, 0xd5, 0x58, 0x75, 0xd6, 0x54, 0x4c, 0x2a, 0x6c, + 0x10, 0x28, 0x6a, 0x44, 0x46, 0x4e, 0x9b, 0x43, 0x9a, 0x0b, 0x25, 0x32, 0xce, 0x1a, 0xae, 0xc8, + 0x2e, 0x69, 0x1a, 0xe9, 0x65, 0x31, 0xe4, 0x8e, 0xc9, 0x41, 0xb8, 0x3b, 0xec, 0xee, 0x90, 0x36, + 0xff, 0x41, 0xea, 0x53, 0x8e, 0x45, 0x51, 0x03, 0x06, 0x7a, 0xe9, 0x31, 0x07, 0x03, 0xfd, 0x01, + 0xbd, 0xe4, 0xd4, 0x06, 0xbe, 0xf4, 0x03, 0x85, 0x5b, 0xd8, 0x87, 0x06, 0xf9, 0x0f, 0x05, 0x8a, + 0xf9, 0x58, 0x92, 0xa2, 0x68, 0x48, 0x0a, 0x72, 0x91, 0x76, 0xde, 0x79, 0x9e, 0x77, 0xde, 0xef, + 0xd9, 0x25, 0x58, 0x98, 0x33, 0x9f, 0x05, 0xa4, 0xd4, 0x65, 0xa3, 0xd2, 0xe8, 0x48, 0xfc, 0x2b, + 0x0e, 0x42, 0xc6, 0x19, 0xca, 0xe8, 0x9d, 0xa2, 0x10, 0x8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x14, 0x49, 0x88, 0xd1, 0x1d, 0x30, 0x75, 0x7c, + 0x5d, 0x12, 0x78, 0x4a, 0x4f, 0xea, 0x92, 0x7a, 0x32, 0x9a, 0x59, 0x0d, 0x3c, 0xa9, 0xcb, 0x86, + 0x4d, 0xce, 0x38, 0xee, 0xbb, 0x5a, 0x6e, 0xad, 0x5e, 0x21, 0x4b, 0x1b, 0x92, 0x1a, 0x97, 0xd0, + 0x5d, 0xd8, 0x1e, 0x31, 0x4e, 0x83, 0xae, 0x1b, 0x71, 0x1c, 0x6a, 0xff, 0xd2, 0x97, 0xb4, 0x6b, + 0x4b, 0x51, 0x1b, 0x82, 0x29, 0x0d, 0xfb, 0x14, 0xb4, 0x68, 0xea, 0xe3, 0xda, 0x25, 0x75, 0x6d, + 0x2a, 0x62, 0xec, 0x62, 0x56, 0x94, 0x09, 0xc7, 0x1e, 0xe6, 0xd8, 0x02, 0x51, 0xb8, 0xce, 0x64, + 0x8d, 0x76, 0x60, 0x85, 0x53, 0xde, 0x27, 0xd6, 0xba, 0xdc, 0x50, 0x0b, 0x64, 0xc1, 0x6a, 0x34, + 0xf4, 0x7d, 0x1c, 0x8e, 0xad, 0x0d, 0x29, 0x8f, 0x97, 0xe8, 0xa7, 0x90, 0x56, 0x3d, 0x41, 0x42, + 0x6b, 0xf3, 0x82, 0x26, 0x98, 0x20, 0x0b, 0x7f, 0x33, 0x60, 0x7d, 0xb6, 0x06, 0x7e, 0x02, 0x6b, + 0x63, 0x12, 0xb9, 0x1d, 0xd9, 0x16, 0xc6, 0xb9, 0x1e, 0xb5, 0x03, 0xee, 0xa4, 0xc7, 0x24, 0x3a, + 0x11, 0xfb, 0xe8, 0x03, 0xd8, 0xc4, 0xed, 0x88, 0x63, 0x1a, 0x68, 0x42, 0x62, 0x21, 0x61, 0x43, + 0x83, 0x14, 0xe9, 0x5d, 0x48, 0x07, 0x4c, 0xe3, 0x97, 0x17, 0xe2, 0x57, 0x03, 0xa6, 0xa0, 0x3f, + 0x07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xf5, 0x77, 0x71, 0x15, 0x6b, 0xad, 0xef, 0x40, 0xea, + 0xd7, 0x43, 0x16, 0x0e, 0xfd, 0x05, 0x25, 0x2c, 0xaf, 0x19, 0xb5, 0x8b, 0xde, 0x83, 0x35, 0xde, + 0x0b, 0x49, 0xd4, 0x63, 0x7d, 0xef, 0x35, 0x37, 0xd2, 0x14, 0x80, 0x7e, 0x06, 0x19, 0x59, 0x86, + 0x53, 0xca, 0xf2, 0x42, 0xca, 0xa6, 0x40, 0x35, 0x63, 0x50, 0xe1, 0xaf, 0x49, 0x48, 0x69, 0xbb, + 0xaa, 0x57, 0xcc, 0xe3, 0xcc, 0x40, 0x9b, 0xcd, 0xd9, 0x2f, 0xbe, 0x5f, 0xce, 0x92, 0x8b, 0x73, + 0x72, 0x3e, 0x07, 0xcb, 0xdf, 0x23, 0x07, 0x33, 0x31, 0x4f, 0x5e, 0x3e, 0xe6, 0x2b, 0x57, 0x8f, + 0x79, 0xea, 0x12, 0x31, 0x47, 0x36, 0xdc, 0x10, 0x81, 0xa6, 0x01, 0xe5, 0x74, 0x7a, 0x83, 0xb8, + 0xd2, 0x7c, 0x6b, 0x75, 0xa1, 0x86, 0xeb, 0x3e, 0x0d, 0x6c, 0x85, 0xd7, 0xe1, 0x71, 0x04, 0x1a, + 0xed, 0x83, 0xd9, 0x1e, 0x86, 0x81, 0x2b, 0x7a, 0xdf, 0xd5, 0x1e, 0x8a, 0xf9, 0x9a, 0x76, 0x32, + 0x42, 0x2e, 0x5a, 0xfc, 0x97, 0xca, 0xb3, 0x32, 0xdc, 0x94, 0xc8, 0xc9, 0xb4, 0x99, 0x24, 0x28, + 0x24, 0x82, 0x6d, 0x65, 0x24, 0x2d, 0x2b, 0x40, 0xf1, 0x6d, 0x1e, 0x67, 0x42, 0x21, 0xd0, 0xdb, + 0x90, 0x99, 0x1e, 0x26, 0x5c, 0xb2, 0xb6, 0x24, 0x67, 0x23, 0x3e, 0x4a, 0xcc, 0xb7, 0xc2, 0x2b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c, 0x19, 0xdf, 0xbc, + 0xcc, 0x19, 0xff, 0x79, 0x99, 0x33, 0xbe, 0x7c, 0x95, 0x5b, 0xfa, 0xe6, 0x55, 0x6e, 0xe9, 0xef, + 0xaf, 0x72, 0x4b, 0xbf, 0x3a, 0xec, 0x52, 0xde, 0x1b, 0xb6, 0x8b, 0x1d, 0xe6, 0x97, 0xf4, 0xe0, + 0x3b, 0xec, 0x0d, 0xdb, 0xf1, 0x73, 0xe9, 0x91, 0xfc, 0x81, 0x80, 0x8f, 0x07, 0x24, 0x12, 0x1f, + 0xff, 0x29, 0x79, 0x9d, 0x7e, 0xf0, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x95, 0x8c, 0xc9, 0x9e, + 0x3f, 0x10, 0x00, 0x00, } func (this *GovernorDescription) Equal(that interface{}) bool { @@ -1856,20 +1853,6 @@ func (m *Governor) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.DelegatedShares) > 0 { - for iNdEx := len(m.DelegatedShares) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DelegatedShares[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } { size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1953,7 +1936,7 @@ func (m *GovernorDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ValidatorGovDelegation) Marshal() (dAtA []byte, err error) { +func (m *GovernorValShares) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1963,12 +1946,12 @@ func (m *ValidatorGovDelegation) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ValidatorGovDelegation) MarshalTo(dAtA []byte) (int, error) { +func (m *GovernorValShares) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ValidatorGovDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GovernorValShares) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2323,12 +2306,6 @@ func (m *Governor) Size() (n int) { } l = m.Description.Size() n += 1 + l + sovGov(uint64(l)) - if len(m.DelegatedShares) > 0 { - for _, e := range m.DelegatedShares { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } return n } @@ -2361,7 +2338,7 @@ func (m *GovernorDescription) Size() (n int) { return n } -func (m *ValidatorGovDelegation) Size() (n int) { +func (m *GovernorValShares) Size() (n int) { if m == nil { return 0 } @@ -4261,40 +4238,6 @@ func (m *Governor) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatedShares", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegatedShares = append(m.DelegatedShares, &ValidatorGovDelegation{}) - if err := m.DelegatedShares[len(m.DelegatedShares)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) @@ -4526,7 +4469,7 @@ func (m *GovernorDescription) Unmarshal(dAtA []byte) error { } return nil } -func (m *ValidatorGovDelegation) Unmarshal(dAtA []byte) error { +func (m *GovernorValShares) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4549,10 +4492,10 @@ func (m *ValidatorGovDelegation) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ValidatorGovDelegation: wiretype end group for non-group") + return fmt.Errorf("proto: GovernorValShares: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorGovDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GovernorValShares: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 5b1e445ca..0adb7f8e4 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -10,7 +10,6 @@ import ( "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -35,7 +34,6 @@ func NewGovernor(address string, description GovernorDescription) (Governor, err return Governor{ GovernorAddress: address, Description: description, - DelegatedShares: make([]*ValidatorGovDelegation, 0), Status: Active, }, nil } @@ -207,29 +205,11 @@ func (d GovernorDescription) EnsureLength() (GovernorDescription, error) { return d, nil } -// GetDelegations returns the delegations of the governor -func (g Governor) GetDelegations() []*ValidatorGovDelegation { - return g.DelegatedShares -} - -// GetDelegationShares returns the shares delegated to the governor for a specific validator -func (g Governor) GetDelegationShares(valAddr sdk.ValAddress) sdk.Dec { - valAddrStr := valAddr.String() - for _, del := range g.DelegatedShares { - if del.ValidatorAddress == valAddrStr { - return del.Shares - } - } - - return sdk.ZeroDec() -} - // MinEqual defines a more minimum set of equality conditions when comparing two // governors. func (g *Governor) MinEqual(other *Governor) bool { return g.GovernorAddress == other.GovernorAddress && g.Status == other.Status && - g.DelegatedShares.Equal(other.DelegatedShares) && g.Description.Equal(other.Description) } @@ -240,5 +220,11 @@ func (g *Governor) Equal(v2 *Governor) bool { func (g Governor) GetMoniker() string { return g.Description.Moniker } func (g Governor) GetStatus() GovernorStatus { return g.Status } -func (g Governor) GetAddress() GovernorAddress { return GovernorAddressFromBech32(g.GovernorAddress) } func (g Governor) GetDescription() GovernorDescription { return g.Description } +func (g Governor) GetAddress() GovernorAddress { + addr, err := GovernorAddressFromBech32(g.GovernorAddress) + if err != nil { + panic(err) + } + return addr +} diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index 313c15f01..622b4817f 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -8,19 +8,24 @@ import ( // GovernorGovInfo used for tallying type GovernorGovInfo struct { - Address GovernorAddress // address of the governor - Delegations []*ValidatorGovDelegation // Delegations of the governor - DelegationsDeductions []ValidatorGovDelegation // Delegator deductions from validator's delegators voting independently - Vote WeightedVoteOptions // Vote of the validator + Address GovernorAddress // address of the governor + ValShares map[string]sdk.Dec // shares held for each validator + ValSharesDeductions map[string]sdk.Dec // deductions from validator's shares when a delegator votes independently + Vote WeightedVoteOptions // vote of the governor } // NewGovernorGovInfo creates a GovernorGovInfo instance -func NewGovernorGovInfo(address GovernorAddress, delegations []*ValidatorGovDelegation, deductions []ValidatorGovDelegation, options WeightedVoteOptions) GovernorGovInfo { +func NewGovernorGovInfo(address GovernorAddress, valShares []*GovernorValShares, options WeightedVoteOptions) GovernorGovInfo { + valSharesMap := make(map[string]sdk.Dec) + for _, valShare := range valShares { + valSharesMap[valShare.ValidatorAddress] = valShare.Shares + } + return GovernorGovInfo{ - Address: address, - Delegations: delegations, - DelegationsDeductions: deductions, - Vote: options, + Address: address, + ValShares: valSharesMap, + ValSharesDeductions: make(map[string]sdk.Dec), + Vote: options, } } From f9ad9d8181c9fc1555ca35b8db2bea5c5fdaba00 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sat, 14 Sep 2024 10:42:53 +0200 Subject: [PATCH 06/43] ... --- proto/atomone/gov/v1/gov.proto | 2 +- x/gov/types/{v1 => }/address.go | 13 ++++++++++++- x/gov/types/keys.go | 28 ++++++++++++++++++++++++++++ x/gov/types/v1/exported.go | 4 +++- x/gov/types/v1/governor.go | 5 +++-- x/gov/types/v1/tally.go | 11 ++++++----- 6 files changed, 53 insertions(+), 10 deletions(-) rename x/gov/types/{v1 => }/address.go (92%) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 03a4a5c2b..9aa13f811 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -291,4 +291,4 @@ message GovernanceDelegation { string governor_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. string percentage = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; -} \ No newline at end of file +} diff --git a/x/gov/types/v1/address.go b/x/gov/types/address.go similarity index 92% rename from x/gov/types/v1/address.go rename to x/gov/types/address.go index 943f94f46..7d87ba9b2 100644 --- a/x/gov/types/v1/address.go +++ b/x/gov/types/address.go @@ -1,4 +1,4 @@ -package v1 +package types import ( "bytes" @@ -51,6 +51,17 @@ func GovernorAddressFromBech32(address string) (addr GovernorAddress, err error) return GovernorAddress(bz), nil } +// MustGovernorAddressFromBech32 creates a GovernorAddress from a Bech32 string. +// If the address is invalid, it panics. +func MustGovernorAddressFromBech32(address string) GovernorAddress { + addr, err := GovernorAddressFromBech32(address) + if err != nil { + panic(err) + } + + return addr +} + // Returns boolean for whether two GovernorAddresses are Equal func (ga GovernorAddress) Equals(ga2 sdk.Address) bool { if ga.Empty() && ga2.Empty() { diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index 3aebc6c9b..504c4f3a4 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -51,6 +51,12 @@ var ( // ParamsKey is the key to query all gov params ParamsKey = []byte{0x30} + + // GovernorKeyPrefix is the prefix for governor key + GovernorKeyPrefix = []byte{0x40} + GovernanceDelegationsByGovernorKeyPrefix = []byte{0x41} + GovernanceDelegationByDelegatorKeyPrefix = []byte{0x42} + ValidatorSharesByGovernorKeyPrefix = []byte{0x43} ) var lenTime = len(sdk.FormatTimeBytes(time.Now())) @@ -117,6 +123,28 @@ func VoteKey(proposalID uint64, voterAddr sdk.AccAddress) []byte { return append(VotesKey(proposalID), address.MustLengthPrefix(voterAddr.Bytes())...) } +// GovernorKey gets the first part of the governor key based on the governor address +func GovernorKey(governorAddr GovernorAddress) []byte { + return append(GovernorKeyPrefix, address.MustLengthPrefix(governorAddr.Bytes())...) +} + +// GovernanceDelegationsByGovernorKey gets the first part of the governance delegation key based +// on the governor address and delegator address +func GovernanceDelegationsByGovernorKey(governorAddr GovernorAddress, delegatorAddr sdk.AccAddress) []byte { + return append(GovernanceDelegationsByGovernorKeyPrefix, append(address.MustLengthPrefix(governorAddr.Bytes()), address.MustLengthPrefix(delegatorAddr.Bytes())...)...) +} + +// GovernanceDelegationByDelegatorKey gets the first part of the governance delegation key based on the delegator address +func GovernanceDelegationByDelegatorKey(delegatorAddr sdk.AccAddress) []byte { + return append(GovernanceDelegationByDelegatorKeyPrefix, address.MustLengthPrefix(delegatorAddr.Bytes())...) +} + +// ValidatorSharesByGovernorKey gets the first part of the validator shares key based +// on the governor address and validator address +func ValidatorSharesByGovernorKey(governorAddr GovernorAddress, validatorAddr sdk.ValAddress) []byte { + return append(ValidatorSharesByGovernorKeyPrefix, append(address.MustLengthPrefix(governorAddr.Bytes()), address.MustLengthPrefix(validatorAddr.Bytes())...)...) +} + // Split keys function; used for iterators // SplitProposalKey split the proposal key and returns the proposal id diff --git a/x/gov/types/v1/exported.go b/x/gov/types/v1/exported.go index c6926770a..99962aa04 100644 --- a/x/gov/types/v1/exported.go +++ b/x/gov/types/v1/exported.go @@ -1,10 +1,12 @@ package v1 +import "github.com/atomone-hub/atomone/x/gov/types" + type GovernorI interface { GetMoniker() string // moniker of the governor GetStatus() GovernorStatus // status of the governor IsActive() bool // check if has a active status IsInactive() bool // check if has status inactive - GetAddress() GovernorAddress // governor address to receive/return governors delegations + GetAddress() types.GovernorAddress // governor address to receive/return governors delegations GetDescription() GovernorDescription // description of the governor } diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 0adb7f8e4..080b6afb3 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/errors" "cosmossdk.io/math" + "github.com/atomone-hub/atomone/x/gov/types" "github.com/cosmos/cosmos-sdk/codec" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -221,8 +222,8 @@ func (g *Governor) Equal(v2 *Governor) bool { func (g Governor) GetMoniker() string { return g.Description.Moniker } func (g Governor) GetStatus() GovernorStatus { return g.Status } func (g Governor) GetDescription() GovernorDescription { return g.Description } -func (g Governor) GetAddress() GovernorAddress { - addr, err := GovernorAddressFromBech32(g.GovernorAddress) +func (g Governor) GetAddress() types.GovernorAddress { + addr, err := types.GovernorAddressFromBech32(g.GovernorAddress) if err != nil { panic(err) } diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index 622b4817f..0c6d56bd1 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -3,19 +3,20 @@ package v1 import ( "cosmossdk.io/math" + "github.com/atomone-hub/atomone/x/gov/types" sdk "github.com/cosmos/cosmos-sdk/types" ) // GovernorGovInfo used for tallying type GovernorGovInfo struct { - Address GovernorAddress // address of the governor - ValShares map[string]sdk.Dec // shares held for each validator - ValSharesDeductions map[string]sdk.Dec // deductions from validator's shares when a delegator votes independently - Vote WeightedVoteOptions // vote of the governor + Address types.GovernorAddress // address of the governor + ValShares map[string]sdk.Dec // shares held for each validator + ValSharesDeductions map[string]sdk.Dec // deductions from validator's shares when a delegator votes independently + Vote WeightedVoteOptions // vote of the governor } // NewGovernorGovInfo creates a GovernorGovInfo instance -func NewGovernorGovInfo(address GovernorAddress, valShares []*GovernorValShares, options WeightedVoteOptions) GovernorGovInfo { +func NewGovernorGovInfo(address types.GovernorAddress, valShares []*GovernorValShares, options WeightedVoteOptions) GovernorGovInfo { valSharesMap := make(map[string]sdk.Dec) for _, valShare := range valShares { valSharesMap[valShare.ValidatorAddress] = valShare.Shares From 700703dda6d5ba3751f5f4e6ba01629e10cfdca6 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:56:26 +0200 Subject: [PATCH 07/43] ... --- x/gov/keeper/delegation.go | 111 +++++++++++++++++++++++++++++++++++++ x/gov/keeper/governor.go | 43 ++++++++++++++ x/gov/keeper/tally.go | 11 ++-- x/gov/types/keys.go | 20 +++---- x/gov/types/v1/tally.go | 2 +- 5 files changed, 172 insertions(+), 15 deletions(-) create mode 100644 x/gov/keeper/delegation.go create mode 100644 x/gov/keeper/governor.go diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go new file mode 100644 index 000000000..4dd3882fb --- /dev/null +++ b/x/gov/keeper/delegation.go @@ -0,0 +1,111 @@ +package keeper + +import ( + "github.com/atomone-hub/atomone/x/gov/types" + v1 "github.com/atomone-hub/atomone/x/gov/types/v1" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetGovernanceDelegation sets a governance delegation in the store +func (k Keeper) SetGovernanceDelegation(ctx sdk.Context, delegation v1.GovernanceDelegation) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) + b := k.cdc.MustMarshal(&delegation) + delAddr := sdk.MustAccAddressFromBech32(delegation.DelegatorAddress) + store.Set(types.GovernanceDelegationKey(delAddr), b) + + // Set the reverse mapping from governor to delegation + // mainly for querying all delegations for a governor + // TODO: see if we can avoid duplicate storage + govAddr := types.MustGovernorAddressFromBech32(delegation.GovernorAddress) + store = prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) + store.Set(types.GovernanceDelegationsByGovernorKey(govAddr, delAddr), b) +} + +// GetGovernanceDelegation gets a governance delegation from the store +func (k Keeper) GetGovernanceDelegation(ctx sdk.Context, delegatorAddr sdk.AccAddress) (v1.GovernanceDelegation, bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) + b := store.Get(types.GovernanceDelegationKey(delegatorAddr)) + if b == nil { + return v1.GovernanceDelegation{}, false + } + var delegation v1.GovernanceDelegation + k.cdc.MustUnmarshal(b, &delegation) + return delegation, true +} + +// RemoveGovernanceDelegation removes a governance delegation from the store +func (k Keeper) RemoveGovernanceDelegation(ctx sdk.Context, delegatorAddr sdk.AccAddress) { + // need to remove from both the delegator and governor mapping + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) + delegation, found := k.GetGovernanceDelegation(ctx, delegatorAddr) + if !found { + return + } + delAddr := sdk.MustAccAddressFromBech32(delegation.DelegatorAddress) + store.Delete(types.GovernanceDelegationKey(delAddr)) + + govAddr := types.MustGovernorAddressFromBech32(delegation.GovernorAddress) + store = prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) + store.Delete(types.GovernanceDelegationsByGovernorKey(govAddr, delAddr)) +} + +// SetGovernorValShares sets a governor validator shares in the store +func (k Keeper) SetGovernorValShares(ctx sdk.Context, share v1.GovernorValShares) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ValidatorSharesByGovernorKeyPrefix) + b := k.cdc.MustMarshal(&share) + govAddr := types.MustGovernorAddressFromBech32(share.GovernorAddress) + valAddr, err := sdk.ValAddressFromBech32(share.ValidatorAddress) + if err != nil { + panic(err) + } + store.Set(types.ValidatorSharesByGovernorKey(govAddr, valAddr), b) +} + +// GetGovernorValShares gets a governor validator shares from the store +func (k Keeper) GetGovernorValShares(ctx sdk.Context, governorAddr types.GovernorAddress, validatorAddr sdk.ValAddress) (v1.GovernorValShares, bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ValidatorSharesByGovernorKeyPrefix) + b := store.Get(types.ValidatorSharesByGovernorKey(governorAddr, validatorAddr)) + if b == nil { + return v1.GovernorValShares{}, false + } + var share v1.GovernorValShares + k.cdc.MustUnmarshal(b, &share) + return share, true +} + +// RemoveGovernorValShares removes a governor validator shares from the store +func (k Keeper) RemoveGovernorValShares(ctx sdk.Context, governorAddr types.GovernorAddress, validatorAddr sdk.ValAddress) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ValidatorSharesByGovernorKeyPrefix) + store.Delete(types.ValidatorSharesByGovernorKey(governorAddr, validatorAddr)) +} + +// GetAllGovernanceDelegationsByGovernor gets all governance delegations for a specific governor +func (k Keeper) GetAllGovernanceDelegationsByGovernor(ctx sdk.Context, governorAddr types.GovernorAddress) []v1.GovernanceDelegation { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationsByGovernorKeyPrefix) + iterator := sdk.KVStorePrefixIterator(store, types.GovernanceDelegationsByGovernorKey(governorAddr, []byte{})) + defer iterator.Close() + + var delegations []v1.GovernanceDelegation + for ; iterator.Valid(); iterator.Next() { + var delegation v1.GovernanceDelegation + k.cdc.MustUnmarshal(iterator.Value(), &delegation) + delegations = append(delegations, delegation) + } + return delegations +} + +// GetAllGovernorValShares gets all governor validators shares +func (k Keeper) GetAllGovernorValShares(ctx sdk.Context, governorAddr types.GovernorAddress) []v1.GovernorValShares { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ValidatorSharesByGovernorKeyPrefix) + iterator := sdk.KVStorePrefixIterator(store, types.ValidatorSharesByGovernorKey(governorAddr, []byte{})) + defer iterator.Close() + + var shares []v1.GovernorValShares + for ; iterator.Valid(); iterator.Next() { + var share v1.GovernorValShares + k.cdc.MustUnmarshal(iterator.Value(), &share) + shares = append(shares, share) + } + return shares +} diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go new file mode 100644 index 000000000..3f7bc21f2 --- /dev/null +++ b/x/gov/keeper/governor.go @@ -0,0 +1,43 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/atomone-hub/atomone/x/gov/types" + v1 "github.com/atomone-hub/atomone/x/gov/types/v1" +) + +// GetGovernor returns the governor with the provided address +func (k Keeper) GetGovernor(ctx sdk.Context, addr types.GovernorAddress) (v1.Governor, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.GovernorKey(addr)) + if bz == nil { + return v1.Governor{}, false + } + + var governor v1.Governor + v1.MustMarshalGovernor(k.cdc, &governor) + return governor, true +} + +// SetGovernor sets the governor in the store +func (k Keeper) SetGovernor(ctx sdk.Context, governor v1.Governor) { + store := ctx.KVStore(k.storeKey) + bz := v1.MustMarshalGovernor(k.cdc, &governor) + store.Set(types.GovernorKey(governor.GetAddress()), bz) +} + +// GetAllGovernors returns all governors +func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors []v1.Governor) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, types.GovernorKeyPrefix) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + governor := v1.MustUnmarshalGovernor(k.cdc, iterator.Value()) + governors = append(governors, governor) + } + + return governors +} diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index c2b7f8d84..b6e6d04cb 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" ) @@ -34,7 +35,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, keeper.IterateGovernorsByPower(ctx, func(index int64, governor v1.GovernorI) (stop bool) { currGovernors[governor.GetAddress().String()] = v1.NewGovernorGovInfo( governor.GetAddress(), - keeper.GovernorValShares(ctx, governor.GetAddress()), + keeper.GetAllGovernorValShares(ctx, governor.GetAddress()), v1.WeightedVoteOptions{}, ) return false @@ -46,17 +47,19 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, voter := sdk.MustAccAddressFromBech32(vote.Voter) // if voter is a governor record it in the map - govAddrStr := v1.GovernorAddress(voter.Bytes()).String() + govAddrStr := types.GovernorAddress(voter.Bytes()).String() if gov, ok := currGovernors[govAddrStr]; ok { gov.Vote = vote.Options currGovernors[govAddrStr] = gov } - g, governorDelegationPercentage, hasGovernor := keeper.GetDelegatorGovernor(ctx, voter) + governorDelegationPercentage := sdk.ZeroDec() + gd, hasGovernor := keeper.GetGovernanceDelegation(ctx, voter) if hasGovernor { - if gi, ok := currGovernors[g.GetAddress().String()]; ok { + if gi, ok := currGovernors[gd.GovernorAddress]; ok { governor = gi } + governorDelegationPercentage = sdk.MustNewDecFromStr(gd.Percentage) } // iterate over all delegations from voter diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index 504c4f3a4..abc6e789d 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -54,9 +54,9 @@ var ( // GovernorKeyPrefix is the prefix for governor key GovernorKeyPrefix = []byte{0x40} - GovernanceDelegationsByGovernorKeyPrefix = []byte{0x41} - GovernanceDelegationByDelegatorKeyPrefix = []byte{0x42} - ValidatorSharesByGovernorKeyPrefix = []byte{0x43} + GovernanceDelegationKeyPrefix = []byte{0x41} + ValidatorSharesByGovernorKeyPrefix = []byte{0x42} + GovernanceDelegationsByGovernorKeyPrefix = []byte{0x43} ) var lenTime = len(sdk.FormatTimeBytes(time.Now())) @@ -128,15 +128,15 @@ func GovernorKey(governorAddr GovernorAddress) []byte { return append(GovernorKeyPrefix, address.MustLengthPrefix(governorAddr.Bytes())...) } -// GovernanceDelegationsByGovernorKey gets the first part of the governance delegation key based -// on the governor address and delegator address -func GovernanceDelegationsByGovernorKey(governorAddr GovernorAddress, delegatorAddr sdk.AccAddress) []byte { - return append(GovernanceDelegationsByGovernorKeyPrefix, append(address.MustLengthPrefix(governorAddr.Bytes()), address.MustLengthPrefix(delegatorAddr.Bytes())...)...) +// GovernanceDelegationKey gets the first part of the governance delegation key based on the delegator address +func GovernanceDelegationKey(delegatorAddr sdk.AccAddress) []byte { + return append(GovernanceDelegationKeyPrefix, address.MustLengthPrefix(delegatorAddr.Bytes())...) } -// GovernanceDelegationByDelegatorKey gets the first part of the governance delegation key based on the delegator address -func GovernanceDelegationByDelegatorKey(delegatorAddr sdk.AccAddress) []byte { - return append(GovernanceDelegationByDelegatorKeyPrefix, address.MustLengthPrefix(delegatorAddr.Bytes())...) +// GovernanceDelegationsByGovernorKey gets the first part of the governance delegations key based on +// the governor and delegator address +func GovernanceDelegationsByGovernorKey(governorAddr GovernorAddress, delegatorAddr sdk.AccAddress) []byte { + return append(GovernanceDelegationsByGovernorKeyPrefix, append(address.MustLengthPrefix(governorAddr.Bytes()), address.MustLengthPrefix(delegatorAddr.Bytes())...)...) } // ValidatorSharesByGovernorKey gets the first part of the validator shares key based diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index 0c6d56bd1..938f6d0c6 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -16,7 +16,7 @@ type GovernorGovInfo struct { } // NewGovernorGovInfo creates a GovernorGovInfo instance -func NewGovernorGovInfo(address types.GovernorAddress, valShares []*GovernorValShares, options WeightedVoteOptions) GovernorGovInfo { +func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValShares, options WeightedVoteOptions) GovernorGovInfo { valSharesMap := make(map[string]sdk.Dec) for _, valShare := range valShares { valSharesMap[valShare.ValidatorAddress] = valShare.Shares From f6c3392804e5d8d3ddbe08a78416c80975f8b994 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:18:11 +0200 Subject: [PATCH 08/43] missing governor election --- x/gov/keeper/governor.go | 19 +++++++- x/gov/keeper/tally.go | 4 +- x/gov/types/v1/governor.go | 99 +++++++++----------------------------- 3 files changed, 43 insertions(+), 79 deletions(-) diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index 3f7bc21f2..b8b556e7a 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -28,7 +28,7 @@ func (k Keeper) SetGovernor(ctx sdk.Context, governor v1.Governor) { } // GetAllGovernors returns all governors -func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors []v1.Governor) { +func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors v1.Governors) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.GovernorKeyPrefix) @@ -41,3 +41,20 @@ func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors []v1.Governor) { return governors } + +// GetAllActiveGovernors returns all active governors +func (k Keeper) GetAllActiveGovernors(ctx sdk.Context) (governors v1.Governors) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, types.GovernorKeyPrefix) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + governor := v1.MustUnmarshalGovernor(k.cdc, iterator.Value()) + if governor.IsActive() { + governors = append(governors, governor) + } + } + + return governors +} diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index b6e6d04cb..52a6d9bdc 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -31,8 +31,8 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, return false }) - // fetch all the governors, insert them into currGovernors - keeper.IterateGovernorsByPower(ctx, func(index int64, governor v1.GovernorI) (stop bool) { + // fetch all the top active param.MaxGovernors governors by delegated VP, insert them into currGovernors + keeper.IterateGovernorsByGovernancePower(ctx, func(index int64, governor v1.GovernorI) (stop bool) { currGovernors[governor.GetAddress().String()] = v1.NewGovernorGovInfo( governor.GetAddress(), keeper.GetAllGovernorValShares(ctx, governor.GetAddress()), diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 080b6afb3..b430373da 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -5,21 +5,12 @@ import ( "sort" "strings" - "cosmossdk.io/core/address" "cosmossdk.io/errors" - "cosmossdk.io/math" "github.com/atomone-hub/atomone/x/gov/types" "github.com/cosmos/cosmos-sdk/codec" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const ( - MaxMonikerLength = 70 - MaxIdentityLength = 3000 - MaxWebsiteLength = 140 - MaxSecurityContactLength = 140 - MaxDetailsLength = 280 + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var ( @@ -40,71 +31,34 @@ func NewGovernor(address string, description GovernorDescription) (Governor, err } // Governors is a collection of Governor -type Governors struct { - Governors []Governor - GovernorCodec address.Codec -} +type Governors []Governor func (g Governors) String() (out string) { - for _, gov := range g.Governors { + for _, gov := range g { out += gov.String() + "\n" } return strings.TrimSpace(out) } -// Sort Governors sorts governor array in ascending operator address order +// Sort Governors sorts governor array in ascending governor address order func (g Governors) Sort() { sort.Sort(g) } // Implements sort interface func (g Governors) Len() int { - return len(g.Governors) + return len(g) } // Implements sort interface func (g Governors) Less(i, j int) bool { - gi, err := g.GovernorCodec.StringToBytes(g.Governors[i].GetAddress().String()) - if err != nil { - panic(err) - } - gj, err := g.GovernorCodec.StringToBytes(g.Governors[j].GetAddress().String()) - if err != nil { - panic(err) - } - - return bytes.Compare(gi, gj) == -1 + return bytes.Compare(g[i].GetAddress().Bytes(), g[j].GetAddress().Bytes()) == -1 } // Implements sort interface func (g Governors) Swap(i, j int) { - g.Governors[i], g.Governors[j] = g.Governors[j], g.Governors[i] -} - -// GovernorsByVotingPower implements sort.Interface for []Governor based on -// the VotingPower and Address fields. -// The vovernors are sorted first by their voting power (descending). Secondary index - Address (ascending). -// Copied from tendermint/types/vovernor_set.go -type GovernorsByVotingPower []Governor - -func (govs GovernorsByVotingPower) Len() int { return len(govs) } - -func (govs GovernorsByVotingPower) Less(i, j int, r math.Int) bool { - if valz[i].ConsensusPower(r) == valz[j].ConsensusPower(r) { - addrI, errI := valz[i].GetConsAddr() - addrJ, errJ := valz[j].GetConsAddr() - // If either returns error, then return false - if errI != nil || errJ != nil { - return false - } - return bytes.Compare(addrI, addrJ) == -1 - } - return valz[i].ConsensusPower(r) > valz[j].ConsensusPower(r) -} - -func (govs GovernorsByVotingPower) Swap(i, j int) { - govs[i], govs[j] = govs[j], govs[i] + g[i], g[j] = g[j], g[i] } func MustMarshalGovernor(cdc codec.BinaryCodec, governor *Governor) []byte { @@ -136,9 +90,6 @@ func (g Governor) IsInactive() bool { return g.GetStatus() == Inactive } -// constant used in flags to indicate that description field should not be updated -const DoNotModifyDesc = "[do-not-modify]" - func NewGovernorDescription(moniker, identity, website, securityContact, details string) GovernorDescription { return GovernorDescription{ Moniker: moniker, @@ -152,23 +103,23 @@ func NewGovernorDescription(moniker, identity, website, securityContact, details // UpdateDescription updates the fields of a given description. An error is // returned if the resulting description contains an invalid length. func (d GovernorDescription) UpdateDescription(d2 GovernorDescription) (GovernorDescription, error) { - if d2.Moniker == DoNotModifyDesc { + if d2.Moniker == stakingtypes.DoNotModifyDesc { d2.Moniker = d.Moniker } - if d2.Identity == DoNotModifyDesc { + if d2.Identity == stakingtypes.DoNotModifyDesc { d2.Identity = d.Identity } - if d2.Website == DoNotModifyDesc { + if d2.Website == stakingtypes.DoNotModifyDesc { d2.Website = d.Website } - if d2.SecurityContact == DoNotModifyDesc { + if d2.SecurityContact == stakingtypes.DoNotModifyDesc { d2.SecurityContact = d.SecurityContact } - if d2.Details == DoNotModifyDesc { + if d2.Details == stakingtypes.DoNotModifyDesc { d2.Details = d.Details } @@ -183,24 +134,24 @@ func (d GovernorDescription) UpdateDescription(d2 GovernorDescription) (Governor // EnsureLength ensures the length of a vovernor's description. func (d GovernorDescription) EnsureLength() (GovernorDescription, error) { - if len(d.Moniker) > MaxMonikerLength { - return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid moniker length; got: %d, max: %d", len(d.Moniker), MaxMonikerLength) + if len(d.Moniker) > stakingtypes.MaxMonikerLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid moniker length; got: %d, max: %d", len(d.Moniker), stakingtypes.MaxMonikerLength) } - if len(d.Identity) > MaxIdentityLength { - return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid identity length; got: %d, max: %d", len(d.Identity), MaxIdentityLength) + if len(d.Identity) > stakingtypes.MaxIdentityLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid identity length; got: %d, max: %d", len(d.Identity), stakingtypes.MaxIdentityLength) } - if len(d.Website) > MaxWebsiteLength { - return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid website length; got: %d, max: %d", len(d.Website), MaxWebsiteLength) + if len(d.Website) > stakingtypes.MaxWebsiteLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid website length; got: %d, max: %d", len(d.Website), stakingtypes.MaxWebsiteLength) } - if len(d.SecurityContact) > MaxSecurityContactLength { - return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid security contact length; got: %d, max: %d", len(d.SecurityContact), MaxSecurityContactLength) + if len(d.SecurityContact) > stakingtypes.MaxSecurityContactLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid security contact length; got: %d, max: %d", len(d.SecurityContact), stakingtypes.MaxSecurityContactLength) } - if len(d.Details) > MaxDetailsLength { - return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid details length; got: %d, max: %d", len(d.Details), MaxDetailsLength) + if len(d.Details) > stakingtypes.MaxDetailsLength { + return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid details length; got: %d, max: %d", len(d.Details), stakingtypes.MaxDetailsLength) } return d, nil @@ -223,9 +174,5 @@ func (g Governor) GetMoniker() string { return g.Description.Mo func (g Governor) GetStatus() GovernorStatus { return g.Status } func (g Governor) GetDescription() GovernorDescription { return g.Description } func (g Governor) GetAddress() types.GovernorAddress { - addr, err := types.GovernorAddressFromBech32(g.GovernorAddress) - if err != nil { - panic(err) - } - return addr + return types.MustGovernorAddressFromBech32(g.GovernorAddress) } From 6951d84f414ae1e23b599b96ef06110882fa5fe9 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sat, 14 Sep 2024 19:10:34 +0200 Subject: [PATCH 09/43] not right, cannot iterate on all governors --- proto/atomone/gov/v1/gov.proto | 3 + x/gov/keeper/governor.go | 16 +++ x/gov/keeper/tally.go | 7 +- x/gov/simulation/genesis.go | 4 +- x/gov/types/v1/gov.pb.go | 251 +++++++++++++++++++-------------- x/gov/types/v1/params.go | 4 + 6 files changed, 176 insertions(+), 109 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 9aa13f811..259a59509 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -217,6 +217,9 @@ message Params { // burn deposits if quorum with vote type no_veto is met bool burn_vote_veto = 15; + + // defines the maximum number of governors that can be active at any given time. + uint64 max_governors = 20; } diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index b8b556e7a..c88c478e5 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -58,3 +58,19 @@ func (k Keeper) GetAllActiveGovernors(ctx sdk.Context) (governors v1.Governors) return governors } + +// IterateGovernors iterates over all governors and performs a callback function +func (k Keeper) IterateGovernors(ctx sdk.Context, cb func(index int64, governor v1.GovernorI) (stop bool)) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, types.GovernorKeyPrefix) + defer iterator.Close() + + for i := int64(0); iterator.Valid(); iterator.Next() { + governor := v1.MustUnmarshalGovernor(k.cdc, iterator.Value()) + if cb(i, governor) { + break + } + i++ + } +} diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 52a6d9bdc..66877dd3f 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -31,8 +31,11 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, return false }) - // fetch all the top active param.MaxGovernors governors by delegated VP, insert them into currGovernors - keeper.IterateGovernorsByGovernancePower(ctx, func(index int64, governor v1.GovernorI) (stop bool) { + // fetch all the active governors, insert them into currGovernors + keeper.IterateGovernors(ctx, func(index int64, governor v1.GovernorI) (stop bool) { + if !governor.IsActive() { + return false + } currGovernors[governor.GetAddress().String()] = v1.NewGovernorGovInfo( governor.GetAddress(), keeper.GetAllGovernorValShares(ctx, governor.GetAddress()), diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 82b78f212..dd11faec9 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -110,9 +110,11 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { veto = GenTallyParamsVeto(r) }, ) + maxGovernors := uint64(simState.Rand.Intn(100)) + govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0), + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, maxGovernors), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 44aed8a28..598271996 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -778,6 +778,8 @@ type Params struct { BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` // burn deposits if quorum with vote type no_veto is met BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` + // defines the maximum number of governors that can be active at any given time. + MaxGovernors uint64 `protobuf:"varint,20,opt,name=max_governors,json=maxGovernors,proto3" json:"max_governors,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -883,6 +885,13 @@ func (m *Params) GetBurnVoteVeto() bool { return false } +func (m *Params) GetMaxGovernors() uint64 { + if m != nil { + return m.MaxGovernors + } + return 0 +} + // Governor defines a governor, together with the total amount of delegated // validator's bond shares for a set amount of validators. When a delegator // delegates a percentage of its x/gov power to a governor, the resulting @@ -1118,112 +1127,113 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1668 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4d, 0x6f, 0x1b, 0xc7, - 0x19, 0xd6, 0x52, 0x14, 0x45, 0xbd, 0x92, 0xa8, 0xd5, 0x58, 0x75, 0xd6, 0x54, 0x4c, 0x2a, 0x6c, - 0x10, 0x28, 0x6a, 0x44, 0x46, 0x4e, 0x9b, 0x43, 0x9a, 0x0b, 0x25, 0x32, 0xce, 0x1a, 0xae, 0xc8, - 0x2e, 0x69, 0x1a, 0xe9, 0x65, 0x31, 0xe4, 0x8e, 0xc9, 0x41, 0xb8, 0x3b, 0xec, 0xee, 0x90, 0x36, - 0xff, 0x41, 0xea, 0x53, 0x8e, 0x45, 0x51, 0x03, 0x06, 0x7a, 0xe9, 0x31, 0x07, 0x03, 0xfd, 0x01, - 0xbd, 0xe4, 0xd4, 0x06, 0xbe, 0xf4, 0x03, 0x85, 0x5b, 0xd8, 0x87, 0x06, 0xf9, 0x0f, 0x05, 0x8a, - 0xf9, 0x58, 0x92, 0xa2, 0x68, 0x48, 0x0a, 0x72, 0x91, 0x76, 0xde, 0x79, 0x9e, 0x77, 0xde, 0xef, -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 0xac, 0x0f, 0x42, 0x36, 0x60, 0x11, 0xee, 0xbb, 0xd4, - 0x93, 0x87, 0x25, 0x1d, 0x88, 0x45, 0xb6, 0x87, 0x3e, 0x84, 0x35, 0x4f, 0x61, 0x59, 0xa8, 0xf5, - 0x5a, 0xcf, 0x9f, 0x1d, 0xee, 0x68, 0xbd, 0x65, 0xcf, 0x0b, 0x49, 0x14, 0x35, 0x78, 0x48, 0x83, - 0xae, 0x33, 0x85, 0xa2, 0x8f, 0x21, 0x85, 0x7d, 0x36, 0x0c, 0xb8, 0xb5, 0xbc, 0xb7, 0xbc, 0xbf, - 0x7e, 0xeb, 0x46, 0x51, 0x33, 0x44, 0x9e, 0x8a, 0x3a, 0x4f, 0xc5, 0x13, 0x46, 0x83, 0xe3, 0xb5, - 0xaf, 0x5f, 0xe4, 0x97, 0xfe, 0xf8, 0xdf, 0xaf, 0x0e, 0x0c, 0x47, 0x73, 0x0a, 0x7f, 0x5e, 0x81, - 0x74, 0x5d, 0x1b, 0x81, 0x32, 0x90, 0x98, 0x98, 0x96, 0xa0, 0x1e, 0x7a, 0x1f, 0xd2, 0x3e, 0x89, - 0x22, 0xdc, 0x25, 0x91, 0x95, 0x90, 0xca, 0x77, 0x8a, 0x2a, 0x25, 0xc5, 0x38, 0x25, 0xc5, 0x72, - 0x30, 0x76, 0x26, 0x28, 0xf4, 0x21, 0xa4, 0x22, 0x8e, 0xf9, 0x30, 0xb2, 0x96, 0x65, 0x34, 0x73, - 0xf3, 0xd1, 0x8c, 0xcf, 0x6a, 0x48, 0x94, 0xa3, 0xd1, 0xc8, 0x06, 0xf4, 0x80, 0x06, 0xb8, 0xef, - 0x72, 0xdc, 0xef, 0x8f, 0xdd, 0x90, 0x44, 0xc3, 0x3e, 0xb7, 0x92, 0x7b, 0xc6, 0xfe, 0xfa, 0xad, - 0xdd, 0x79, 0x1d, 0x4d, 0x81, 0x71, 0x24, 0xc4, 0x31, 0x25, 0x6d, 0x46, 0x82, 0xca, 0xb0, 0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9e, 0xc8, 0xfd, - 0x42, 0x13, 0x36, 0x5a, 0xb2, 0x05, 0xb4, 0x67, 0x15, 0xd0, 0x2d, 0x11, 0x9f, 0x6c, 0x5c, 0x74, - 0x72, 0x52, 0x6a, 0xde, 0x50, 0x2c, 0xad, 0xf5, 0x77, 0x71, 0x15, 0x6b, 0xad, 0xef, 0x40, 0xea, - 0xd7, 0x43, 0x16, 0x0e, 0xfd, 0x05, 0x25, 0x2c, 0xaf, 0x19, 0xb5, 0x8b, 0xde, 0x83, 0x35, 0xde, - 0x0b, 0x49, 0xd4, 0x63, 0x7d, 0xef, 0x35, 0x37, 0xd2, 0x14, 0x80, 0x7e, 0x06, 0x19, 0x59, 0x86, - 0x53, 0xca, 0xf2, 0x42, 0xca, 0xa6, 0x40, 0x35, 0x63, 0x50, 0xe1, 0xaf, 0x49, 0x48, 0x69, 0xbb, - 0xaa, 0x57, 0xcc, 0xe3, 0xcc, 0x40, 0x9b, 0xcd, 0xd9, 0x2f, 0xbe, 0x5f, 0xce, 0x92, 0x8b, 0x73, - 0x72, 0x3e, 0x07, 0xcb, 0xdf, 0x23, 0x07, 0x33, 0x31, 0x4f, 0x5e, 0x3e, 0xe6, 0x2b, 0x57, 0x8f, - 0x79, 0xea, 0x12, 0x31, 0x47, 0x36, 0xdc, 0x10, 0x81, 0xa6, 0x01, 0xe5, 0x74, 0x7a, 0x83, 0xb8, - 0xd2, 0x7c, 0x6b, 0x75, 0xa1, 0x86, 0xeb, 0x3e, 0x0d, 0x6c, 0x85, 0xd7, 0xe1, 0x71, 0x04, 0x1a, - 0xed, 0x83, 0xd9, 0x1e, 0x86, 0x81, 0x2b, 0x7a, 0xdf, 0xd5, 0x1e, 0x8a, 0xf9, 0x9a, 0x76, 0x32, - 0x42, 0x2e, 0x5a, 0xfc, 0x97, 0xca, 0xb3, 0x32, 0xdc, 0x94, 0xc8, 0xc9, 0xb4, 0x99, 0x24, 0x28, - 0x24, 0x82, 0x6d, 0x65, 0x24, 0x2d, 0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38, 0xfb, 0x54, 0x23, 0x13, 0xd9, 0x8d, 0xc7, 0x4f, 0xf6, 0xd2, 0x76, 0x80, - 0x25, 0x36, 0x9b, 0xfc, 0xe2, 0x0f, 0xb9, 0xa5, 0xe3, 0xdb, 0x5f, 0xbf, 0xcc, 0x19, 0xdf, 0xbc, - 0xcc, 0x19, 0xff, 0x79, 0x99, 0x33, 0xbe, 0x7c, 0x95, 0x5b, 0xfa, 0xe6, 0x55, 0x6e, 0xe9, 0xef, - 0xaf, 0x72, 0x4b, 0xbf, 0x3a, 0xec, 0x52, 0xde, 0x1b, 0xb6, 0x8b, 0x1d, 0xe6, 0x97, 0xf4, 0xe0, - 0x3b, 0xec, 0x0d, 0xdb, 0xf1, 0x73, 0xe9, 0x91, 0xfc, 0x81, 0x80, 0x8f, 0x07, 0x24, 0x12, 0x1f, - 0xff, 0x29, 0x79, 0x9d, 0x7e, 0xf0, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x95, 0x8c, 0xc9, 0x9e, - 0x3f, 0x10, 0x00, 0x00, + // 1686 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, + 0x15, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x49, 0xd4, 0x6a, 0xac, 0x3a, 0x6b, 0x2a, 0x26, 0x15, 0x26, + 0x08, 0x14, 0x35, 0x22, 0x23, 0xa7, 0xcd, 0x21, 0xcd, 0x85, 0x12, 0x19, 0x67, 0x0d, 0x57, 0x64, + 0x97, 0x34, 0x8d, 0xf4, 0xb2, 0x18, 0x72, 0xc7, 0xe4, 0x20, 0xdc, 0x1d, 0x76, 0x77, 0x48, 0x9b, + 0xff, 0x41, 0xea, 0x53, 0x8e, 0x45, 0x51, 0x03, 0x06, 0x7a, 0xe9, 0x31, 0x07, 0x03, 0xfd, 0x03, + 0x7a, 0xc9, 0xa9, 0x08,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x5a, 0xab, 0xea, 0x9c, 0xd6, 0x9c, 0x85, 0x0e, 0x65, 0xb7, 0x1e, 0x3f, + 0xd9, 0x5b, 0xbf, 0x17, 0x44, 0x03, 0xd2, 0xa1, 0x0f, 0x28, 0x11, 0x37, 0xd5, 0xf5, 0x79, 0x46, + 0xf9, 0xa4, 0x69, 0xb7, 0xaa, 0xa6, 0x91, 0x85, 0xc7, 0x4f, 0xf6, 0x52, 0xe5, 0x0e, 0xa7, 0x23, + 0x82, 0x0e, 0xc0, 0x9a, 0xc7, 0xd9, 0xa7, 0x1a, 0x99, 0xc8, 0x6e, 0x3c, 0x7e, 0xb2, 0x97, 0xb6, + 0x03, 0x2c, 0xb1, 0xd9, 0xe4, 0x97, 0xbf, 0xcf, 0x2d, 0x1d, 0xdf, 0xfe, 0xe6, 0x65, 0xce, 0xf8, + 0xf6, 0x65, 0xce, 0xf8, 0xd7, 0xcb, 0x9c, 0xf1, 0xd5, 0xab, 0xdc, 0xd2, 0xb7, 0xaf, 0x72, 0x4b, + 0x7f, 0x7d, 0x95, 0x5b, 0xfa, 0xe5, 0x61, 0x97, 0xf2, 0xde, 0xb0, 0x5d, 0xec, 0x30, 0xbf, 0xa4, + 0x07, 0xdf, 0x61, 0x6f, 0xd8, 0x8e, 0x9f, 0x4b, 0x8f, 0xe4, 0xaf, 0x08, 0x7c, 0x3c, 0x20, 0x51, + 0x69, 0x74, 0xd4, 0x4e, 0xc9, 0x3b, 0xf7, 0xc3, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x11, 0xa2, + 0x0f, 0xb8, 0x64, 0x10, 0x00, 0x00, } func (this *GovernorDescription) Equal(that interface{}) bool { @@ -1738,6 +1748,13 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MaxGovernors != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.MaxGovernors)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } if m.BurnVoteVeto { i-- if m.BurnVoteVeto { @@ -2288,6 +2305,9 @@ func (m *Params) Size() (n int) { if m.BurnVoteVeto { n += 2 } + if m.MaxGovernors != 0 { + n += 2 + sovGov(uint64(m.MaxGovernors)) + } return n } @@ -4104,6 +4124,25 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.BurnVoteVeto = bool(v != 0) + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxGovernors", wireType) + } + m.MaxGovernors = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxGovernors |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index ef72de653..e0409480c 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -24,6 +24,7 @@ var ( DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47) DefaultBurnVoteQuorom = false // set to false to replicate behavior of when this change was made (0.47) DefaultBurnVoteVeto = true // set to true to replicate behavior of when this change was made (0.47) + DefaultMaxGovernors = uint64(100) ) // Deprecated: NewDepositParams creates a new DepositParams object @@ -54,6 +55,7 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { func NewParams( minDeposit sdk.Coins, maxDepositPeriod, votingPeriod time.Duration, quorum, threshold, vetoThreshold, minInitialDepositRatio string, burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, + maxGovernors uint64, ) Params { return Params{ MinDeposit: minDeposit, @@ -66,6 +68,7 @@ func NewParams( BurnProposalDepositPrevote: burnProposalDeposit, BurnVoteQuorum: burnVoteQuorum, BurnVoteVeto: burnVoteVeto, + MaxGovernors: maxGovernors, } } @@ -82,6 +85,7 @@ func DefaultParams() Params { DefaultBurnProposalPrevote, DefaultBurnVoteQuorom, DefaultBurnVoteVeto, + DefaultMaxGovernors, ) } From 1a8495ca2f4bf40a81e4d5219e94fe68895fa3a9 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 00:24:17 +0200 Subject: [PATCH 10/43] remove percentage and try sorting governors by VP can only delegate all or nothing to governors now --- app/keepers/keepers.go | 1 + proto/atomone/gov/v1/gov.proto | 8 +- x/gov/keeper/delegation.go | 135 ++++++++++++-- x/gov/keeper/governor.go | 32 ++++ x/gov/keeper/hooks.go | 116 ++++++++++++ x/gov/keeper/tally.go | 11 +- x/gov/types/expected_keepers.go | 3 + x/gov/types/keys.go | 25 ++- x/gov/types/v1/delegation.go | 46 +++++ x/gov/types/v1/gov.pb.go | 303 ++++++++++++++++---------------- x/gov/types/v1/governor.go | 25 +++ 11 files changed, 529 insertions(+), 176 deletions(-) create mode 100644 x/gov/keeper/hooks.go create mode 100644 x/gov/types/v1/delegation.go diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 09e5efc4c..fb769f9b3 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -213,6 +213,7 @@ func NewAppKeeper( stakingtypes.NewMultiStakingHooks( appKeepers.DistrKeeper.Hooks(), appKeepers.SlashingKeeper.Hooks(), + appKeepers.GovKeeper.StakingHooks(), ), ) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 259a59509..dde4229ee 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -238,6 +238,12 @@ message Governor { GovernorStatus status = 2; // description defines the description terms for the governor. GovernorDescription description = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // voting_power defines the voting power of the governor. + string voting_power = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } // GovernorStatus is the status of a governor. @@ -292,6 +298,4 @@ message GovernanceDelegation { string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string governor_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. - string percentage = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; } diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 4dd3882fb..7f2344fba 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -3,13 +3,13 @@ package keeper import ( "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // SetGovernanceDelegation sets a governance delegation in the store func (k Keeper) SetGovernanceDelegation(ctx sdk.Context, delegation v1.GovernanceDelegation) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) + store := ctx.KVStore(k.storeKey) b := k.cdc.MustMarshal(&delegation) delAddr := sdk.MustAccAddressFromBech32(delegation.DelegatorAddress) store.Set(types.GovernanceDelegationKey(delAddr), b) @@ -18,13 +18,12 @@ func (k Keeper) SetGovernanceDelegation(ctx sdk.Context, delegation v1.Governanc // mainly for querying all delegations for a governor // TODO: see if we can avoid duplicate storage govAddr := types.MustGovernorAddressFromBech32(delegation.GovernorAddress) - store = prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) store.Set(types.GovernanceDelegationsByGovernorKey(govAddr, delAddr), b) } // GetGovernanceDelegation gets a governance delegation from the store func (k Keeper) GetGovernanceDelegation(ctx sdk.Context, delegatorAddr sdk.AccAddress) (v1.GovernanceDelegation, bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) + store := ctx.KVStore(k.storeKey) b := store.Get(types.GovernanceDelegationKey(delegatorAddr)) if b == nil { return v1.GovernanceDelegation{}, false @@ -37,7 +36,7 @@ func (k Keeper) GetGovernanceDelegation(ctx sdk.Context, delegatorAddr sdk.AccAd // RemoveGovernanceDelegation removes a governance delegation from the store func (k Keeper) RemoveGovernanceDelegation(ctx sdk.Context, delegatorAddr sdk.AccAddress) { // need to remove from both the delegator and governor mapping - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) + store := ctx.KVStore(k.storeKey) delegation, found := k.GetGovernanceDelegation(ctx, delegatorAddr) if !found { return @@ -46,13 +45,12 @@ func (k Keeper) RemoveGovernanceDelegation(ctx sdk.Context, delegatorAddr sdk.Ac store.Delete(types.GovernanceDelegationKey(delAddr)) govAddr := types.MustGovernorAddressFromBech32(delegation.GovernorAddress) - store = prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationKeyPrefix) store.Delete(types.GovernanceDelegationsByGovernorKey(govAddr, delAddr)) } // SetGovernorValShares sets a governor validator shares in the store func (k Keeper) SetGovernorValShares(ctx sdk.Context, share v1.GovernorValShares) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ValidatorSharesByGovernorKeyPrefix) + store := ctx.KVStore(k.storeKey) b := k.cdc.MustMarshal(&share) govAddr := types.MustGovernorAddressFromBech32(share.GovernorAddress) valAddr, err := sdk.ValAddressFromBech32(share.ValidatorAddress) @@ -60,11 +58,15 @@ func (k Keeper) SetGovernorValShares(ctx sdk.Context, share v1.GovernorValShares panic(err) } store.Set(types.ValidatorSharesByGovernorKey(govAddr, valAddr), b) + + // set the reverse mapping from validator to governor + // TODO: see if we can avoid duplicate storage + store.Set(types.ValidatorSharesByValidatorKey(valAddr, govAddr), b) } // GetGovernorValShares gets a governor validator shares from the store func (k Keeper) GetGovernorValShares(ctx sdk.Context, governorAddr types.GovernorAddress, validatorAddr sdk.ValAddress) (v1.GovernorValShares, bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ValidatorSharesByGovernorKeyPrefix) + store := ctx.KVStore(k.storeKey) b := store.Get(types.ValidatorSharesByGovernorKey(governorAddr, validatorAddr)) if b == nil { return v1.GovernorValShares{}, false @@ -74,15 +76,47 @@ func (k Keeper) GetGovernorValShares(ctx sdk.Context, governorAddr types.Governo return share, true } +// GetGovernorValSharesByValidator gets all governor validator shares for a specific validator +func (k Keeper) GetGovernorValSharesByValidator(ctx sdk.Context, validatorAddr sdk.ValAddress) []v1.GovernorValShares { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.ValidatorSharesByValidatorKey(validatorAddr, []byte{})) + defer iterator.Close() + + var shares []v1.GovernorValShares + for ; iterator.Valid(); iterator.Next() { + var share v1.GovernorValShares + k.cdc.MustUnmarshal(iterator.Value(), &share) + shares = append(shares, share) + } + return shares +} + +// IterateGovernorValSharesByValidator iterates over all governor validator shares for a specific validator +func (k Keeper) IterateGovernorValSharesByValidator(ctx sdk.Context, validatorAddr sdk.ValAddress, cb func(index int64, share v1.GovernorValShares) (stop bool)) { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.ValidatorSharesByValidatorKey(validatorAddr, []byte{})) + defer iterator.Close() + + for i := int64(0); iterator.Valid(); iterator.Next() { + var share v1.GovernorValShares + k.cdc.MustUnmarshal(iterator.Value(), &share) + if cb(i, share) { + break + } + i++ + } +} + // RemoveGovernorValShares removes a governor validator shares from the store func (k Keeper) RemoveGovernorValShares(ctx sdk.Context, governorAddr types.GovernorAddress, validatorAddr sdk.ValAddress) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ValidatorSharesByGovernorKeyPrefix) + store := ctx.KVStore(k.storeKey) store.Delete(types.ValidatorSharesByGovernorKey(governorAddr, validatorAddr)) + store.Delete(types.ValidatorSharesByValidatorKey(validatorAddr, governorAddr)) } // GetAllGovernanceDelegationsByGovernor gets all governance delegations for a specific governor func (k Keeper) GetAllGovernanceDelegationsByGovernor(ctx sdk.Context, governorAddr types.GovernorAddress) []v1.GovernanceDelegation { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.GovernanceDelegationsByGovernorKeyPrefix) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.GovernanceDelegationsByGovernorKey(governorAddr, []byte{})) defer iterator.Close() @@ -97,7 +131,7 @@ func (k Keeper) GetAllGovernanceDelegationsByGovernor(ctx sdk.Context, governorA // GetAllGovernorValShares gets all governor validators shares func (k Keeper) GetAllGovernorValShares(ctx sdk.Context, governorAddr types.GovernorAddress) []v1.GovernorValShares { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ValidatorSharesByGovernorKeyPrefix) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.ValidatorSharesByGovernorKey(governorAddr, []byte{})) defer iterator.Close() @@ -109,3 +143,82 @@ func (k Keeper) GetAllGovernorValShares(ctx sdk.Context, governorAddr types.Gove } return shares } + +// IncreaseGovernorShares increases the governor validator shares in the store +func (k Keeper) IncreaseGovernorShares(ctx sdk.Context, governorAddr types.GovernorAddress, validatorAddr sdk.ValAddress, shares sdk.Dec) { + valShares, found := k.GetGovernorValShares(ctx, governorAddr, validatorAddr) + if !found { + valShares = v1.NewGovernorValShares(governorAddr, validatorAddr, shares) + } else { + valShares.Shares = valShares.Shares.Add(shares) + } + k.SetGovernorValShares(ctx, valShares) + governor, _ := k.GetGovernor(ctx, governorAddr) + validator, _ := k.sk.GetValidator(ctx, validatorAddr) + vp := shares.MulInt(validator.GetBondedTokens()).Quo(validator.GetDelegatorShares()) + governor.SetVotingPower(governor.GetVotingPower().Add(vp)) + k.SetGovernor(ctx, governor) +} + +// DecreaseGovernorShares decreases the governor validator shares in the store +func (k Keeper) DecreaseGovernorShares(ctx sdk.Context, governorAddr types.GovernorAddress, validatorAddr sdk.ValAddress, shares sdk.Dec) { + share, found := k.GetGovernorValShares(ctx, governorAddr, validatorAddr) + if !found { + panic("cannot decrease shares for a non-existent governor delegation") + } + share.Shares = share.Shares.Sub(shares) + if share.Shares.IsNegative() { + panic("negative shares") + } + if share.Shares.IsZero() { + k.RemoveGovernorValShares(ctx, governorAddr, validatorAddr) + } else { + k.SetGovernorValShares(ctx, share) + } + governor, _ := k.GetGovernor(ctx, governorAddr) + validator, _ := k.sk.GetValidator(ctx, validatorAddr) + vp := shares.MulInt(validator.GetBondedTokens()).Quo(validator.GetDelegatorShares()) + governorVP := governor.GetVotingPower().Sub(vp) + if governorVP.IsNegative() { + panic("negative governor voting power") + } + governor.SetVotingPower(governorVP) + k.SetGovernor(ctx, governor) +} + +// UndelegateGovernor decreases all governor validator shares in the store +// and then removes the governor delegation for the given delegator +func (k Keeper) UndelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress) { + delegation, found := k.GetGovernanceDelegation(ctx, delegatorAddr) + if !found { + return + } + govAddr := types.MustGovernorAddressFromBech32(delegation.GovernorAddress) + // iterate all delegations of delegator and decrease shares + k.sk.IterateDelegations(ctx, delegatorAddr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { + k.DecreaseGovernorShares(ctx, govAddr, delegation.GetValidatorAddr(), delegation.GetShares()) + return false + }) + // remove the governor delegation + k.RemoveGovernanceDelegation(ctx, delegatorAddr) +} + +// DelegateGovernor creates a governor delegation for the given delegator +// and increases all governor validator shares in the store +func (k Keeper) DelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, governorAddr types.GovernorAddress) { + delegation := v1.NewGovernanceDelegation(delegatorAddr, governorAddr) + k.SetGovernanceDelegation(ctx, delegation) + // iterate all delegations of delegator and increase shares + k.sk.IterateDelegations(ctx, delegatorAddr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { + k.IncreaseGovernorShares(ctx, governorAddr, delegation.GetValidatorAddr(), delegation.GetShares()) + return false + }) +} + +// RedelegateGovernor re-delegates all governor validator shares from one governor to another +func (k Keeper) RedelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, srcGovernorAddr, dstGovernorAddr types.GovernorAddress) { + // undelegate from the source governor + k.UndelegateGovernor(ctx, delegatorAddr) + // delegate to the destination governor + k.DelegateGovernor(ctx, delegatorAddr, dstGovernorAddr) +} diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index c88c478e5..a49343308 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -74,3 +74,35 @@ func (k Keeper) IterateGovernors(ctx sdk.Context, cb func(index int64, governor i++ } } + +// governor by power index +func (k Keeper) SetGovernorByPowerIndex(ctx sdk.Context, governor v1.Governor) { + store := ctx.KVStore(k.storeKey) + store.Set(types.GovernorsByPowerKey(governor.GetAddress(), governor.GetVotingPower()), governor.GetAddress()) +} + +// governor by power index +func (k Keeper) DeleteValidatorByPowerIndex(ctx sdk.Context, governor v1.Governor) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.GovernorsByPowerKey(governor.GetAddress(), governor.GetVotingPower())) +} + +// IterateMaxGovernorsByGovernancePower iterates over the top params.MaxGovernors governors by governance power +func (k Keeper) IterateMaxGovernorsByGovernancePower(ctx sdk.Context, cb func(index int64, governor v1.GovernorI) (stop bool)) { + store := ctx.KVStore(k.storeKey) + maxGovernors := k.GetParams(ctx).MaxGovernors + var totGovernors uint64 = 0 + + iterator := sdk.KVStoreReversePrefixIterator(store, types.GovernorsByPowerKeyPrefix) + defer iterator.Close() + + for ; iterator.Valid() && totGovernors < maxGovernors; iterator.Next() { + governor := v1.MustUnmarshalGovernor(k.cdc, iterator.Value()) + if governor.IsActive() { + if cb(int64(totGovernors), governor) { + break + } + totGovernors++ + } + } +} diff --git a/x/gov/keeper/hooks.go b/x/gov/keeper/hooks.go new file mode 100644 index 000000000..fbb080c84 --- /dev/null +++ b/x/gov/keeper/hooks.go @@ -0,0 +1,116 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "github.com/atomone-hub/atomone/x/gov/types" + v1 "github.com/atomone-hub/atomone/x/gov/types/v1" +) + +// Hooks wrapper struct for gov keeper +type Hooks struct { + k Keeper +} + +var _ stakingtypes.StakingHooks = Hooks{} + +// Return the slashing hooks +func (k Keeper) StakingHooks() Hooks { + return Hooks{k} +} + +// BeforeDelegationSharesModified is called when a delegation's shares are modified +func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + // does the delegator have a governance delegation? + govDelegation, found := h.k.GetGovernanceDelegation(ctx, delAddr) + if !found { + return nil + } + govAddr := types.MustGovernorAddressFromBech32(govDelegation.GovernorAddress) + + // Fetch the delegation + delegation, _ := h.k.sk.GetDelegation(ctx, delAddr, valAddr) + + // update the Governor's Validator shares + h.k.DecreaseGovernorShares(ctx, govAddr, valAddr, delegation.Shares) + + return nil +} + +// AfterDelegationModified is called when a delegation is created or modified +func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + // does the delegator have a governance delegation? + govDelegation, found := h.k.GetGovernanceDelegation(ctx, delAddr) + if !found { + return nil + } + + // Fetch the delegation + delegation, found := h.k.sk.GetDelegation(ctx, delAddr, valAddr) + if !found { + return nil + } + + governor, _ := h.k.GetGovernor(ctx, types.MustGovernorAddressFromBech32(govDelegation.GovernorAddress)) + + // Calculate the new shares and update the Governor's shares + shares := delegation.Shares + + h.k.IncreaseGovernorShares(ctx, governor.GetAddress(), valAddr, shares) + + return nil +} + +// BeforeValidatorSlashed is called when a validator is slashed +func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error { + // iterate through all GovernorValShares and reduce the governor VP by the appropriate amount + h.k.IterateGovernorValSharesByValidator(ctx, valAddr, func(index int64, shares v1.GovernorValShares) bool { + govAddr := types.MustGovernorAddressFromBech32(shares.GovernorAddress) + governor, _ := h.k.GetGovernor(ctx, govAddr) + validator, _ := h.k.sk.GetValidator(ctx, valAddr) + tokensBurned := shares.Shares.MulInt(validator.GetBondedTokens()).Quo(validator.GetDelegatorShares()).Mul(fraction) + governorVP := governor.GetVotingPower().Sub(tokensBurned) + if governorVP.IsNegative() { + panic("negative governor voting power") + } + governor.SetVotingPower(governorVP) + h.k.SetGovernor(ctx, governor) + return false + }) + + return nil +} + +// BeforeDelegationRemoved is called when a delegation is removed +func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + return nil +} + +func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { + return nil +} + +func (h Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error { + return nil +} + +func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { + return nil +} + +func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { + return nil +} + +func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { + return nil +} + +func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + return nil +} + +func (h Hooks) AfterUnbondingInitiated(ctx sdk.Context, unbondingID uint64) error { + return nil +} diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 66877dd3f..7f4d765d7 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -31,11 +31,8 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, return false }) - // fetch all the active governors, insert them into currGovernors - keeper.IterateGovernors(ctx, func(index int64, governor v1.GovernorI) (stop bool) { - if !governor.IsActive() { - return false - } + // fetch all the active param.MaxGovernors top governors by voting power, insert them into currGovernors + keeper.IterateMaxGovernorsByGovernancePower(ctx, func(index int64, governor v1.GovernorI) (stop bool) { currGovernors[governor.GetAddress().String()] = v1.NewGovernorGovInfo( governor.GetAddress(), keeper.GetAllGovernorValShares(ctx, governor.GetAddress()), @@ -56,13 +53,11 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, currGovernors[govAddrStr] = gov } - governorDelegationPercentage := sdk.ZeroDec() gd, hasGovernor := keeper.GetGovernanceDelegation(ctx, voter) if hasGovernor { if gi, ok := currGovernors[gd.GovernorAddress]; ok { governor = gi } - governorDelegationPercentage = sdk.MustNewDecFromStr(gd.Percentage) } // iterate over all delegations from voter @@ -82,7 +77,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, // remove the delegation shares from the governor if hasGovernor { - governor.ValSharesDeductions[valAddrStr] = governor.ValSharesDeductions[valAddrStr].Add(delegation.GetShares().Mul(governorDelegationPercentage)) + governor.ValSharesDeductions[valAddrStr] = governor.ValSharesDeductions[valAddrStr].Add(delegation.GetShares()) } } diff --git a/x/gov/types/expected_keepers.go b/x/gov/types/expected_keepers.go index b486e5daf..bb78d19f4 100644 --- a/x/gov/types/expected_keepers.go +++ b/x/gov/types/expected_keepers.go @@ -16,6 +16,9 @@ type ParamSubspace interface { // StakingKeeper expected staking keeper (Validator and Delegator sets) (noalias) type StakingKeeper interface { + GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) + GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool) + // iterate through bonded validators by operator address, execute func for each validator IterateBondedValidatorsByPower( sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool), diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index abc6e789d..987fec87b 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -54,9 +54,11 @@ var ( // GovernorKeyPrefix is the prefix for governor key GovernorKeyPrefix = []byte{0x40} - GovernanceDelegationKeyPrefix = []byte{0x41} - ValidatorSharesByGovernorKeyPrefix = []byte{0x42} - GovernanceDelegationsByGovernorKeyPrefix = []byte{0x43} + GovernorsByPowerKeyPrefix = []byte{0x41} + GovernanceDelegationKeyPrefix = []byte{0x42} + ValidatorSharesByGovernorKeyPrefix = []byte{0x43} + GovernanceDelegationsByGovernorKeyPrefix = []byte{0x44} + ValidatorSharesByValidatorKeyPrefix = []byte{0x45} ) var lenTime = len(sdk.FormatTimeBytes(time.Now())) @@ -128,13 +130,20 @@ func GovernorKey(governorAddr GovernorAddress) []byte { return append(GovernorKeyPrefix, address.MustLengthPrefix(governorAddr.Bytes())...) } +// GovernorsByPowerKey gets the first part of the governors by power key based on the power and governor address +func GovernorsByPowerKey(governorAddr GovernorAddress, power sdk.Dec) []byte { + powerBytes := make([]byte, 8) + binary.BigEndian.PutUint64(powerBytes, uint64(power.TruncateInt64())) + return append(GovernorsByPowerKeyPrefix, append(powerBytes, address.MustLengthPrefix(governorAddr.Bytes())...)...) +} + // GovernanceDelegationKey gets the first part of the governance delegation key based on the delegator address func GovernanceDelegationKey(delegatorAddr sdk.AccAddress) []byte { return append(GovernanceDelegationKeyPrefix, address.MustLengthPrefix(delegatorAddr.Bytes())...) } -// GovernanceDelegationsByGovernorKey gets the first part of the governance delegations key based on -// the governor and delegator address +// GovernanceDelegationsByGovernorKey gets the first part of the key for governance delegations indexed by governor +// based on the delegator address and delegator address func GovernanceDelegationsByGovernorKey(governorAddr GovernorAddress, delegatorAddr sdk.AccAddress) []byte { return append(GovernanceDelegationsByGovernorKeyPrefix, append(address.MustLengthPrefix(governorAddr.Bytes()), address.MustLengthPrefix(delegatorAddr.Bytes())...)...) } @@ -145,6 +154,12 @@ func ValidatorSharesByGovernorKey(governorAddr GovernorAddress, validatorAddr sd return append(ValidatorSharesByGovernorKeyPrefix, append(address.MustLengthPrefix(governorAddr.Bytes()), address.MustLengthPrefix(validatorAddr.Bytes())...)...) } +// ValidatorSharesByValidatorKey gets the first part of the key for validator shares indexed by validator based on +// on the validator address and governor address +func ValidatorSharesByValidatorKey(validatorAddr sdk.ValAddress, governorAddr GovernorAddress) []byte { + return append(ValidatorSharesByValidatorKeyPrefix, append(address.MustLengthPrefix(validatorAddr.Bytes()), address.MustLengthPrefix(governorAddr.Bytes())...)...) +} + // Split keys function; used for iterators // SplitProposalKey split the proposal key and returns the proposal id diff --git a/x/gov/types/v1/delegation.go b/x/gov/types/v1/delegation.go new file mode 100644 index 000000000..941b17dd5 --- /dev/null +++ b/x/gov/types/v1/delegation.go @@ -0,0 +1,46 @@ +package v1 + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/atomone-hub/atomone/x/gov/types" +) + +// NewGovernanceDelegation creates a new GovernanceDelegation instance +func NewGovernanceDelegation(delegatorAddr sdk.AccAddress, governorAddr types.GovernorAddress) GovernanceDelegation { + return GovernanceDelegation{ + DelegatorAddress: delegatorAddr.String(), + GovernorAddress: governorAddr.String(), + } +} + +// RegisterCodec registers the necessary types and interfaces for the module +func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(GovernanceDelegation{}, "gov/Delegation", nil) +} + +// String implements the Stringer interface for GovernanceDelegation +func (gd GovernanceDelegation) String() string { + return fmt.Sprintf("Delegator: %s, Governor: %s, Percentage: %s", gd.DelegatorAddress, gd.GovernorAddress) +} + +// NewGovernorValShares creates a new GovernorValShares instance +func NewGovernorValShares(governorAddr types.GovernorAddress, validatorAddress sdk.ValAddress, shares sdk.Dec) GovernorValShares { + if shares.IsNegative() { + panic(fmt.Sprintf("invalid governor val shares: %s", shares)) + } + + return GovernorValShares{ + GovernorAddress: governorAddr.String(), + ValidatorAddress: validatorAddress.String(), + Shares: shares, + } +} + +// String implements the Stringer interface for GovernorValShares +func (gvs GovernorValShares) String() string { + return fmt.Sprintf("Governor: %s, Validator: %s, Shares: %s", gvs.GovernorAddress, gvs.ValidatorAddress, gvs.Shares) +} diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 598271996..c4cfe90a5 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -904,6 +904,8 @@ type Governor struct { Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` // description defines the description terms for the governor. Description GovernorDescription `protobuf:"bytes,3,opt,name=description,proto3" json:"description"` + // voting_power defines the voting power of the governor. + VotingPower cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=voting_power,json=votingPower,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"voting_power"` } func (m *Governor) Reset() { *m = Governor{} } @@ -1068,8 +1070,6 @@ var xxx_messageInfo_GovernorValShares proto.InternalMessageInfo type GovernanceDelegation struct { DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` GovernorAddress string `protobuf:"bytes,2,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` - // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. - Percentage string `protobuf:"bytes,3,opt,name=percentage,proto3" json:"percentage,omitempty"` } func (m *GovernanceDelegation) Reset() { *m = GovernanceDelegation{} } @@ -1127,113 +1127,113 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1686 bytes of a gzipped FileDescriptorProto + // 1692 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x49, 0xd4, 0x6a, 0xac, 0x3a, 0x6b, 0x2a, 0x26, 0x15, 0x26, + 0x15, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x4a, 0xd4, 0x7a, 0xac, 0x3a, 0x6b, 0x2a, 0x26, 0x15, 0x26, 0x08, 0x14, 0x35, 0x22, 0x23, 0xa7, 0xcd, 0x21, 0xc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, 0x4c, - 0xd6, 0x68, 0x07, 0x56, 0x38, 0xe5, 0x7d, 0x62, 0xad, 0xcb, 0x0d, 0xb5, 0x40, 0x16, 0xac, 0x46, - 0x43, 0xdf, 0xc7, 0xe1, 0xd8, 0xda, 0x90, 0xf2, 0x78, 0x89, 0x7e, 0x02, 0x69, 0xd5, 0x13, 0x24, - 0xb4, 0x36, 0x2f, 0x68, 0x82, 0x09, 0xb2, 0xf0, 0x17, 0x03, 0xd6, 0x67, 0x6b, 0xe0, 0xc7, 0xb0, - 0x36, 0x26, 0x91, 0xdb, 0x91, 0x6d, 0x61, 0x9c, 0xeb, 0x51, 0x3b, 0xe0, 0x4e, 0x7a, 0x4c, 0xa2, - 0x13, 0xb1, 0x8f, 0x3e, 0x84, 0x4d, 0xdc, 0x8e, 0x38, 0xa6, 0x81, 0x26, 0x24, 0x16, 0x12, 0x36, - 0x34, 0x48, 0x91, 0xde, 0x83, 0x74, 0xc0, 0x34, 0x7e, 0x79, 0x21, 0x7e, 0x35, 0x60, 0x0a, 0xfa, - 0x33, 0x40, 0x01, 0x73, 0x1f, 0x52, 0xde, 0x73, 0x47, 0x84, 0xc7, 0xa4, 0xe4, 0x42, 0xd2, 0x56, - 0xc0, 0xee, 0x53, 0xde, 0x6b, 0x11, 0xae, 0xc8, 0x85, 0x3f, 0x1a, 0x90, 0x14, 0x13, 0xe8, 0xe2, - 0xf9, 0x51, 0x84, 0x95, 0x11, 0xe3, 0xe4, 0xe2, 0xd9, 0xa1, 0x60, 0xe8, 0x13, 0x58, 0x55, 0xe3, - 0x2c, 0xb2, 0x92, 0xb2, 0x24, 0x0b, 0xf3, 0x7d, 0x76, 0x7e, 0x5a, 0x3a, 0x31, 0xe5, 0x4c, 0xce, - 0x57, 0xce, 0xe6, 0xfc, 0x4e, 0x32, 0xbd, 0x6c, 0x26, 0x0b, 0x7f, 0x33, 0x60, 0x53, 0x57, 0x6e, - 0x1d, 0x87, 0xd8, 0x8f, 0xd0, 0xe7, 0xb0, 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07, + 0x00, 0x00, 0xff, 0xff, 0x22, 0xbd, 0x12, 0x95, 0x8a, 0x10, 0x00, 0x00, } func (this *GovernorDescription) Equal(that interface{}) bool { @@ -1870,6 +1870,16 @@ func (m *Governor) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.VotingPower.Size() + i -= size + if _, err := m.VotingPower.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 { size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2020,13 +2030,6 @@ func (m *GovernanceDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Percentage) > 0 { - i -= len(m.Percentage) - copy(dAtA[i:], m.Percentage) - i = encodeVarintGov(dAtA, i, uint64(len(m.Percentage))) - i-- - dAtA[i] = 0x1a - } if len(m.GovernorAddress) > 0 { i -= len(m.GovernorAddress) copy(dAtA[i:], m.GovernorAddress) @@ -2326,6 +2329,8 @@ func (m *Governor) Size() (n int) { } l = m.Description.Size() n += 1 + l + sovGov(uint64(l)) + l = m.VotingPower.Size() + n += 1 + l + sovGov(uint64(l)) return n } @@ -2391,10 +2396,6 @@ func (m *GovernanceDelegation) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } - l = len(m.Percentage) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } return n } @@ -4277,6 +4278,40 @@ func (m *Governor) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VotingPower.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) @@ -4749,38 +4784,6 @@ func (m *GovernanceDelegation) Unmarshal(dAtA []byte) error { } m.GovernorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Percentage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Percentage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index b430373da..4a0b722ac 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -9,6 +9,7 @@ import ( "github.com/atomone-hub/atomone/x/gov/types" "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -27,6 +28,7 @@ func NewGovernor(address string, description GovernorDescription) (Governor, err GovernorAddress: address, Description: description, Status: Active, + VotingPower: sdk.ZeroDec(), }, nil } @@ -61,6 +63,27 @@ func (g Governors) Swap(i, j int) { g[i], g[j] = g[j], g[i] } +// GovernorsByVotingPower implements sort.Interface for []Governor based on +// the VotingPower and Address fields. +// The governors are sorted first by their voting power (descending). Secondary index - Address (ascending). +// Copied from tendermint/types/validator_set.go +type GovernorsByVotingPower []Governor + +func (govz GovernorsByVotingPower) Len() int { return len(govz) } + +func (govz GovernorsByVotingPower) Less(i, j int) bool { + if govz[i].GetVotingPower().Equal(govz[j].GetVotingPower()) { + addrI := govz[i].GetAddress() + addrJ := govz[j].GetAddress() + return bytes.Compare(addrI, addrJ) == -1 + } + return govz[i].GetVotingPower().GT(govz[j].GetVotingPower()) +} + +func (govz GovernorsByVotingPower) Swap(i, j int) { + govz[i], govz[j] = govz[j], govz[i] +} + func MustMarshalGovernor(cdc codec.BinaryCodec, governor *Governor) []byte { return cdc.MustMarshal(governor) } @@ -170,6 +193,8 @@ func (g *Governor) Equal(v2 *Governor) bool { return g.MinEqual(v2) } +func (g Governor) GetVotingPower() sdk.Dec { return g.VotingPower } +func (g Governor) SetVotingPower(votingPower sdk.Dec) { g.VotingPower = votingPower } func (g Governor) GetMoniker() string { return g.Description.Moniker } func (g Governor) GetStatus() GovernorStatus { return g.Status } func (g Governor) GetDescription() GovernorDescription { return g.Description } From a76911804d7f1fb6f44c674067f1ce3a7fc3c5d2 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 01:13:47 +0200 Subject: [PATCH 11/43] add msgs --- proto/atomone/gov/v1/tx.proto | 18 ++- x/gov/keeper/delegation.go | 10 +- x/gov/keeper/msg_server.go | 93 ++++++++++++++++ x/gov/types/errors.go | 29 +++-- x/gov/types/v1/governor.go | 4 + x/gov/types/v1/tx.pb.go | 202 +++++++++++++++++----------------- 6 files changed, 228 insertions(+), 128 deletions(-) diff --git a/proto/atomone/gov/v1/tx.proto b/proto/atomone/gov/v1/tx.proto index f9002c0a0..e02e712ec 100644 --- a/proto/atomone/gov/v1/tx.proto +++ b/proto/atomone/gov/v1/tx.proto @@ -187,15 +187,15 @@ message MsgUpdateParamsResponse {} // MsgCreateGovernor defines a SDK message for creating a new governor. message MsgCreateGovernor { - option (cosmos.msg.v1.signer) = "governor_address"; + option (cosmos.msg.v1.signer) = "address"; option (amino.name) = "atomone/MsgCreateGovernor"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - string governor_address = 2 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; - google.protobuf.Any pubkey = 3 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + google.protobuf.Any pubkey = 3 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; } // MsgCreateGovernorrResponse defines the Msg/CreateGovernor response type. @@ -203,15 +203,15 @@ message MsgCreateGovernorResponse {} // MsgEditGovernor defines a SDK message for editing an existing governor. message MsgEditGovernor { - option (cosmos.msg.v1.signer) = "governor_address"; + option (cosmos.msg.v1.signer) = "address"; option (amino.name) = "cosmos-sdk/MsgEditGovernor"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - GovernorStatus status = 2; - string governor_address = 3 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; + GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + GovernorStatus status = 2; + string address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgEditGovernorResponse defines the Msg/EditGovernor response type. @@ -228,8 +228,6 @@ message MsgDelegateGovernor { string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string governor_address = 2 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; - // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. - string percentage = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; } // MsgDelegateGovernorResponse defines the Msg/Delegate response type. diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 7f2344fba..554f784f2 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -188,7 +188,7 @@ func (k Keeper) DecreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover // UndelegateGovernor decreases all governor validator shares in the store // and then removes the governor delegation for the given delegator -func (k Keeper) UndelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress) { +func (k Keeper) undelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress) { delegation, found := k.GetGovernanceDelegation(ctx, delegatorAddr) if !found { return @@ -205,7 +205,7 @@ func (k Keeper) UndelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress // DelegateGovernor creates a governor delegation for the given delegator // and increases all governor validator shares in the store -func (k Keeper) DelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, governorAddr types.GovernorAddress) { +func (k Keeper) delegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, governorAddr types.GovernorAddress) { delegation := v1.NewGovernanceDelegation(delegatorAddr, governorAddr) k.SetGovernanceDelegation(ctx, delegation) // iterate all delegations of delegator and increase shares @@ -216,9 +216,9 @@ func (k Keeper) DelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, } // RedelegateGovernor re-delegates all governor validator shares from one governor to another -func (k Keeper) RedelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, srcGovernorAddr, dstGovernorAddr types.GovernorAddress) { +func (k Keeper) redelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, dstGovernorAddr types.GovernorAddress) { // undelegate from the source governor - k.UndelegateGovernor(ctx, delegatorAddr) + k.undelegateGovernor(ctx, delegatorAddr) // delegate to the destination governor - k.DelegateGovernor(ctx, delegatorAddr, dstGovernorAddr) + k.delegateGovernor(ctx, delegatorAddr, dstGovernorAddr) } diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index a6f43c81e..b25a1169d 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -174,6 +174,99 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *v1.MsgUpdateParams) return &v1.MsgUpdateParamsResponse{}, nil } +func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovernor) (*v1.MsgCreateGovernorResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Ensure the governor does not already exist + addr := sdk.MustAccAddressFromBech32(msg.Address) + govAddr := govtypes.GovernorAddress(addr.Bytes()) + if _, found := k.GetGovernor(ctx, govAddr); found { + return nil, govtypes.ErrGovernorExists + } + + // Ensure the governor has a valid description + if _, err := msg.Description.EnsureLength(); err != nil { + return nil, err + } + + governor, err := v1.NewGovernor(govAddr.String(), msg.Description) + if err != nil { + return nil, err + } + + k.SetGovernor(ctx, governor) + + return &v1.MsgCreateGovernorResponse{}, nil +} + +func (k msgServer) EditGovernor(goCtx context.Context, msg *v1.MsgEditGovernor) (*v1.MsgEditGovernorResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Ensure the governor exists + addr := sdk.MustAccAddressFromBech32(msg.Address) + govAddr := govtypes.GovernorAddress(addr.Bytes()) + governor, found := k.GetGovernor(ctx, govAddr) + if !found { + return nil, govtypes.ErrUnknownGovernor + } + + // Ensure the governor has a valid description + if _, err := msg.Description.EnsureLength(); err != nil { + return nil, err + } + + // Ensure the governor has a valid status + if !msg.Status.EnsureValid() { + return nil, govtypes.ErrInvalidGovernorStatus + } + + // Update the governor + governor.Description = msg.Description + governor.Status = msg.Status + k.SetGovernor(ctx, governor) + + return &v1.MsgEditGovernorResponse{}, nil +} + +func (k msgServer) DelegateGovernor(goCtx context.Context, msg *v1.MsgDelegateGovernor) (*v1.MsgDelegateGovernorResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + delAddr := sdk.MustAccAddressFromBech32(msg.DelegatorAddress) + govAddr := govtypes.MustGovernorAddressFromBech32(msg.GovernorAddress) + + // Ensure the delegation is not already present + gd, found := k.GetGovernanceDelegation(ctx, delAddr) + if found && govAddr.Equals(govtypes.MustGovernorAddressFromBech32(gd.GovernorAddress)) { + return nil, govtypes.ErrGovernanceDelegationExists + } + // redelegate if a delegation to another governor already exists + if found { + k.redelegateGovernor(ctx, delAddr, govAddr) + } else { + // Create the delegation + k.delegateGovernor(ctx, delAddr, govAddr) + } + + return &v1.MsgDelegateGovernorResponse{}, nil +} + +func (k msgServer) UndelegateGovernor(goCtx context.Context, msg *v1.MsgUndelegateGovernor) (*v1.MsgUndelegateGovernorResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + delAddr := sdk.MustAccAddressFromBech32(msg.DelegatorAddress) + + // Ensure the delegation exists + _, found := k.GetGovernanceDelegation(ctx, delAddr) + if !found { + return nil, govtypes.ErrUnknownGovernanceDelegation + } + + // Remove the delegation + k.undelegateGovernor(ctx, delAddr) + + return &v1.MsgUndelegateGovernorResponse{}, nil +} + type legacyMsgServer struct { govAcct string server v1.MsgServer diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 19b410820..882d06402 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -10,16 +10,21 @@ var ( ErrInactiveProposal = sdkerrors.Register(ModuleName, 30, "inactive proposal") //nolint:staticcheck ErrAlreadyActiveProposal = sdkerrors.Register(ModuleName, 40, "proposal already active") //nolint:staticcheck // Errors 5 & 6 are legacy errors related to v1beta1.Proposal. - ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 50, "invalid proposal content") //nolint:staticcheck - ErrInvalidProposalType = sdkerrors.Register(ModuleName, 60, "invalid proposal type") //nolint:staticcheck - ErrInvalidVote = sdkerrors.Register(ModuleName, 70, "invalid vote option") //nolint:staticcheck - ErrInvalidGenesis = sdkerrors.Register(ModuleName, 80, "invalid genesis state") //nolint:staticcheck - ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 90, "no handler exists for proposal type") //nolint:staticcheck - ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 100, "proposal message not recognized by router") //nolint:staticcheck - ErrNoProposalMsgs = sdkerrors.Register(ModuleName, 110, "no messages proposed") //nolint:staticcheck - ErrInvalidProposalMsg = sdkerrors.Register(ModuleName, 120, "invalid proposal message") //nolint:staticcheck - ErrInvalidSigner = sdkerrors.Register(ModuleName, 130, "expected gov account as only signer for proposal message") //nolint:staticcheck - ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 140, "signal message is invalid") //nolint:staticcheck - ErrMetadataTooLong = sdkerrors.Register(ModuleName, 150, "metadata too long") //nolint:staticcheck - ErrMinDepositTooSmall = sdkerrors.Register(ModuleName, 160, "minimum deposit is too small") //nolint:staticcheck + ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 50, "invalid proposal content") //nolint:staticcheck + ErrInvalidProposalType = sdkerrors.Register(ModuleName, 60, "invalid proposal type") //nolint:staticcheck + ErrInvalidVote = sdkerrors.Register(ModuleName, 70, "invalid vote option") //nolint:staticcheck + ErrInvalidGenesis = sdkerrors.Register(ModuleName, 80, "invalid genesis state") //nolint:staticcheck + ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 90, "no handler exists for proposal type") //nolint:staticcheck + ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 100, "proposal message not recognized by router") //nolint:staticcheck + ErrNoProposalMsgs = sdkerrors.Register(ModuleName, 110, "no messages proposed") //nolint:staticcheck + ErrInvalidProposalMsg = sdkerrors.Register(ModuleName, 120, "invalid proposal message") //nolint:staticcheck + ErrInvalidSigner = sdkerrors.Register(ModuleName, 130, "expected gov account as only signer for proposal message") //nolint:staticcheck + ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 140, "signal message is invalid") //nolint:staticcheck + ErrMetadataTooLong = sdkerrors.Register(ModuleName, 150, "metadata too long") //nolint:staticcheck + ErrMinDepositTooSmall = sdkerrors.Register(ModuleName, 160, "minimum deposit is too small") //nolint:staticcheck + ErrGovernorExists = sdkerrors.Register(ModuleName, 170, "governor already exists") //nolint:staticcheck + ErrUnknownGovernor = sdkerrors.Register(ModuleName, 180, "unknown governor") //nolint:staticcheck + ErrInvalidGovernorStatus = sdkerrors.Register(ModuleName, 190, "invalid governor status") //nolint:staticcheck + ErrGovernanceDelegationExists = sdkerrors.Register(ModuleName, 200, "governance delegation already exists") //nolint:staticcheck + ErrUnknownGovernanceDelegation = sdkerrors.Register(ModuleName, 210, "unknown governance delegation") //nolint:staticcheck ) diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 4a0b722ac..b4f866a7f 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -180,6 +180,10 @@ func (d GovernorDescription) EnsureLength() (GovernorDescription, error) { return d, nil } +func (s GovernorStatus) EnsureValid() bool { + return s == Active || s == Inactive +} + // MinEqual defines a more minimum set of equality conditions when comparing two // governors. func (g *Governor) MinEqual(other *Governor) bool { diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 628840e7a..2309bf0f8 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -690,9 +690,9 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // MsgCreateGovernor defines a SDK message for creating a new governor. type MsgCreateGovernor struct { - Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` - GovernorAddress string `protobuf:"bytes,2,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` - Pubkey *types.Any `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Pubkey *types.Any `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"` } func (m *MsgCreateGovernor) Reset() { *m = MsgCreateGovernor{} } @@ -767,9 +767,9 @@ var xxx_messageInfo_MsgCreateGovernorResponse proto.InternalMessageInfo // MsgEditGovernor defines a SDK message for editing an existing governor. type MsgEditGovernor struct { - Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` - Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` - GovernorAddress string `protobuf:"bytes,3,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` + Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` + Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` + Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` } func (m *MsgEditGovernor) Reset() { *m = MsgEditGovernor{} } @@ -1022,87 +1022,87 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/tx.proto", fileDescriptor_f6c84786701fca8d) } var fileDescriptor_f6c84786701fca8d = []byte{ - // 1268 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xf7, 0x26, 0x8d, 0xdd, 0x4c, 0xbe, 0x72, 0x9b, 0xfd, 0xba, 0x64, 0xb3, 0x69, 0xec, 0x64, - 0x0b, 0x22, 0x0d, 0x78, 0x97, 0xb8, 0x50, 0x09, 0x13, 0x21, 0xea, 0x24, 0x54, 0x15, 0xb5, 0x1a, - 0x39, 0xe2, 0x87, 0x38, 0x10, 0xad, 0xbd, 0xc3, 0x66, 0x69, 0x76, 0x67, 0xb5, 0x33, 0xb6, 0xe2, - 0x1b, 0xe2, 0x84, 0x38, 0x71, 0xe6, 0x54, 0xc1, 0x01, 0x8e, 0x39, 0xe4, 0x40, 0xff, 0x01, 0x54, - 0xf5, 0x54, 0xe5, 0xc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 0x47, 0xa0, 0x47, 0xe4, 0x07, 0xa0, 0xd0, 0x61, 0x9f, 0x34, 0x6a, 0xc4, 0x42, 0x34, 0x2a, 0x4f, - 0x8f, 0xaa, 0x0b, 0xc9, 0x66, 0x14, 0x42, 0xd3, 0xe0, 0x96, 0xc8, 0x22, 0x5f, 0x07, 0xd3, 0x66, - 0x97, 0xec, 0xa1, 0xc0, 0x21, 0x7d, 0x65, 0x82, 0xd6, 0x3c, 0x30, 0xd4, 0x6b, 0x61, 0xd5, 0x83, - 0x71, 0x58, 0x76, 0x25, 0x59, 0x76, 0x8a, 0xa2, 0x56, 0x06, 0xd7, 0xb3, 0xec, 0xa2, 0x78, 0xed, - 0x54, 0x02, 0x85, 0x26, 0xb6, 0x3f, 0x41, 0x04, 0xca, 0xef, 0x64, 0x08, 0xd1, 0x28, 0xfd, 0xf5, - 0xbc, 0x12, 0x37, 0xb3, 0x96, 0x88, 0xc9, 0x23, 0xeb, 0x60, 0xaa, 0x87, 0x08, 0x0c, 0x18, 0xe1, - 0x73, 0x7a, 0x81, 0xc1, 0xe4, 0x1a, 0xc8, 0x23, 0x9f, 0x38, 0xc8, 0xa3, 0xcd, 0x53, 0xac, 0xa9, - 0x7a, 0x52, 0x1b, 0x3d, 0x24, 0xf3, 0x80, 0x22, 0x5a, 0x1c, 0x79, 0x5e, 0xf3, 0xd4, 0x97, 0x43, - 0x59, 0x58, 0xee, 0x50, 0x12, 0x39, 0x29, 0x49, 0x98, 0x4c, 0x9b, 0x05, 0x57, 0xf8, 0x67, 0x54, - 0xf8, 0xdf, 0x52, 0x64, 0xfb, 0x14, 0x3a, 0xf6, 0x1e, 0x81, 0xd6, 0x7f, 0x25, 0xc0, 0x3a, 0x28, - 0xb0, 0xb2, 0xb0, 0x32, 0x49, 0xb7, 0xa1, 0x36, 0xac, 0x80, 0x60, 0x14, 0x53, 0x42, 0x84, 0x9c, - 0x2b, 0xc5, 0xcd, 0xa4, 0x14, 0x6a, 0x5a, 0x0a, 0x91,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, 0xb1, 0xe9, 0x5f, 0xcb, - 0x92, 0x37, 0x05, 0x53, 0xab, 0x17, 0x82, 0x89, 0xb9, 0xd4, 0xa9, 0xaf, 0xc3, 0x3b, 0xa9, 0x71, - 0xf7, 0xc9, 0x49, 0x59, 0x7a, 0x76, 0x52, 0x96, 0xfe, 0x38, 0x29, 0x4b, 0xdf, 0x9f, 0x96, 0x73, - 0xcf, 0x4e, 0xcb, 0xb9, 0xdf, 0x4f, 0xcb, 0xb9, 0xcf, 0xab, 0xb6, 0x43, 0xf6, 0xba, 0x6d, 0xbd, - 0x83, 0x5c, 0x83, 0x67, 0xae, 0xee, 0x75, 0xdb, 0x46, 0xf2, 0xc9, 0x42, 0xfa, 0x3e, 0xc4, 0xe1, - 0x3f, 0xef, 0x3c, 0xbd, 0xbf, 0x6f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x3e, 0xf0, 0xd5, - 0xbb, 0x0f, 0x00, 0x00, + // 1272 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0x26, 0x8d, 0xdd, 0x4c, 0x90, 0xdb, 0x0c, 0x2e, 0xd9, 0x6c, 0x1a, 0x3b, 0xd9, 0x82, + 0x48, 0x03, 0xde, 0x25, 0x0e, 0x54, 0xc2, 0x8a, 0x10, 0x75, 0x12, 0xaa, 0x8a, 0x5a, 0x8d, 0x1c, + 0xf1, 0x43, 0x1c, 0x88, 0xd6, 0xde, 0x61, 0xb3, 0x34, 0xbb, 0xb3, 0xda, 0x19, 0x5b, 0xf1, 0x0d, + 0x21, 0x0e, 0x88, 0x13, 0x17, 0x2e, 0x9c, 0x2a, 0xb8, 0x70, 0xcc, 0x21, 0x97, 0xfe, 0x03, 0xa8, + 0xea, 0xa9, 0xca, 0x89, 0x53, 0x85, 0x92, 0x43, 0x10, 0xff, 0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e8, 0xb0, 0xcf, 0x30, 0x6a, 0xc4, 0x42, 0x34, 0x2a, 0xcf, + 0x8e, 0xab, 0x0b, 0xc9, 0x66, 0x14, 0x42, 0x87, 0xc1, 0x2d, 0x91, 0x05, 0xde, 0x04, 0xd3, 0x46, + 0x97, 0xee, 0x63, 0xdf, 0xa6, 0x7d, 0x79, 0x22, 0xac, 0x79, 0x60, 0xa8, 0xd7, 0x82, 0xaa, 0x07, + 0xe3, 0xa0, 0xec, 0x4a, 0xb2, 0xec, 0x14, 0x45, 0xb5, 0x0c, 0x6e, 0x66, 0xd9, 0x45, 0xf1, 0xea, + 0x99, 0x04, 0x0a, 0x4d, 0x62, 0x7d, 0x8a, 0x29, 0x82, 0xef, 0x65, 0x08, 0xd1, 0x28, 0xfd, 0xfd, + 0xa2, 0x12, 0x37, 0xb3, 0x96, 0x88, 0xc9, 0x03, 0x35, 0x30, 0xd5, 0xc3, 0x14, 0xf9, 0x8c, 0xf0, + 0x05, 0xbd, 0xc0, 0x60, 0xb0, 0x06, 0xf2, 0xd8, 0xa3, 0x36, 0x76, 0xc3, 0xe6, 0x29, 0xd6, 0x14, + 0x2d, 0xa9, 0x8d, 0x16, 0x90, 0x79, 0x18, 0x22, 0x5a, 0x1c, 0x79, 0x51, 0xf3, 0xd4, 0x97, 0x03, + 0x59, 0x58, 0xee, 0x40, 0x12, 0x98, 0x94, 0x24, 0x48, 0xa6, 0xce, 0x82, 0x6b, 0xfc, 0x33, 0x2a, + 0xfc, 0x1f, 0x29, 0xb2, 0x7d, 0x86, 0x6c, 0x6b, 0x9f, 0x22, 0xf3, 0xff, 0x12, 0x60, 0x03, 0x14, + 0x58, 0x59, 0x44, 0x9e, 0x0c, 0xb7, 0xa1, 0x3a, 0xac, 0x80, 0x60, 0x14, 0x53, 0x42, 0x84, 0x5c, + 0x28, 0xc5, 0xed, 0xa4, 0x14, 0x4a, 0x5a, 0x0a, 0x91, 0x59, 0x9d, 0x07, 0x73, 0x43, 0xa6, 0x78, + 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e, 0x82, 0x85, 0x0c, 0x73, + 0xa4, 0xdd, 0xaf, 0x12, 0xb8, 0x11, 0x6c, 0x57, 0xd7, 0x7c, 0x39, 0xea, 0xd5, 0x37, 0xc7, 0xf3, + 0x5f, 0x4a, 0x2e, 0x7b, 0x9a, 0x8b, 0x5a, 0x01, 0x8b, 0x99, 0x0e, 0x51, 0x46, 0xed, 0x97, 0x02, + 0x98, 0x6c, 0x12, 0x0b, 0x7e, 0x09, 0x8a, 0x43, 0xef, 0xd4, 0xe5, 0xe1, 0x46, 0x4e, 0x3d, 0xc1, + 0x94, 0xdb, 0x63, 0x21, 0xd1, 0x2b, 0xcd, 0x02, 0xb3, 0xe9, 0x07, 0xd8, 0xeb, 0x19, 0xf1, 0x29, + 0x94, 0xf2, 0xf6, 0x65, 0x50, 0xd1, 0x44, 0x1f, 0x82, 0x2b, 0xe1, 0x6b, 0x68, 0x2e, 0x23, 0x2a, + 0x70, 0x28, 0x95, 0x11, 0x8e, 0x28, 0xc3, 0xe7, 0xe0, 0x95, 0xc4, 0xb3, 0x62, 0x54, 0x80, 0x00, + 0x28, 0x6f, 0x8e, 0x01, 0x44, 0x99, 0xef, 0x83, 0x82, 0xb8, 0x95, 0x95, 0x8c, 0x18, 0xee, 0x53, + 0xd4, 0xd1, 0xbe, 0x38, 0xc9, 0xc4, 0x25, 0x97, 0x45, 0x32, 0x0e, 0xc8, 0x24, 0x99, 0x75, 0xd7, + 0x04, 0x9d, 0x30, 0x74, 0xcf, 0x64, 0x75, 0x42, 0x12, 0x92, 0xd9, 0x09, 0xd9, 0xc7, 0x72, 0xc0, + 0x3c, 0x71, 0x24, 0x67, 0x31, 0x8f, 0x03, 0x32, 0x99, 0x67, 0x1d, 0x67, 0xd0, 0x04, 0xd7, 0x53, + 0x47, 0xd9, 0xad, 0x4c, 0x2d, 0x93, 0x20, 0xe5, 0xad, 0x4b, 0x80, 0xa2, 0x59, 0xbe, 0x06, 0x30, + 0x63, 0xd3, 0xbf, 0x91, 0x25, 0x6f, 0x0a, 0xa6, 0x54, 0x2f, 0x05, 0x13, 0x73, 0x29, 0x53, 0xdf, + 0x04, 0x17, 0x4e, 0xe3, 0xde, 0xd3, 0xd3, 0xb2, 0xf4, 0xfc, 0xb4, 0x2c, 0xfd, 0x79, 0x5a, 0x96, + 0x7e, 0x3c, 0x2b, 0xe7, 0x9e, 0x9f, 0x95, 0x73, 0x7f, 0x9c, 0x95, 0x73, 0x5f, 0x54, 0x2d, 0x9b, + 0xee, 0x77, 0xdb, 0x5a, 0x07, 0x3b, 0x3a, 0xcf, 0x5c, 0xdd, 0xef, 0xb6, 0xf5, 0xe4, 0x63, 0x83, + 0xf6, 0x3d, 0x44, 0x82, 0xff, 0xcc, 0xf9, 0xf0, 0x4e, 0x5e, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, + 0xcd, 0x1f, 0x2d, 0x63, 0x75, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2029,10 +2029,10 @@ func (m *MsgCreateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.GovernorAddress) > 0 { - i -= len(m.GovernorAddress) - copy(dAtA[i:], m.GovernorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.GovernorAddress))) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0x12 } @@ -2092,10 +2092,10 @@ func (m *MsgEditGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.GovernorAddress) > 0 { - i -= len(m.GovernorAddress) - copy(dAtA[i:], m.GovernorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.GovernorAddress))) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0x1a } @@ -2476,7 +2476,7 @@ func (m *MsgCreateGovernor) Size() (n int) { _ = l l = m.Description.Size() n += 1 + l + sovTx(uint64(l)) - l = len(m.GovernorAddress) + l = len(m.Address) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -2507,7 +2507,7 @@ func (m *MsgEditGovernor) Size() (n int) { if m.Status != 0 { n += 1 + sovTx(uint64(m.Status)) } - l = len(m.GovernorAddress) + l = len(m.Address) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -3897,7 +3897,7 @@ func (m *MsgCreateGovernor) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3925,7 +3925,7 @@ func (m *MsgCreateGovernor) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.GovernorAddress = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -4117,7 +4117,7 @@ func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { } case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4145,7 +4145,7 @@ func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.GovernorAddress = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex From ca19aaf220c36e25ca85a381c3f9d47342923c0d Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 01:26:54 +0200 Subject: [PATCH 12/43] update test mock keepers --- go.mod | 6 ++--- x/gov/testutil/expected_keepers_mocks.go | 30 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3b02fe1f6..8c970ab34 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d cosmossdk.io/tools/rosetta v0.2.1 + github.com/chzyer/readline v1.5.1 github.com/cometbft/cometbft v0.37.4 github.com/cometbft/cometbft-db v0.10.0 github.com/cosmos/cosmos-proto v1.0.0-beta.4 @@ -19,6 +20,7 @@ require ( github.com/golang/mock v1.6.0 github.com/google/gofuzz v1.2.0 github.com/gorilla/mux v1.8.1 + github.com/manifoldco/promptui v0.9.0 github.com/ory/dockertest/v3 v3.10.0 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.6.0 @@ -30,6 +32,7 @@ require ( golang.org/x/sync v0.4.0 google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 google.golang.org/protobuf v1.32.0 + gopkg.in/yaml.v2 v2.4.0 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 ) @@ -66,7 +69,6 @@ require ( github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.10.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect @@ -145,7 +147,6 @@ require ( github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/linxGnu/grocksdb v1.8.11 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect @@ -203,7 +204,6 @@ require ( google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v1.1.0 // indirect diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 3492e16a4..97885d2c7 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -984,6 +984,36 @@ func (mr *MockStakingKeeperMockRecorder) BondDenom(ctx interface{}) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BondDenom", reflect.TypeOf((*MockStakingKeeper)(nil).BondDenom), ctx) } +// GetDelegation mocks base method. +func (m *MockStakingKeeper) GetDelegation(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) (types2.Delegation, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDelegation", ctx, delAddr, valAddr) + ret0, _ := ret[0].(types2.Delegation) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetDelegation indicates an expected call of GetDelegation. +func (mr *MockStakingKeeperMockRecorder) GetDelegation(ctx, delAddr, valAddr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegation", reflect.TypeOf((*MockStakingKeeper)(nil).GetDelegation), ctx, delAddr, valAddr) +} + +// GetValidator mocks base method. +func (m *MockStakingKeeper) GetValidator(ctx types.Context, addr types.ValAddress) (types2.Validator, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetValidator", ctx, addr) + ret0, _ := ret[0].(types2.Validator) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetValidator indicates an expected call of GetValidator. +func (mr *MockStakingKeeperMockRecorder) GetValidator(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidator", reflect.TypeOf((*MockStakingKeeper)(nil).GetValidator), ctx, addr) +} + // IterateBondedValidatorsByPower mocks base method. func (m *MockStakingKeeper) IterateBondedValidatorsByPower(arg0 types.Context, arg1 func(int64, types2.ValidatorI) bool) { m.ctrl.T.Helper() From be1db0087c1fd39e884fa6a7fe6808dfbbd0a676 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 01:51:22 +0200 Subject: [PATCH 13/43] ... --- x/gov/keeper/delegation.go | 4 ++-- x/gov/keeper/governor.go | 14 +++++++++++++- x/gov/keeper/hooks.go | 2 +- x/gov/types/v1/exported.go | 6 +++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 554f784f2..8cc0bfb41 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -157,7 +157,7 @@ func (k Keeper) IncreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover validator, _ := k.sk.GetValidator(ctx, validatorAddr) vp := shares.MulInt(validator.GetBondedTokens()).Quo(validator.GetDelegatorShares()) governor.SetVotingPower(governor.GetVotingPower().Add(vp)) - k.SetGovernor(ctx, governor) + k.UpdateGovernorByPowerIndex(ctx, governor) } // DecreaseGovernorShares decreases the governor validator shares in the store @@ -183,7 +183,7 @@ func (k Keeper) DecreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover panic("negative governor voting power") } governor.SetVotingPower(governorVP) - k.SetGovernor(ctx, governor) + k.UpdateGovernorByPowerIndex(ctx, governor) } // UndelegateGovernor decreases all governor validator shares in the store diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index a49343308..f242581c2 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -25,6 +25,10 @@ func (k Keeper) SetGovernor(ctx sdk.Context, governor v1.Governor) { store := ctx.KVStore(k.storeKey) bz := v1.MustMarshalGovernor(k.cdc, &governor) store.Set(types.GovernorKey(governor.GetAddress()), bz) + + if governor.VotingPower.GT(sdk.ZeroDec()) { + k.SetGovernorByPowerIndex(ctx, governor) + } } // GetAllGovernors returns all governors @@ -82,11 +86,19 @@ func (k Keeper) SetGovernorByPowerIndex(ctx sdk.Context, governor v1.Governor) { } // governor by power index -func (k Keeper) DeleteValidatorByPowerIndex(ctx sdk.Context, governor v1.Governor) { +func (k Keeper) DeleteGovernorByPowerIndex(ctx sdk.Context, governor v1.Governor) { store := ctx.KVStore(k.storeKey) store.Delete(types.GovernorsByPowerKey(governor.GetAddress(), governor.GetVotingPower())) } +// UpdateGovernorByPowerIndex updates the governor in the governor by power index +func (k Keeper) UpdateGovernorByPowerIndex(ctx sdk.Context, governor v1.Governor) { + oldGovernor, _ := k.GetGovernor(ctx, governor.GetAddress()) + k.DeleteGovernorByPowerIndex(ctx, oldGovernor) + k.SetGovernorByPowerIndex(ctx, governor) + k.SetGovernor(ctx, governor) +} + // IterateMaxGovernorsByGovernancePower iterates over the top params.MaxGovernors governors by governance power func (k Keeper) IterateMaxGovernorsByGovernancePower(ctx sdk.Context, cb func(index int64, governor v1.GovernorI) (stop bool)) { store := ctx.KVStore(k.storeKey) diff --git a/x/gov/keeper/hooks.go b/x/gov/keeper/hooks.go index fbb080c84..594025a54 100644 --- a/x/gov/keeper/hooks.go +++ b/x/gov/keeper/hooks.go @@ -75,7 +75,7 @@ func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, f panic("negative governor voting power") } governor.SetVotingPower(governorVP) - h.k.SetGovernor(ctx, governor) + h.k.UpdateGovernorByPowerIndex(ctx, governor) return false }) diff --git a/x/gov/types/v1/exported.go b/x/gov/types/v1/exported.go index 99962aa04..ddd7a74af 100644 --- a/x/gov/types/v1/exported.go +++ b/x/gov/types/v1/exported.go @@ -1,6 +1,9 @@ package v1 -import "github.com/atomone-hub/atomone/x/gov/types" +import ( + "github.com/atomone-hub/atomone/x/gov/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) type GovernorI interface { GetMoniker() string // moniker of the governor @@ -9,4 +12,5 @@ type GovernorI interface { IsInactive() bool // check if has status inactive GetAddress() types.GovernorAddress // governor address to receive/return governors delegations GetDescription() GovernorDescription // description of the governor + GetVotingPower() sdk.Dec // voting power of the governor } From e1a2bbb0c0b4842ae5369b758fcc6e00afc41f86 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 10:15:28 +0200 Subject: [PATCH 14/43] compiles --- app/keepers/keepers.go | 20 +-- proto/atomone/gov/v1/tx.proto | 1 - x/gov/keeper/hooks.go | 4 + x/gov/types/errors.go | 35 ++--- x/gov/types/v1/codec.go | 8 ++ x/gov/types/v1/delegation.go | 16 --- x/gov/types/v1/governor.go | 3 +- x/gov/types/v1/msgs.go | 131 +++++++++++++++++ x/gov/types/v1/tx.pb.go | 256 ++++++++++------------------------ 9 files changed, 250 insertions(+), 224 deletions(-) diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index fb769f9b3..f9b254a78 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -207,16 +207,6 @@ func NewAppKeeper( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - // register the staking hooks - // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks - appKeepers.StakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks( - appKeepers.DistrKeeper.Hooks(), - appKeepers.SlashingKeeper.Hooks(), - appKeepers.GovKeeper.StakingHooks(), - ), - ) - // UpgradeKeeper must be created before IBCKeeper appKeepers.UpgradeKeeper = upgradekeeper.NewKeeper( skipUpgradeHeights, @@ -267,6 +257,16 @@ func NewAppKeeper( // If evidence needs to be handled for the app, set routes in router here and seal appKeepers.EvidenceKeeper = *evidenceKeeper + // register the staking hooks + // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks + appKeepers.StakingKeeper.SetHooks( + stakingtypes.NewMultiStakingHooks( + appKeepers.DistrKeeper.Hooks(), + appKeepers.SlashingKeeper.Hooks(), + appKeepers.GovKeeper.StakingHooks(), + ), + ) + return appKeepers } diff --git a/proto/atomone/gov/v1/tx.proto b/proto/atomone/gov/v1/tx.proto index e02e712ec..64f6a9b64 100644 --- a/proto/atomone/gov/v1/tx.proto +++ b/proto/atomone/gov/v1/tx.proto @@ -195,7 +195,6 @@ message MsgCreateGovernor { GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any pubkey = 3 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; } // MsgCreateGovernorrResponse defines the Msg/CreateGovernor response type. diff --git a/x/gov/keeper/hooks.go b/x/gov/keeper/hooks.go index 594025a54..20a0f022c 100644 --- a/x/gov/keeper/hooks.go +++ b/x/gov/keeper/hooks.go @@ -21,6 +21,8 @@ func (k Keeper) StakingHooks() Hooks { } // BeforeDelegationSharesModified is called when a delegation's shares are modified +// We trigger a governor shares decrease here subtracting all delegation shares. +// The right amount of shares will be possibly added back in AfterDelegationModified func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { // does the delegator have a governance delegation? govDelegation, found := h.k.GetGovernanceDelegation(ctx, delAddr) @@ -39,6 +41,8 @@ func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAd } // AfterDelegationModified is called when a delegation is created or modified +// We trigger a governor shares increase here adding all delegation shares. +// It is balanced by the full-amount decrease in BeforeDelegationSharesModified func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { // does the delegator have a governance delegation? govDelegation, found := h.k.GetGovernanceDelegation(ctx, delAddr) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 882d06402..ac23e76b5 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -10,21 +10,22 @@ var ( ErrInactiveProposal = sdkerrors.Register(ModuleName, 30, "inactive proposal") //nolint:staticcheck ErrAlreadyActiveProposal = sdkerrors.Register(ModuleName, 40, "proposal already active") //nolint:staticcheck // Errors 5 & 6 are legacy errors related to v1beta1.Proposal. - ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 50, "invalid proposal content") //nolint:staticcheck - ErrInvalidProposalType = sdkerrors.Register(ModuleName, 60, "invalid proposal type") //nolint:staticcheck - ErrInvalidVote = sdkerrors.Register(ModuleName, 70, "invalid vote option") //nolint:staticcheck - ErrInvalidGenesis = sdkerrors.Register(ModuleName, 80, "invalid genesis state") //nolint:staticcheck - ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 90, "no handler exists for proposal type") //nolint:staticcheck - ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 100, "proposal message not recognized by router") //nolint:staticcheck - ErrNoProposalMsgs = sdkerrors.Register(ModuleName, 110, "no messages proposed") //nolint:staticcheck - ErrInvalidProposalMsg = sdkerrors.Register(ModuleName, 120, "invalid proposal message") //nolint:staticcheck - ErrInvalidSigner = sdkerrors.Register(ModuleName, 130, "expected gov account as only signer for proposal message") //nolint:staticcheck - ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 140, "signal message is invalid") //nolint:staticcheck - ErrMetadataTooLong = sdkerrors.Register(ModuleName, 150, "metadata too long") //nolint:staticcheck - ErrMinDepositTooSmall = sdkerrors.Register(ModuleName, 160, "minimum deposit is too small") //nolint:staticcheck - ErrGovernorExists = sdkerrors.Register(ModuleName, 170, "governor already exists") //nolint:staticcheck - ErrUnknownGovernor = sdkerrors.Register(ModuleName, 180, "unknown governor") //nolint:staticcheck - ErrInvalidGovernorStatus = sdkerrors.Register(ModuleName, 190, "invalid governor status") //nolint:staticcheck - ErrGovernanceDelegationExists = sdkerrors.Register(ModuleName, 200, "governance delegation already exists") //nolint:staticcheck - ErrUnknownGovernanceDelegation = sdkerrors.Register(ModuleName, 210, "unknown governance delegation") //nolint:staticcheck + ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 50, "invalid proposal content") //nolint:staticcheck + ErrInvalidProposalType = sdkerrors.Register(ModuleName, 60, "invalid proposal type") //nolint:staticcheck + ErrInvalidVote = sdkerrors.Register(ModuleName, 70, "invalid vote option") //nolint:staticcheck + ErrInvalidGenesis = sdkerrors.Register(ModuleName, 80, "invalid genesis state") //nolint:staticcheck + ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 90, "no handler exists for proposal type") //nolint:staticcheck + ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 100, "proposal message not recognized by router") //nolint:staticcheck + ErrNoProposalMsgs = sdkerrors.Register(ModuleName, 110, "no messages proposed") //nolint:staticcheck + ErrInvalidProposalMsg = sdkerrors.Register(ModuleName, 120, "invalid proposal message") //nolint:staticcheck + ErrInvalidSigner = sdkerrors.Register(ModuleName, 130, "expected gov account as only signer for proposal message") //nolint:staticcheck + ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 140, "signal message is invalid") //nolint:staticcheck + ErrMetadataTooLong = sdkerrors.Register(ModuleName, 150, "metadata too long") //nolint:staticcheck + ErrMinDepositTooSmall = sdkerrors.Register(ModuleName, 160, "minimum deposit is too small") //nolint:staticcheck + ErrGovernorExists = sdkerrors.Register(ModuleName, 170, "governor already exists") //nolint:staticcheck + ErrUnknownGovernor = sdkerrors.Register(ModuleName, 180, "unknown governor") //nolint:staticcheck + ErrInvalidGovernorStatus = sdkerrors.Register(ModuleName, 190, "invalid governor status") //nolint:staticcheck + ErrGovernanceDelegationExists = sdkerrors.Register(ModuleName, 200, "governance delegation already exists") //nolint:staticcheck + ErrUnknownGovernanceDelegation = sdkerrors.Register(ModuleName, 210, "unknown governance delegation") //nolint:staticcheck + ErrInvalidGovernanceDescription = sdkerrors.Register(ModuleName, 220, "invalid governance description") //nolint:staticcheck ) diff --git a/x/gov/types/v1/codec.go b/x/gov/types/v1/codec.go index 633bbb7b2..d2d43876e 100644 --- a/x/gov/types/v1/codec.go +++ b/x/gov/types/v1/codec.go @@ -30,6 +30,10 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { legacy.RegisterAminoMsg(cdc, &MsgVoteWeighted{}, "atomone/v1/MsgVoteWeighted") legacy.RegisterAminoMsg(cdc, &MsgExecLegacyContent{}, "atomone/v1/MsgExecLegacyContent") legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "atomone/x/gov/v1/MsgUpdateParams") + legacy.RegisterAminoMsg(cdc, &MsgCreateGovernor{}, "atomone/v1/MsgCreateGovernor") + legacy.RegisterAminoMsg(cdc, &MsgEditGovernor{}, "atomone/v1/MsgEditGovernor") + legacy.RegisterAminoMsg(cdc, &MsgDelegateGovernor{}, "atomone/v1/MsgDelegateGovernor") + legacy.RegisterAminoMsg(cdc, &MsgUndelegateGovernor{}, "atomone/v1/MsgUndelegateGovernor") } // RegisterInterfaces registers the interfaces types with the Interface Registry. @@ -41,6 +45,10 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgDeposit{}, &MsgExecLegacyContent{}, &MsgUpdateParams{}, + &MsgCreateGovernor{}, + &MsgEditGovernor{}, + &MsgDelegateGovernor{}, + &MsgUndelegateGovernor{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/gov/types/v1/delegation.go b/x/gov/types/v1/delegation.go index 941b17dd5..acefc2d9b 100644 --- a/x/gov/types/v1/delegation.go +++ b/x/gov/types/v1/delegation.go @@ -3,7 +3,6 @@ package v1 import ( "fmt" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/atomone-hub/atomone/x/gov/types" @@ -17,16 +16,6 @@ func NewGovernanceDelegation(delegatorAddr sdk.AccAddress, governorAddr types.Go } } -// RegisterCodec registers the necessary types and interfaces for the module -func RegisterCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(GovernanceDelegation{}, "gov/Delegation", nil) -} - -// String implements the Stringer interface for GovernanceDelegation -func (gd GovernanceDelegation) String() string { - return fmt.Sprintf("Delegator: %s, Governor: %s, Percentage: %s", gd.DelegatorAddress, gd.GovernorAddress) -} - // NewGovernorValShares creates a new GovernorValShares instance func NewGovernorValShares(governorAddr types.GovernorAddress, validatorAddress sdk.ValAddress, shares sdk.Dec) GovernorValShares { if shares.IsNegative() { @@ -39,8 +28,3 @@ func NewGovernorValShares(governorAddr types.GovernorAddress, validatorAddress s Shares: shares, } } - -// String implements the Stringer interface for GovernorValShares -func (gvs GovernorValShares) String() string { - return fmt.Sprintf("Governor: %s, Validator: %s, Shares: %s", gvs.GovernorAddress, gvs.ValidatorAddress, gvs.Shares) -} diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index b4f866a7f..017762df5 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -189,7 +189,8 @@ func (s GovernorStatus) EnsureValid() bool { func (g *Governor) MinEqual(other *Governor) bool { return g.GovernorAddress == other.GovernorAddress && g.Status == other.Status && - g.Description.Equal(other.Description) + g.Description.Equal(other.Description) && + g.VotingPower.Equal(other.VotingPower) } // Equal checks if the receiver equals the parameter diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index fc4cfda30..613dc56e7 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -322,3 +322,134 @@ func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { authority, _ := sdk.AccAddressFromBech32(msg.Authority) return []sdk.AccAddress{authority} } + +// NewMsgCreateGovernor creates a new MsgCreateGovernor instance +func NewMsgCreateGovernor(address sdk.AccAddress, description GovernorDescription) *MsgCreateGovernor { + return &MsgCreateGovernor{Address: address.String(), Description: description} +} + +// Route implements the sdk.Msg interface. +func (msg MsgCreateGovernor) Route() string { return types.RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgCreateGovernor) Type() string { return sdk.MsgTypeURL(&msg) } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgCreateGovernor) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { + return sdkerrors.ErrInvalidAddress.Wrap(err.Error()) + } + + if _, err := msg.Description.EnsureLength(); err != nil { + types.ErrInvalidGovernanceDescription.Wrap(err.Error()) + } + return nil +} + +// GetSignBytes returns the message bytes to sign over. +func (msg MsgCreateGovernor) GetSignBytes() []byte { + bz := codec.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners returns the expected signers for a MsgCreateGovernor. +func (msg MsgCreateGovernor) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Address) + return []sdk.AccAddress{addr} +} + +// NewMsgEditGovernor creates a new MsgEditGovernor instance +func NewMsgEditGovernor(addr sdk.AccAddress, description GovernorDescription, status GovernorStatus) *MsgEditGovernor { + return &MsgEditGovernor{Address: addr.String(), Description: description, Status: status} +} + +// Route implements the sdk.Msg interface. +func (msg MsgEditGovernor) Route() string { return types.RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgEditGovernor) Type() string { return sdk.MsgTypeURL(&msg) } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgEditGovernor) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { + return sdkerrors.ErrInvalidAddress.Wrap(err.Error()) + } + return nil +} + +// GetSignBytes returns the message bytes to sign over. +func (msg MsgEditGovernor) GetSignBytes() []byte { + bz := codec.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners returns the expected signers for a MsgEditGovernor. +func (msg MsgEditGovernor) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Address) + return []sdk.AccAddress{addr} +} + +// NewMsgDelegateGovernor creates a new MsgDelegateGovernor instance +func NewMsgDelegateGovernor(delegator sdk.AccAddress, governor types.GovernorAddress) *MsgDelegateGovernor { + return &MsgDelegateGovernor{DelegatorAddress: delegator.String(), GovernorAddress: governor.String()} +} + +// Route implements the sdk.Msg interface. +func (msg MsgDelegateGovernor) Route() string { return types.RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgDelegateGovernor) Type() string { return sdk.MsgTypeURL(&msg) } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgDelegateGovernor) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrap(err.Error()) + } + if _, err := types.GovernorAddressFromBech32(msg.GovernorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid governor address: %s", err) + } + return nil +} + +// GetSignBytes returns the message bytes to sign over. +func (msg MsgDelegateGovernor) GetSignBytes() []byte { + bz := codec.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners returns the expected signers for a MsgDelegateGovernor. +func (msg MsgDelegateGovernor) GetSigners() []sdk.AccAddress { + delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) + return []sdk.AccAddress{delegator} +} + +// NewMsgUndelegateGovernor creates a new MsgUndelegateGovernor instance +func NewMsgUndelegateGovernor(delegator sdk.AccAddress) *MsgUndelegateGovernor { + return &MsgUndelegateGovernor{DelegatorAddress: delegator.String()} +} + +// Route implements the sdk.Msg interface. +func (msg MsgUndelegateGovernor) Route() string { return types.RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgUndelegateGovernor) Type() string { return sdk.MsgTypeURL(&msg) } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgUndelegateGovernor) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrap(err.Error()) + } + return nil +} + +// GetSignBytes returns the message bytes to sign over. +func (msg MsgUndelegateGovernor) GetSignBytes() []byte { + bz := codec.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners returns the expected signers for a MsgUndelegateGovernor. +func (msg MsgUndelegateGovernor) GetSigners() []sdk.AccAddress { + delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) + return []sdk.AccAddress{delegator} +} diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 2309bf0f8..360e3e242 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -692,7 +692,6 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo type MsgCreateGovernor struct { Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Pubkey *types.Any `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"` } func (m *MsgCreateGovernor) Reset() { *m = MsgCreateGovernor{} } @@ -847,8 +846,6 @@ var xxx_messageInfo_MsgEditGovernorResponse proto.InternalMessageInfo type MsgDelegateGovernor struct { DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` GovernorAddress string `protobuf:"bytes,2,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` - // percentage is the percentage of the delegator's bonded tokens that are delegated to the governor. - Percentage string `protobuf:"bytes,6,opt,name=percentage,proto3" json:"percentage,omitempty"` } func (m *MsgDelegateGovernor) Reset() { *m = MsgDelegateGovernor{} } @@ -1022,87 +1019,83 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/tx.proto", fileDescriptor_f6c84786701fca8d) } var fileDescriptor_f6c84786701fca8d = []byte{ - // 1272 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x26, 0x8d, 0xdd, 0x4c, 0x90, 0xdb, 0x0c, 0x2e, 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 0x03, - 0x59, 0x58, 0xee, 0x40, 0x12, 0x98, 0x94, 0x24, 0x48, 0xa6, 0xce, 0x82, 0x6b, 0xfc, 0x33, 0x2a, - 0xfc, 0x1f, 0x29, 0xb2, 0x7d, 0x86, 0x6c, 0x6b, 0x9f, 0x22, 0xf3, 0xff, 0x12, 0x60, 0x03, 0x14, - 0x58, 0x59, 0x44, 0x9e, 0x0c, 0xb7, 0xa1, 0x3a, 0xac, 0x80, 0x60, 0x14, 0x53, 0x42, 0x84, 0x5c, - 0x28, 0xc5, 0xed, 0xa4, 0x14, 0x4a, 0x5a, 0x0a, 0x91, 0x59, 0x9d, 0x07, 0x73, 0x43, 0xa6, 0x78, - 0x4f, 0x80, 0x26, 0xb1, 0xc4, 0x76, 0xff, 0x8f, 0xaa, 0xdc, 0x01, 0xd3, 0xfc, 0xb0, 0xc1, 0xe3, - 0x95, 0x19, 0x40, 0xe1, 0x06, 0xc8, 0x1b, 0x0e, 0xee, 0xba, 0x94, 0x8b, 0x73, 0xb9, 0x33, 0x8a, - 0xc7, 0xd4, 0x57, 0xc2, 0x3d, 0x12, 0x65, 0x0b, 0x54, 0xb8, 0x91, 0x54, 0x81, 0x97, 0xa5, 0x96, - 0x00, 0x1c, 0x8c, 0xa2, 0xda, 0x9f, 0xb0, 0xb6, 0xf8, 0xc4, 0x33, 0x0d, 0x8a, 0x76, 0x0c, 0xdf, - 0x70, 0x48, 0x50, 0xc9, 0x60, 0x57, 0x4a, 0xe3, 0x2a, 0x89, 0xa0, 0xf0, 0x7d, 0x90, 0xf7, 0xc2, - 0x0c, 0x61, 0xf9, 0x33, 0xb5, 0xd7, 0x86, 0x97, 0x99, 0xe5, 0x4f, 0x94, 0xc1, 0x02, 0xea, 0xeb, - 0xe9, 0xad, 0xbe, 0x24, 0xca, 0x38, 0x14, 0x17, 0xd4, 0x10, 0x4f, 0xbe, 0xa4, 0x71, 0x53, 0x54, - 0xd6, 0x4f, 0xec, 0x26, 0xd9, 0xf4, 0x91, 0x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x38, 0xc9, 0xc4, 0x25, 0x97, 0x45, 0x32, 0x0e, 0xc8, 0x24, 0x99, 0x75, 0xd7, - 0x04, 0x9d, 0x30, 0x74, 0xcf, 0x64, 0x75, 0x42, 0x12, 0x92, 0xd9, 0x09, 0xd9, 0xc7, 0x72, 0xc0, - 0x3c, 0x71, 0x24, 0x67, 0x31, 0x8f, 0x03, 0x32, 0x99, 0x67, 0x1d, 0x67, 0xd0, 0x04, 0xd7, 0x53, - 0x47, 0xd9, 0xad, 0x4c, 0x2d, 0x93, 0x20, 0xe5, 0xad, 0x4b, 0x80, 0xa2, 0x59, 0xbe, 0x06, 0x30, - 0x63, 0xd3, 0xbf, 0x91, 0x25, 0x6f, 0x0a, 0xa6, 0x54, 0x2f, 0x05, 0x13, 0x73, 0x29, 0x53, 0xdf, - 0x04, 0x17, 0x4e, 0xe3, 0xde, 0xd3, 0xd3, 0xb2, 0xf4, 0xfc, 0xb4, 0x2c, 0xfd, 0x79, 0x5a, 0x96, - 0x7e, 0x3c, 0x2b, 0xe7, 0x9e, 0x9f, 0x95, 0x73, 0x7f, 0x9c, 0x95, 0x73, 0x5f, 0x54, 0x2d, 0x9b, - 0xee, 0x77, 0xdb, 0x5a, 0x07, 0x3b, 0x3a, 0xcf, 0x5c, 0xdd, 0xef, 0xb6, 0xf5, 0xe4, 0x63, 0x83, - 0xf6, 0x3d, 0x44, 0x82, 0xff, 0xcc, 0xf9, 0xf0, 0x4e, 0x5e, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, - 0xcd, 0x1f, 0x2d, 0x63, 0x75, 0x0f, 0x00, 0x00, + // 1213 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4b, 0x6f, 0xe3, 0x54, + 0x14, 0x8e, 0xfb, 0x48, 0xa6, 0xb7, 0xa8, 0x0f, 0x93, 0xa1, 0xae, 0xdb, 0x26, 0xad, 0x07, 0x44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, 0xd7, 0xdd, 0xb4, 0x52, + 0x92, 0x19, 0xdb, 0x60, 0x31, 0x65, 0x6c, 0x40, 0xdc, 0x46, 0x01, 0x86, 0x6a, 0x19, 0x4c, 0xb7, + 0x85, 0xed, 0xd0, 0x73, 0x34, 0x65, 0x55, 0x59, 0x9f, 0x68, 0x00, 0x69, 0x7a, 0xe0, 0x18, 0x4f, + 0x14, 0x50, 0xac, 0x63, 0x77, 0xef, 0x04, 0xb6, 0x1e, 0x42, 0xd7, 0x6e, 0xf5, 0x76, 0x51, 0x40, + 0x60, 0x40, 0xd4, 0x47, 0xa0, 0xd0, 0xe2, 0x9f, 0x2c, 0x6a, 0xc8, 0x42, 0xec, 0x94, 0x7f, 0x3f, + 0xab, 0x2c, 0x25, 0x9b, 0x51, 0x0a, 0xcd, 0x82, 0x1b, 0x32, 0x8b, 0xba, 0x0c, 0xa6, 0xec, 0x0e, + 0x39, 0x42, 0xa1, 0x47, 0x7a, 0xda, 0x18, 0xe3, 0xdc, 0x37, 0xd4, 0xaa, 0x94, 0x75, 0x7f, 0x4c, + 0x69, 0x97, 0x93, 0xb4, 0x53, 0x25, 0x1a, 0x25, 0xb0, 0x9c, 0x65, 0x97, 0xe4, 0x8d, 0x0b, 0x05, + 0x14, 0xea, 0xd8, 0xfd, 0x14, 0x11, 0xa8, 0x7e, 0x90, 0x21, 0xc4, 0x4e, 0xf1, 0xe5, 0x8b, 0x72, + 0xdc, 0xcc, 0x5b, 0x22, 0x26, 0x8f, 0x6a, 0x82, 0xc9, 0x2e, 0x22, 0x30, 0xe4, 0x05, 0x5f, 0xd1, + 0x0b, 0x1c, 0xa6, 0x56, 0x41, 0x1e, 0xb5, 0x89, 0x87, 0x02, 0xd6, 0x3c, 0x33, 0x55, 0xdd, 0x4c, + 0x6a, 0x63, 0xd2, 0x62, 0x1e, 0x31, 0x44, 0x43, 0x20, 0xaf, 0x6a, 0x9e, 0xda, 0x1a, 0x95, 0x85, + 0xe7, 0xa6, 0x92, 0xa8, 0x49, 0x49, 0x68, 0x32, 0x63, 0x1e, 0xcc, 0x8a, 0xcf, 0x88, 0xf8, 0x3f, + 0x4a, 0x64, 0xfb, 0x0c, 0x7a, 0xee, 0x11, 0x81, 0xce, 0xff, 0x25, 0xc0, 0x36, 0x28, 0x70, 0x5a, + 0x58, 0x1b, 0x67, 0xdb, 0xd0, 0x18, 0x54, 0x40, 0x56, 0x14, 0x53, 0x42, 0x86, 0x5c, 0x29, 0xc5, + 0xed, 0xa4, 0x14, 0x7a, 0x5a, 0x0a, 0x99, 0xd9, 0x58, 0x04, 0x0b, 0x03, 0xa6, 0x78, 0x4f, 0x80, + 0x3a, 0x76, 0xe5, 0x76, 0xff, 0x8f, 0xaa, 0xdc, 0x01, 0x53, 0xe2, 0xb0, 0x41, 0xa3, 0x95, 0xe9, + 0x43, 0xd5, 0x6d, 0x90, 0xb7, 0x7d, 0xd4, 0x09, 0x88, 0x10, 0xe7, 0x7a, 0x67, 0x94, 0x88, 0xa9, + 0xad, 0xb3, 0x3d, 0x12, 0x65, 0xa3, 0x2a, 0xdc, 0x4c, 0xaa, 0x20, 0x68, 0x19, 0x45, 0xa0, 0xf6, + 0x47, 0x11, 0xf7, 0x27, 0xbc, 0x2d, 0x3e, 0x69, 0x3b, 0x36, 0x81, 0xfb, 0x76, 0x68, 0xfb, 0x98, + 0x32, 0xe9, 0xef, 0x4a, 0x65, 0x14, 0x93, 0x08, 0xaa, 0x7e, 0x08, 0xf2, 0x6d, 0x96, 0x81, 0xd1, + 0x9f, 0xae, 0xbe, 0x31, 0xb8, 0xcc, 0x3c, 0x7f, 0x82, 0x06, 0x0f, 0xa8, 0x6d, 0xa5, 0xb7, 0xfa, + 0xaa, 0xa4, 0x71, 0x22, 0x2f, 0xa8, 0x81, 0x3a, 0xc5, 0x92, 0xc6, 0x4d, 0x11, 0xad, 0x3f, 0x14, + 0x76, 0x93, 0xec, 0x86, 0xd0, 0x26, 0xf0, 0x3e, 0xea, 0xc2, 0x30, 0x40, 0x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f, 0x0a, 0xa6, 0x57, 0xae, 0x05, 0x93, + 0x73, 0xe9, 0x93, 0xdf, 0xd2, 0x0b, 0x64, 0xe7, 0xfe, 0xd3, 0xf3, 0x92, 0xf2, 0xec, 0xbc, 0xa4, + 0xfc, 0x75, 0x5e, 0x52, 0x7e, 0xba, 0x28, 0xe5, 0x9e, 0x5d, 0x94, 0x72, 0x7f, 0x5e, 0x94, 0x72, + 0x5f, 0x54, 0x5c, 0x8f, 0x1c, 0x75, 0x9a, 0x66, 0x0b, 0xf9, 0x96, 0xc8, 0x5c, 0x39, 0xea, 0x34, + 0xad, 0xe4, 0xa5, 0x4f, 0x7a, 0x6d, 0x88, 0xe9, 0x7f, 0xd7, 0x3c, 0xfb, 0x83, 0xb1, 0xf5, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0xaa, 0x51, 0xd2, 0xfd, 0x0e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2017,18 +2010,6 @@ func (m *MsgCreateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Pubkey != nil { - { - size, err := m.Pubkey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) @@ -2160,13 +2141,6 @@ func (m *MsgDelegateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Percentage) > 0 { - i -= len(m.Percentage) - copy(dAtA[i:], m.Percentage) - i = encodeVarintTx(dAtA, i, uint64(len(m.Percentage))) - i-- - dAtA[i] = 0x32 - } if len(m.GovernorAddress) > 0 { i -= len(m.GovernorAddress) copy(dAtA[i:], m.GovernorAddress) @@ -2480,10 +2454,6 @@ func (m *MsgCreateGovernor) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.Pubkey != nil { - l = m.Pubkey.Size() - n += 1 + l + sovTx(uint64(l)) - } return n } @@ -2537,10 +2507,6 @@ func (m *MsgDelegateGovernor) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Percentage) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } return n } @@ -3927,42 +3893,6 @@ func (m *MsgCreateGovernor) Unmarshal(dAtA []byte) error { } m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pubkey == nil { - m.Pubkey = &types.Any{} - } - if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4311,38 +4241,6 @@ func (m *MsgDelegateGovernor) Unmarshal(dAtA []byte) error { } m.GovernorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Percentage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Percentage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 851c00546a49a994e989817b9ccc4b73191f3537 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 11:23:42 +0200 Subject: [PATCH 15/43] add query and cli --- proto/atomone/gov/v1/query.proto | 100 + x/gov/client/cli/query.go | 220 ++ x/gov/client/cli/tx.go | 130 + x/gov/keeper/delegation.go | 5 +- x/gov/keeper/governor.go | 4 +- x/gov/keeper/grpc_query.go | 149 + x/gov/types/v1/governor.go | 15 +- x/gov/types/v1/query.pb.go | 5243 +++++++++++++++++++++--------- x/gov/types/v1/query.pb.gw.go | 523 +++ 9 files changed, 4906 insertions(+), 1483 deletions(-) diff --git a/proto/atomone/gov/v1/query.proto b/proto/atomone/gov/v1/query.proto index 9052a450d..d902fbcff 100644 --- a/proto/atomone/gov/v1/query.proto +++ b/proto/atomone/gov/v1/query.proto @@ -51,6 +51,31 @@ service Query { rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { option (google.api.http).get = "/atomone/gov/v1/proposals/{proposal_id}/tally"; } + + // Governor queries governor information based on governor address. + rpc Governor(QueryGovernorRequest) returns (QueryGovernorResponse) { + option (google.api.http).get = "/atomone/gov/v1/governor/{governor_address}"; + } + + // Governors queries all governors. + rpc Governors(QueryGovernorsRequest) returns (QueryGovernorsResponse) { + option (google.api.http).get = "/atomone/gov/v1/governors"; + } + + // GovernanceDelegations queries all delegations of a governor. + rpc GovernanceDelegations(QueryGovernanceDelegationsRequest) returns (QueryGovernanceDelegationsResponse) { + option (google.api.http).get = "/atomone/gov/v1/governors/{governor_address}/delegations"; + } + + // GovernanceDelegation queries a delegation + rpc GovernanceDelegation(QueryGovernanceDelegationRequest) returns (QueryGovernanceDelegationResponse) { + option (google.api.http).get = "/atomone/gov/v1/delegations/{delegator_address}"; + } + + // GovernorValShares queries all governor validator shares resulting from all governance delegations. + rpc GovernorValShares(QueryGovernorValSharesRequest) returns (QueryGovernorValSharesResponse) { + option (google.api.http).get = "/atomone/gov/v1/valshares/{governor_address}"; + } } // QueryProposalRequest is the request type for the Query/Proposal RPC method. @@ -191,3 +216,78 @@ message QueryTallyResultResponse { // tally defines the requested tally. TallyResult tally = 1; } + +// QueryGovernorRequest is the request type for the Query/Governor RPC method. +message QueryGovernorRequest { + // gvernor_address defines the address of the governor. + string governor_address = 1 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; +} + +// QueryGovernorResponse is the response type for the Query/Governor RPC method. +message QueryGovernorResponse { + // governor defines the requested governor. + Governor governor = 1; +} + +// QueryGovernorsRequest is the request type for the Query/Governors RPC method. +message QueryGovernorsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryGovernorsResponse is the response type for the Query/Governors RPC method. +message QueryGovernorsResponse { + // governors defines the requested governors. + repeated Governor governors = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGovernanceDelegationsRequest is the request type for the Query/GovernanceDelegations RPC method. +message QueryGovernanceDelegationsRequest { + // governor_address defines the address of the governor. + string governor_address = 1 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGovernanceDelegationsResponse is the response type for the Query/GovernanceDelegations RPC method. +message QueryGovernanceDelegationsResponse { + // delegations defines the requested delegations. + repeated GovernanceDelegation delegations = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGovernanceDelegationRequest is the request type for the Query/GovernanceDelegation RPC method. +message QueryGovernanceDelegationRequest { + // delegator_address defines the address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryGovernanceDelegationResponse is the response type for the Query/GovernanceDelegation RPC method. +message QueryGovernanceDelegationResponse { + // governor_address defines the address of the governor. + string governor_address = 1; +} + +// QueryGovernorValSharesRequest is the request type for the Query/GovernorValShares RPC method. +message QueryGovernorValSharesRequest { + // governor_address defines the address of the governor. + string governor_address = 1 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; + + // pagination defines the pagination in the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGovernorValSharesResponse is the response type for the Query/GovernorValShares RPC method. +message QueryGovernorValSharesResponse { + // val_shares defines the requested validator shares. + repeated GovernorValShares val_shares = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index be807bd2b..e31d78be2 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -653,3 +653,223 @@ $ %s query gov proposer 1 return cmd } + +// GetCmdQueryGovernor implements the query governor command. +func GetCmdQueryGovernor() *cobra.Command { + cmd := &cobra.Command{ + Use: "governor [address]", + Args: cobra.ExactArgs(1), + Short: "Query details of a single governor", + Long: strings.TrimSpace( + fmt.Sprintf(`Query details for a governor by its address. + +Example: +$ %s query gov governor cosmosgov1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + addr, err := types.GovernorAddressFromBech32(args[0]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := v1.NewQueryClient(clientCtx) + + res, err := queryClient.Governor( + cmd.Context(), + &v1.QueryGovernorRequest{GovernorAddress: addr.String()}, + ) + if err != nil { + return err + } + + return clientCtx.PrintProto(res.Governor) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryGovernors implements the query governors command. +func GetCmdQueryGovernors() *cobra.Command { + cmd := &cobra.Command{ + Use: "governors", + Short: "Query all governors", + Long: strings.TrimSpace( + fmt.Sprintf(`Query all governors. + +Example: +$ %s query gov governors +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := v1.NewQueryClient(clientCtx) + + res, err := queryClient.Governors( + cmd.Context(), + &v1.QueryGovernorsRequest{}, + ) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryGovernanceDelegation implements the query governance delegation command. +func GetCmdQueryGovernanceDelegation() *cobra.Command { + cmd := &cobra.Command{ + Use: "delegation [address]", + Args: cobra.ExactArgs(1), + Short: "Query governance delegation for a delegator", + Long: strings.TrimSpace( + fmt.Sprintf(`Query details for a governance delegation by a delegator. + +Example: +$ %s query gov delegation cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + addr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := v1.NewQueryClient(clientCtx) + + res, err := queryClient.GovernanceDelegation( + cmd.Context(), + &v1.QueryGovernanceDelegationRequest{DelegatorAddress: addr.String()}, + ) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryGovernanceDelegations implements the query governance delegations command. +func GetCmdQueryGovernanceDelegations() *cobra.Command { + cmd := &cobra.Command{ + Use: "delegations [governor_address]", + Short: "Query all governance delegations for a governor", + Long: strings.TrimSpace( + fmt.Sprintf(`Query all governance delegations for a governor. + +Example: +$ %s query gov delegations cosmosgov1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk +`, + version.AppName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + addr, err := types.GovernorAddressFromBech32(args[0]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := v1.NewQueryClient(clientCtx) + + res, err := queryClient.GovernanceDelegations( + cmd.Context(), + &v1.QueryGovernanceDelegationsRequest{GovernorAddress: addr.String()}, + ) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryGovernorValShares implements the query governor validator shares command. +func GetCmdQueryGovernorValShares() *cobra.Command { + cmd := &cobra.Command{ + Use: "valshares [governor_address]", + Args: cobra.ExactArgs(1), + Short: "Query governor validators shares", + Long: strings.TrimSpace( + fmt.Sprintf(`Query details for a governor validators shares by its address. + +Example: +$ %s query gov valshares cosmosgov1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + + addr, err := types.GovernorAddressFromBech32(args[0]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := v1.NewQueryClient(clientCtx) + + res, err := queryClient.GovernorValShares( + cmd.Context(), + &v1.QueryGovernorValSharesRequest{GovernorAddress: addr.String()}, + ) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 240c5fcda..d49cea639 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -375,3 +375,133 @@ $ %s tx gov weighted-vote 1 yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05 --from return cmd } + +// CreateGovernorCmd creates a new Governor +func CreateGovernorCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "create-governor [address] [moniker] [identity] [website] [security-contact] [details]", + Short: "Create a new Governor", + Args: cobra.ExactArgs(6), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + address, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + description := v1.GovernorDescription{ + Moniker: args[1], + Identity: args[2], + Website: args[3], + SecurityContact: args[4], + Details: args[5], + } + + msg := v1.NewMsgCreateGovernor(address, description) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +// EditGovernorCmd edits a Governor +func EditGovernorCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "edit-governor [address] [status] [moniker] [identity] [website] [security-contact] [details]", + Short: "Edit a Governor. Can also update the Governor status.", + Args: cobra.ExactArgs(7), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + address, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + status, err := v1.GovernorStatusFromString(args[1]) + if err != nil { + return err + } + + description := v1.GovernorDescription{ + Moniker: args[2], + Identity: args[3], + Website: args[4], + SecurityContact: args[5], + Details: args[6], + } + + msg := v1.NewMsgEditGovernor(address, description, status) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +// DelegateGovernorCmd delegates or redelegates to a Governor +func DelegateGovernorCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "delegate-governor [delegator-address] [governor-address]", + Short: "Delegate governance power to a Governor. Triggers a redelegation if a governance delegation already exists", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + delegatorAddress, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + governorAddress, err := types.GovernorAddressFromBech32(args[1]) + if err != nil { + return err + } + + msg := v1.NewMsgDelegateGovernor(delegatorAddress, governorAddress) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +// UndelegateGovernorCmd undelegates from a Governor +func UndelegateGovernorCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "undelegate-governor [delegator-address]", + Short: "Undelegate tokens from a Governor", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + delegatorAddress, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + msg := v1.NewMsgUndelegateGovernor(delegatorAddress) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 8cc0bfb41..4238e5037 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -115,16 +115,15 @@ func (k Keeper) RemoveGovernorValShares(ctx sdk.Context, governorAddr types.Gove } // GetAllGovernanceDelegationsByGovernor gets all governance delegations for a specific governor -func (k Keeper) GetAllGovernanceDelegationsByGovernor(ctx sdk.Context, governorAddr types.GovernorAddress) []v1.GovernanceDelegation { +func (k Keeper) GetAllGovernanceDelegationsByGovernor(ctx sdk.Context, governorAddr types.GovernorAddress) (delegations []*v1.GovernanceDelegation) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.GovernanceDelegationsByGovernorKey(governorAddr, []byte{})) defer iterator.Close() - var delegations []v1.GovernanceDelegation for ; iterator.Valid(); iterator.Next() { var delegation v1.GovernanceDelegation k.cdc.MustUnmarshal(iterator.Value(), &delegation) - delegations = append(delegations, delegation) + delegations = append(delegations, &delegation) } return delegations } diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index f242581c2..f0cbd7c9a 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -40,7 +40,7 @@ func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors v1.Governors) { for ; iterator.Valid(); iterator.Next() { governor := v1.MustUnmarshalGovernor(k.cdc, iterator.Value()) - governors = append(governors, governor) + governors = append(governors, &governor) } return governors @@ -56,7 +56,7 @@ func (k Keeper) GetAllActiveGovernors(ctx sdk.Context) (governors v1.Governors) for ; iterator.Valid(); iterator.Next() { governor := v1.MustUnmarshalGovernor(k.cdc, iterator.Value()) if governor.IsActive() { - governors = append(governors, governor) + governors = append(governors, &governor) } } diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 8314d8984..0df0545eb 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -282,6 +282,155 @@ func (q Keeper) TallyResult(c context.Context, req *v1.QueryTallyResultRequest) return &v1.QueryTallyResultResponse{Tally: &tallyResult}, nil } +// Governor queries governor information based on governor address. +func (q Keeper) Governor(c context.Context, req *v1.QueryGovernorRequest) (*v1.QueryGovernorResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.GovernorAddress == "" { + return nil, status.Error(codes.InvalidArgument, "empty governor address") + } + + governorAddr, err := types.GovernorAddressFromBech32(req.GovernorAddress) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ctx := sdk.UnwrapSDKContext(c) + + governor, found := q.GetGovernor(ctx, governorAddr) + if !found { + return nil, status.Errorf(codes.NotFound, "governor %s doesn't exist", req.GovernorAddress) + } + + return &v1.QueryGovernorResponse{Governor: &governor}, nil +} + +// Governors queries all governors. +func (q Keeper) Governors(c context.Context, req *v1.QueryGovernorsRequest) (*v1.QueryGovernorsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(q.storeKey) + governorStore := prefix.NewStore(store, types.GovernorKeyPrefix) + + var governors v1.Governors + pageRes, err := query.Paginate(governorStore, req.Pagination, func(key []byte, value []byte) error { + var governor v1.Governor + if err := q.cdc.Unmarshal(value, &governor); err != nil { + return err + } + + governors = append(governors, &governor) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &v1.QueryGovernorsResponse{Governors: governors, Pagination: pageRes}, nil +} + +// GovernanceDelegations queries all delegations of a governor. +func (q Keeper) GovernanceDelegations(c context.Context, req *v1.QueryGovernanceDelegationsRequest) (*v1.QueryGovernanceDelegationsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.GovernorAddress == "" { + return nil, status.Error(codes.InvalidArgument, "empty governor address") + } + + governorAddr, err := types.GovernorAddressFromBech32(req.GovernorAddress) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(q.storeKey) + delegationStore := prefix.NewStore(store, types.GovernanceDelegationsByGovernorKey(governorAddr, []byte{})) + + var delegations []*v1.GovernanceDelegation + pageRes, err := query.Paginate(delegationStore, req.Pagination, func(key []byte, value []byte) error { + var delegation v1.GovernanceDelegation + if err := q.cdc.Unmarshal(value, &delegation); err != nil { + return err + } + + delegations = append(delegations, &delegation) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &v1.QueryGovernanceDelegationsResponse{Delegations: delegations, Pagination: pageRes}, nil +} + +// GovernanceDelegation queries a delegation +func (q Keeper) GovernanceDelegation(c context.Context, req *v1.QueryGovernanceDelegationRequest) (*v1.QueryGovernanceDelegationResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.DelegatorAddress == "" { + return nil, status.Error(codes.InvalidArgument, "empty delegator address") + } + + delegatorAddr, err := sdk.AccAddressFromBech32(req.DelegatorAddress) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ctx := sdk.UnwrapSDKContext(c) + + delegation, found := q.GetGovernanceDelegation(ctx, delegatorAddr) + if !found { + return nil, status.Errorf(codes.NotFound, "governance delegation for %s does not exist", req.DelegatorAddress) + } + + return &v1.QueryGovernanceDelegationResponse{GovernorAddress: delegation.GovernorAddress}, nil +} + +// GovernorValShares queries all validator shares of a governor. +func (q Keeper) GovernorValShares(c context.Context, req *v1.QueryGovernorValSharesRequest) (*v1.QueryGovernorValSharesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.GovernorAddress == "" { + return nil, status.Error(codes.InvalidArgument, "empty governor address") + } + + governorAddr, err := types.GovernorAddressFromBech32(req.GovernorAddress) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(q.storeKey) + valShareStore := prefix.NewStore(store, types.ValidatorSharesByGovernorKey(governorAddr, []byte{})) + + var valShares []*v1.GovernorValShares + pageRes, err := query.Paginate(valShareStore, req.Pagination, func(key []byte, value []byte) error { + var valShare v1.GovernorValShares + if err := q.cdc.Unmarshal(value, &valShare); err != nil { + return err + } + + valShares = append(valShares, &valShare) + + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &v1.QueryGovernorValSharesResponse{ValShares: valShares, Pagination: pageRes}, nil +} + var _ v1beta1.QueryServer = legacyQueryServer{} type legacyQueryServer struct { diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 017762df5..0cae95a1d 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -33,7 +33,7 @@ func NewGovernor(address string, description GovernorDescription) (Governor, err } // Governors is a collection of Governor -type Governors []Governor +type Governors []*Governor func (g Governors) String() (out string) { for _, gov := range g { @@ -184,6 +184,19 @@ func (s GovernorStatus) EnsureValid() bool { return s == Active || s == Inactive } +// GovernorStatusFromString returns a GovernorStatus from a string. It returns an +// error if the string is invalid. +func GovernorStatusFromString(str string) (GovernorStatus, error) { + switch str { + case GovernorStatusActive: + return Active, nil + case GovernorStatusInactive: + return Inactive, nil + default: + return Unspecified, types.ErrInvalidGovernorStatus.Wrapf("unrecognized governor status %s", str) + } +} + // MinEqual defines a more minimum set of equality conditions when comparing two // governors. func (g *Governor) MinEqual(other *Governor) bool { diff --git a/x/gov/types/v1/query.pb.go b/x/gov/types/v1/query.pb.go index 8d29bb15a..e67ef3d09 100644 --- a/x/gov/types/v1/query.pb.go +++ b/x/gov/types/v1/query.pb.go @@ -893,1365 +893,3578 @@ func (m *QueryTallyResultResponse) GetTally() *TallyResult { return nil } -func init() { - proto.RegisterType((*QueryProposalRequest)(nil), "atomone.gov.v1.QueryProposalRequest") - proto.RegisterType((*QueryProposalResponse)(nil), "atomone.gov.v1.QueryProposalResponse") - proto.RegisterType((*QueryProposalsRequest)(nil), "atomone.gov.v1.QueryProposalsRequest") - proto.RegisterType((*QueryProposalsResponse)(nil), "atomone.gov.v1.QueryProposalsResponse") - proto.RegisterType((*QueryVoteRequest)(nil), "atomone.gov.v1.QueryVoteRequest") - proto.RegisterType((*QueryVoteResponse)(nil), "atomone.gov.v1.QueryVoteResponse") - proto.RegisterType((*QueryVotesRequest)(nil), "atomone.gov.v1.QueryVotesRequest") - proto.RegisterType((*QueryVotesResponse)(nil), "atomone.gov.v1.QueryVotesResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "atomone.gov.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "atomone.gov.v1.QueryParamsResponse") - proto.RegisterType((*QueryDepositRequest)(nil), "atomone.gov.v1.QueryDepositRequest") - proto.RegisterType((*QueryDepositResponse)(nil), "atomone.gov.v1.QueryDepositResponse") - proto.RegisterType((*QueryDepositsRequest)(nil), "atomone.gov.v1.QueryDepositsRequest") - proto.RegisterType((*QueryDepositsResponse)(nil), "atomone.gov.v1.QueryDepositsResponse") - proto.RegisterType((*QueryTallyResultRequest)(nil), "atomone.gov.v1.QueryTallyResultRequest") - proto.RegisterType((*QueryTallyResultResponse)(nil), "atomone.gov.v1.QueryTallyResultResponse") +// QueryGovernorRequest is the request type for the Query/Governor RPC method. +type QueryGovernorRequest struct { + // gvernor_address defines the address of the governor. + GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` } -func init() { proto.RegisterFile("atomone/gov/v1/query.proto", fileDescriptor_2290d0188dd70223) } - -var fileDescriptor_2290d0188dd70223 = []byte{ - // 971 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xdd, 0x6e, 0xdc, 0x44, - 0x14, 0x8e, 0x37, 0x3f, 0xdd, 0x3d, 0x69, 0x03, 0x1c, 0x42, 0xeb, 0xba, 0x65, 0x49, 0x4d, 0x48, - 0x42, 0x45, 0x3c, 0x6c, 0x4a, 0x5a, 0x84, 0x28, 0x12, 0x51, 0x69, 0xe8, 0x05, 0x52, 0xd8, 0x56, - 0x5c, 0x70, 0x13, 0x39, 0x59, 0xcb, 0xb5, 0xb4, 0xf1, 0xb8, 0x3b, 0xb3, 0x2b, 0xa2, 0xb0, 0xaa, - 0x84, 0x84, 0x04, 0x5c, 0x15, 0x21, 0x84, 0xe8, 0x73, 0xf0, 0x10, 0x5c, 0x56, 0x70, 0xc3, 0x25, - 0x4a, 0x78, 0x02, 0x9e, 0x00, 0x79, 0xe6, 0xd8, 0x6b, 0x3b, 0xde, 0x9f, 0x54, 0x15, 0x97, 0x9e, - 0xf9, 0xce, 0x39, 0xdf, 0xf9, 0xfb, 0x66, 0x17, 0x2c, 0x57, 0xf2, 0x03, 0x1e, 0x7a, 0xcc, 0xe7, - 0x3d, 0xd6, 0x6b, 0xb0, 0x47, 0x5d, 0xaf, 0x73, 0xe8, 0x44, 0x1d, 0x2e, 0x39, 0x2e, 0xd0, 0x9d, - 0xe3, 0xf3, 0x9e, 0xd3, 0x6b, 0x58, 0xd7, 0xf7, 0xb9, 0x38, 0xe0, 0x82, 0xed, 0xb9, 0xc2, 0xd3, - 0x40, 0xd6, 0x6b, 0xec, 0x79, 0xd2, 0x6d, 0xb0, 0xc8, 0xf5, 0x83, 0xd0, 0x95, 0x01, 0x0f, 0xb5, - 0xad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0x01, 0x4f, 0x6b, 0x90, 0xb5, 0x36, 0x1e, 0xf8, 0xbc, - 0xb3, 0xa4, 0x44, 0x67, 0x6b, 0xfb, 0xf7, 0xe3, 0xba, 0xf1, 0xec, 0xb8, 0x6e, 0xfc, 0x7d, 0x5c, - 0x37, 0x9e, 0x9c, 0xd4, 0xa7, 0x9e, 0x9d, 0xd4, 0xa7, 0xfe, 0x3a, 0xa9, 0x4f, 0x7d, 0xb9, 0xee, - 0x07, 0xf2, 0x61, 0x77, 0xcf, 0xd9, 0xe7, 0x07, 0x89, 0xcb, 0xf5, 0x87, 0xdd, 0xbd, 0xd4, 0xfd, - 0x57, 0x2a, 0x40, 0x3c, 0x10, 0x22, 0xfe, 0xfb, 0x32, 0xa7, 0xfe, 0x5c, 0xdc, 0xf8, 0x2f, 0x00, - 0x00, 0xff, 0xff, 0x34, 0x71, 0xdf, 0xcf, 0x09, 0x0d, 0x00, 0x00, +func (m *QueryGovernorRequest) Reset() { *m = QueryGovernorRequest{} } +func (m *QueryGovernorRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGovernorRequest) ProtoMessage() {} +func (*QueryGovernorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{16} +} +func (m *QueryGovernorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovernorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernorRequest.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 *QueryGovernorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernorRequest.Merge(m, src) +} +func (m *QueryGovernorRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGovernorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernorRequest.DiscardUnknown(m) } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +var xxx_messageInfo_QueryGovernorRequest proto.InternalMessageInfo -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Proposal queries proposal details based on ProposalID. - Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) - // Proposals queries all proposals based on given status. - Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) - // Vote queries voted information based on proposalID, voterAddr. - Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) - // Votes queries votes of a given proposal. - Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) - // Params queries all parameters of the gov module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. - Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) - // Deposits queries all deposits of a single proposal. - Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) - // TallyResult queries the tally of a proposal vote. - TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) +func (m *QueryGovernorRequest) GetGovernorAddress() string { + if m != nil { + return m.GovernorAddress + } + return "" } -type queryClient struct { - cc grpc1.ClientConn +// QueryGovernorResponse is the response type for the Query/Governor RPC method. +type QueryGovernorResponse struct { + // governor defines the requested governor. + Governor *Governor `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` } -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} +func (m *QueryGovernorResponse) Reset() { *m = QueryGovernorResponse{} } +func (m *QueryGovernorResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGovernorResponse) ProtoMessage() {} +func (*QueryGovernorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{17} } - -func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { - out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Proposal", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryGovernorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovernorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernorResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryGovernorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernorResponse.Merge(m, src) +} +func (m *QueryGovernorResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGovernorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernorResponse.DiscardUnknown(m) } -func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { - out := new(QueryProposalsResponse) - err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Proposals", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryGovernorResponse proto.InternalMessageInfo + +func (m *QueryGovernorResponse) GetGovernor() *Governor { + if m != nil { + return m.Governor } - return out, nil + return nil } -func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { - out := new(QueryVoteResponse) - err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Vote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +// QueryGovernorsRequest is the request type for the Query/Governors RPC method. +type QueryGovernorsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { - out := new(QueryVotesResponse) - err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Votes", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryGovernorsRequest) Reset() { *m = QueryGovernorsRequest{} } +func (m *QueryGovernorsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGovernorsRequest) ProtoMessage() {} +func (*QueryGovernorsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{18} +} +func (m *QueryGovernorsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovernorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernorsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryGovernorsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernorsRequest.Merge(m, src) +} +func (m *QueryGovernorsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGovernorsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernorsRequest.DiscardUnknown(m) } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Params", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryGovernorsRequest proto.InternalMessageInfo + +func (m *QueryGovernorsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination } - return out, nil + return nil } -func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { - out := new(QueryDepositResponse) - err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Deposit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +// QueryGovernorsResponse is the response type for the Query/Governors RPC method. +type QueryGovernorsResponse struct { + // governors defines the requested governors. + Governors []*Governor `protobuf:"bytes,1,rep,name=governors,proto3" json:"governors,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { - out := new(QueryDepositsResponse) - err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Deposits", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryGovernorsResponse) Reset() { *m = QueryGovernorsResponse{} } +func (m *QueryGovernorsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGovernorsResponse) ProtoMessage() {} +func (*QueryGovernorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{19} +} +func (m *QueryGovernorsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovernorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernorsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryGovernorsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernorsResponse.Merge(m, src) +} +func (m *QueryGovernorsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGovernorsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernorsResponse.DiscardUnknown(m) } -func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { - out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/TallyResult", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryGovernorsResponse proto.InternalMessageInfo + +func (m *QueryGovernorsResponse) GetGovernors() []*Governor { + if m != nil { + return m.Governors } - return out, nil + return nil } -// QueryServer is the server API for Query service. -type QueryServer interface { - // Proposal queries proposal details based on ProposalID. - Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) - // Proposals queries all proposals based on given status. - Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error) - // Vote queries voted information based on proposalID, voterAddr. - Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error) - // Votes queries votes of a given proposal. - Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) - // Params queries all parameters of the gov module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. - Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) - // Deposits queries all deposits of a single proposal. - Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) - // TallyResult queries the tally of a proposal vote. - TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) +func (m *QueryGovernorsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil } -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { +// QueryGovernanceDelegationsRequest is the request type for the Query/GovernanceDelegations RPC method. +type QueryGovernanceDelegationsRequest struct { + // governor_address defines the address of the governor. + GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (*UnimplementedQueryServer) Proposal(ctx context.Context, req *QueryProposalRequest) (*QueryProposalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented") -} -func (*UnimplementedQueryServer) Proposals(ctx context.Context, req *QueryProposalsRequest) (*QueryProposalsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Proposals not implemented") -} -func (*UnimplementedQueryServer) Vote(ctx context.Context, req *QueryVoteRequest) (*QueryVoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") +func (m *QueryGovernanceDelegationsRequest) Reset() { *m = QueryGovernanceDelegationsRequest{} } +func (m *QueryGovernanceDelegationsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGovernanceDelegationsRequest) ProtoMessage() {} +func (*QueryGovernanceDelegationsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{20} } -func (*UnimplementedQueryServer) Votes(ctx context.Context, req *QueryVotesRequest) (*QueryVotesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Votes not implemented") +func (m *QueryGovernanceDelegationsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +func (m *QueryGovernanceDelegationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernanceDelegationsRequest.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 (*UnimplementedQueryServer) Deposit(ctx context.Context, req *QueryDepositRequest) (*QueryDepositResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +func (m *QueryGovernanceDelegationsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernanceDelegationsRequest.Merge(m, src) } -func (*UnimplementedQueryServer) Deposits(ctx context.Context, req *QueryDepositsRequest) (*QueryDepositsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Deposits not implemented") +func (m *QueryGovernanceDelegationsRequest) XXX_Size() int { + return m.Size() } -func (*UnimplementedQueryServer) TallyResult(ctx context.Context, req *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") +func (m *QueryGovernanceDelegationsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernanceDelegationsRequest.DiscardUnknown(m) } -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} +var xxx_messageInfo_QueryGovernanceDelegationsRequest proto.InternalMessageInfo -func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProposalRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Proposal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/atomone.gov.v1.Query/Proposal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest)) +func (m *QueryGovernanceDelegationsRequest) GetGovernorAddress() string { + if m != nil { + return m.GovernorAddress } - return interceptor(ctx, in, info, handler) + return "" } -func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProposalsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Proposals(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/atomone.gov.v1.Query/Proposals", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest)) +func (m *QueryGovernanceDelegationsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination } - return interceptor(ctx, in, info, handler) + return nil } -func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVoteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Vote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/atomone.gov.v1.Query/Vote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest)) - } - return interceptor(ctx, in, info, handler) +// QueryGovernanceDelegationsResponse is the response type for the Query/GovernanceDelegations RPC method. +type QueryGovernanceDelegationsResponse struct { + // delegations defines the requested delegations. + Delegations []*GovernanceDelegation `protobuf:"bytes,1,rep,name=delegations,proto3" json:"delegations,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVotesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Votes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/atomone.gov.v1.Query/Votes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest)) +func (m *QueryGovernanceDelegationsResponse) Reset() { *m = QueryGovernanceDelegationsResponse{} } +func (m *QueryGovernanceDelegationsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGovernanceDelegationsResponse) ProtoMessage() {} +func (*QueryGovernanceDelegationsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{21} +} +func (m *QueryGovernanceDelegationsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovernanceDelegationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernanceDelegationsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *QueryGovernanceDelegationsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernanceDelegationsResponse.Merge(m, src) +} +func (m *QueryGovernanceDelegationsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGovernanceDelegationsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernanceDelegationsResponse.DiscardUnknown(m) } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/atomone.gov.v1.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) +var xxx_messageInfo_QueryGovernanceDelegationsResponse proto.InternalMessageInfo + +func (m *QueryGovernanceDelegationsResponse) GetDelegations() []*GovernanceDelegation { + if m != nil { + return m.Delegations } - return interceptor(ctx, in, info, handler) + return nil } -func _Query_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDepositRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Deposit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/atomone.gov.v1.Query/Deposit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) +func (m *QueryGovernanceDelegationsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination } - return interceptor(ctx, in, info, handler) + return nil } -func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDepositsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Deposits(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/atomone.gov.v1.Query/Deposits", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest)) - } - return interceptor(ctx, in, info, handler) +// QueryGovernanceDelegationRequest is the request type for the Query/GovernanceDelegation RPC method. +type QueryGovernanceDelegationRequest struct { + // delegator_address defines the address of the delegator. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` } -func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTallyResultRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TallyResult(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/atomone.gov.v1.Query/TallyResult", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) +func (m *QueryGovernanceDelegationRequest) Reset() { *m = QueryGovernanceDelegationRequest{} } +func (m *QueryGovernanceDelegationRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGovernanceDelegationRequest) ProtoMessage() {} +func (*QueryGovernanceDelegationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{22} +} +func (m *QueryGovernanceDelegationRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovernanceDelegationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernanceDelegationRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) } - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "atomone.gov.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Proposal", - Handler: _Query_Proposal_Handler, - }, - { - MethodName: "Proposals", - Handler: _Query_Proposals_Handler, - }, - { - MethodName: "Vote", - Handler: _Query_Vote_Handler, - }, - { - MethodName: "Votes", - Handler: _Query_Votes_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Deposit", - Handler: _Query_Deposit_Handler, - }, - { - MethodName: "Deposits", - Handler: _Query_Deposits_Handler, - }, - { - MethodName: "TallyResult", - Handler: _Query_TallyResult_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "atomone/gov/v1/query.proto", +func (m *QueryGovernanceDelegationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernanceDelegationRequest.Merge(m, src) +} +func (m *QueryGovernanceDelegationRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGovernanceDelegationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernanceDelegationRequest.DiscardUnknown(m) } -func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_QueryGovernanceDelegationRequest proto.InternalMessageInfo + +func (m *QueryGovernanceDelegationRequest) GetDelegatorAddress() string { + if m != nil { + return m.DelegatorAddress } - return dAtA[:n], nil + return "" } -func (m *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// QueryGovernanceDelegationResponse is the response type for the Query/GovernanceDelegation RPC method. +type QueryGovernanceDelegationResponse struct { + // governor_address defines the address of the governor. + GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` } -func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 +func (m *QueryGovernanceDelegationResponse) Reset() { *m = QueryGovernanceDelegationResponse{} } +func (m *QueryGovernanceDelegationResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGovernanceDelegationResponse) ProtoMessage() {} +func (*QueryGovernanceDelegationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{23} +} +func (m *QueryGovernanceDelegationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovernanceDelegationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernanceDelegationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *QueryGovernanceDelegationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernanceDelegationResponse.Merge(m, src) +} +func (m *QueryGovernanceDelegationResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGovernanceDelegationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernanceDelegationResponse.DiscardUnknown(m) } -func (m *QueryProposalResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_QueryGovernanceDelegationResponse proto.InternalMessageInfo + +func (m *QueryGovernanceDelegationResponse) GetGovernorAddress() string { + if m != nil { + return m.GovernorAddress } - return dAtA[:n], nil + return "" } -func (m *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// QueryGovernorValSharesRequest is the request type for the Query/GovernorValShares RPC method. +type QueryGovernorValSharesRequest struct { + // governor_address defines the address of the governor. + GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` + // pagination defines the pagination in the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Proposal != nil { - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (m *QueryGovernorValSharesRequest) Reset() { *m = QueryGovernorValSharesRequest{} } +func (m *QueryGovernorValSharesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGovernorValSharesRequest) ProtoMessage() {} +func (*QueryGovernorValSharesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{24} } - -func (m *QueryProposalsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryGovernorValSharesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovernorValSharesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernorValSharesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil } - -func (m *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryGovernorValSharesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernorValSharesRequest.Merge(m, src) +} +func (m *QueryGovernorValSharesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGovernorValSharesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernorValSharesRequest.DiscardUnknown(m) } -func (m *QueryProposalsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x1a - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalStatus != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalStatus)) - i-- - dAtA[i] = 0x8 +var xxx_messageInfo_QueryGovernorValSharesRequest proto.InternalMessageInfo + +func (m *QueryGovernorValSharesRequest) GetGovernorAddress() string { + if m != nil { + return m.GovernorAddress } - return len(dAtA) - i, nil + return "" } -func (m *QueryProposalsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryGovernorValSharesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination } - return dAtA[:n], nil + return nil } -func (m *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// QueryGovernorValSharesResponse is the response type for the Query/GovernorValShares RPC method. +type QueryGovernorValSharesResponse struct { + // val_shares defines the requested validator shares. + ValShares []*GovernorValShares `protobuf:"bytes,1,rep,name=val_shares,json=valShares,proto3" json:"val_shares,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryProposalsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) +func (m *QueryGovernorValSharesResponse) Reset() { *m = QueryGovernorValSharesResponse{} } +func (m *QueryGovernorValSharesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGovernorValSharesResponse) ProtoMessage() {} +func (*QueryGovernorValSharesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{25} +} +func (m *QueryGovernorValSharesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovernorValSharesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovernorValSharesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x12 + return b[:n], nil } - if len(m.Proposals) > 0 { - for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } +} +func (m *QueryGovernorValSharesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovernorValSharesResponse.Merge(m, src) +} +func (m *QueryGovernorValSharesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGovernorValSharesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovernorValSharesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGovernorValSharesResponse proto.InternalMessageInfo + +func (m *QueryGovernorValSharesResponse) GetValShares() []*GovernorValShares { + if m != nil { + return m.ValShares } - return len(dAtA) - i, nil + return nil } -func (m *QueryVoteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryGovernorValSharesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination } - return dAtA[:n], nil + return nil } -func (m *QueryVoteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func init() { + proto.RegisterType((*QueryProposalRequest)(nil), "atomone.gov.v1.QueryProposalRequest") + proto.RegisterType((*QueryProposalResponse)(nil), "atomone.gov.v1.QueryProposalResponse") + proto.RegisterType((*QueryProposalsRequest)(nil), "atomone.gov.v1.QueryProposalsRequest") + proto.RegisterType((*QueryProposalsResponse)(nil), "atomone.gov.v1.QueryProposalsResponse") + proto.RegisterType((*QueryVoteRequest)(nil), "atomone.gov.v1.QueryVoteRequest") + proto.RegisterType((*QueryVoteResponse)(nil), "atomone.gov.v1.QueryVoteResponse") + proto.RegisterType((*QueryVotesRequest)(nil), "atomone.gov.v1.QueryVotesRequest") + proto.RegisterType((*QueryVotesResponse)(nil), "atomone.gov.v1.QueryVotesResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "atomone.gov.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "atomone.gov.v1.QueryParamsResponse") + proto.RegisterType((*QueryDepositRequest)(nil), "atomone.gov.v1.QueryDepositRequest") + proto.RegisterType((*QueryDepositResponse)(nil), "atomone.gov.v1.QueryDepositResponse") + proto.RegisterType((*QueryDepositsRequest)(nil), "atomone.gov.v1.QueryDepositsRequest") + proto.RegisterType((*QueryDepositsResponse)(nil), "atomone.gov.v1.QueryDepositsResponse") + proto.RegisterType((*QueryTallyResultRequest)(nil), "atomone.gov.v1.QueryTallyResultRequest") + proto.RegisterType((*QueryTallyResultResponse)(nil), "atomone.gov.v1.QueryTallyResultResponse") + proto.RegisterType((*QueryGovernorRequest)(nil), "atomone.gov.v1.QueryGovernorRequest") + proto.RegisterType((*QueryGovernorResponse)(nil), "atomone.gov.v1.QueryGovernorResponse") + proto.RegisterType((*QueryGovernorsRequest)(nil), "atomone.gov.v1.QueryGovernorsRequest") + proto.RegisterType((*QueryGovernorsResponse)(nil), "atomone.gov.v1.QueryGovernorsResponse") + proto.RegisterType((*QueryGovernanceDelegationsRequest)(nil), "atomone.gov.v1.QueryGovernanceDelegationsRequest") + proto.RegisterType((*QueryGovernanceDelegationsResponse)(nil), "atomone.gov.v1.QueryGovernanceDelegationsResponse") + proto.RegisterType((*QueryGovernanceDelegationRequest)(nil), "atomone.gov.v1.QueryGovernanceDelegationRequest") + proto.RegisterType((*QueryGovernanceDelegationResponse)(nil), "atomone.gov.v1.QueryGovernanceDelegationResponse") + proto.RegisterType((*QueryGovernorValSharesRequest)(nil), "atomone.gov.v1.QueryGovernorValSharesRequest") + proto.RegisterType((*QueryGovernorValSharesResponse)(nil), "atomone.gov.v1.QueryGovernorValSharesResponse") } -func (m *QueryVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil +func init() { proto.RegisterFile("atomone/gov/v1/query.proto", fileDescriptor_2290d0188dd70223) } + +var fileDescriptor_2290d0188dd70223 = []byte{ + // 1337 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0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b, 0x93, 0x02, 0xfa, 0xf3, 0xa4, 0x80, 0x9e, 0x9e, + 0x16, 0x06, 0x5e, 0x9c, 0x16, 0x06, 0xfe, 0x38, 0x2d, 0x0c, 0x7c, 0x5c, 0xd4, 0x6b, 0xf6, 0x7e, + 0x73, 0x57, 0xde, 0x23, 0x07, 0x22, 0x63, 0x71, 0xbf, 0xb9, 0xeb, 0x65, 0xff, 0x84, 0xe6, 0x77, + 0xef, 0x50, 0x4b, 0x71, 0x4a, 0xbb, 0x23, 0xf4, 0xcf, 0x9a, 0x2b, 0x7f, 0x07, 0x00, 0x00, 0xff, + 0xff, 0xa5, 0xa3, 0x94, 0xf7, 0x83, 0x15, 0x00, 0x00, } -func (m *QueryVoteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Proposal queries proposal details based on ProposalID. + Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) + // Proposals queries all proposals based on given status. + Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) + // Vote queries voted information based on proposalID, voterAddr. + Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) + // Votes queries votes of a given proposal. + Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) + // Params queries all parameters of the gov module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Deposit queries single deposit information based proposalID, depositAddr. + Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) + // Deposits queries all deposits of a single proposal. + Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) + // TallyResult queries the tally of a proposal vote. + TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) + // Governor queries governor information based on governor address. + Governor(ctx context.Context, in *QueryGovernorRequest, opts ...grpc.CallOption) (*QueryGovernorResponse, error) + // Governors queries all governors. + Governors(ctx context.Context, in *QueryGovernorsRequest, opts ...grpc.CallOption) (*QueryGovernorsResponse, error) + // GovernanceDelegations queries all delegations of a governor. + GovernanceDelegations(ctx context.Context, in *QueryGovernanceDelegationsRequest, opts ...grpc.CallOption) (*QueryGovernanceDelegationsResponse, error) + // GovernanceDelegation queries a delegation + GovernanceDelegation(ctx context.Context, in *QueryGovernanceDelegationRequest, opts ...grpc.CallOption) (*QueryGovernanceDelegationResponse, error) + // GovernorValShares queries all governor validator shares resulting from all governance delegations. + GovernorValShares(ctx context.Context, in *QueryGovernorValSharesRequest, opts ...grpc.CallOption) (*QueryGovernorValSharesResponse, error) } -func (m *QueryVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type queryClient struct { + cc grpc1.ClientConn } -func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Vote != nil { - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} } -func (m *QueryVotesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { + out := new(QueryProposalResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Proposal", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *QueryVotesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { + out := new(QueryProposalsResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Proposals", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *QueryVotesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryVotesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { + out := new(QueryVoteResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Vote", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryVotesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return out, nil } -func (m *QueryVotesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } +func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { + out := new(QueryVotesResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Votes", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return out, nil } -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ParamsType) > 0 { - i -= len(m.ParamsType) - copy(dAtA[i:], m.ParamsType) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ParamsType))) - i-- - dAtA[i] = 0xa +func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { + out := new(QueryDepositResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Deposit", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { + out := new(QueryDepositsResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Deposits", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return out, nil } -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.TallyParams != nil { - { - size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.DepositParams != nil { - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.VotingParams != nil { - { - size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { + out := new(QueryTallyResultResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/TallyResult", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *QueryDepositRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) Governor(ctx context.Context, in *QueryGovernorRequest, opts ...grpc.CallOption) (*QueryGovernorResponse, error) { + out := new(QueryGovernorResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Governor", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return out, nil } -func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 +func (c *queryClient) Governors(ctx context.Context, in *QueryGovernorsRequest, opts ...grpc.CallOption) (*QueryGovernorsResponse, error) { + out := new(QueryGovernorsResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Governors", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *QueryDepositResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) GovernanceDelegations(ctx context.Context, in *QueryGovernanceDelegationsRequest, opts ...grpc.CallOption) (*QueryGovernanceDelegationsResponse, error) { + out := new(QueryGovernanceDelegationsResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/GovernanceDelegations", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return out, nil } -func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Deposit != nil { - { - size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (c *queryClient) GovernanceDelegation(ctx context.Context, in *QueryGovernanceDelegationRequest, opts ...grpc.CallOption) (*QueryGovernanceDelegationResponse, error) { + out := new(QueryGovernanceDelegationResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/GovernanceDelegation", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *QueryDepositsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) GovernorValShares(ctx context.Context, in *QueryGovernorValSharesRequest, opts ...grpc.CallOption) (*QueryGovernorValSharesResponse, error) { + out := new(QueryGovernorValSharesResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/GovernorValShares", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return out, nil } -func (m *QueryDepositsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil +// QueryServer is the server API for Query service. +type QueryServer interface { + // Proposal queries proposal details based on ProposalID. + Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) + // Proposals queries all proposals based on given status. + Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error) + // Vote queries voted information based on proposalID, voterAddr. + Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error) + // Votes queries votes of a given proposal. + Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) + // Params queries all parameters of the gov module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Deposit queries single deposit information based proposalID, depositAddr. + Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) + // Deposits queries all deposits of a single proposal. + Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) + // TallyResult queries the tally of a proposal vote. + TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) + // Governor queries governor information based on governor address. + Governor(context.Context, *QueryGovernorRequest) (*QueryGovernorResponse, error) + // Governors queries all governors. + Governors(context.Context, *QueryGovernorsRequest) (*QueryGovernorsResponse, error) + // GovernanceDelegations queries all delegations of a governor. + GovernanceDelegations(context.Context, *QueryGovernanceDelegationsRequest) (*QueryGovernanceDelegationsResponse, error) + // GovernanceDelegation queries a delegation + GovernanceDelegation(context.Context, *QueryGovernanceDelegationRequest) (*QueryGovernanceDelegationResponse, error) + // GovernorValShares queries all governor validator shares resulting from all governance delegations. + GovernorValShares(context.Context, *QueryGovernorValSharesRequest) (*QueryGovernorValSharesResponse, error) } -func (m *QueryDepositsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { } -func (m *QueryDepositsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (*UnimplementedQueryServer) Proposal(ctx context.Context, req *QueryProposalRequest) (*QueryProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented") } - -func (m *QueryDepositsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Deposits) > 0 { - for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +func (*UnimplementedQueryServer) Proposals(ctx context.Context, req *QueryProposalsRequest) (*QueryProposalsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposals not implemented") } - -func (m *QueryTallyResultRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (*UnimplementedQueryServer) Vote(ctx context.Context, req *QueryVoteRequest) (*QueryVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") } - -func (m *QueryTallyResultRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (*UnimplementedQueryServer) Votes(ctx context.Context, req *QueryVotesRequest) (*QueryVotesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Votes not implemented") } - -func (m *QueryTallyResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } - -func (m *QueryTallyResultResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (*UnimplementedQueryServer) Deposit(ctx context.Context, req *QueryDepositRequest) (*QueryDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") } - -func (m *QueryTallyResultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (*UnimplementedQueryServer) Deposits(ctx context.Context, req *QueryDepositsRequest) (*QueryDepositsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposits not implemented") +} +func (*UnimplementedQueryServer) TallyResult(ctx context.Context, req *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") +} +func (*UnimplementedQueryServer) Governor(ctx context.Context, req *QueryGovernorRequest) (*QueryGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Governor not implemented") +} +func (*UnimplementedQueryServer) Governors(ctx context.Context, req *QueryGovernorsRequest) (*QueryGovernorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Governors not implemented") +} +func (*UnimplementedQueryServer) GovernanceDelegations(ctx context.Context, req *QueryGovernanceDelegationsRequest) (*QueryGovernanceDelegationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovernanceDelegations not implemented") +} +func (*UnimplementedQueryServer) GovernanceDelegation(ctx context.Context, req *QueryGovernanceDelegationRequest) (*QueryGovernanceDelegationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovernanceDelegation not implemented") +} +func (*UnimplementedQueryServer) GovernorValShares(ctx context.Context, req *QueryGovernorValSharesRequest) (*QueryGovernorValSharesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovernorValShares not implemented") } -func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Tally != nil { - { - size, err := m.Tally.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposalRequest) + if err := dec(in); err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryProposalRequest) Size() (n int) { - if m == nil { - return 0 + if interceptor == nil { + return srv.(QueryServer).Proposal(ctx, in) } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Proposal", } - return n + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryProposalResponse) Size() (n int) { - if m == nil { - return 0 +func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposalsRequest) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - if m.Proposal != nil { - l = m.Proposal.Size() - n += 1 + l + sovQuery(uint64(l)) + if interceptor == nil { + return srv.(QueryServer).Proposals(ctx, in) } - return n + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Proposals", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryProposalsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalStatus != 0 { - n += 1 + sovQuery(uint64(m.ProposalStatus)) +func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVoteRequest) + if err := dec(in); err != nil { + return nil, err } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if interceptor == nil { + return srv.(QueryServer).Vote(ctx, in) } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Vote", } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest)) } - return n + return interceptor(ctx, in, info, handler) } -func (m *QueryProposalsResponse) Size() (n int) { - if m == nil { - return 0 +func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVotesRequest) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - if len(m.Proposals) > 0 { - for _, e := range m.Proposals { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } + if interceptor == nil { + return srv.(QueryServer).Votes(ctx, in) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Votes", } - return n + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryVoteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) } - return n -} - -func (m *QueryVoteResponse) Size() (n int) { - if m == nil { - return 0 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Params", } - var l int - _ = l - if m.Vote != nil { - l = m.Vote.Size() - n += 1 + l + sovQuery(uint64(l)) + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) } - return n + return interceptor(ctx, in, info, handler) } -func (m *QueryVotesRequest) Size() (n int) { - if m == nil { - return 0 +func _Query_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDepositRequest) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) + if interceptor == nil { + return srv.(QueryServer).Deposit(ctx, in) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Deposit", } - return n + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryVotesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Votes) > 0 { - for _, e := range m.Votes { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } +func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDepositsRequest) + if err := dec(in); err != nil { + return nil, err } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if interceptor == nil { + return srv.(QueryServer).Deposits(ctx, in) } - return n -} - -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Deposits", } - var l int - _ = l - l = len(m.ParamsType) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest)) } - return n + return interceptor(ctx, in, info, handler) } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VotingParams != nil { - l = m.VotingParams.Size() - n += 1 + l + sovQuery(uint64(l)) +func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTallyResultRequest) + if err := dec(in); err != nil { + return nil, err } - if m.DepositParams != nil { - l = m.DepositParams.Size() - n += 1 + l + sovQuery(uint64(l)) + if interceptor == nil { + return srv.(QueryServer).TallyResult(ctx, in) } - if m.TallyParams != nil { - l = m.TallyParams.Size() - n += 1 + l + sovQuery(uint64(l)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/TallyResult", } - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) } - return n + return interceptor(ctx, in, info, handler) } -func (m *QueryDepositRequest) Size() (n int) { - if m == nil { - return 0 +func _Query_Governor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGovernorRequest) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) + if interceptor == nil { + return srv.(QueryServer).Governor(ctx, in) } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Governor", } - return n + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Governor(ctx, req.(*QueryGovernorRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryDepositResponse) Size() (n int) { - if m == nil { - return 0 +func _Query_Governors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGovernorsRequest) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - if m.Deposit != nil { - l = m.Deposit.Size() - n += 1 + l + sovQuery(uint64(l)) + if interceptor == nil { + return srv.(QueryServer).Governors(ctx, in) } - return n + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Governors", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Governors(ctx, req.(*QueryGovernorsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryDepositsRequest) Size() (n int) { - if m == nil { - return 0 +func _Query_GovernanceDelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGovernanceDelegationsRequest) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) + if interceptor == nil { + return srv.(QueryServer).GovernanceDelegations(ctx, in) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/GovernanceDelegations", } - return n + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GovernanceDelegations(ctx, req.(*QueryGovernanceDelegationsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryDepositsResponse) Size() (n int) { - if m == nil { - return 0 +func _Query_GovernanceDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGovernanceDelegationRequest) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - if len(m.Deposits) > 0 { - for _, e := range m.Deposits { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } + if interceptor == nil { + return srv.(QueryServer).GovernanceDelegation(ctx, in) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/GovernanceDelegation", } - return n + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GovernanceDelegation(ctx, req.(*QueryGovernanceDelegationRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryTallyResultRequest) Size() (n int) { - if m == nil { - return 0 +func _Query_GovernorValShares_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGovernorValSharesRequest) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) + if interceptor == nil { + return srv.(QueryServer).GovernorValShares(ctx, in) } - return n + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/GovernorValShares", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GovernorValShares(ctx, req.(*QueryGovernorValSharesRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryTallyResultResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Tally != nil { - l = m.Tally.Size() - n += 1 + l + sovQuery(uint64(l)) +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "atomone.gov.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Proposal", + Handler: _Query_Proposal_Handler, + }, + { + MethodName: "Proposals", + Handler: _Query_Proposals_Handler, + }, + { + MethodName: "Vote", + Handler: _Query_Vote_Handler, + }, + { + MethodName: "Votes", + Handler: _Query_Votes_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Deposit", + Handler: _Query_Deposit_Handler, + }, + { + MethodName: "Deposits", + Handler: _Query_Deposits_Handler, + }, + { + MethodName: "TallyResult", + Handler: _Query_TallyResult_Handler, + }, + { + MethodName: "Governor", + Handler: _Query_Governor_Handler, + }, + { + MethodName: "Governors", + Handler: _Query_Governors_Handler, + }, + { + MethodName: "GovernanceDelegations", + Handler: _Query_GovernanceDelegations_Handler, + }, + { + MethodName: "GovernanceDelegation", + Handler: _Query_GovernanceDelegation_Handler, + }, + { + MethodName: "GovernorValShares", + Handler: _Query_GovernorValShares_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "atomone/gov/v1/query.proto", +} + +func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Proposal != nil { + { + size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x1a + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalStatus != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalStatus)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Proposals) > 0 { + for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryVoteRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryVoteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryVoteResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Vote != nil { + { + size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryVotesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryVotesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVotesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryVotesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryVotesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVotesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Votes) > 0 { + for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ParamsType) > 0 { + i -= len(m.ParamsType) + copy(dAtA[i:], m.ParamsType) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ParamsType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.TallyParams != nil { + { + size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.DepositParams != nil { + { + size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.VotingParams != nil { + { + size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Deposit != nil { + { + size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDepositsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Deposits) > 0 { + for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryTallyResultRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTallyResultRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTallyResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryTallyResultResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTallyResultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Tally != nil { + { + size, err := m.Tally.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernorRequest) 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 *QueryGovernorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernorResponse) 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 *QueryGovernorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Governor != nil { + { + size, err := m.Governor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernorsRequest) 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 *QueryGovernorsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernorsResponse) 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 *QueryGovernorsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Governors) > 0 { + for iNdEx := len(m.Governors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Governors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernanceDelegationsRequest) 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 *QueryGovernanceDelegationsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernanceDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernanceDelegationsResponse) 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 *QueryGovernanceDelegationsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernanceDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Delegations) > 0 { + for iNdEx := len(m.Delegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Delegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernanceDelegationRequest) 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 *QueryGovernanceDelegationRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernanceDelegationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernanceDelegationResponse) 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 *QueryGovernanceDelegationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernanceDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernorValSharesRequest) 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 *QueryGovernorValSharesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernorValSharesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.GovernorAddress) > 0 { + i -= len(m.GovernorAddress) + copy(dAtA[i:], m.GovernorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGovernorValSharesResponse) 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 *QueryGovernorValSharesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovernorValSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ValShares) > 0 { + for iNdEx := len(m.ValShares) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValShares[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryProposalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proposal != nil { + l = m.Proposal.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProposalsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalStatus != 0 { + n += 1 + sovQuery(uint64(m.ProposalStatus)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProposalsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Proposals) > 0 { + for _, e := range m.Proposals { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVoteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Vote != nil { + l = m.Vote.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVotesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVotesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Votes) > 0 { + for _, e := range m.Votes { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ParamsType) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VotingParams != nil { + l = m.VotingParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.DepositParams != nil { + l = m.DepositParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.TallyParams != nil { + l = m.TallyParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Deposit != nil { + l = m.Deposit.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Deposits) > 0 { + for _, e := range m.Deposits { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTallyResultRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryTallyResultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Tally != nil { + l = m.Tally.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Governor != nil { + l = m.Governor.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernorsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Governors) > 0 { + for _, e := range m.Governors { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernanceDelegationsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernanceDelegationsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Delegations) > 0 { + for _, e := range m.Delegations { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernanceDelegationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernanceDelegationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernorValSharesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GovernorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGovernorValSharesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ValShares) > 0 { + for _, e := range m.ValShares { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proposal == nil { + m.Proposal = &Proposal{} + } + if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalStatus", wireType) + } + m.ProposalStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalStatus |= ProposalStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposals = append(m.Proposals, &Proposal{}) + if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVoteRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVoteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Vote == nil { + m.Vote = &Vote{} + } + if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVotesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVotesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVotesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVotesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Votes = append(m.Votes, &Vote{}) + if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParamsType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ParamsType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - return n -} -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error { +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2274,17 +4487,17 @@ func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryProposalRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsResponse: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) } - m.ProposalId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2294,11 +4507,136 @@ func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VotingParams == nil { + m.VotingParams = &VotingParams{} + } + if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DepositParams == nil { + m.DepositParams = &DepositParams{} + } + if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TallyParams == nil { + m.TallyParams = &TallyParams{} + } + if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2320,7 +4658,7 @@ func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDepositRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2343,17 +4681,36 @@ func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryProposalResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDepositRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2363,27 +4720,23 @@ func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Proposal == nil { - m.Proposal = &Proposal{} - } - if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Depositor = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2406,7 +4759,7 @@ func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDepositResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2429,36 +4782,17 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryProposalsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDepositResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalStatus", wireType) - } - m.ProposalStatus = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalStatus |= ProposalStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2468,29 +4802,83 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } - if postIndex > l { + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Deposit == nil { + m.Deposit = &Deposit{} + } + if err := m.Deposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - var stringLen uint64 + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDepositsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2500,25 +4888,12 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.ProposalId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } @@ -2575,7 +4950,7 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2598,15 +4973,15 @@ func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryProposalsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDepositsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2633,8 +5008,8 @@ func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Proposals = append(m.Proposals, &Proposal{}) - if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Deposits = append(m.Deposits, &Deposit{}) + if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2695,7 +5070,7 @@ func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryVoteRequest) Unmarshal(dAtA []byte) error { +func (m *QueryTallyResultRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2718,10 +5093,10 @@ func (m *QueryVoteRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryVoteRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTallyResultRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTallyResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2743,38 +5118,6 @@ func (m *QueryVoteRequest) Unmarshal(dAtA []byte) error { break } } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2796,7 +5139,7 @@ func (m *QueryVoteRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error { +func (m *QueryTallyResultResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2819,15 +5162,15 @@ func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryVoteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTallyResultResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTallyResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tally", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2854,10 +5197,10 @@ func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Vote == nil { - m.Vote = &Vote{} + if m.Tally == nil { + m.Tally = &TallyResult{} } - if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Tally.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2882,7 +5225,7 @@ func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryVotesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGovernorRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2905,36 +5248,17 @@ func (m *QueryVotesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryVotesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGovernorRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVotesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGovernorRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2944,27 +5268,23 @@ func (m *QueryVotesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2987,7 +5307,7 @@ func (m *QueryVotesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGovernorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3010,49 +5330,15 @@ func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryVotesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGovernorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Votes = append(m.Votes, &Vote{}) - if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Governor", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3079,10 +5365,10 @@ func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + if m.Governor == nil { + m.Governor = &Governor{} } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Governor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3107,7 +5393,7 @@ func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGovernorsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3130,17 +5416,17 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGovernorsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGovernorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamsType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3150,23 +5436,27 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.ParamsType = string(dAtA[iNdEx:postIndex]) + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -3189,7 +5479,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGovernorsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3212,15 +5502,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGovernorsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGovernorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Governors", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3247,16 +5537,14 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.VotingParams == nil { - m.VotingParams = &VotingParams{} - } - if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Governors = append(m.Governors, &Governor{}) + if err := m.Governors[len(m.Governors)-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 DepositParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3280,21 +5568,71 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex < 0 { return ErrInvalidLengthQuery } - if postIndex > l { + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.DepositParams == nil { - m.DepositParams = &DepositParams{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGovernanceDelegationsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery } - if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 3: + 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: QueryGovernanceDelegationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGovernanceDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3304,31 +5642,27 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.TallyParams == nil { - m.TallyParams = &TallyParams{} - } - if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3355,10 +5689,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Params == nil { - m.Params = &Params{} + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3383,7 +5717,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDepositRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGovernanceDelegationsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3406,17 +5740,17 @@ func (m *QueryDepositRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDepositRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGovernanceDelegationsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGovernanceDelegationsResponse: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegations", wireType) } - m.ProposalId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3426,16 +5760,31 @@ func (m *QueryDepositRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Delegations = append(m.Delegations, &GovernanceDelegation{}) + if err := m.Delegations[len(m.Delegations)-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 Depositor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3445,23 +5794,27 @@ func (m *QueryDepositRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Depositor = string(dAtA[iNdEx:postIndex]) + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -3484,7 +5837,7 @@ func (m *QueryDepositRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDepositResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGovernanceDelegationRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3507,17 +5860,17 @@ func (m *QueryDepositResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDepositResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGovernanceDelegationRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGovernanceDelegationRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3527,27 +5880,23 @@ func (m *QueryDepositResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Deposit == nil { - m.Deposit = &Deposit{} - } - if err := m.Deposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3570,7 +5919,7 @@ func (m *QueryDepositResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDepositsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGovernanceDelegationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3593,36 +5942,17 @@ func (m *QueryDepositsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDepositsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGovernanceDelegationResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGovernanceDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3632,27 +5962,23 @@ func (m *QueryDepositsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3675,7 +6001,7 @@ func (m *QueryDepositsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGovernorValSharesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3698,17 +6024,17 @@ func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDepositsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGovernorValSharesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGovernorValSharesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3718,25 +6044,23 @@ func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Deposits = append(m.Deposits, &Deposit{}) - if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.GovernorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -3768,7 +6092,7 @@ func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + m.Pagination = &query.PageRequest{} } if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3795,7 +6119,7 @@ func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryTallyResultRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGovernorValSharesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3818,17 +6142,17 @@ func (m *QueryTallyResultRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryTallyResultRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGovernorValSharesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTallyResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGovernorValSharesResponse: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValShares", wireType) } - m.ProposalId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3838,64 +6162,29 @@ func (m *QueryTallyResultRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTallyResultResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.ValShares = append(m.ValShares, &GovernorValShares{}) + if err := m.ValShares[len(m.ValShares)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryTallyResultResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTallyResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tally", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3922,10 +6211,10 @@ func (m *QueryTallyResultResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Tally == nil { - m.Tally = &TallyResult{} + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} } - if err := m.Tally.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/gov/types/v1/query.pb.gw.go b/x/gov/types/v1/query.pb.gw.go index 574319919..e48eb8a1d 100644 --- a/x/gov/types/v1/query.pb.gw.go +++ b/x/gov/types/v1/query.pb.gw.go @@ -527,6 +527,294 @@ func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Ma } +func request_Query_Governor_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernorRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["governor_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "governor_address") + } + + protoReq.GovernorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "governor_address", err) + } + + msg, err := client.Governor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Governor_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernorRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["governor_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "governor_address") + } + + protoReq.GovernorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "governor_address", err) + } + + msg, err := server.Governor(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Governors_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Governors_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernorsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Governors_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Governors(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Governors_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernorsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Governors_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Governors(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GovernanceDelegations_0 = &utilities.DoubleArray{Encoding: map[string]int{"governor_address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_GovernanceDelegations_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernanceDelegationsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["governor_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "governor_address") + } + + protoReq.GovernorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "governor_address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GovernanceDelegations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GovernanceDelegations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GovernanceDelegations_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernanceDelegationsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["governor_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "governor_address") + } + + protoReq.GovernorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "governor_address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GovernanceDelegations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GovernanceDelegations(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_GovernanceDelegation_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernanceDelegationRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + msg, err := client.GovernanceDelegation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GovernanceDelegation_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernanceDelegationRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + msg, err := server.GovernanceDelegation(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GovernorValShares_0 = &utilities.DoubleArray{Encoding: map[string]int{"governor_address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_GovernorValShares_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernorValSharesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["governor_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "governor_address") + } + + protoReq.GovernorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "governor_address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GovernorValShares_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GovernorValShares(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GovernorValShares_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovernorValSharesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["governor_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "governor_address") + } + + protoReq.GovernorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "governor_address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GovernorValShares_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GovernorValShares(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -717,6 +1005,121 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Governor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Governor_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Governor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Governors_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Governors_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Governors_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GovernanceDelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GovernanceDelegations_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GovernanceDelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GovernanceDelegation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GovernanceDelegation_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GovernanceDelegation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GovernorValShares_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GovernorValShares_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GovernorValShares_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -918,6 +1321,106 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Governor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Governor_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Governor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Governors_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Governors_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Governors_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GovernanceDelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GovernanceDelegations_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GovernanceDelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GovernanceDelegation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GovernanceDelegation_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GovernanceDelegation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GovernorValShares_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GovernorValShares_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GovernorValShares_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -937,6 +1440,16 @@ var ( pattern_Query_Deposits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"atomone", "gov", "v1", "proposals", "proposal_id", "deposits"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_TallyResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"atomone", "gov", "v1", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Governor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"atomone", "gov", "v1", "governor", "governor_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Governors_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"atomone", "gov", "v1", "governors"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GovernanceDelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"atomone", "gov", "v1", "governors", "governor_address", "delegations"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GovernanceDelegation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"atomone", "gov", "v1", "delegations", "delegator_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GovernorValShares_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"atomone", "gov", "v1", "valshares", "governor_address"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -955,4 +1468,14 @@ var ( forward_Query_Deposits_0 = runtime.ForwardResponseMessage forward_Query_TallyResult_0 = runtime.ForwardResponseMessage + + forward_Query_Governor_0 = runtime.ForwardResponseMessage + + forward_Query_Governors_0 = runtime.ForwardResponseMessage + + forward_Query_GovernanceDelegations_0 = runtime.ForwardResponseMessage + + forward_Query_GovernanceDelegation_0 = runtime.ForwardResponseMessage + + forward_Query_GovernorValShares_0 = runtime.ForwardResponseMessage ) From 372bca2947baa80cfebb001d97450ec6bf070881 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 12:27:59 +0200 Subject: [PATCH 16/43] allow governor status updates only once a month --- proto/atomone/gov/v1/gov.proto | 7 +- proto/atomone/gov/v1/tx.proto | 21 +- x/gov/client/cli/tx.go | 48 ++- x/gov/keeper/delegation.go | 4 +- x/gov/keeper/governor.go | 4 - x/gov/keeper/hooks.go | 2 +- x/gov/keeper/msg_server.go | 55 +++- x/gov/simulation/genesis.go | 9 +- x/gov/types/errors.go | 3 + x/gov/types/v1/gov.pb.go | 352 ++++++++++++++-------- x/gov/types/v1/governor.go | 16 +- x/gov/types/v1/msgs.go | 38 ++- x/gov/types/v1/params.go | 15 +- x/gov/types/v1/tx.pb.go | 525 ++++++++++++++++++++++++++------- 14 files changed, 841 insertions(+), 258 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index dde4229ee..9afcfaa42 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -220,6 +220,8 @@ message Params { // defines the maximum number of governors that can be active at any given time. uint64 max_governors = 20; + // defines the duration of time that need to elapse between governor status changes. + google.protobuf.Duration governor_status_change_period = 21 [(gogoproto.stdduration) = true]; } @@ -238,12 +240,15 @@ message Governor { GovernorStatus status = 2; // description defines the description terms for the governor. GovernorDescription description = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // voting_power defines the voting power of the governor. + // voting_power defines the (estimated) voting power of the governor. string voting_power = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; + + // last_status_change_time is the time when the governor's status was last changed. + google.protobuf.Timestamp last_status_change_time = 5 [(gogoproto.stdtime) = true]; } // GovernorStatus is the status of a governor. diff --git a/proto/atomone/gov/v1/tx.proto b/proto/atomone/gov/v1/tx.proto index 64f6a9b64..0e0bcc154 100644 --- a/proto/atomone/gov/v1/tx.proto +++ b/proto/atomone/gov/v1/tx.proto @@ -45,6 +45,9 @@ service Msg { // It also sets its status. rpc EditGovernor(MsgEditGovernor) returns (MsgEditGovernorResponse); + // UpdateGovernorStatus defines a method to update the status of a governor. + rpc UpdateGovernorStatus(MsgUpdateGovernorStatus) returns (MsgUpdateGovernorStatusResponse); + // DelegateGovernor defines a method to delegate a non-zero percentange of // governance voting power from a delegator to a governor. rpc DelegateGovernor(MsgDelegateGovernor) returns (MsgDelegateGovernorResponse); @@ -209,13 +212,27 @@ message MsgEditGovernor { option (gogoproto.goproto_getters) = false; GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - GovernorStatus status = 2; - string address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgEditGovernorResponse defines the Msg/EditGovernor response type. message MsgEditGovernorResponse {} +// MsgUpdateGovernorStatus defines a SDK message for updating the status of a governor. +message MsgUpdateGovernorStatus { + option (cosmos.msg.v1.signer) = "address"; + option (amino.name) = "cosmos-sdk/MsgUpdateGovernorStatus"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + GovernorStatus status = 2; +} + +// MsgUpdateGovernorStatusResponse defines the Msg/UpdateGovernorStatus response type. +message MsgUpdateGovernorStatusResponse {} + // MsgDelegateGovernor defines a SDK message for performing a delegation of governance voting power // from a delegator to a governor. message MsgDelegateGovernor { diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index d49cea639..58ec92991 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -413,9 +413,9 @@ func CreateGovernorCmd() *cobra.Command { // EditGovernorCmd edits a Governor func EditGovernorCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "edit-governor [address] [status] [moniker] [identity] [website] [security-contact] [details]", - Short: "Edit a Governor. Can also update the Governor status.", - Args: cobra.ExactArgs(7), + Use: "edit-governor [address] [moniker] [identity] [website] [security-contact] [details]", + Short: "Edit a Governor.", + Args: cobra.ExactArgs(6), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -427,20 +427,46 @@ func EditGovernorCmd() *cobra.Command { return err } - status, err := v1.GovernorStatusFromString(args[1]) + description := v1.GovernorDescription{ + Moniker: args[1], + Identity: args[2], + Website: args[3], + SecurityContact: args[4], + Details: args[5], + } + + msg := v1.NewMsgEditGovernor(address, description) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +// UpdateGovernorStatusCmd updates the status of a Governor +func UpdateGovernorStatusCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-governor-status [address] [status]", + Short: "Update the status of a Governor", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - description := v1.GovernorDescription{ - Moniker: args[2], - Identity: args[3], - Website: args[4], - SecurityContact: args[5], - Details: args[6], + address, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + status, err := v1.GovernorStatusFromString(args[1]) + if err != nil { + return err } - msg := v1.NewMsgEditGovernor(address, description, status) + msg := v1.NewMsgUpdateGovernorStatus(address, status) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 4238e5037..98c275a03 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -155,7 +155,7 @@ func (k Keeper) IncreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover governor, _ := k.GetGovernor(ctx, governorAddr) validator, _ := k.sk.GetValidator(ctx, validatorAddr) vp := shares.MulInt(validator.GetBondedTokens()).Quo(validator.GetDelegatorShares()) - governor.SetVotingPower(governor.GetVotingPower().Add(vp)) + governor.VotingPower = governor.GetVotingPower().Add(vp) k.UpdateGovernorByPowerIndex(ctx, governor) } @@ -181,7 +181,7 @@ func (k Keeper) DecreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover if governorVP.IsNegative() { panic("negative governor voting power") } - governor.SetVotingPower(governorVP) + governor.VotingPower = governorVP k.UpdateGovernorByPowerIndex(ctx, governor) } diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index f0cbd7c9a..63351c1e3 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -25,10 +25,6 @@ func (k Keeper) SetGovernor(ctx sdk.Context, governor v1.Governor) { store := ctx.KVStore(k.storeKey) bz := v1.MustMarshalGovernor(k.cdc, &governor) store.Set(types.GovernorKey(governor.GetAddress()), bz) - - if governor.VotingPower.GT(sdk.ZeroDec()) { - k.SetGovernorByPowerIndex(ctx, governor) - } } // GetAllGovernors returns all governors diff --git a/x/gov/keeper/hooks.go b/x/gov/keeper/hooks.go index 20a0f022c..c35f5f150 100644 --- a/x/gov/keeper/hooks.go +++ b/x/gov/keeper/hooks.go @@ -78,7 +78,7 @@ func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, f if governorVP.IsNegative() { panic("negative governor voting power") } - governor.SetVotingPower(governorVP) + governor.VotingPower = governorVP h.k.UpdateGovernorByPowerIndex(ctx, governor) return false }) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index b25a1169d..53da082da 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -189,13 +189,16 @@ func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovern return nil, err } - governor, err := v1.NewGovernor(govAddr.String(), msg.Description) + governor, err := v1.NewGovernor(govAddr.String(), msg.Description, ctx.BlockTime()) if err != nil { return nil, err } k.SetGovernor(ctx, governor) + // a base account automatically creates a governance delegation to itself + k.delegateGovernor(ctx, addr, govAddr) + return &v1.MsgCreateGovernorResponse{}, nil } @@ -215,25 +218,63 @@ func (k msgServer) EditGovernor(goCtx context.Context, msg *v1.MsgEditGovernor) return nil, err } - // Ensure the governor has a valid status - if !msg.Status.EnsureValid() { - return nil, govtypes.ErrInvalidGovernorStatus - } - // Update the governor governor.Description = msg.Description - governor.Status = msg.Status k.SetGovernor(ctx, governor) return &v1.MsgEditGovernorResponse{}, nil } +func (k msgServer) UpdateGovernorStatus(goCtx context.Context, msg *v1.MsgUpdateGovernorStatus) (*v1.MsgUpdateGovernorStatusResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Ensure the governor exists + addr := sdk.MustAccAddressFromBech32(msg.Address) + govAddr := govtypes.GovernorAddress(addr.Bytes()) + governor, found := k.GetGovernor(ctx, govAddr) + if !found { + return nil, govtypes.ErrUnknownGovernor + } + + if !msg.Status.IsValid() { + return nil, govtypes.ErrInvalidGovernorStatus + } + + // Ensure the governor is not already in the desired status + if governor.Status == msg.Status { + return nil, govtypes.ErrGovernorStatusEqual + } + + // Ensure the governor has been in the current status for the required period + governorStatusChangePeriod := *k.GetParams(ctx).GovernorStatusChangePeriod + changeTime := ctx.BlockTime() + if governor.LastStatusChangeTime.Add(governorStatusChangePeriod).Before(changeTime) { + return nil, govtypes.ErrGovernorStatusChangePeriod.Wrapf("last status change time: %s, need to wait until: %s", governor.LastStatusChangeTime, governor.LastStatusChangeTime.Add(governorStatusChangePeriod)) + } + + // Update the governor status + governor.Status = msg.Status + governor.LastStatusChangeTime = &changeTime + k.SetGovernor(ctx, governor) + // if status changes to active, create governance self-delegation + // in case it didn't exist + if governor.IsActive() { + k.redelegateGovernor(ctx, addr, govAddr) + } + return &v1.MsgUpdateGovernorStatusResponse{}, nil +} + func (k msgServer) DelegateGovernor(goCtx context.Context, msg *v1.MsgDelegateGovernor) (*v1.MsgDelegateGovernorResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) delAddr := sdk.MustAccAddressFromBech32(msg.DelegatorAddress) govAddr := govtypes.MustGovernorAddressFromBech32(msg.GovernorAddress) + // Ensure the delegator is not already an active governor, as they cannot delegate + if g, found := k.GetGovernor(ctx, govtypes.GovernorAddress(delAddr.Bytes())); found && g.IsActive() { + return nil, govtypes.ErrDelegatorIsGovernor + } + // Ensure the delegation is not already present gd, found := k.GetGovernanceDelegation(ctx, delAddr) if found && govAddr.Equals(govtypes.MustGovernorAddressFromBech32(gd.GovernorAddress)) { diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index dd11faec9..ab975b4ce 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -27,6 +27,7 @@ const ( TallyParamsQuorum = "tally_params_quorum" TallyParamsThreshold = "tally_params_threshold" TallyParamsVeto = "tally_params_veto" + GovernorStatusChangePeriod = "governor_status_change_period" ) // GenDepositParamsDepositPeriod returns randomized DepositParamsDepositPeriod @@ -112,9 +113,15 @@ func RandomizedGenState(simState *module.SimulationState) { maxGovernors := uint64(simState.Rand.Intn(100)) + var governorStatusChangePeriod time.Duration + simState.AppParams.GetOrGenerate( + simState.Cdc, GovernorStatusChangePeriod, &governorStatusChangePeriod, simState.Rand, + func(r *rand.Rand) { governorStatusChangePeriod = GenDepositParamsDepositPeriod(r) }, + ) + govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, maxGovernors), + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, maxGovernors, governorStatusChangePeriod), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index ac23e76b5..0578d812f 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -28,4 +28,7 @@ var ( ErrGovernanceDelegationExists = sdkerrors.Register(ModuleName, 200, "governance delegation already exists") //nolint:staticcheck ErrUnknownGovernanceDelegation = sdkerrors.Register(ModuleName, 210, "unknown governance delegation") //nolint:staticcheck ErrInvalidGovernanceDescription = sdkerrors.Register(ModuleName, 220, "invalid governance description") //nolint:staticcheck + ErrDelegatorIsGovernor = sdkerrors.Register(ModuleName, 230, "cannot delegate, delegator is an active governor") //nolint:staticcheck + ErrGovernorStatusEqual = sdkerrors.Register(ModuleName, 240, "cannot change governor status to the same status") //nolint:staticcheck + ErrGovernorStatusChangePeriod = sdkerrors.Register(ModuleName, 250, "governor status change period not elapsed") //nolint:staticcheck ) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index c4cfe90a5..b91b705dc 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -780,6 +780,8 @@ type Params struct { BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` // defines the maximum number of governors that can be active at any given time. MaxGovernors uint64 `protobuf:"varint,20,opt,name=max_governors,json=maxGovernors,proto3" json:"max_governors,omitempty"` + // defines the duration of time that need to elapse between governor status changes. + GovernorStatusChangePeriod *time.Duration `protobuf:"bytes,21,opt,name=governor_status_change_period,json=governorStatusChangePeriod,proto3,stdduration" json:"governor_status_change_period,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -892,6 +894,13 @@ func (m *Params) GetMaxGovernors() uint64 { return 0 } +func (m *Params) GetGovernorStatusChangePeriod() *time.Duration { + if m != nil { + return m.GovernorStatusChangePeriod + } + return nil +} + // Governor defines a governor, together with the total amount of delegated // validator's bond shares for a set amount of validators. When a delegator // delegates a percentage of its x/gov power to a governor, the resulting @@ -904,8 +913,10 @@ type Governor struct { Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` // description defines the description terms for the governor. Description GovernorDescription `protobuf:"bytes,3,opt,name=description,proto3" json:"description"` - // voting_power defines the voting power of the governor. + // voting_power defines the (estimated) voting power of the governor. VotingPower cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=voting_power,json=votingPower,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"voting_power"` + // last_status_change_time is the time when the governor's status was last changed. + LastStatusChangeTime *time.Time `protobuf:"bytes,5,opt,name=last_status_change_time,json=lastStatusChangeTime,proto3,stdtime" json:"last_status_change_time,omitempty"` } func (m *Governor) Reset() { *m = Governor{} } @@ -1127,113 +1138,116 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1692 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x4a, 0xd4, 0x7a, 0xac, 0x3a, 0x6b, 0x2a, 0x26, 0x15, 0x26, - 0x08, 0x14, 0x35, 0x22, 0x23, 0xa7, 0xcd, 0x21, 0xcd, 0x85, 0x12, 0x19, 0x67, 0x0d, 0x57, 0x64, - 0x97, 0x34, 0x8d, 0xf4, 0xb2, 0x18, 0x72, 0xc7, 0xd4, 0x20, 0xdc, 0x1d, 0x76, 0x77, 0x48, 0x9b, - 0xff, 0x41, 0xea, 0x53, 0x8e, 0x45, 0x51, 0x03, 0x06, 0x7a, 0xe9, 0xa1, 0x87, 0x1c, 0x0c, 0x14, - 0x3d, 0xf7, 0x92, 0x53, 0x11, 0xf8, 0xd2, 0x8f, 0x83, 0x5b, 0xd8, 0x87, 0x06, 0x39, 0xf7, 0x5a, - 0xa0, 0x98, 0x8f, 0x25, 0x29, 0x8a, 0x86, 0x24, 0x23, 0x17, 0x69, 0xe7, 0xcd, 0xef, 0xf7, 0xe6, - 0x7d, 0xcf, 0x2e, 0xc1, 0xc2, 0x9c, 0xf9, 0x2c, 0x20, 0xe5, 0x1e, 0x1b, 0x95, 0x47, 0x07, 0xe2, - 0x5f, 0x69, 0x10, 0x32, 0xce, 0x50, 0x56, 0xef, 0x94, 0x84, 0x68, 0x74, 0x90, 0xcb, 0x77, 0x59, - 0xe4, 0xb3, 0xa8, 0xdc, 0xc1, 0x11, 0x29, 0x8f, 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 0x51, 0x93, 0x87, - 0x34, 0xe8, 0x39, 0x53, 0x28, 0xfa, 0x04, 0x52, 0xd8, 0x67, 0xc3, 0x80, 0x5b, 0xcb, 0x3b, 0xcb, - 0xbb, 0x99, 0x9b, 0xd7, 0x4b, 0x9a, 0x21, 0xf2, 0x54, 0xd2, 0x79, 0x2a, 0x1d, 0x31, 0x1a, 0x1c, - 0xae, 0x7d, 0xf3, 0xbc, 0xb0, 0xf4, 0x87, 0xff, 0x7c, 0xbd, 0x67, 0x38, 0x9a, 0x53, 0xfc, 0xcb, - 0x0a, 0xa4, 0x1b, 0xda, 0x08, 0x94, 0x85, 0xc4, 0xc4, 0xb4, 0x04, 0xf5, 0xd0, 0x07, 0x90, 0xf6, - 0x49, 0x14, 0xe1, 0x1e, 0x89, 0xac, 0x84, 0x54, 0xbe, 0x55, 0x52, 0x29, 0x29, 0xc5, 0x29, 0x29, - 0x55, 0x82, 0xb1, 0x33, 0x41, 0xa1, 0x8f, 0x20, 0x15, 0x71, 0xcc, 0x87, 0x91, 0xb5, 0x2c, 0xa3, - 0x99, 0x9f, 0x8f, 0x66, 0x7c, 0x56, 0x53, 0xa2, 0x1c, 0x8d, 0x46, 0x36, 0xa0, 0xfb, 0x34, 0xc0, - 0x7d, 0x97, 0xe3, 0x7e, 0x7f, 0xec, 0x86, 0x24, 0x1a, 0xf6, 0xb9, 0x95, 0xdc, 0x31, 0x76, 0x33, - 0x37, 0xb7, 0xe7, 0x75, 0xb4, 0x04, 0xc6, 0x91, 0x10, 0xc7, 0x94, 0xb4, 0x19, 0x09, 0xaa, 0x40, - 0x26, 0x1a, 0x76, 0x7c, 0xca, 0x5d, 0x51, 0x69, 0xd6, 0x8a, 0xd4, 0x91, 0x3b, 0x63, 0x77, 0x2b, - 0x2e, 0xc3, 0xc3, 0xe4, 0x57, 0xff, 0x2a, 0x18, 0x0e, 0x28, 0x92, 0x10, 0xa3, 0xdb, 0x60, 0xea, - 0xf8, 0xba, 0x24, 0xf0, 0x94, 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, 0x2e, 0xf9, 0xe5, 0xef, 0xf3, 0x4b, 0x87, - 0xb7, 0xbe, 0x79, 0x91, 0x37, 0xbe, 0x7d, 0x91, 0x37, 0xfe, 0xfd, 0x22, 0x6f, 0x7c, 0xf5, 0x32, - 0xbf, 0xf4, 0xed, 0xcb, 0xfc, 0xd2, 0xdf, 0x5f, 0xe6, 0x97, 0x7e, 0xb9, 0xdf, 0xa3, 0xfc, 0x64, - 0xd8, 0x29, 0x75, 0x99, 0x5f, 0xd6, 0xe3, 0x71, 0xff, 0x64, 0xd8, 0x89, 0x9f, 0xcb, 0x0f, 0xe5, - 0x6f, 0x0d, 0x7c, 0x3c, 0x20, 0x51, 0x79, 0x74, 0xd0, 0x49, 0xc9, 0x9b, 0xf9, 0xc3, 0xff, 0x07, - 0x00, 0x00, 0xff, 0xff, 0x22, 0xbd, 0x12, 0x95, 0x8a, 0x10, 0x00, 0x00, + // 1742 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x6f, 0x1b, 0xc7, + 0x15, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x52, 0xd4, 0x6a, 0xac, 0xd8, 0x6b, 0x2a, 0x22, 0x15, 0x26, + 0x08, 0x14, 0x35, 0x22, 0x23, 0xa7, 0xcd, 0x21, 0xcd, 0x85, 0x12, 0x19, 0x65, 0x0d, 0x57, 0x64, + 0x97, 0x34, 0x8d, 0xf4, 0xb2, 0x18, 0x72, 0xc7, 0xe4, 0x20, 0xdc, 0x1d, 0x76, 0x77, 0x48, 0x9b, + 0xdf, 0x20, 0xf5, 0x29, 0xe8, 0xa9, 0x28, 0x6a, 0xc0, 0x40, 0x2f, 0x3d, 0xf4, 0x90, 0x83, 0x81, + 0x7e, 0x80, 0x5e, 0x72, 0x2a, 0x02, 0x5f, 0x9a, 0xf6, 0xe0, 0x16, 0xf6, 0xa1, 0x81, 0xbf, 0x43, + 0x81, 0x62, 0x76, 0x66, 0x49, 0x8a, 0xa2, 0x21, 0xc9, 0xe8, 0xc5, 0xde, 0x79, 0xf3, 0xfb, 0xbd, + 0x79, 0xff, 0x67, 0x28, 0x30, 0x30, 0x67, 0x2e, 0xf3, 0x48, 0xa9, 0xcb, 0x46, 0xa5, 0xd1, 0xa1, + 0xf8, 0xaf, 0x38, 0xf0, 0x19, 0x67, 0x28, 0xa3, 0x76, 0x8a, 0x42, 0x34, 0x3a, 0xcc, 0xe6, 0x3a, + 0x2c, 0x70, 0x59, 0x50, 0x6a, 0xe3, 0x80, 0x94, 0x46, 0x87, 0x6d, 0xc2, 0xf1, 0x61, 0xa9, 0xc3, + 0xa8, 0x27, 0xf1, 0xd9, 0xad, 0x2e, 0xeb, 0xb2, 0xf0, 0xb3, 0x24, 0xbe, 0x94, 0x34, 0xdf, 0x65, + 0xac, 0xdb, 0x27, 0xa5, 0x70, 0xd5, 0x1e, 0xde, 0x2f, 0x71, 0xea, 0x92, 0x80, 0x63, 0x77, 0xa0, + 0x00, 0x37, 0xe7, 0x01, 0xd8, 0x1b, 0xab, 0xad, 0xdc, 0xfc, 0x96, 0x33, 0xf4, 0x31, 0xa7, 0x2c, + 0x3a, 0xf1, 0xa6, 0xb4, 0xc8, 0x96, 0x87, 0xca, 0x85, 0xda, 0xda, 0xc4, 0x2e, 0xf5, 0x58, 0x29, + 0xfc, 0x57, 0x8a, 0x0a, 0x03, 0x40, 0xf7, 0x08, 0xed, 0xf6, 0x38, 0x71, 0x5a, 0x8c, 0x93, 0xda, + 0x40, 0x68, 0x42, 0xb7, 0x20, 0xc1, 0xc2, 0x2f, 0x43, 0xdb, 0xd5, 0xf6, 0x32, 0xb7, 0xb2, 0xc5, + 0xb3, 0x6e, 0x17, 0xa7, 0x58, 0x4b, 0x21, 0xd1, 0xfb, 0x90, 0x78, 0x10, 0x6a, 0x32, 0x62, 0xbb, + 0xda, 0xde, 0xda, 0x51, 0xe6, 0xd9, 0xd3, 0x03, 0x50, 0xc7, 0x57, 0x48, 0xc7, 0x52, 0xbb, 0x85, + 0x27, 0x1a, 0xac, 0x56, 0xc8, 0x80, 0x05, 0x94, 0xa3, 0x3c, 0xa4, 0x06, 0x3e, 0x1b, 0xb0, 0x00, + 0xf7, 0x6d, 0xea, 0x84, 0x87, 0xc5, 0x2d, 0x88, 0x44, 0xa6, 0x83, 0x3e, 0x81, 0x35, 0x47, 0x62, + 0x99, 0xaf, 0xf4, 0x1a, 0xcf, 0x9e, 0x1e, 0x6c, 0x29, 0xbd, 0x65, 0xc7, 0xf1, 0x49, 0x10, 0x34, + 0xb8, 0x4f, 0xbd, 0xae, 0x35, 0x85, 0xa2, 0xcf, 0x20, 0x81, 0x5d, 0x36, 0xf4, 0xb8, 0xb1, 0xbc, + 0xbb, 0xbc, 0x97, 0xba, 0x75, 0xb3, 0xa8, 0x18, 0x22, 0x4f, 0x45, 0x95, 0xa7, 0xe2, 0x31, 0xa3, + 0xde, 0xd1, 0xda, 0x77, 0xcf, 0xf3, 0x4b, 0x7f, 0xfa, 0xcf, 0xb7, 0xfb, 0x9a, 0xa5, 0x38, 0x85, + 0xbf, 0xae, 0x40, 0xb2, 0xae, 0x8c, 0x40, 0x19, 0x88, 0x4d, 0x4c, 0x8b, 0x51, 0x07, 0x7d, 0x04, + 0x49, 0x97, 0x04, 0x01, 0xee, 0x92, 0xc0, 0x88, 0x85, 0xca, 0xb7, 0x8a, 0x32, 0x25, 0xc5, 0x28, + 0x25, 0xc5, 0xb2, 0x37, 0xb6, 0x26, 0x28, 0xf4, 0x09, 0x24, 0x02, 0x8e, 0xf9, 0x30, 0x30, 0x96, + 0xc3, 0x68, 0xe6, 0xe6, 0xa3, 0x19, 0x9d, 0xd5, 0x08, 0x51, 0x96, 0x42, 0x23, 0x13, 0xd0, 0x7d, + 0xea, 0xe1, 0xbe, 0xcd, 0x71, 0xbf, 0x3f, 0xb6, 0x7d, 0x12, 0x0c, 0xfb, 0xdc, 0x88, 0xef, 0x6a, + 0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xfe, 0x8f, 0x47, 0x11, 0x00, 0x00, } func (this *GovernorDescription) Equal(that interface{}) bool { @@ -1748,6 +1762,18 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.GovernorStatusChangePeriod != nil { + n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.GovernorStatusChangePeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.GovernorStatusChangePeriod):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintGov(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } if m.MaxGovernors != 0 { i = encodeVarintGov(dAtA, i, uint64(m.MaxGovernors)) i-- @@ -1814,22 +1840,22 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } if m.VotingPeriod != nil { - n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod):]) - if err8 != nil { - return 0, err8 + n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod):]) + if err9 != nil { + return 0, err9 } - i -= n8 - i = encodeVarintGov(dAtA, i, uint64(n8)) + i -= n9 + i = encodeVarintGov(dAtA, i, uint64(n9)) i-- dAtA[i] = 0x1a } if m.MaxDepositPeriod != nil { - n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) - if err9 != nil { - return 0, err9 + n10, err10 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) + if err10 != nil { + return 0, err10 } - i -= n9 - i = encodeVarintGov(dAtA, i, uint64(n9)) + i -= n10 + i = encodeVarintGov(dAtA, i, uint64(n10)) i-- dAtA[i] = 0x12 } @@ -1870,6 +1896,16 @@ func (m *Governor) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.LastStatusChangeTime != nil { + n11, err11 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.LastStatusChangeTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.LastStatusChangeTime):]) + if err11 != nil { + return 0, err11 + } + i -= n11 + i = encodeVarintGov(dAtA, i, uint64(n11)) + i-- + dAtA[i] = 0x2a + } { size := m.VotingPower.Size() i -= size @@ -2311,6 +2347,10 @@ func (m *Params) Size() (n int) { if m.MaxGovernors != 0 { n += 2 + sovGov(uint64(m.MaxGovernors)) } + if m.GovernorStatusChangePeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.GovernorStatusChangePeriod) + n += 2 + l + sovGov(uint64(l)) + } return n } @@ -2331,6 +2371,10 @@ func (m *Governor) Size() (n int) { n += 1 + l + sovGov(uint64(l)) l = m.VotingPower.Size() n += 1 + l + sovGov(uint64(l)) + if m.LastStatusChangeTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.LastStatusChangeTime) + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -4144,6 +4188,42 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovernorStatusChangePeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GovernorStatusChangePeriod == nil { + m.GovernorStatusChangePeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.GovernorStatusChangePeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) @@ -4312,6 +4392,42 @@ func (m *Governor) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastStatusChangeTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastStatusChangeTime == nil { + m.LastStatusChangeTime = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.LastStatusChangeTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 0cae95a1d..744e14dd8 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -4,6 +4,7 @@ import ( "bytes" "sort" "strings" + time "time" "cosmossdk.io/errors" @@ -23,12 +24,13 @@ var ( var _ GovernorI = Governor{} // NewGovernor constructs a new Governor -func NewGovernor(address string, description GovernorDescription) (Governor, error) { +func NewGovernor(address string, description GovernorDescription, creationTime time.Time) (Governor, error) { return Governor{ - GovernorAddress: address, - Description: description, - Status: Active, - VotingPower: sdk.ZeroDec(), + GovernorAddress: address, + Description: description, + Status: Active, + VotingPower: sdk.ZeroDec(), + LastStatusChangeTime: &creationTime, }, nil } @@ -180,7 +182,7 @@ func (d GovernorDescription) EnsureLength() (GovernorDescription, error) { return d, nil } -func (s GovernorStatus) EnsureValid() bool { +func (s GovernorStatus) IsValid() bool { return s == Active || s == Inactive } @@ -212,10 +214,10 @@ func (g *Governor) Equal(v2 *Governor) bool { } func (g Governor) GetVotingPower() sdk.Dec { return g.VotingPower } -func (g Governor) SetVotingPower(votingPower sdk.Dec) { g.VotingPower = votingPower } func (g Governor) GetMoniker() string { return g.Description.Moniker } func (g Governor) GetStatus() GovernorStatus { return g.Status } func (g Governor) GetDescription() GovernorDescription { return g.Description } +func (g Governor) GetLastStatusChangeTime() *time.Time { return g.LastStatusChangeTime } func (g Governor) GetAddress() types.GovernorAddress { return types.MustGovernorAddressFromBech32(g.GovernorAddress) } diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 613dc56e7..39431e171 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -359,8 +359,8 @@ func (msg MsgCreateGovernor) GetSigners() []sdk.AccAddress { } // NewMsgEditGovernor creates a new MsgEditGovernor instance -func NewMsgEditGovernor(addr sdk.AccAddress, description GovernorDescription, status GovernorStatus) *MsgEditGovernor { - return &MsgEditGovernor{Address: addr.String(), Description: description, Status: status} +func NewMsgEditGovernor(addr sdk.AccAddress, description GovernorDescription) *MsgEditGovernor { + return &MsgEditGovernor{Address: addr.String(), Description: description} } // Route implements the sdk.Msg interface. @@ -453,3 +453,37 @@ func (msg MsgUndelegateGovernor) GetSigners() []sdk.AccAddress { delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) return []sdk.AccAddress{delegator} } + +// NewMsgUpdateGovernorStatus creates a new MsgUpdateGovernorStatus instance +func NewMsgUpdateGovernorStatus(address sdk.AccAddress, status GovernorStatus) *MsgUpdateGovernorStatus { + return &MsgUpdateGovernorStatus{Address: address.String(), Status: status} +} + +// Route implements the sdk.Msg interface. +func (msg MsgUpdateGovernorStatus) Route() string { return types.RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgUpdateGovernorStatus) Type() string { return sdk.MsgTypeURL(&msg) } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgUpdateGovernorStatus) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { + return sdkerrors.ErrInvalidAddress.Wrap(err.Error()) + } + if !msg.Status.IsValid() { + return types.ErrInvalidGovernorStatus.Wrap(msg.Status.String()) + } + return nil +} + +// GetSignBytes returns the message bytes to sign over. +func (msg MsgUpdateGovernorStatus) GetSignBytes() []byte { + bz := codec.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners returns the expected signers for a MsgUpdateGovernorStatus. +func (msg MsgUpdateGovernorStatus) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Address) + return []sdk.AccAddress{addr} +} diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index e0409480c..0ece68ffc 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -11,7 +11,8 @@ import ( // Default period for deposits & voting const ( - DefaultPeriod time.Duration = time.Hour * 24 * 2 // 2 days + DefaultPeriod time.Duration = time.Hour * 24 * 2 // 2 days + DefaultGovernorStatusChangePeriod time.Duration = time.Hour * 24 * 28 // 28 days ) // Default governance params @@ -55,7 +56,7 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { func NewParams( minDeposit sdk.Coins, maxDepositPeriod, votingPeriod time.Duration, quorum, threshold, vetoThreshold, minInitialDepositRatio string, burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, - maxGovernors uint64, + maxGovernors uint64, governorStatusChangePeriod time.Duration, ) Params { return Params{ MinDeposit: minDeposit, @@ -69,6 +70,7 @@ func NewParams( BurnVoteQuorum: burnVoteQuorum, BurnVoteVeto: burnVoteVeto, MaxGovernors: maxGovernors, + GovernorStatusChangePeriod: &governorStatusChangePeriod, } } @@ -86,6 +88,7 @@ func DefaultParams() Params { DefaultBurnVoteQuorom, DefaultBurnVoteVeto, DefaultMaxGovernors, + DefaultGovernorStatusChangePeriod, ) } @@ -155,5 +158,13 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("mininum initial deposit ratio of proposal is too large: %s", minInitialDepositRatio) } + if p.GovernorStatusChangePeriod == nil { + return fmt.Errorf("governor status change period must not be nil: %d", p.GovernorStatusChangePeriod) + } + + if p.GovernorStatusChangePeriod.Seconds() <= 0 { + return fmt.Errorf("governor status change period must be positive: %d", p.GovernorStatusChangePeriod) + } + return nil } diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 360e3e242..d5fb45ea6 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -767,8 +767,7 @@ var xxx_messageInfo_MsgCreateGovernorResponse proto.InternalMessageInfo // MsgEditGovernor defines a SDK message for editing an existing governor. type MsgEditGovernor struct { Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` - Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` } func (m *MsgEditGovernor) Reset() { *m = MsgEditGovernor{} } @@ -841,6 +840,82 @@ func (m *MsgEditGovernorResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgEditGovernorResponse proto.InternalMessageInfo +// MsgUpdateGovernorStatus defines a SDK message for updating the status of a governor. +type MsgUpdateGovernorStatus struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` +} + +func (m *MsgUpdateGovernorStatus) Reset() { *m = MsgUpdateGovernorStatus{} } +func (m *MsgUpdateGovernorStatus) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateGovernorStatus) ProtoMessage() {} +func (*MsgUpdateGovernorStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{16} +} +func (m *MsgUpdateGovernorStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateGovernorStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateGovernorStatus.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 *MsgUpdateGovernorStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateGovernorStatus.Merge(m, src) +} +func (m *MsgUpdateGovernorStatus) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateGovernorStatus) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateGovernorStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateGovernorStatus proto.InternalMessageInfo + +// MsgUpdateGovernorStatusResponse defines the Msg/UpdateGovernorStatus response type. +type MsgUpdateGovernorStatusResponse struct { +} + +func (m *MsgUpdateGovernorStatusResponse) Reset() { *m = MsgUpdateGovernorStatusResponse{} } +func (m *MsgUpdateGovernorStatusResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateGovernorStatusResponse) ProtoMessage() {} +func (*MsgUpdateGovernorStatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f6c84786701fca8d, []int{17} +} +func (m *MsgUpdateGovernorStatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateGovernorStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateGovernorStatusResponse.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 *MsgUpdateGovernorStatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateGovernorStatusResponse.Merge(m, src) +} +func (m *MsgUpdateGovernorStatusResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateGovernorStatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateGovernorStatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateGovernorStatusResponse proto.InternalMessageInfo + // MsgDelegateGovernor defines a SDK message for performing a delegation of governance voting power // from a delegator to a governor. type MsgDelegateGovernor struct { @@ -852,7 +927,7 @@ func (m *MsgDelegateGovernor) Reset() { *m = MsgDelegateGovernor{} } func (m *MsgDelegateGovernor) String() string { return proto.CompactTextString(m) } func (*MsgDelegateGovernor) ProtoMessage() {} func (*MsgDelegateGovernor) Descriptor() ([]byte, []int) { - return fileDescriptor_f6c84786701fca8d, []int{16} + return fileDescriptor_f6c84786701fca8d, []int{18} } func (m *MsgDelegateGovernor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -889,7 +964,7 @@ func (m *MsgDelegateGovernorResponse) Reset() { *m = MsgDelegateGovernor func (m *MsgDelegateGovernorResponse) String() string { return proto.CompactTextString(m) } func (*MsgDelegateGovernorResponse) ProtoMessage() {} func (*MsgDelegateGovernorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f6c84786701fca8d, []int{17} + return fileDescriptor_f6c84786701fca8d, []int{19} } func (m *MsgDelegateGovernorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -927,7 +1002,7 @@ func (m *MsgUndelegateGovernor) Reset() { *m = MsgUndelegateGovernor{} } func (m *MsgUndelegateGovernor) String() string { return proto.CompactTextString(m) } func (*MsgUndelegateGovernor) ProtoMessage() {} func (*MsgUndelegateGovernor) Descriptor() ([]byte, []int) { - return fileDescriptor_f6c84786701fca8d, []int{18} + return fileDescriptor_f6c84786701fca8d, []int{20} } func (m *MsgUndelegateGovernor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -964,7 +1039,7 @@ func (m *MsgUndelegateGovernorResponse) Reset() { *m = MsgUndelegateGove func (m *MsgUndelegateGovernorResponse) String() string { return proto.CompactTextString(m) } func (*MsgUndelegateGovernorResponse) ProtoMessage() {} func (*MsgUndelegateGovernorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f6c84786701fca8d, []int{19} + return fileDescriptor_f6c84786701fca8d, []int{21} } func (m *MsgUndelegateGovernorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1010,6 +1085,8 @@ func init() { proto.RegisterType((*MsgCreateGovernorResponse)(nil), "atomone.gov.v1.MsgCreateGovernorResponse") proto.RegisterType((*MsgEditGovernor)(nil), "atomone.gov.v1.MsgEditGovernor") proto.RegisterType((*MsgEditGovernorResponse)(nil), "atomone.gov.v1.MsgEditGovernorResponse") + proto.RegisterType((*MsgUpdateGovernorStatus)(nil), "atomone.gov.v1.MsgUpdateGovernorStatus") + proto.RegisterType((*MsgUpdateGovernorStatusResponse)(nil), "atomone.gov.v1.MsgUpdateGovernorStatusResponse") proto.RegisterType((*MsgDelegateGovernor)(nil), "atomone.gov.v1.MsgDelegateGovernor") proto.RegisterType((*MsgDelegateGovernorResponse)(nil), "atomone.gov.v1.MsgDelegateGovernorResponse") proto.RegisterType((*MsgUndelegateGovernor)(nil), "atomone.gov.v1.MsgUndelegateGovernor") @@ -1019,83 +1096,86 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/tx.proto", fileDescriptor_f6c84786701fca8d) } var fileDescriptor_f6c84786701fca8d = []byte{ - // 1213 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4b, 0x6f, 0xe3, 0x54, - 0x14, 0x8e, 0xfb, 0x48, 0xa6, 0xb7, 0xa8, 0x0f, 0x93, 0xa1, 0xae, 0xdb, 0x26, 0xad, 0x07, 0x44, - 0xa7, 0x10, 0x9b, 0xa6, 0x30, 0x12, 0x51, 0x85, 0x98, 0x76, 0xaa, 0xd1, 0x48, 0x13, 0x4d, 0x95, - 0x8a, 0x87, 0x58, 0x50, 0x39, 0xf1, 0xc5, 0x35, 0xd4, 0xbe, 0x91, 0xef, 0x4d, 0xd4, 0xec, 0x10, - 0x62, 0x81, 0x58, 0xf1, 0x13, 0x46, 0xb0, 0x61, 0xd9, 0x45, 0x37, 0xf3, 0x07, 0xd0, 0x08, 0x09, - 0x69, 0x34, 0x2b, 0x56, 0x23, 0xd4, 0x2e, 0x8a, 0xe6, 0x3f, 0x20, 0xa1, 0xfb, 0x72, 0xec, 0xd8, - 0x69, 0x2a, 0xa4, 0x61, 0x13, 0xf9, 0x9e, 0xf3, 0x9d, 0x73, 0xcf, 0xf7, 0xdd, 0x73, 0x1f, 0x01, - 0x0b, 0x36, 0x41, 0x3e, 0x0a, 0xa0, 0xe5, 0xa2, 0xae, 0xd5, 0xdd, 0xb4, 0xc8, 0x89, 0xd9, 0x0e, - 0x11, 0x41, 0xea, 0x8c, 0x70, 0x98, 0x2e, 0xea, 0x9a, 0xdd, 0x4d, 0xbd, 0xd4, 0x42, 0xd8, 0x47, - 0xd8, 0x6a, 0xda, 0x18, 0x5a, 0xdd, 0xcd, 0x26, 0x24, 0xf6, 0xa6, 0xd5, 0x42, 0x5e, 0xc0, 0xf1, - 0xba, 0x36, 0x90, 0x88, 0x86, 0x71, 0x4f, 0xd1, 0x45, 0x2e, 0x62, 0x9f, 0x16, 0xfd, 0x12, 0xd6, - 0x45, 0x9e, 0xef, 0x90, 0x3b, 0xf8, 0x40, 0xba, 0x5c, 0x84, 0xdc, 0x63, 0x68, 0xb1, 0x51, 0xb3, - 0xf3, 0x95, 0x65, 0x07, 0x3d, 0xe1, 0x5a, 0x10, 0x55, 0xf8, 0xd8, 0xa5, 0x93, 0xf8, 0xd8, 0x15, - 0x8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x7f, 0xbc, 0x3c, 0xdd, 0x58, 0x96, 0x8b, 0xd7, 0xdd, 0xb4, 0x52, - 0x92, 0x19, 0xdb, 0x60, 0x31, 0x65, 0x6c, 0x40, 0xdc, 0x46, 0x01, 0x86, 0x6a, 0x19, 0x4c, 0xb7, - 0x85, 0xed, 0xd0, 0x73, 0x34, 0x65, 0x55, 0x59, 0x9f, 0x68, 0x00, 0x69, 0x7a, 0xe0, 0x18, 0x4f, - 0x14, 0x50, 0xac, 0x63, 0x77, 0xef, 0x04, 0xb6, 0x1e, 0x42, 0xd7, 0x6e, 0xf5, 0x76, 0x51, 0x40, - 0x60, 0x40, 0xd4, 0x47, 0xa0, 0xd0, 0xe2, 0x9f, 0x2c, 0x6a, 0xc8, 0x42, 0xec, 0x94, 0x7f, 0x3f, - 0xab, 0x2c, 0x25, 0x9b, 0x51, 0x0a, 0xcd, 0x82, 0x1b, 0x32, 0x8b, 0xba, 0x0c, 0xa6, 0xec, 0x0e, - 0x39, 0x42, 0xa1, 0x47, 0x7a, 0xda, 0x18, 0xe3, 0xdc, 0x37, 0xd4, 0xaa, 0x94, 0x75, 0x7f, 0x4c, - 0x69, 0x97, 0x93, 0xb4, 0x53, 0x25, 0x1a, 0x25, 0xb0, 0x9c, 0x65, 0x97, 0xe4, 0x8d, 0x0b, 0x05, - 0x14, 0xea, 0xd8, 0xfd, 0x14, 0x11, 0xa8, 0x7e, 0x90, 0x21, 0xc4, 0x4e, 0xf1, 0xe5, 0x8b, 0x72, - 0xdc, 0xcc, 0x5b, 0x22, 0x26, 0x8f, 0x6a, 0x82, 0xc9, 0x2e, 0x22, 0x30, 0xe4, 0x05, 0x5f, 0xd1, - 0x0b, 0x1c, 0xa6, 0x56, 0x41, 0x1e, 0xb5, 0x89, 0x87, 0x02, 0xd6, 0x3c, 0x33, 0x55, 0xdd, 0x4c, - 0x6a, 0x63, 0xd2, 0x62, 0x1e, 0x31, 0x44, 0x43, 0x20, 0xaf, 0x6a, 0x9e, 0xda, 0x1a, 0x95, 0x85, - 0xe7, 0xa6, 0x92, 0xa8, 0x49, 0x49, 0x68, 0x32, 0x63, 0x1e, 0xcc, 0x8a, 0xcf, 0x88, 0xf8, 0x3f, - 0x4a, 0x64, 0xfb, 0x0c, 0x7a, 0xee, 0x11, 0x81, 0xce, 0xff, 0x25, 0xc0, 0x36, 0x28, 0x70, 0x5a, - 0x58, 0x1b, 0x67, 0xdb, 0xd0, 0x18, 0x54, 0x40, 0x56, 0x14, 0x53, 0x42, 0x86, 0x5c, 0x29, 0xc5, - 0xed, 0xa4, 0x14, 0x7a, 0x5a, 0x0a, 0x99, 0xd9, 0x58, 0x04, 0x0b, 0x03, 0xa6, 0x78, 0x4f, 0x80, - 0x3a, 0x76, 0xe5, 0x76, 0xff, 0x8f, 0xaa, 0xdc, 0x01, 0x53, 0xe2, 0xb0, 0x41, 0xa3, 0x95, 0xe9, - 0x43, 0xd5, 0x6d, 0x90, 0xb7, 0x7d, 0xd4, 0x09, 0x88, 0x10, 0xe7, 0x7a, 0x67, 0x94, 0x88, 0xa9, - 0xad, 0xb3, 0x3d, 0x12, 0x65, 0xa3, 0x2a, 0xdc, 0x4c, 0xaa, 0x20, 0x68, 0x19, 0x45, 0xa0, 0xf6, - 0x47, 0x11, 0xf7, 0x27, 0xbc, 0x2d, 0x3e, 0x69, 0x3b, 0x36, 0x81, 0xfb, 0x76, 0x68, 0xfb, 0x98, - 0x32, 0xe9, 0xef, 0x4a, 0x65, 0x14, 0x93, 0x08, 0xaa, 0x7e, 0x08, 0xf2, 0x6d, 0x96, 0x81, 0xd1, - 0x9f, 0xae, 0xbe, 0x31, 0xb8, 0xcc, 0x3c, 0x7f, 0x82, 0x06, 0x0f, 0xa8, 0x6d, 0xa5, 0xb7, 0xfa, - 0xaa, 0xa4, 0x71, 0x22, 0x2f, 0xa8, 0x81, 0x3a, 0xc5, 0x92, 0xc6, 0x4d, 0x11, 0xad, 0x3f, 0x14, - 0x76, 0x93, 0xec, 0x86, 0xd0, 0x26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, 0x35, 0x63, 0xd3, 0xbf, 0x95, 0x25, 0x6f, 0x0a, 0xa6, 0x57, 0xae, 0x05, 0x93, - 0x73, 0xe9, 0x93, 0xdf, 0xd2, 0x0b, 0x64, 0xe7, 0xfe, 0xd3, 0xf3, 0x92, 0xf2, 0xec, 0xbc, 0xa4, - 0xfc, 0x75, 0x5e, 0x52, 0x7e, 0xba, 0x28, 0xe5, 0x9e, 0x5d, 0x94, 0x72, 0x7f, 0x5e, 0x94, 0x72, - 0x5f, 0x54, 0x5c, 0x8f, 0x1c, 0x75, 0x9a, 0x66, 0x0b, 0xf9, 0x96, 0xc8, 0x5c, 0x39, 0xea, 0x34, - 0xad, 0xe4, 0xa5, 0x4f, 0x7a, 0x6d, 0x88, 0xe9, 0x7f, 0xd7, 0x3c, 0xfb, 0x83, 0xb1, 0xf5, 0x6f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0xaa, 0x51, 0xd2, 0xfd, 0x0e, 0x00, 0x00, + // 1250 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcb, 0x6f, 0xe3, 0x44, + 0x1c, 0x8e, 0xfb, 0x48, 0xda, 0x29, 0xea, 0x63, 0xc8, 0x52, 0xd7, 0x6d, 0x93, 0xd6, 0x0b, 0xa2, + 0x5b, 0x88, 0x4d, 0x53, 0x58, 0x89, 0x50, 0x21, 0xb6, 0xdd, 0x6a, 0xb5, 0xd2, 0x46, 0x5b, 0xa5, + 0xe2, 0x21, 0x0e, 0x54, 0x4e, 0x3c, 0xb8, 0x86, 0xda, 0x13, 0x79, 0x26, 0x51, 0x73, 0x43, 0x9c, + 0x10, 0x27, 0x0e, 0xfc, 0x01, 0x2b, 0x71, 0xe1, 0xd8, 0x43, 0x2f, 0x7b, 0xe5, 0x80, 0x56, 0x08, + 0xa4, 0xd5, 0x9e, 0x38, 0xad, 0x50, 0x7b, 0x28, 0xda, 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1f, 0x82, 0x42, 0x8b, 0x7d, 0x06, 0x59, 0x03, 0x16, 0x62, 0xb7, 0xfc, 0xcb, 0x79, + 0x65, 0x39, 0xde, 0x8c, 0x42, 0xe8, 0x20, 0xb9, 0x21, 0xaa, 0xc0, 0x15, 0x30, 0x6d, 0x74, 0xe8, + 0x31, 0xf6, 0x6c, 0xda, 0x93, 0xc7, 0x02, 0xce, 0x7d, 0x43, 0xad, 0xea, 0xb3, 0xee, 0x8f, 0x7d, + 0xda, 0xe5, 0x38, 0xed, 0x14, 0x44, 0xb5, 0x04, 0x56, 0xb2, 0xec, 0x82, 0xbc, 0x7a, 0x29, 0x81, + 0x42, 0x9d, 0x58, 0x1f, 0x61, 0x8a, 0xe0, 0x3b, 0x19, 0x42, 0xec, 0x16, 0x5f, 0x3c, 0x2f, 0x47, + 0xcd, 0xac, 0x25, 0x22, 0xf2, 0x40, 0x0d, 0x4c, 0x76, 0x31, 0x45, 0x1e, 0x03, 0x7c, 0x4d, 0x2f, + 0xb0, 0x30, 0x58, 0x05, 0x79, 0xdc, 0xa6, 0x36, 0x76, 0x83, 0xe6, 0x99, 0xad, 0x2a, 0x5a, 0x5c, + 0x1b, 0xcd, 0x07, 0xf3, 0x30, 0x88, 0x68, 0xf0, 0xc8, 0xeb, 0x9a, 0xa7, 0xb6, 0xee, 0xcb, 0xc2, + 0x6a, 0xfb, 0x92, 0xc0, 0xb8, 0x24, 0x7e, 0x31, 0x75, 0x01, 0xcc, 0xf1, 0xcf, 0x90, 0xf8, 0x5f, + 0x52, 0x68, 0xfb, 0x18, 0xd9, 0xd6, 0x31, 0x45, 0xe6, 0x7f, 0x25, 0xc0, 0x0e, 0x28, 0x30, 0x5a, + 0x44, 0x1e, 0x0f, 0xb6, 0xa1, 0x9a, 0x54, 0x40, 0x20, 0x8a, 0x28, 0x21, 0x52, 0xae, 0x95, 0xe2, + 0x56, 0x5c, 0x0a, 0x25, 0x2d, 0x85, 0xa8, 0xac, 0x2e, 0x81, 0xc5, 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x28, 0x49, 0x4f, 0x2f, 0x4a, 0xd2, 0x1f, 0x17, 0x25, 0xe9, 0xbb, 0xcb, 0x52, 0xee, 0xe9, 0x65, + 0x29, 0xf7, 0xfb, 0x65, 0x29, 0xf7, 0x69, 0xc5, 0xb2, 0xe9, 0x71, 0xa7, 0xa9, 0xb5, 0xb0, 0xa3, + 0xf3, 0xca, 0x95, 0xe3, 0x4e, 0x53, 0x8f, 0x3f, 0x8b, 0x68, 0xaf, 0x8d, 0x88, 0xff, 0xef, 0x3e, + 0x1f, 0xfc, 0x05, 0xdb, 0xfe, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xb8, 0x86, 0x84, 0x1f, 0x10, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1131,6 +1211,8 @@ type MsgClient interface { // EditGovernor defines a method to edit an existing governor. // It also sets its status. EditGovernor(ctx context.Context, in *MsgEditGovernor, opts ...grpc.CallOption) (*MsgEditGovernorResponse, error) + // UpdateGovernorStatus defines a method to update the status of a governor. + UpdateGovernorStatus(ctx context.Context, in *MsgUpdateGovernorStatus, opts ...grpc.CallOption) (*MsgUpdateGovernorStatusResponse, error) // DelegateGovernor defines a method to delegate a non-zero percentange of // governance voting power from a delegator to a governor. DelegateGovernor(ctx context.Context, in *MsgDelegateGovernor, opts ...grpc.CallOption) (*MsgDelegateGovernorResponse, error) @@ -1218,6 +1300,15 @@ func (c *msgClient) EditGovernor(ctx context.Context, in *MsgEditGovernor, opts return out, nil } +func (c *msgClient) UpdateGovernorStatus(ctx context.Context, in *MsgUpdateGovernorStatus, opts ...grpc.CallOption) (*MsgUpdateGovernorStatusResponse, error) { + out := new(MsgUpdateGovernorStatusResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Msg/UpdateGovernorStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) DelegateGovernor(ctx context.Context, in *MsgDelegateGovernor, opts ...grpc.CallOption) (*MsgDelegateGovernorResponse, error) { out := new(MsgDelegateGovernorResponse) err := c.cc.Invoke(ctx, "/atomone.gov.v1.Msg/DelegateGovernor", in, out, opts...) @@ -1259,6 +1350,8 @@ type MsgServer interface { // EditGovernor defines a method to edit an existing governor. // It also sets its status. EditGovernor(context.Context, *MsgEditGovernor) (*MsgEditGovernorResponse, error) + // UpdateGovernorStatus defines a method to update the status of a governor. + UpdateGovernorStatus(context.Context, *MsgUpdateGovernorStatus) (*MsgUpdateGovernorStatusResponse, error) // DelegateGovernor defines a method to delegate a non-zero percentange of // governance voting power from a delegator to a governor. DelegateGovernor(context.Context, *MsgDelegateGovernor) (*MsgDelegateGovernorResponse, error) @@ -1294,6 +1387,9 @@ func (*UnimplementedMsgServer) CreateGovernor(ctx context.Context, req *MsgCreat func (*UnimplementedMsgServer) EditGovernor(ctx context.Context, req *MsgEditGovernor) (*MsgEditGovernorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EditGovernor not implemented") } +func (*UnimplementedMsgServer) UpdateGovernorStatus(ctx context.Context, req *MsgUpdateGovernorStatus) (*MsgUpdateGovernorStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGovernorStatus not implemented") +} func (*UnimplementedMsgServer) DelegateGovernor(ctx context.Context, req *MsgDelegateGovernor) (*MsgDelegateGovernorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DelegateGovernor not implemented") } @@ -1449,6 +1545,24 @@ func _Msg_EditGovernor_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_UpdateGovernorStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateGovernorStatus) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateGovernorStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Msg/UpdateGovernorStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateGovernorStatus(ctx, req.(*MsgUpdateGovernorStatus)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_DelegateGovernor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgDelegateGovernor) if err := dec(in); err != nil { @@ -1521,6 +1635,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "EditGovernor", Handler: _Msg_EditGovernor_Handler, }, + { + MethodName: "UpdateGovernorStatus", + Handler: _Msg_UpdateGovernorStatus_Handler, + }, { MethodName: "DelegateGovernor", Handler: _Msg_DelegateGovernor_Handler, @@ -2078,12 +2196,7 @@ func (m *MsgEditGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Address) i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) i-- - dAtA[i] = 0x1a - } - if m.Status != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } { size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) @@ -2121,6 +2234,64 @@ func (m *MsgEditGovernorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgUpdateGovernorStatus) 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 *MsgUpdateGovernorStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateGovernorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateGovernorStatusResponse) 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 *MsgUpdateGovernorStatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateGovernorStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgDelegateGovernor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2474,9 +2645,6 @@ func (m *MsgEditGovernor) Size() (n int) { _ = l l = m.Description.Size() n += 1 + l + sovTx(uint64(l)) - if m.Status != 0 { - n += 1 + sovTx(uint64(m.Status)) - } l = len(m.Address) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2493,6 +2661,31 @@ func (m *MsgEditGovernorResponse) Size() (n int) { return n } +func (m *MsgUpdateGovernorStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovTx(uint64(m.Status)) + } + return n +} + +func (m *MsgUpdateGovernorStatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgDelegateGovernor) Size() (n int) { if m == nil { return 0 @@ -4027,10 +4220,10 @@ func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - m.Status = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4040,12 +4233,125 @@ func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= GovernorStatus(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 3: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgEditGovernorResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgEditGovernorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateGovernorStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateGovernorStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateGovernorStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } @@ -4077,6 +4383,25 @@ func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { } m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= GovernorStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4098,7 +4423,7 @@ func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgEditGovernorResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateGovernorStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4121,10 +4446,10 @@ func (m *MsgEditGovernorResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgEditGovernorResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateGovernorStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgEditGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateGovernorStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: From 4ea0dad2b3b9b7aeb3dd4bbf6c3c2d0d4331f2ac Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 12:56:27 +0200 Subject: [PATCH 17/43] genesis --- proto/atomone/gov/v1/genesis.proto | 5 + x/gov/genesis.go | 56 ++++++++- x/gov/keeper/delegation.go | 6 +- x/gov/keeper/msg_server.go | 8 +- x/gov/types/v1/genesis.go | 46 +++++++- x/gov/types/v1/genesis.pb.go | 177 +++++++++++++++++++++++++---- 6 files changed, 259 insertions(+), 39 deletions(-) diff --git a/proto/atomone/gov/v1/genesis.proto b/proto/atomone/gov/v1/genesis.proto index b382bdb88..195c5b0cf 100644 --- a/proto/atomone/gov/v1/genesis.proto +++ b/proto/atomone/gov/v1/genesis.proto @@ -30,4 +30,9 @@ message GenesisState { // // Since: cosmos-sdk 0.47 Params params = 8; + + // governors defines all the governors present at genesis. + repeated Governor governors = 9; + // governance_delegations defines all the governance delegations present at genesis. + repeated GovernanceDelegation governance_delegations = 10; } diff --git a/x/gov/genesis.go b/x/gov/genesis.go index b6f928d80..90ea55a69 100644 --- a/x/gov/genesis.go +++ b/x/gov/genesis.go @@ -53,6 +53,44 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k if !balance.IsEqual(totalDeposits) { panic(fmt.Sprintf("expected module account was %s but we got %s", balance.String(), totalDeposits.String())) } + + // set governors + for _, governor := range data.Governors { + // check that base account exists + accAddr := sdk.AccAddress(governor.GetAddress()) + acc := ak.GetAccount(ctx, accAddr) + if acc == nil { + panic(fmt.Sprintf("account %s does not exist", accAddr.String())) + } + + k.SetGovernor(ctx, *governor) + if governor.IsActive() { + k.DelegateToGovernor(ctx, accAddr, governor.GetAddress()) + } + } + // set governance delegations + for _, delegation := range data.GovernanceDelegations { + delAddr := sdk.MustAccAddressFromBech32(delegation.DelegatorAddress) + govAddr := types.MustGovernorAddressFromBech32(delegation.GovernorAddress) + // check delegator exists + acc := ak.GetAccount(ctx, delAddr) + if acc == nil { + panic(fmt.Sprintf("account %s does not exist", delAddr.String())) + } + // check governor exists + _, found := k.GetGovernor(ctx, govAddr) + if !found { + panic(fmt.Sprintf("governor %s does not exist", govAddr.String())) + } + + // if account is active governor and delegation is not to self, error + delGovAddr := types.GovernorAddress(delAddr) + if _, found = k.GetGovernor(ctx, delGovAddr); found && !delGovAddr.Equals(govAddr) { + panic(fmt.Sprintf("account %s is an active governor and cannot delegate", delAddr.String())) + } + + k.DelegateToGovernor(ctx, delAddr, govAddr) + } } // ExportGenesis - output genesis parameters @@ -60,6 +98,7 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *v1.GenesisState { startingProposalID, _ := k.GetProposalID(ctx) proposals := k.GetProposals(ctx) params := k.GetParams(ctx) + governors := k.GetAllGovernors(ctx) var proposalsDeposits v1.Deposits var proposalsVotes v1.Votes @@ -71,11 +110,18 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *v1.GenesisState { proposalsVotes = append(proposalsVotes, votes...) } + var governanceDelegations []*v1.GovernanceDelegation + for _, g := range governors { + delegations := k.GetAllGovernanceDelegationsByGovernor(ctx, g.GetAddress()) + governanceDelegations = append(governanceDelegations, delegations...) + } return &v1.GenesisState{ - StartingProposalId: startingProposalID, - Deposits: proposalsDeposits, - Votes: proposalsVotes, - Proposals: proposals, - Params: ¶ms, + StartingProposalId: startingProposalID, + Deposits: proposalsDeposits, + Votes: proposalsVotes, + Proposals: proposals, + Params: ¶ms, + Governors: governors, + GovernanceDelegations: governanceDelegations, } } diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 98c275a03..13a591a2b 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -204,7 +204,7 @@ func (k Keeper) undelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress // DelegateGovernor creates a governor delegation for the given delegator // and increases all governor validator shares in the store -func (k Keeper) delegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, governorAddr types.GovernorAddress) { +func (k Keeper) DelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, governorAddr types.GovernorAddress) { delegation := v1.NewGovernanceDelegation(delegatorAddr, governorAddr) k.SetGovernanceDelegation(ctx, delegation) // iterate all delegations of delegator and increase shares @@ -215,9 +215,9 @@ func (k Keeper) delegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, } // RedelegateGovernor re-delegates all governor validator shares from one governor to another -func (k Keeper) redelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, dstGovernorAddr types.GovernorAddress) { +func (k Keeper) RedelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, dstGovernorAddr types.GovernorAddress) { // undelegate from the source governor k.undelegateGovernor(ctx, delegatorAddr) // delegate to the destination governor - k.delegateGovernor(ctx, delegatorAddr, dstGovernorAddr) + k.DelegateToGovernor(ctx, delegatorAddr, dstGovernorAddr) } diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 53da082da..161746eb7 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -197,7 +197,7 @@ func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovern k.SetGovernor(ctx, governor) // a base account automatically creates a governance delegation to itself - k.delegateGovernor(ctx, addr, govAddr) + k.DelegateToGovernor(ctx, addr, govAddr) return &v1.MsgCreateGovernorResponse{}, nil } @@ -259,7 +259,7 @@ func (k msgServer) UpdateGovernorStatus(goCtx context.Context, msg *v1.MsgUpdate // if status changes to active, create governance self-delegation // in case it didn't exist if governor.IsActive() { - k.redelegateGovernor(ctx, addr, govAddr) + k.RedelegateToGovernor(ctx, addr, govAddr) } return &v1.MsgUpdateGovernorStatusResponse{}, nil } @@ -282,10 +282,10 @@ func (k msgServer) DelegateGovernor(goCtx context.Context, msg *v1.MsgDelegateGo } // redelegate if a delegation to another governor already exists if found { - k.redelegateGovernor(ctx, delAddr, govAddr) + k.RedelegateToGovernor(ctx, delAddr, govAddr) } else { // Create the delegation - k.delegateGovernor(ctx, delAddr, govAddr) + k.DelegateToGovernor(ctx, delAddr, govAddr) } return &v1.MsgDelegateGovernorResponse{}, nil diff --git a/x/gov/types/v1/genesis.go b/x/gov/types/v1/genesis.go index 0065eb9ea..17d25f149 100644 --- a/x/gov/types/v1/genesis.go +++ b/x/gov/types/v1/genesis.go @@ -6,7 +6,10 @@ import ( "golang.org/x/sync/errgroup" - "github.com/cosmos/cosmos-sdk/codec/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/atomone-hub/atomone/x/gov/types" ) // NewGenesisState creates a new genesis state for the governance module @@ -97,6 +100,43 @@ func ValidateGenesis(data *GenesisState) error { return nil }) + // weed out duplicate governors + errGroup.Go(func() error { + governorIds := make(map[string]struct{}) + for _, g := range data.Governors { + if _, err := types.GovernorAddressFromBech32(g.GovernorAddress); err != nil { + return fmt.Errorf("invalid governor address: %v", g) + } + if _, ok := governorIds[g.GovernorAddress]; ok { + return fmt.Errorf("duplicate governor: %v", g) + } + + governorIds[g.GovernorAddress] = struct{}{} + } + + return nil + }) + + // weed out duplicate governance delegations + errGroup.Go(func() error { + delegatorIds := make(map[string]struct{}) + for _, d := range data.GovernanceDelegations { + if _, err := sdk.AccAddressFromBech32(d.DelegatorAddress); err != nil { + return fmt.Errorf("invalid delegator address: %v", d) + } + if _, err := types.GovernorAddressFromBech32(d.GovernorAddress); err != nil { + return fmt.Errorf("invalid governor address: %v", d) + } + if _, ok := delegatorIds[d.DelegatorAddress]; ok { + return fmt.Errorf("duplicate governance delegation: %v", d) + } + + delegatorIds[d.DelegatorAddress] = struct{}{} + } + + return nil + }) + // verify params errGroup.Go(func() error { return data.Params.ValidateBasic() @@ -105,10 +145,10 @@ func ValidateGenesis(data *GenesisState) error { return errGroup.Wait() } -var _ types.UnpackInterfacesMessage = GenesisState{} +var _ codectypes.UnpackInterfacesMessage = GenesisState{} // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (data GenesisState) UnpackInterfaces(unpacker types.AnyUnpacker) error { +func (data GenesisState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { for _, p := range data.Proposals { err := p.UnpackInterfaces(unpacker) if err != nil { diff --git a/x/gov/types/v1/genesis.pb.go b/x/gov/types/v1/genesis.pb.go index a761a4d39..1874375bf 100644 --- a/x/gov/types/v1/genesis.pb.go +++ b/x/gov/types/v1/genesis.pb.go @@ -45,6 +45,10 @@ type GenesisState struct { // // Since: cosmos-sdk 0.47 Params *Params `protobuf:"bytes,8,opt,name=params,proto3" json:"params,omitempty"` + // governors defines all the governors present at genesis. + Governors []*Governor `protobuf:"bytes,9,rep,name=governors,proto3" json:"governors,omitempty"` + // governance_delegations defines all the governance delegations present at genesis. + GovernanceDelegations []*GovernanceDelegation `protobuf:"bytes,10,rep,name=governance_delegations,json=governanceDelegations,proto3" json:"governance_delegations,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -139,6 +143,20 @@ func (m *GenesisState) GetParams() *Params { return nil } +func (m *GenesisState) GetGovernors() []*Governor { + if m != nil { + return m.Governors + } + return nil +} + +func (m *GenesisState) GetGovernanceDelegations() []*GovernanceDelegation { + if m != nil { + return m.GovernanceDelegations + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "atomone.gov.v1.GenesisState") } @@ -146,30 +164,33 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/genesis.proto", fileDescriptor_7737a96fb154b10d) } var fileDescriptor_7737a96fb154b10d = []byte{ - // 358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcd, 0x4e, 0x02, 0x31, - 0x14, 0x85, 0x29, 0x7f, 0x62, 0xf9, 0x59, 0x34, 0x44, 0x1b, 0xc5, 0x09, 0x71, 0x45, 0x4c, 0xe8, - 0x08, 0x24, 0x3e, 0x00, 0xd1, 0xa0, 0x3b, 0x32, 0x1a, 0x17, 0x6e, 0x48, 0x71, 0x9a, 0x61, 0x12, - 0xe0, 0x4e, 0xa6, 0xa5, 0x91, 0xb7, 0xf0, 0xb1, 0x5c, 0xb2, 0x74, 0x65, 0x0c, 0xbc, 0x88, 0xa1, - 0x33, 0x23, 0x38, 0xea, 0xae, 0xb9, 0xe7, 0x3b, 0xa7, 0x27, 0x37, 0x17, 0x37, 0xb8, 0x82, 0x19, - 0xcc, 0x85, 0xed, 0x81, 0xb6, 0x75, 0xc7, 0xf6, 0xc4, 0x5c, 0x48, 0x5f, 0xb2, 0x20, 0x04, 0x05, - 0xa4, 0x16, 0xab, 0xcc, 0x03, 0xcd, 0x74, 0xe7, 0x84, 0xa6, 0x69, 0xd0, 0x11, 0x79, 0xfe, 0x91, - 0xc3, 0x95, 0x41, 0xe4, 0xbd, 0x57, 0x5c, 0x09, 0x72, 0x89, 0xeb, 0x52, 0xf1, 0x50, 0xf9, 0x73, - 0x6f, 0x14, 0x84, 0x10, 0x80, 0xe4, 0xd3, 0x91, 0xef, 0x52, 0xd4, 0x44, 0xad, 0xbc, 0x43, 0x12, - 0x6d, 0x18, 0x4b, 0x77, 0x2e, 0xe9, 0xe1, 0x92, 0x2b, 0x02, 0x90, 0xbe, 0x92, 0x34, 0xdb, 0xcc, - 0xb5, 0xca, 0xdd, 0x63, 0xf6, 0xf3, 0x7f, 0x76, 0x1d, 0xe9, 0xce, 0x37, 0x48, 0x2e, 0x70, 0x41, - 0x83, 0x12, 0x92, 0xe6, 0x8c, 0xa3, 0x9e, 0x76, 0x3c, 0x82, 0x12, 0x4e, 0x84, 0x90, 0x2b, 0x7c, - 0x98, 0x34, 0x91, 0x34, 0x6f, 0x78, 0x9a, 0xe6, 0x93, 0x3e, 0xce, 0x0e, 0x25, 0xb7, 0xb8, 0x16, - 0xff, 0x37, 0x0a, 0x78, 0xc8, 0x67, 0x92, 0x16, 0x9a, 0xa8, 0x55, 0xee, 0x9e, 0xfd, 0x53, 0x6f, - 0x68, 0xa0, 0x7e, 0x96, 0x22, 0xa7, 0xea, 0xee, 0x8f, 0xc8, 0x0d, 0xae, 0x6a, 0x88, 0x56, 0x12, - 0x05, 0x15, 0x4d, 0x50, 0xe3, 0x8f, 0xd6, 0xdb, 0xdd, 0xec, 0x72, 0x2a, 0x7a, 0x6f, 0x42, 0xfa, - 0xb8, 0xa2, 0xf8, 0x74, 0xba, 0x4c, 0x52, 0x0e, 0x4c, 0xca, 0x69, 0x3a, 0xe5, 0x61, 0xcb, 0xec, - 0x85, 0x94, 0xd5, 0x6e, 0x40, 0x18, 0x2e, 0xc6, 0xee, 0x92, 0x71, 0x1f, 0xfd, 0xda, 0x84, 0x51, - 0x9d, 0x98, 0xea, 0x0f, 0xde, 0xd6, 0x16, 0x5a, 0xad, 0x2d, 0xf4, 0xb9, 0xb6, 0xd0, 0xeb, 0xc6, - 0xca, 0xac, 0x36, 0x56, 0xe6, 0x7d, 0x63, 0x65, 0x9e, 0xda, 0x9e, 0xaf, 0x26, 0x8b, 0x31, 0x7b, - 0x86, 0x99, 0x1d, 0x67, 0xb4, 0x27, 0x8b, 0x71, 0xf2, 0xb6, 0x5f, 0xcc, 0xb5, 0xa8, 0x65, 0x20, - 0xa4, 0xad, 0x3b, 0xe3, 0xa2, 0x39, 0x98, 0xde, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x1f, - 0x36, 0x2b, 0x7a, 0x02, 0x00, 0x00, + // 413 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 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xdd, 0xca, 0x59, 0xc3, 0xd6, 0xcd, 0x17, 0x8c, 0x36, 0xbb, 0x55, 0xf1, + 0xed, 0x7e, 0x37, 0x4f, 0x58, 0xed, 0x63, 0x2e, 0x5d, 0x3d, 0x5e, 0xb5, 0xcc, 0x2b, 0x9e, 0xfe, + 0x0d, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x01, 0x29, 0x32, 0x0f, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -192,6 +213,34 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.GovernanceDelegations) > 0 { + for iNdEx := len(m.GovernanceDelegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GovernanceDelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } + if len(m.Governors) > 0 { + for iNdEx := len(m.Governors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Governors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } if m.Params != nil { { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) @@ -344,6 +393,18 @@ func (m *GenesisState) Size() (n int) { l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) } + if len(m.Governors) > 0 { + for _, e := range m.Governors { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.GovernanceDelegations) > 0 { + for _, e := range m.GovernanceDelegations { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -647,6 +708,74 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Governors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Governors = append(m.Governors, &Governor{}) + if err := m.Governors[len(m.Governors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovernanceDelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GovernanceDelegations = append(m.GovernanceDelegations, &GovernanceDelegation{}) + if err := m.GovernanceDelegations[len(m.GovernanceDelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) From fedba974ff9a7b40285fc2c29a6e5b8a937165e6 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 13:18:44 +0200 Subject: [PATCH 18/43] fix e2e --- tests/e2e/genesis.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 7dd9ad287..64704ea66 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -127,6 +127,8 @@ func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, de maxDepositPeriod := 10 * time.Minute votingPeriod := 15 * time.Second + maxGovernors := uint64(100) + governorStatusChangePeriod := 30 * time.Second govGenState := govv1.NewGenesisState(1, govv1.NewParams( @@ -135,6 +137,7 @@ func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, de quorum.String(), threshold.String(), govv1.DefaultVetoThreshold.String(), sdk.ZeroDec().String(), false, false, true, + maxGovernors, governorStatusChangePeriod, ), ) govGenStateBz, err := cdc.MarshalJSON(govGenState) From 68645f27aef73e7d1c2c63c21b2b6354fd3054d4 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Sun, 15 Sep 2024 14:02:41 +0200 Subject: [PATCH 19/43] add governors vp invariant --- x/gov/keeper/delegation.go | 22 ++++++++++++--- x/gov/keeper/invariants.go | 55 ++++++++++++++++++++++++++++++++++++++ x/gov/keeper/msg_server.go | 2 +- 3 files changed, 75 insertions(+), 4 deletions(-) diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 13a591a2b..306524050 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -76,6 +76,22 @@ func (k Keeper) GetGovernorValShares(ctx sdk.Context, governorAddr types.Governo return share, true } +// IterateGovernorValShares iterates over all governor validator shares +func (k Keeper) IterateGovernorValShares(ctx sdk.Context, governorAddr types.GovernorAddress, cb func(index int64, share v1.GovernorValShares) (stop bool)) { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.ValidatorSharesByGovernorKey(governorAddr, []byte{})) + defer iterator.Close() + + for i := int64(0); iterator.Valid(); iterator.Next() { + var share v1.GovernorValShares + k.cdc.MustUnmarshal(iterator.Value(), &share) + if cb(i, share) { + break + } + i++ + } +} + // GetGovernorValSharesByValidator gets all governor validator shares for a specific validator func (k Keeper) GetGovernorValSharesByValidator(ctx sdk.Context, validatorAddr sdk.ValAddress) []v1.GovernorValShares { store := ctx.KVStore(k.storeKey) @@ -185,9 +201,9 @@ func (k Keeper) DecreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover k.UpdateGovernorByPowerIndex(ctx, governor) } -// UndelegateGovernor decreases all governor validator shares in the store +// UndelegateFromGovernor decreases all governor validator shares in the store // and then removes the governor delegation for the given delegator -func (k Keeper) undelegateGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress) { +func (k Keeper) UndelegateFromGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress) { delegation, found := k.GetGovernanceDelegation(ctx, delegatorAddr) if !found { return @@ -217,7 +233,7 @@ func (k Keeper) DelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress // RedelegateGovernor re-delegates all governor validator shares from one governor to another func (k Keeper) RedelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, dstGovernorAddr types.GovernorAddress) { // undelegate from the source governor - k.undelegateGovernor(ctx, delegatorAddr) + k.UndelegateFromGovernor(ctx, delegatorAddr) // delegate to the destination governor k.DelegateToGovernor(ctx, delegatorAddr, dstGovernorAddr) } diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index fcb1b4f8b..494ebbcb0 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -14,6 +14,7 @@ import ( // RegisterInvariants registers all governance invariants func RegisterInvariants(ir sdk.InvariantRegistry, keeper *Keeper, bk types.BankKeeper) { ir.RegisterRoute(types.ModuleName, "module-account", ModuleAccountInvariant(keeper, bk)) + ir.RegisterRoute(types.ModuleName, "governors-voting-power", GovernorsVotingPowerInvariant(keeper, keeper.sk)) } // AllInvariants runs all invariants of the governance module @@ -47,3 +48,57 @@ func ModuleAccountInvariant(keeper *Keeper, bk types.BankKeeper) sdk.Invariant { balances, expectedDeposits)), broken } } + +// GovernorsVotingPowerInvariant checks that the voting power of all governors +// is actually equal to the voting power resulting from the delegated validator shares +func GovernorsVotingPowerInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.Invariant { + return func(ctx sdk.Context) (string, bool) { + var ( + expectedVotingPower sdk.Dec + actualVotingPower sdk.Dec + broken bool + brokenGovernorAddr string + fail bool + invariantStr string + ) + + keeper.IterateGovernors(ctx, func(index int64, governor v1.GovernorI) bool { + expectedVotingPower = governor.GetVotingPower() + actualVotingPower = sdk.ZeroDec() + fail = false + keeper.IterateGovernorValShares(ctx, governor.GetAddress(), func(index int64, shares v1.GovernorValShares) bool { + validatorAddr, err := sdk.ValAddressFromBech32(shares.ValidatorAddress) + if err != nil { + invariantStr = sdk.FormatInvariant(types.ModuleName, "governor %s voting power", + fmt.Sprintf("failed to parse validator address %s: %v", shares.ValidatorAddress, err)) + fail = true + return true + } + validator, found := sk.GetValidator(ctx, validatorAddr) + if !found { + invariantStr = sdk.FormatInvariant(types.ModuleName, "governor %s voting power", + fmt.Sprintf("validator %s not found", validatorAddr.String())) + fail = true + return true + } + vp := shares.Shares.MulInt(validator.GetBondedTokens()).Quo(validator.GetDelegatorShares()) + actualVotingPower = actualVotingPower.Add(vp) + return false + }) + broken = !expectedVotingPower.Equal(actualVotingPower) + if fail { + broken = true + } + if broken { + brokenGovernorAddr = governor.GetAddress().String() + } + return broken // break on first broken invariant + }) + if !fail { + invariantStr = sdk.FormatInvariant(types.ModuleName, "governor %s voting power", + fmt.Sprintf("\texpected %s voting power: %s\n\tactual voting power: %s\n", + brokenGovernorAddr, expectedVotingPower, actualVotingPower)) + } + return invariantStr, broken + } +} diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 161746eb7..37242802d 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -303,7 +303,7 @@ func (k msgServer) UndelegateGovernor(goCtx context.Context, msg *v1.MsgUndelega } // Remove the delegation - k.undelegateGovernor(ctx, delAddr) + k.UndelegateFromGovernor(ctx, delAddr) return &v1.MsgUndelegateGovernorResponse{}, nil } From 201b1120a36c86042fd379489be5d521d81b8837 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:03:58 +0200 Subject: [PATCH 20/43] iterate over correct values --- x/gov/keeper/governor.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index 63351c1e3..b8a0cf91a 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -104,8 +104,10 @@ func (k Keeper) IterateMaxGovernorsByGovernancePower(ctx sdk.Context, cb func(in iterator := sdk.KVStoreReversePrefixIterator(store, types.GovernorsByPowerKeyPrefix) defer iterator.Close() - for ; iterator.Valid() && totGovernors < maxGovernors; iterator.Next() { - governor := v1.MustUnmarshalGovernor(k.cdc, iterator.Value()) + for ; iterator.Valid() && totGovernors <= maxGovernors; iterator.Next() { + // the value stored is the governor address + governorAddr := types.GovernorAddress(iterator.Value()) + governor, _ := k.GetGovernor(ctx, governorAddr) if governor.IsActive() { if cb(int64(totGovernors), governor) { break From e5c128448921a3e1d747b30adb934725d4679a5f Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:45:03 +0200 Subject: [PATCH 21/43] format pass --- x/gov/client/cli/query.go | 1 - x/gov/keeper/delegation.go | 5 +++-- x/gov/types/address.go | 7 +++---- x/gov/types/v1/exported.go | 3 ++- x/gov/types/v1/governor.go | 3 ++- x/gov/types/v1/tally.go | 3 ++- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index e31d78be2..1231ca8b7 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -844,7 +844,6 @@ $ %s query gov valshares cosmosgov1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk ), ), RunE: func(cmd *cobra.Command, args []string) error { - addr, err := types.GovernorAddressFromBech32(args[0]) if err != nil { return err diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 306524050..d733bf009 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -1,10 +1,11 @@ package keeper import ( - "github.com/atomone-hub/atomone/x/gov/types" - v1 "github.com/atomone-hub/atomone/x/gov/types/v1" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "github.com/atomone-hub/atomone/x/gov/types" + v1 "github.com/atomone-hub/atomone/x/gov/types/v1" ) // SetGovernanceDelegation sets a governance delegation in the store diff --git a/x/gov/types/address.go b/x/gov/types/address.go index 7d87ba9b2..eec4d6704 100644 --- a/x/gov/types/address.go +++ b/x/gov/types/address.go @@ -8,14 +8,13 @@ import ( "fmt" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" "gopkg.in/yaml.v2" -) -var ( - _ sdk.Address = GovernorAddress{} + sdk "github.com/cosmos/cosmos-sdk/types" ) +var _ sdk.Address = GovernorAddress{} + const ( // Prefix for governor addresses // Full prefix is defined as `bech32AccountPrefix + PrefixGovernor` diff --git a/x/gov/types/v1/exported.go b/x/gov/types/v1/exported.go index ddd7a74af..343d12350 100644 --- a/x/gov/types/v1/exported.go +++ b/x/gov/types/v1/exported.go @@ -1,8 +1,9 @@ package v1 import ( - "github.com/atomone-hub/atomone/x/gov/types" sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/atomone-hub/atomone/x/gov/types" ) type GovernorI interface { diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 744e14dd8..465e5b267 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -8,11 +8,12 @@ import ( "cosmossdk.io/errors" - "github.com/atomone-hub/atomone/x/gov/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "github.com/atomone-hub/atomone/x/gov/types" ) var ( diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index 938f6d0c6..a43d535c3 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -3,8 +3,9 @@ package v1 import ( "cosmossdk.io/math" - "github.com/atomone-hub/atomone/x/gov/types" sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/atomone-hub/atomone/x/gov/types" ) // GovernorGovInfo used for tallying From 6f378701002d071b6ba2cebc8e6a4a40fdf06801 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:46:47 +0200 Subject: [PATCH 22/43] fix missing return --- x/gov/types/v1/msgs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 39431e171..0a1d5340e 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -341,7 +341,7 @@ func (msg MsgCreateGovernor) ValidateBasic() error { } if _, err := msg.Description.EnsureLength(); err != nil { - types.ErrInvalidGovernanceDescription.Wrap(err.Error()) + return types.ErrInvalidGovernanceDescription.Wrap(err.Error()) } return nil } From c0cdec96432f6bed5246a2741c0c0b28a91d7b90 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:03:21 +0200 Subject: [PATCH 23/43] cleanup protos --- proto/atomone/gov/v1/gov.proto | 8 +- proto/atomone/gov/v1/tx.proto | 13 +- x/gov/types/v1/gov.pb.go | 222 +++++++++++++-------------- x/gov/types/v1/tx.pb.go | 270 +++++++++++++++++---------------- 4 files changed, 259 insertions(+), 254 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 9afcfaa42..0ab233a73 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -234,8 +234,8 @@ message Governor { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // governor_address defines the address of the governor; bech encoded in JSON. - string governor_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // governor_address defines the address of the governor; bech32-encoded. + string governor_address = 1; // status is the status of the governor (active/inactive). GovernorStatus status = 2; // description defines the description terms for the governor. @@ -285,7 +285,7 @@ message GovernorValShares { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string governor_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string governor_address = 1; string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // shares define the delegation shares available from this validator. string shares = 3 [ @@ -302,5 +302,5 @@ message GovernanceDelegation { option (gogoproto.goproto_getters) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string governor_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string governor_address = 2; } diff --git a/proto/atomone/gov/v1/tx.proto b/proto/atomone/gov/v1/tx.proto index 0e0bcc154..5f036da35 100644 --- a/proto/atomone/gov/v1/tx.proto +++ b/proto/atomone/gov/v1/tx.proto @@ -196,8 +196,9 @@ message MsgCreateGovernor { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // address is the base account address that is creating the governor. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + GovernorDescription description = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgCreateGovernorrResponse defines the Msg/CreateGovernor response type. @@ -211,8 +212,9 @@ message MsgEditGovernor { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - GovernorDescription description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // address is the base account address that is editing the corresponding governor. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + GovernorDescription description = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgEditGovernorResponse defines the Msg/EditGovernor response type. @@ -226,6 +228,7 @@ message MsgUpdateGovernorStatus { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; + // address is the base account address that is editing the corresponding governor. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; GovernorStatus status = 2; } @@ -243,7 +246,7 @@ message MsgDelegateGovernor { option (gogoproto.goproto_getters) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string governor_address = 2 [(cosmos_proto.scalar) = "atomone.GovernorAddressString"]; + string governor_address = 2; } // MsgDelegateGovernorResponse defines the Msg/Delegate response type. diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index b91b705dc..d5bdf2f6d 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -907,7 +907,7 @@ func (m *Params) GetGovernorStatusChangePeriod() *time.Duration { // shares from each delegators delegations in x/staking are added to the // governor's total shares. type Governor struct { - // governor_address defines the address of the governor; bech encoded in JSON. + // governor_address defines the address of the governor; bech32-encoded. GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` // status is the status of the governor (active/inactive). Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` @@ -1138,116 +1138,116 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1742 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x52, 0xd4, 0x6a, 0xac, 0xd8, 0x6b, 0x2a, 0x22, 0x15, 0x26, - 0x08, 0x14, 0x35, 0x22, 0x23, 0xa7, 0xcd, 0x21, 0xcd, 0x85, 0x12, 0x19, 0x65, 0x0d, 0x57, 0x64, - 0x97, 0x34, 0x8d, 0xf4, 0xb2, 0x18, 0x72, 0xc7, 0xe4, 0x20, 0xdc, 0x1d, 0x76, 0x77, 0x48, 0x9b, - 0xdf, 0x20, 0xf5, 0x29, 0xe8, 0xa9, 0x28, 0x6a, 0xc0, 0x40, 0x2f, 0x3d, 0xf4, 0x90, 0x83, 0x81, - 0x7e, 0x80, 0x5e, 0x72, 0x2a, 0x02, 0x5f, 0x9a, 0xf6, 0xe0, 0x16, 0xf6, 0xa1, 0x81, 0xbf, 0x43, - 0x81, 0x62, 0x76, 0x66, 0x49, 0x8a, 0xa2, 0x21, 0xc9, 0xe8, 0xc5, 0xde, 0x79, 0xf3, 0xfb, 0xbd, - 0x79, 0xff, 0x67, 0x28, 0x30, 0x30, 0x67, 0x2e, 0xf3, 0x48, 0xa9, 0xcb, 0x46, 0xa5, 0xd1, 0xa1, - 0xf8, 0xaf, 0x38, 0xf0, 0x19, 0x67, 0x28, 0xa3, 0x76, 0x8a, 0x42, 0x34, 0x3a, 0xcc, 0xe6, 0x3a, - 0x2c, 0x70, 0x59, 0x50, 0x6a, 0xe3, 0x80, 0x94, 0x46, 0x87, 0x6d, 0xc2, 0xf1, 0x61, 0xa9, 0xc3, - 0xa8, 0x27, 0xf1, 0xd9, 0xad, 0x2e, 0xeb, 0xb2, 0xf0, 0xb3, 0x24, 0xbe, 0x94, 0x34, 0xdf, 0x65, - 0xac, 0xdb, 0x27, 0xa5, 0x70, 0xd5, 0x1e, 0xde, 0x2f, 0x71, 0xea, 0x92, 0x80, 0x63, 0x77, 0xa0, - 0x00, 0x37, 0xe7, 0x01, 0xd8, 0x1b, 0xab, 0xad, 0xdc, 0xfc, 0x96, 0x33, 0xf4, 0x31, 0x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96, 0x8e, 0x4e, 0xbe, 0x7b, 0x91, 0xd3, 0xbe, 0x7f, 0x91, 0xd3, 0xfe, 0xfd, 0x22, 0xa7, 0x7d, - 0xf3, 0x32, 0xb7, 0xf4, 0xfd, 0xcb, 0xdc, 0xd2, 0x0f, 0x2f, 0x73, 0x4b, 0xbf, 0x3a, 0xe8, 0x52, - 0xde, 0x1b, 0xb6, 0x8b, 0x1d, 0xe6, 0x96, 0xd4, 0xdc, 0x3d, 0xe8, 0x0d, 0xdb, 0xd1, 0x77, 0xe9, - 0x61, 0xf8, 0x87, 0x12, 0x3e, 0x1e, 0x90, 0xa0, 0x34, 0x3a, 0x6c, 0x27, 0xc2, 0x01, 0xf7, 0xf1, - 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x1e, 0xfe, 0x8f, 0x47, 0x11, 0x00, 0x00, + // 1740 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4f, 0x6f, 0x1b, 0xc7, + 0x15, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x4a, 0x14, 0x3d, 0x56, 0xec, 0x35, 0x15, 0x91, 0x0a, 0x13, + 0x04, 0x8a, 0x1a, 0x91, 0x91, 0xd3, 0xe6, 0x90, 0xe6, 0x42, 0x89, 0x8c, 0xb2, 0x86, 0x2b, 0xb2, + 0x4b, 0x9a, 0x46, 0x7a, 0x59, 0x0c, 0xb9, 0x63, 0x72, 0x10, 0xee, 0x0e, 0xbb, 0x3b, 0xa4, 0xcd, + 0x6f, 0x90, 0xfa, 0x14, 0xf4, 0x54, 0x14, 0x35, 0x60, 0xa0, 0x97, 0x1e, 0x73, 0x30, 0xd0, 0x0f, + 0xd0, 0x4b, 0x4e, 0x45, 0xe0, 0x4b, 0xd3, 0x1e, 0xdc, 0xc2, 0x3e, 0x34, 0xc8, 0x27, 0xe8, 0xb1, + 0x98, 0x3f, 0x4b, 0x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 0x00, 0x00, } func (this *GovernorDescription) Equal(that interface{}) bool { diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index d5fb45ea6..13740e0f9 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -690,8 +690,9 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // MsgCreateGovernor defines a SDK message for creating a new governor. type MsgCreateGovernor struct { - Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // address is the base account address that is creating the governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Description GovernorDescription `protobuf:"bytes,2,opt,name=description,proto3" json:"description"` } func (m *MsgCreateGovernor) Reset() { *m = MsgCreateGovernor{} } @@ -766,8 +767,9 @@ var xxx_messageInfo_MsgCreateGovernorResponse proto.InternalMessageInfo // MsgEditGovernor defines a SDK message for editing an existing governor. type MsgEditGovernor struct { - Description GovernorDescription `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // address is the base account address that is editing the corresponding governor. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Description GovernorDescription `protobuf:"bytes,2,opt,name=description,proto3" json:"description"` } func (m *MsgEditGovernor) Reset() { *m = MsgEditGovernor{} } @@ -842,6 +844,7 @@ var xxx_messageInfo_MsgEditGovernorResponse proto.InternalMessageInfo // MsgUpdateGovernorStatus defines a SDK message for updating the status of a governor. type MsgUpdateGovernorStatus struct { + // address is the base account address that is editing the corresponding governor. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` } @@ -1096,86 +1099,85 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/tx.proto", fileDescriptor_f6c84786701fca8d) } var fileDescriptor_f6c84786701fca8d = []byte{ - // 1250 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcb, 0x6f, 0xe3, 0x44, - 0x1c, 0x8e, 0xfb, 0x48, 0xda, 0x29, 0xea, 0x63, 0xc8, 0x52, 0xd7, 0x6d, 0x93, 0xd6, 0x0b, 0xa2, - 0x5b, 0x88, 0x4d, 0x53, 0x58, 0x89, 0x50, 0x21, 0xb6, 0xdd, 0x6a, 0xb5, 0xd2, 0x46, 0x5b, 0xa5, - 0xe2, 0x21, 0x0e, 0x54, 0x4e, 0x3c, 0xb8, 0x86, 0xda, 0x13, 0x79, 0x26, 0x51, 0x73, 0x43, 0x9c, - 0x10, 0x27, 0x0e, 0xfc, 0x01, 0x2b, 0x71, 0xe1, 0xd8, 0x43, 0x2f, 0x7b, 0xe5, 0x80, 0x56, 0x08, - 0xa4, 0xd5, 0x9e, 0x38, 0xad, 0x50, 0x7b, 0x28, 0xda, 0xff, 0x01, 0x09, 0xd9, 0x33, 0xe3, 0xf8, - 0x95, 0x26, 0x42, 0x02, 0x71, 0x89, 0x3c, 0xbf, 0xd7, 0x7c, 0xdf, 0x37, 0xbf, 0x79, 0x04, 0x2c, - 0x1a, 0x14, 0x3b, 0xd8, 0x45, 0xba, 0x85, 0xbb, 0x7a, 0x77, 0x4b, 0xa7, 0xa7, 0x5a, 0xdb, 0xc3, - 0x14, 0xc3, 0x59, 0xee, 0xd0, 0x2c, 0xdc, 0xd5, 0xba, 0x5b, 0x4a, 0xa9, 0x85, 0x89, 0x83, 0x89, - 0xde, 0x34, 0x08, 0xd2, 0xbb, 0x5b, 0x4d, 0x44, 0x8d, 0x2d, 0xbd, 0x85, 0x6d, 0x97, 0xc5, 0x2b, - 0x72, 0xa2, 0x90, 0x9f, 0xc6, 0x3c, 0x45, 0x0b, 0x5b, 0x38, 0xf8, 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 0xc8, 0x13, - 0x7e, 0x56, 0x23, 0x1c, 0xc3, 0x22, 0x98, 0xa4, 0x36, 0x3d, 0x41, 0xf2, 0x64, 0xe0, 0x60, 0x03, - 0x28, 0x83, 0x02, 0xe9, 0x38, 0x8e, 0xe1, 0xf5, 0xe4, 0x7c, 0x60, 0x17, 0xc3, 0x9a, 0xf6, 0xf5, - 0xd5, 0xd9, 0x66, 0x58, 0xfa, 0xdb, 0xab, 0xb3, 0xcd, 0x15, 0xb1, 0x78, 0xdd, 0x2d, 0x3d, 0x25, - 0x99, 0xba, 0x03, 0x96, 0x52, 0xc6, 0x06, 0x22, 0x6d, 0xec, 0x12, 0x04, 0xcb, 0x60, 0xa6, 0xcd, - 0x6d, 0x47, 0xb6, 0x29, 0x4b, 0x6b, 0xd2, 0xc6, 0x44, 0x03, 0x08, 0xd3, 0x7d, 0x53, 0x7d, 0x2c, - 0x81, 0x62, 0x9d, 0x58, 0xfb, 0xa7, 0xa8, 0xf5, 0x00, 0x59, 0x46, 0xab, 0xb7, 0x87, 0x5d, 0x8a, - 0x5c, 0x0a, 0x1f, 0x82, 0x42, 0x8b, 0x7d, 0x06, 0x59, 0x03, 0x16, 0x62, 0xb7, 0xfc, 0xcb, 0x79, - 0x65, 0x39, 0xde, 0x8c, 0x42, 0xe8, 0x20, 0xb9, 0x21, 0xaa, 0xc0, 0x15, 0x30, 0x6d, 0x74, 0xe8, - 0x31, 0xf6, 0x6c, 0xda, 0x93, 0xc7, 0x02, 0xce, 0x7d, 0x43, 0xad, 0xea, 0xb3, 0xee, 0x8f, 0x7d, - 0xda, 0xe5, 0x38, 0xed, 0x14, 0x44, 0xb5, 0x04, 0x56, 0xb2, 0xec, 0x82, 0xbc, 0x7a, 0x29, 0x81, - 0x42, 0x9d, 0x58, 0x1f, 0x61, 0x8a, 0xe0, 0x3b, 0x19, 0x42, 0xec, 0x16, 0x5f, 0x3c, 0x2f, 0x47, - 0xcd, 0xac, 0x25, 0x22, 0xf2, 0x40, 0x0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 0xb0, 0x2f, 0x0a, 0x32, 0x76, - 0x39, 0x66, 0x81, 0x8c, 0x06, 0x64, 0x82, 0xcc, 0xba, 0xa3, 0xfc, 0x4e, 0x48, 0xdc, 0x4f, 0x59, - 0x9d, 0x10, 0x0f, 0xc9, 0xec, 0x84, 0xec, 0x6b, 0xc1, 0x47, 0x1e, 0xbb, 0x12, 0xb2, 0x90, 0x47, - 0x03, 0x32, 0x91, 0x67, 0x1d, 0xc3, 0xb0, 0x0d, 0x8a, 0x99, 0x47, 0xf0, 0x60, 0xea, 0xf1, 0x40, - 0x45, 0x1f, 0x31, 0x30, 0x9c, 0xd1, 0x04, 0xf3, 0xa9, 0xc3, 0xf0, 0x66, 0xe6, 0xea, 0xc5, 0x83, - 0x94, 0x37, 0x46, 0x08, 0x0a, 0x67, 0xf9, 0x02, 0xc0, 0x8c, 0x63, 0xe6, 0xb5, 0x2c, 0xb0, 0xa9, - 0x30, 0xa5, 0x32, 0x52, 0x98, 0x98, 0x4b, 0x99, 0xfc, 0xca, 0xbf, 0x62, 0x77, 0xef, 0x3d, 0xb9, - 0x28, 0x49, 0x4f, 0x2f, 0x4a, 0xd2, 0x1f, 0x17, 0x25, 0xe9, 0xbb, 0xcb, 0x52, 0xee, 0xe9, 0x65, - 0x29, 0xf7, 0xfb, 0x65, 0x29, 0xf7, 0x69, 0xc5, 0xb2, 0xe9, 0x71, 0xa7, 0xa9, 0xb5, 0xb0, 0xa3, - 0xf3, 0xca, 0x95, 0xe3, 0x4e, 0x53, 0x8f, 0x3f, 0x8b, 0x68, 0xaf, 0x8d, 0x88, 0xff, 0xef, 0x3e, - 0x1f, 0xfc, 0x05, 0xdb, 0xfe, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xb8, 0x86, 0x84, 0x1f, 0x10, - 0x00, 0x00, + // 1239 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xc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, 0x67, + 0xae, 0xae, 0x9b, 0xc9, 0xda, 0x98, 0x94, 0xcc, 0x03, 0x86, 0x68, 0x09, 0xe4, 0x45, 0xcd, 0xd3, + 0x58, 0xa1, 0x65, 0xe1, 0xb9, 0x69, 0x49, 0xd4, 0x64, 0x49, 0x68, 0x32, 0x63, 0x1e, 0x5c, 0x15, + 0x9f, 0x91, 0xf0, 0xbf, 0x94, 0xc8, 0xf6, 0x01, 0xf4, 0xdc, 0x43, 0x02, 0x9d, 0x7f, 0xab, 0x00, + 0x5b, 0xa0, 0xc4, 0x65, 0x61, 0x6d, 0x8a, 0x6d, 0x43, 0x23, 0x5d, 0x01, 0xc9, 0x28, 0x56, 0x09, + 0x19, 0x72, 0x61, 0x29, 0xd6, 0x92, 0xa5, 0xd0, 0xb3, 0xa5, 0x90, 0x99, 0x8d, 0x45, 0xb0, 0x90, + 0x32, 0xc5, 0x7b, 0x02, 0x34, 0xb1, 0x2b, 0xb7, 0xfb, 0x73, 0x56, 0xe5, 0x36, 0x98, 0x11, 0x87, + 0x0d, 0x1a, 0x5f, 0x99, 0x21, 0x54, 0xdd, 0x02, 0x45, 0xdb, 0x47, 0xbd, 0x80, 0x88, 0xe2, 0x4c, + 0x76, 0x46, 0x89, 0x98, 0xc6, 0x2a, 0xdb, 0x23, 0x51, 0x36, 0x5a, 0x85, 0xeb, 0xc9, 0x2a, 0x08, + 0x59, 0x46, 0x19, 0xa8, 0xc3, 0x51, 0xa4, 0xfd, 0x31, 0x6f, 0x8b, 0xf7, 0xba, 0x8e, 0x4d, 0xe0, + 0x9e, 0x1d, 0xda, 0x3e, 0xa6, 0x4a, 0x86, 0xbb, 0x52, 0x19, 0xa7, 0x24, 0x82, 0xaa, 0x6f, 0x82, + 0x62, 0x97, 0x65, 0x60, 0xf2, 0x67, 0xeb, 0x2f, 0xa4, 0x97, 0x99, 0xe7, 0x4f, 0xc8, 0xe0, 0x01, + 0x8d, 0xcd, 0xec, 0x56, 0x5f, 0x96, 0x32, 0x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xbb, 0xba, + 0x06, 0xae, 0xb9, 0x22, 0x65, 0x94, 0x85, 0xdf, 0xbe, 0x57, 0xa5, 0x5d, 0x40, 0x1b, 0x6f, 0xc7, + 0x95, 0x66, 0x27, 0xa7, 0x9a, 0x97, 0x62, 0x6d, 0x9b, 0x66, 0x6c, 0xdc, 0x04, 0x4b, 0x39, 0xe6, + 0x48, 0xe8, 0xb7, 0x0a, 0xb8, 0x4e, 0x8b, 0x11, 0x38, 0xff, 0x8c, 0xd4, 0xc6, 0xce, 0x78, 0xfe, + 0xcb, 0xa9, 0x35, 0xcb, 0x70, 0x31, 0xaa, 0xe0, 0x66, 0xae, 0x43, 0xca, 0xa8, 0x7f, 0x73, 0x05, + 0x4c, 0x35, 0xb1, 0xab, 0x7e, 0x0c, 0xe6, 0x52, 0x8f, 0xd7, 0x95, 0x74, 0x47, 0x65, 0xde, 0x65, + 0xfa, 0xda, 0x58, 0x48, 0xf4, 0x74, 0x73, 0xc1, 0x7c, 0xf6, 0x55, 0xf6, 0x62, 0x4e, 0x7c, 0x06, + 0xa5, 0xbf, 0x3a, 0x09, 0x2a, 0x9a, 0xe8, 0x1d, 0x70, 0x99, 0x3d, 0x91, 0x16, 0x72, 0xa2, 0xa8, + 0x43, 0xaf, 0x8e, 0x70, 0x44, 0x19, 0x3e, 0x04, 0xff, 0x4b, 0xbc, 0x35, 0x46, 0x05, 0x48, 0x80, + 0xfe, 0xf2, 0x18, 0x40, 0x94, 0xf9, 0x3e, 0x28, 0xc9, 0xab, 0x5a, 0xcf, 0x89, 0x11, 0x3e, 0xdd, + 0x18, 0xed, 0x8b, 0x93, 0x4c, 0xdc, 0x7c, 0x79, 0x24, 0xe3, 0x80, 0x5c, 0x92, 0x79, 0x17, 0x10, + 0xed, 0x84, 0xd4, 0xe5, 0x93, 0xd7, 0x09, 0x49, 0x48, 0x6e, 0x27, 0xe4, 0x9f, 0xf9, 0x94, 0x79, + 0xe2, 0xbc, 0xcf, 0x63, 0x1e, 0x07, 0xe4, 0x32, 0xcf, 0x3b, 0x63, 0xd5, 0x2e, 0x28, 0xe7, 0x9e, + 0xaf, 0xa3, 0xa5, 0x27, 0x81, 0xba, 0x35, 0x21, 0x30, 0x9a, 0xd1, 0x01, 0xd7, 0x32, 0x27, 0xdd, + 0xad, 0xdc, 0xd5, 0x4b, 0x82, 0xf4, 0x57, 0x26, 0x00, 0x45, 0xb3, 0x7c, 0x0a, 0xd4, 0x9c, 0x63, + 0xe6, 0xa5, 0x3c, 0xb2, 0x19, 0x98, 0x5e, 0x9b, 0x08, 0x26, 0xe7, 0xd2, 0xa7, 0x3f, 0xa7, 0x77, + 0xe1, 0xf6, 0xbd, 0x27, 0xa7, 0x15, 0xe5, 0xe9, 0x69, 0x45, 0xf9, 0xfd, 0xb4, 0xa2, 0x7c, 0x7d, + 0x56, 0x29, 0x3c, 0x3d, 0xab, 0x14, 0x7e, 0x3b, 0xab, 0x14, 0x3e, 0xaa, 0xb9, 0x1e, 0x39, 0xec, + 0xb5, 0xcd, 0x0e, 0xf2, 0x2d, 0x91, 0xb9, 0x76, 0xd8, 0x6b, 0x5b, 0xc9, 0x37, 0x0f, 0x19, 0x74, + 0x21, 0xa6, 0x7f, 0xdd, 0x8b, 0xec, 0xff, 0xd5, 0xe6, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xca, + 0x0e, 0xa1, 0x58, 0xfc, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2128,13 +2130,6 @@ func (m *MsgCreateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 - } { size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2144,7 +2139,14 @@ func (m *MsgCreateGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -2191,13 +2193,6 @@ func (m *MsgEditGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 - } { size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2207,7 +2202,14 @@ func (m *MsgEditGovernor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -2619,12 +2621,12 @@ func (m *MsgCreateGovernor) Size() (n int) { } var l int _ = l - l = m.Description.Size() - n += 1 + l + sovTx(uint64(l)) l = len(m.Address) if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = m.Description.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -2643,12 +2645,12 @@ func (m *MsgEditGovernor) Size() (n int) { } var l int _ = l - l = m.Description.Size() - n += 1 + l + sovTx(uint64(l)) l = len(m.Address) if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = m.Description.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -4023,9 +4025,9 @@ func (m *MsgCreateGovernor) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4035,30 +4037,29 @@ func (m *MsgCreateGovernor) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4068,23 +4069,24 @@ func (m *MsgCreateGovernor) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -4188,9 +4190,9 @@ func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4200,30 +4202,29 @@ func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4233,23 +4234,24 @@ func (m *MsgEditGovernor) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex From afa8d07e2bb1f3514873ed6a1e73961fbea3ea82 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:26:08 +0200 Subject: [PATCH 24/43] fix merge mistake --- x/gov/simulation/genesis.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 480455a55..e04395f66 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -30,7 +30,7 @@ const ( TallyParamsConstitutionAmendmentThreshold = "tally_params_constitution_amendment_threshold" TallyParamsLawQuorum = "tally_params_law_quorum" TallyParamsLawThreshold = "tally_params_law_threshold" - GovernorStatusChangePeriod = "governor_status_change_period" + GovernorStatusChangePeriod = "governor_status_change_period" // NOTE: backport from v50 MinDepositRatio = "min_deposit_ratio" @@ -190,7 +190,7 @@ func RandomizedGenState(simState *module.SimulationState) { govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), amendmentsQuorum.String(), amendmentsThreshold.String(), lawQuorum.String(), lawThreshold.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String(), quorumTimout, maxVotingPeriodExtension, quorumCheckCount, maxGovernors, governorStatusChangePeriod),main + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), amendmentsQuorum.String(), amendmentsThreshold.String(), lawQuorum.String(), lawThreshold.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String(), quorumTimout, maxVotingPeriodExtension, quorumCheckCount, maxGovernors, governorStatusChangePeriod), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") From 58d6a83316ede9f1ebf5a409f55b8b5e6510bacb Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:33:28 +0200 Subject: [PATCH 25/43] fix merge mistakes --- proto/atomone/gov/v1/genesis.proto | 2 -- proto/atomone/gov/v1/gov.proto | 2 +- x/gov/client/cli/query.go | 1 + x/gov/types/v1/msgs.go | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/atomone/gov/v1/genesis.proto b/proto/atomone/gov/v1/genesis.proto index 036295102..5ea5efdcf 100644 --- a/proto/atomone/gov/v1/genesis.proto +++ b/proto/atomone/gov/v1/genesis.proto @@ -30,12 +30,10 @@ message GenesisState { // // Since: cosmos-sdk 0.47 Params params = 8; - // The constitution allows builders to lay a foundation and define purpose. // // Since: cosmos-sdk 0.48 string constitution = 9; - // governors defines all the governors present at genesis. repeated Governor governors = 10; // governance_delegations defines all the governance delegations present at genesis. diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 56cc170b8..2b423aefa 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -239,7 +239,7 @@ message Params { // burn deposits if the proposal does not enter voting period bool burn_proposal_deposit_prevote = 14; - + // The ratio representing the proportion of the deposit value minimum that // must be met when making a deposit. Default value: 0.01. Meaning that for a // chain with a min_deposit of 100stake, a deposit of 1stake would be diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index ddab7f2ab..9e9d4d767 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -671,6 +671,7 @@ func GetCmdConstitution() *cobra.Command { if err != nil { return err } + return clientCtx.PrintProto(resp) }, } diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 7cb5aca0a..82f205674 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -334,6 +334,7 @@ func (msg MsgProposeConstitutionAmendment) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err) } + return nil } From 44d71e633092b0ed6607070474f75d1c5b889d50 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:39:52 +0200 Subject: [PATCH 26/43] approx VP computation for quorum with governors --- x/gov/keeper/tally.go | 22 +++++++++------------- x/gov/types/v1/tally.go | 4 +++- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index cc41f68e2..18e782430 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -60,18 +60,16 @@ func (keeper Keeper) HasReachedQuorum(ctx sdk.Context, proposal v1.Proposal) (qu return false, nil } - /* DISABLED on AtomOne - no possible increase of computation speed by - iterating over validators since vote inheritance is disabled. - Keeping as comment because this should be adapted with governors loop - - // we check first if voting power of validators alone is enough to pass quorum - // and if so, we return true skipping the iteration over all votes - // can speed up computation in case quorum is already reached by validator votes alone + quorum, _, err := keeper.getQuorumAndThreshold(ctx, proposal) + currGovernors := keeper.getGovernorsByAddress(ctx) + // we check first if voting power of governors alone is enough to pass quorum + // and if so, we return true skipping the iteration over all votes. + // Can speed up computation in case quorum is already reached by governor votes alone approxTotalVotingPower := math.LegacyZeroDec() - for _, val := range currValidators { - _, ok := keeper.GetVote(ctx, proposal.Id, sdk.AccAddress(val.GetOperator())) + for _, gov := range currGovernors { + _, ok := keeper.GetVote(ctx, proposal.Id, sdk.AccAddress(gov.Address)) if ok { - approxTotalVotingPower = approxTotalVotingPower.Add(math.LegacyNewDecFromInt(val.GetBondedTokens())) + approxTotalVotingPower = approxTotalVotingPower.Add(gov.VotingPower) } } // check and return whether or not the proposal has reached quorum @@ -79,15 +77,12 @@ func (keeper Keeper) HasReachedQuorum(ctx sdk.Context, proposal v1.Proposal) (qu if approxPercentVoting.GTE(quorum) { return true, nil } - */ - currGovernors := keeper.getGovernorsByAddress(ctx) currValidators := keeper.getBondedValidatorsByAddress(ctx) totalVotingPower, _ := keeper.tallyVotes(ctx, proposal, currValidators, currGovernors, false) // check and return whether or not the proposal has reached quorum percentVoting := totalVotingPower.Quo(math.LegacyNewDecFromInt(totalBonded)) - quorum, _, err := keeper.getQuorumAndThreshold(ctx, proposal) if err != nil { return false, err } @@ -114,6 +109,7 @@ func (keeper Keeper) getGovernorsByAddress(ctx sdk.Context) map[string]v1.Govern governor.GetAddress(), keeper.GetAllGovernorValShares(ctx, governor.GetAddress()), v1.WeightedVoteOptions{}, + governor.GetVotingPower(), ) return false }) diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index e10242420..2755339a4 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -14,10 +14,11 @@ type GovernorGovInfo struct { ValShares map[string]sdk.Dec // shares held for each validator ValSharesDeductions map[string]sdk.Dec // deductions from validator's shares when a delegator votes independently Vote WeightedVoteOptions // vote of the governor + VotingPower sdk.Dec // voting power of the governor } // NewGovernorGovInfo creates a GovernorGovInfo instance -func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValShares, options WeightedVoteOptions) GovernorGovInfo { +func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValShares, options WeightedVoteOptions, votingPower sdk.Dec) GovernorGovInfo { valSharesMap := make(map[string]sdk.Dec) for _, valShare := range valShares { valSharesMap[valShare.ValidatorAddress] = valShare.Shares @@ -28,6 +29,7 @@ func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValSh ValShares: valSharesMap, ValSharesDeductions: make(map[string]sdk.Dec), Vote: options, + VotingPower: votingPower, } } From 5767ccab68ea1bd92e0296f08ccf23b905a65075 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:37:37 +0200 Subject: [PATCH 27/43] fix error in keeper.GetGovernor --- proto/atomone/gov/v1/gov.proto | 4 ++-- proto/atomone/gov/v1/query.proto | 4 ++-- x/gov/client/cli/query.go | 13 +++++++++---- x/gov/client/cli/tx.go | 5 +++++ x/gov/keeper/governor.go | 4 +--- x/gov/types/v1/governor.go | 2 +- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 2b423aefa..29f0500d0 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -334,8 +334,8 @@ message GovernorDescription { string details = 5; } -// GovernorValShares holds the number of shares from the specific validator -// that a governor can use to vote on proposals. +// GovernorValShares holds the number of virtual shares from the +// specific validator that a governor can use to vote on proposals. message GovernorValShares { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; diff --git a/proto/atomone/gov/v1/query.proto b/proto/atomone/gov/v1/query.proto index 40f397195..773c1c7f6 100644 --- a/proto/atomone/gov/v1/query.proto +++ b/proto/atomone/gov/v1/query.proto @@ -82,9 +82,9 @@ service Query { option (google.api.http).get = "/atomone/gov/v1/delegations/{delegator_address}"; } - // GovernorValShares queries all governor validator shares resulting from all governance delegations. + // GovernorVShares queries all governor virtual validator shares resulting from all governance delegations. rpc GovernorValShares(QueryGovernorValSharesRequest) returns (QueryGovernorValSharesResponse) { - option (google.api.http).get = "/atomone/gov/v1/valshares/{governor_address}"; + option (google.api.http).get = "/atomone/gov/v1/vshares/{governor_address}"; } } diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index 9e9d4d767..b36111a79 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -40,6 +40,11 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryDeposits(), GetCmdQueryTally(), GetCmdConstitution(), + GetCmdQueryGovernor(), + GetCmdQueryGovernors(), + GetCmdQueryGovernanceDelegation(), + GetCmdQueryGovernanceDelegations(), + GetCmdQueryGovernorValShares(), ) return govQueryCmd @@ -854,14 +859,14 @@ $ %s query gov delegations cosmosgov1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk // GetCmdQueryGovernorValShares implements the query governor validator shares command. func GetCmdQueryGovernorValShares() *cobra.Command { cmd := &cobra.Command{ - Use: "valshares [governor_address]", + Use: "vshares [governor_address]", Args: cobra.ExactArgs(1), - Short: "Query governor validators shares", + Short: "Query governor virtual validators shares", Long: strings.TrimSpace( - fmt.Sprintf(`Query details for a governor validators shares by its address. + fmt.Sprintf(`Query details for a governor virtual validators shares by its address. Example: -$ %s query gov valshares cosmosgov1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk +$ %s query gov vshares cosmosgov1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk `, version.AppName, ), diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index c86dfc860..13110d2b2 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -72,6 +72,11 @@ func NewTxCmd(legacyPropCmds []*cobra.Command) *cobra.Command { NewCmdWeightedVote(), NewCmdSubmitProposal(), NewCmdDraftProposal(), + CreateGovernorCmd(), + EditGovernorCmd(), + UpdateGovernorStatusCmd(), + DelegateGovernorCmd(), + UndelegateGovernorCmd(), // Deprecated cmdSubmitLegacyProp, diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index b8a0cf91a..6c4c936af 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -15,9 +15,7 @@ func (k Keeper) GetGovernor(ctx sdk.Context, addr types.GovernorAddress) (v1.Gov return v1.Governor{}, false } - var governor v1.Governor - v1.MustMarshalGovernor(k.cdc, &governor) - return governor, true + return v1.MustUnmarshalGovernor(k.cdc, bz), true } // SetGovernor sets the governor in the store diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 465e5b267..00724b7be 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -206,7 +206,7 @@ func (g *Governor) MinEqual(other *Governor) bool { return g.GovernorAddress == other.GovernorAddress && g.Status == other.Status && g.Description.Equal(other.Description) && - g.VotingPower.Equal(other.VotingPower) + g.GetVotingPower().Equal(other.GetVotingPower()) } // Equal checks if the receiver equals the parameter From 25d017a3db68d13bcfc29b35a1e6b3394909902a Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:40:57 +0200 Subject: [PATCH 28/43] protogen --- proto/atomone/gov/v1/query.proto | 2 +- x/gov/types/v1/gov.pb.go | 4 +- x/gov/types/v1/query.pb.go | 182 +++++++++++++++---------------- x/gov/types/v1/query.pb.gw.go | 2 +- 4 files changed, 95 insertions(+), 95 deletions(-) diff --git a/proto/atomone/gov/v1/query.proto b/proto/atomone/gov/v1/query.proto index 773c1c7f6..69e8fb5a7 100644 --- a/proto/atomone/gov/v1/query.proto +++ b/proto/atomone/gov/v1/query.proto @@ -82,7 +82,7 @@ service Query { option (google.api.http).get = "/atomone/gov/v1/delegations/{delegator_address}"; } - // GovernorVShares queries all governor virtual validator shares resulting from all governance delegations. + // GovernorValShares queries all governor virtual validator shares resulting from all governance delegations. rpc GovernorValShares(QueryGovernorValSharesRequest) returns (QueryGovernorValSharesResponse) { option (google.api.http).get = "/atomone/gov/v1/vshares/{governor_address}"; } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 235cfd688..e5e8df1cd 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -1177,8 +1177,8 @@ func (m *GovernorDescription) GetDetails() string { return "" } -// GovernorValShares holds the number of shares from the specific validator -// that a governor can use to vote on proposals. +// GovernorValShares holds the number of virtual shares from the +// specific validator that a governor can use to vote on proposals. type GovernorValShares struct { GovernorAddress string `protobuf:"bytes,1,opt,name=governor_address,json=governorAddress,proto3" json:"governor_address,omitempty"` ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` diff --git a/x/gov/types/v1/query.pb.go b/x/gov/types/v1/query.pb.go index e6e7fff65..d5b42a659 100644 --- a/x/gov/types/v1/query.pb.go +++ b/x/gov/types/v1/query.pb.go @@ -1514,95 +1514,95 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/query.proto", fileDescriptor_2290d0188dd70223) } var fileDescriptor_2290d0188dd70223 = []byte{ - // 1404 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58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, 0xc5, 0xbd, 0x7d, 0x62, 0x42, 0x28, 0xbd, 0x03, 0x10, 0xb6, - 0x45, 0x71, 0x8c, 0x4b, 0x70, 0x5a, 0xc3, 0x28, 0xbf, 0x87, 0x34, 0xd1, 0x6c, 0xd8, 0x43, 0xda, - 0x3d, 0xc3, 0x32, 0x71, 0xb2, 0xd5, 0x48, 0xa4, 0xfa, 0x3d, 0x81, 0x23, 0x49, 0x49, 0x50, 0xe3, - 0x2b, 0x30, 0x29, 0x27, 0xe7, 0xab, 0xb1, 0x37, 0x57, 0xe4, 0x10, 0x4a, 0x57, 0x63, 0xd4, 0x0a, - 0x9c, 0xda, 0x99, 0xbe, 0xd4, 0x44, 0xd1, 0x18, 0xb7, 0x75, 0x98, 0xe5, 0xd4, 0x1e, 0x32, 0xd7, - 0x1c, 0xb4, 0x65, 0x86, 0x5d, 0x00, 0xf5, 0x06, 0x1c, 0x8a, 0x14, 0xc1, 0xa9, 0x2f, 0xc1, 0x98, - 0xff, 0x15, 0x5b, 0x6b, 0x2e, 0x39, 0x6b, 0x8e, 0xe5, 0x08, 0xf5, 0x93, 0x48, 0xb8, 0x33, 0x30, - 0xc9, 0x3b, 0x29, 0x12, 0xbd, 0xca, 0xea, 0x7d, 0x41, 0x80, 0x46, 0xcb, 0x23, 0xfd, 0x73, 0x42, - 0x03, 0xb9, 0x6a, 0xe9, 0xfc, 0x05, 0x64, 0x74, 0xab, 0x75, 0x19, 0xa9, 0xdc, 0x33, 0xda, 0xc6, - 0x46, 0x4c, 0x0a, 0x3e, 0x50, 0x73, 0x37, 0x5b, 0x26, 0x9e, 0x0e, 0x20, 0x86, 0x1e, 0x6c, 0xb6, - 0x4c, 0xf5, 0x59, 0x01, 0xfe, 0x17, 0x8b, 0xc3, 0x39, 0xdc, 0x86, 0x03, 0x1e, 0x73, 0x1b, 0xb6, - 0x55, 0x13, 0x60, 0x5c, 0x8b, 0x13, 0x29, 0x73, 0x69, 0xd8, 0x96, 0x08, 0x5e, 0x29, 0x14, 0x49, - 0x75, 0xda, 0x8b, 0x8c, 0xd0, 0x77, 0x61, 0x06, 0x37, 0x8d, 0xcc, 0x23, 0xa6, 0x38, 0x9f, 0xcc, - 0x73, 0x4b, 0xa0, 0x22, 0x89, 0x0e, 0xd4, 0xa3, 0x43, 0x74, 0x05, 0xa6, 0x5d, 0xa3, 0xd9, 0xdc, - 0x94, 0x79, 0xf6, 0xf2, 0x3c, 0xc7, 0x93, 0x79, 0x1e, 0xf8, 0x98, 0x48, 0x96, 0x29, 0x37, 0x1c, - 0xa0, 0x1a, 0xec, 0xc3, 0x68, 0xb1, 0x63, 0x8f, 0xf4, 0xec, 0x27, 0x21, 0x02, 0xa2, 0x54, 0x1b, - 0xb5, 0x41, 0x72, 0x03, 0xf7, 0x57, 0xec, 0x54, 0x29, 0x0c, 0x7c, 0xaa, 0xa8, 0x77, 0xf1, 0xa0, - 0x0e, 0xea, 0xe1, 0x62, 0x54, 0x60, 0x3f, 0x82, 0x70, 0x19, 0x8e, 0x66, 0xc8, 0x57, 0x95, 0x38, - 0xf5, 0x49, 0x3c, 0xd5, 0xbf, 0xbf, 0x37, 0xbe, 0x25, 0x78, 0xd8, 0x87, 0x0c, 0x70, 0x36, 0x17, - 0x61, 0x02, 0x59, 0xca, 0x1d, 0x92, 0x39, 0x9d, 0x00, 0x38, 0xba, 0x7d, 0x72, 0x1d, 0x8e, 0x72, - 0x5a, 0xbc, 0x51, 0xaa, 0xa6, 0xd3, 0x69, 0xba, 0x43, 0xdc, 0x87, 0xc5, 0xde, 0xd8, 0x60, 0x8d, - 0xc6, 0x79, 0xab, 0xe1, 0x0a, 0xa5, 0x37, 0x26, 0xc6, 0x08, 0xa4, 0x5a, 0xc7, 0x35, 0x5a, 0x65, - 0x9e, 0xd9, 0xb6, 0x59, 0x5b, 0xf2, 0x78, 0x0f, 0x66, 0x2d, 0x1c, 0xaa, 0x19, 0xa2, 0x57, 0xc4, - 0xce, 0x5d, 0x59, 0x78, 0xb9, 0x5d, 0x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fe, 0x11, 0x8a, 0xfe, 0x6e, 0x4d, 0xd8, - 0xad, 0x2e, 0xfd, 0x81, 0xc0, 0xa1, 0x9e, 0x1b, 0x9f, 0x96, 0x73, 0x97, 0x36, 0x69, 0x88, 0x14, - 0x6d, 0x50, 0x38, 0xb2, 0xbd, 0xc4, 0xd9, 0x6a, 0xf4, 0x7c, 0x92, 0xad, 0x67, 0x34, 0x85, 0x39, - 0x49, 0x51, 0x7b, 0x65, 0xf5, 0xd7, 0x9d, 0x12, 0x79, 0xb1, 0x53, 0x22, 0x7f, 0xec, 0x94, 0xc8, - 0xd3, 0xdd, 0xd2, 0x9e, 0x17, 0xbb, 0xa5, 0x3d, 0xbf, 0xef, 0x96, 0xf6, 0x7c, 0x54, 0xb6, 0x1a, - 0xee, 0xa3, 0xce, 0x9a, 0xb6, 0xce, 0x36, 0x64, 0xc6, 0xf2, 0xa3, 0xce, 0x5a, 0x90, 0xfd, 0x63, - 0x9e, 0xdf, 0x3f, 0x43, 0x1d, 0xdd, 0xab, 0xac, 0xed, 0xe3, 0xff, 0xbe, 0xbd, 0xf8, 0x57, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xd5, 0xac, 0x78, 0x58, 0x6b, 0x16, 0x00, 0x00, + // 1401 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcf, 0x8f, 0x14, 0x45, + 0x14, 0xa6, 0x86, 0x5d, 0xd8, 0x7d, 0xbb, 0x2c, 0x4b, 0xb9, 0xc0, 0xd0, 0xb0, 0x23, 0xdb, 0xac, + 0xb0, 0x20, 0xd3, 0xcd, 0x0c, 0xf2, 0x23, 0x44, 0x14, 0x57, 0x60, 0x25, 0x51, 0x83, 0x03, 0xe1, + 0xe0, 0x65, 0xd2, 0xbb, 0xd3, 0x69, 0x26, 0x99, 0xed, 0x1a, 0xa6, 0x7b, 0x3a, 0x6e, 0xd6, 0x09, + 0x89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, 0x44, 0x1e, 0xed, 0x94, + 0x76, 0x3d, 0xdb, 0x29, 0xed, 0xfa, 0x63, 0xa7, 0xb4, 0xeb, 0xe3, 0xb2, 0xd5, 0x74, 0xef, 0x77, + 0xd7, 0xb5, 0x0d, 0xb6, 0x29, 0xf3, 0x95, 0xef, 0x77, 0xd7, 0x83, 0xdc, 0x9f, 0xf0, 0xec, 0xfe, + 0x09, 0xea, 0xe8, 0x5e, 0x65, 0x7d, 0x0f, 0xff, 0xe7, 0xed, 0xf9, 0xbf, 0x03, 0x00, 0x00, 0xff, + 0xff, 0x66, 0x00, 0x92, 0x22, 0x69, 0x16, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1643,7 +1643,7 @@ type QueryClient interface { GovernanceDelegations(ctx context.Context, in *QueryGovernanceDelegationsRequest, opts ...grpc.CallOption) (*QueryGovernanceDelegationsResponse, error) // GovernanceDelegation queries a delegation GovernanceDelegation(ctx context.Context, in *QueryGovernanceDelegationRequest, opts ...grpc.CallOption) (*QueryGovernanceDelegationResponse, error) - // GovernorValShares queries all governor validator shares resulting from all governance delegations. + // GovernorValShares queries all governor virtual validator shares resulting from all governance delegations. GovernorValShares(ctx context.Context, in *QueryGovernorValSharesRequest, opts ...grpc.CallOption) (*QueryGovernorValSharesResponse, error) } @@ -1809,7 +1809,7 @@ type QueryServer interface { GovernanceDelegations(context.Context, *QueryGovernanceDelegationsRequest) (*QueryGovernanceDelegationsResponse, error) // GovernanceDelegation queries a delegation GovernanceDelegation(context.Context, *QueryGovernanceDelegationRequest) (*QueryGovernanceDelegationResponse, error) - // GovernorValShares queries all governor validator shares resulting from all governance delegations. + // GovernorValShares queries all governor virtual validator shares resulting from all governance delegations. GovernorValShares(context.Context, *QueryGovernorValSharesRequest) (*QueryGovernorValSharesResponse, error) } diff --git a/x/gov/types/v1/query.pb.gw.go b/x/gov/types/v1/query.pb.gw.go index 4ea97107d..ba1920183 100644 --- a/x/gov/types/v1/query.pb.gw.go +++ b/x/gov/types/v1/query.pb.gw.go @@ -1512,7 +1512,7 @@ var ( pattern_Query_GovernanceDelegation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"atomone", "gov", "v1", "delegations", "delegator_address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_GovernorValShares_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"atomone", "gov", "v1", "valshares", "governor_address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GovernorValShares_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"atomone", "gov", "v1", "vshares", "governor_address"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( From 671755c0fb049259ca4950bc1635bdb650657710 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:35:23 +0200 Subject: [PATCH 29/43] add min bonding requirements for governors --- proto/atomone/gov/v1/gov.proto | 4 + tests/e2e/genesis.go | 3 +- x/gov/keeper/governor.go | 40 ++++- x/gov/keeper/msg_server.go | 7 + x/gov/simulation/genesis.go | 14 +- x/gov/types/errors.go | 43 ++--- x/gov/types/v1/gov.pb.go | 298 ++++++++++++++++++++------------- x/gov/types/v1/params.go | 21 ++- 8 files changed, 281 insertions(+), 149 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 29f0500d0..e7d2d8677 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -277,6 +277,10 @@ message Params { uint64 max_governors = 23; // defines the duration of time that need to elapse between governor status changes. google.protobuf.Duration governor_status_change_period = 24 [(gogoproto.stdduration) = true]; + // defines the minimum amound of bonded tokens, aka the "self-delegation" (because active governors + // must have the governance VP from the base account automatically delegated to them), that a governor + // must have to be considered active. + string min_governor_self_delegation = 25 [(cosmos_proto.scalar) = "cosmos.Int" ]; } diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 0981a3cb0..ee74279da 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -128,6 +128,7 @@ func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, de lawThreshold, _ := sdk.NewDecFromStr("0.000000000000000001") amendmentsQuorum, _ := sdk.NewDecFromStr("0.000000000000000001") amendmentsThreshold, _ := sdk.NewDecFromStr("0.000000000000000001") + minGovernorSelfDelegation, _ := sdk.NewIntFromString("10000000") maxDepositPeriod := 10 * time.Minute votingPeriod := 15 * time.Second @@ -143,7 +144,7 @@ func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, de sdk.ZeroDec().String(), false, false, govv1.DefaultMinDepositRatio.String(), govv1.DefaultQuorumTimeout, govv1.DefaultMaxVotingPeriodExtension, govv1.DefaultQuorumCheckCount, - maxGovernors, governorStatusChangePeriod, + maxGovernors, governorStatusChangePeriod, minGovernorSelfDelegation.String(), ), ) govGenStateBz, err := cdc.MarshalJSON(govGenState) diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index 6c4c936af..50a2eade4 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -2,6 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" @@ -94,6 +95,7 @@ func (k Keeper) UpdateGovernorByPowerIndex(ctx sdk.Context, governor v1.Governor } // IterateMaxGovernorsByGovernancePower iterates over the top params.MaxGovernors governors by governance power +// inactive governors or governors that don't meet the minimum self-delegation requirement are not included func (k Keeper) IterateMaxGovernorsByGovernancePower(ctx sdk.Context, cb func(index int64, governor v1.GovernorI) (stop bool)) { store := ctx.KVStore(k.storeKey) maxGovernors := k.GetParams(ctx).MaxGovernors @@ -106,7 +108,7 @@ func (k Keeper) IterateMaxGovernorsByGovernancePower(ctx sdk.Context, cb func(in // the value stored is the governor address governorAddr := types.GovernorAddress(iterator.Value()) governor, _ := k.GetGovernor(ctx, governorAddr) - if governor.IsActive() { + if governor.IsActive() && k.ValidateGovernorMinSelfDelegation(ctx, governor) { if cb(int64(totGovernors), governor) { break } @@ -114,3 +116,39 @@ func (k Keeper) IterateMaxGovernorsByGovernancePower(ctx sdk.Context, cb func(in } } } + +func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorAddress) (bondedTokens sdk.Int) { + bondedTokens = sdk.ZeroInt() + addr := sdk.AccAddress(govAddr) + k.sk.IterateDelegations(ctx, addr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { + validatorAddr := delegation.GetValidatorAddr() + validator, _ := k.sk.GetValidator(ctx, validatorAddr) + shares := delegation.GetShares() + bt := shares.MulInt(validator.GetBondedTokens()).Quo(validator.GetDelegatorShares()).TruncateInt() + bondedTokens = bondedTokens.Add(bt) + + return false + }) + + return bondedTokens +} + +func (k Keeper) ValidateGovernorMinSelfDelegation(ctx sdk.Context, governor v1.Governor) bool { + minGovernorSelfDelegation, _ := sdk.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) + bondedTokens := k.getGovernorBondedTokens(ctx, governor.GetAddress()) + delAddr := sdk.AccAddress(governor.GetAddress()) + + // ensure that the governor is active and that has a valid governance self-delegation + if !governor.IsActive() { + return false + } + if del, found := k.GetGovernanceDelegation(ctx, delAddr); !found || !governor.GetAddress().Equals(types.MustGovernorAddressFromBech32(del.GovernorAddress)) { + panic("active governor without governance self-delegation") + } + + if bondedTokens.LT(minGovernorSelfDelegation) { + return false + } + + return true +} diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 5185b0650..55a43ac21 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -9,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors1 "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/atomone-hub/atomone/x/gov/types" govtypes "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" "github.com/atomone-hub/atomone/x/gov/types/v1beta1" @@ -222,6 +223,12 @@ func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovern return nil, err } + minSelfDelegation, _ := sdk.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) + bondedTokens := k.getGovernorBondedTokens(ctx, govAddr) + if bondedTokens.LT(minSelfDelegation) { + types.ErrInsufficientGovernorDelegation.Wrapf("minimum self-delegation required: %s, total bonded tokens: %s", minSelfDelegation, bondedTokens) + } + governor, err := v1.NewGovernor(govAddr.String(), msg.Description, ctx.BlockTime()) if err != nil { return nil, err diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index e04395f66..4306acda8 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -31,6 +31,7 @@ const ( TallyParamsLawQuorum = "tally_params_law_quorum" TallyParamsLawThreshold = "tally_params_law_threshold" GovernorStatusChangePeriod = "governor_status_change_period" + MinGovernorSelfDelegation = "min_governor_self_delegation" // NOTE: backport from v50 MinDepositRatio = "min_deposit_ratio" @@ -102,6 +103,11 @@ func GenQuorumCheckCount(r *rand.Rand) uint64 { return uint64(simulation.RandIntBetween(r, 0, 30)) } +// GenMinGovernorSelfDelegation returns a randomized MinGovernorSelfDelegation +func GenMinGovernorSelfDelegation(r *rand.Rand) sdk.Int { + return sdk.NewInt(int64(simulation.RandIntBetween(r, 1000, 10000000))) +} + // RandomizedGenState generates a random GenesisState for gov func RandomizedGenState(simState *module.SimulationState) { startingProposalID := uint64(simState.Rand.Intn(100)) @@ -188,9 +194,15 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { governorStatusChangePeriod = GenDepositParamsDepositPeriod(r) }, ) + var minGovernorSelfDelegation sdk.Int + simState.AppParams.GetOrGenerate( + simState.Cdc, MinGovernorSelfDelegation, &minGovernorSelfDelegation, simState.Rand, + func(r *rand.Rand) { minGovernorSelfDelegation = GenMinGovernorSelfDelegation(r) }, + ) + govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), amendmentsQuorum.String(), amendmentsThreshold.String(), lawQuorum.String(), lawThreshold.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String(), quorumTimout, maxVotingPeriodExtension, quorumCheckCount, maxGovernors, governorStatusChangePeriod), + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), amendmentsQuorum.String(), amendmentsThreshold.String(), lawQuorum.String(), lawThreshold.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String(), quorumTimout, maxVotingPeriodExtension, quorumCheckCount, maxGovernors, governorStatusChangePeriod, minGovernorSelfDelegation.String()), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 0578d812f..11ef3bfa0 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -10,25 +10,26 @@ var ( ErrInactiveProposal = sdkerrors.Register(ModuleName, 30, "inactive proposal") //nolint:staticcheck ErrAlreadyActiveProposal = sdkerrors.Register(ModuleName, 40, "proposal already active") //nolint:staticcheck // Errors 5 & 6 are legacy errors related to v1beta1.Proposal. - ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 50, "invalid proposal content") //nolint:staticcheck - ErrInvalidProposalType = sdkerrors.Register(ModuleName, 60, "invalid proposal type") //nolint:staticcheck - ErrInvalidVote = sdkerrors.Register(ModuleName, 70, "invalid vote option") //nolint:staticcheck - ErrInvalidGenesis = sdkerrors.Register(ModuleName, 80, "invalid genesis state") //nolint:staticcheck - ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 90, "no handler exists for proposal type") //nolint:staticcheck - ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 100, "proposal message not recognized by router") //nolint:staticcheck - ErrNoProposalMsgs = sdkerrors.Register(ModuleName, 110, "no messages proposed") //nolint:staticcheck - ErrInvalidProposalMsg = sdkerrors.Register(ModuleName, 120, "invalid proposal message") //nolint:staticcheck - ErrInvalidSigner = sdkerrors.Register(ModuleName, 130, "expected gov account as only signer for proposal message") //nolint:staticcheck - ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 140, "signal message is invalid") //nolint:staticcheck - ErrMetadataTooLong = sdkerrors.Register(ModuleName, 150, "metadata too long") //nolint:staticcheck - ErrMinDepositTooSmall = sdkerrors.Register(ModuleName, 160, "minimum deposit is too small") //nolint:staticcheck - ErrGovernorExists = sdkerrors.Register(ModuleName, 170, "governor already exists") //nolint:staticcheck - ErrUnknownGovernor = sdkerrors.Register(ModuleName, 180, "unknown governor") //nolint:staticcheck - ErrInvalidGovernorStatus = sdkerrors.Register(ModuleName, 190, "invalid governor status") //nolint:staticcheck - ErrGovernanceDelegationExists = sdkerrors.Register(ModuleName, 200, "governance delegation already exists") //nolint:staticcheck - ErrUnknownGovernanceDelegation = sdkerrors.Register(ModuleName, 210, "unknown governance delegation") //nolint:staticcheck - ErrInvalidGovernanceDescription = sdkerrors.Register(ModuleName, 220, "invalid governance description") //nolint:staticcheck - ErrDelegatorIsGovernor = sdkerrors.Register(ModuleName, 230, "cannot delegate, delegator is an active governor") //nolint:staticcheck - ErrGovernorStatusEqual = sdkerrors.Register(ModuleName, 240, "cannot change governor status to the same status") //nolint:staticcheck - ErrGovernorStatusChangePeriod = sdkerrors.Register(ModuleName, 250, "governor status change period not elapsed") //nolint:staticcheck + ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 50, "invalid proposal content") //nolint:staticcheck + ErrInvalidProposalType = sdkerrors.Register(ModuleName, 60, "invalid proposal type") //nolint:staticcheck + ErrInvalidVote = sdkerrors.Register(ModuleName, 70, "invalid vote option") //nolint:staticcheck + ErrInvalidGenesis = sdkerrors.Register(ModuleName, 80, "invalid genesis state") //nolint:staticcheck + ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 90, "no handler exists for proposal type") //nolint:staticcheck + ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 100, "proposal message not recognized by router") //nolint:staticcheck + ErrNoProposalMsgs = sdkerrors.Register(ModuleName, 110, "no messages proposed") //nolint:staticcheck + ErrInvalidProposalMsg = sdkerrors.Register(ModuleName, 120, "invalid proposal message") //nolint:staticcheck + ErrInvalidSigner = sdkerrors.Register(ModuleName, 130, "expected gov account as only signer for proposal message") //nolint:staticcheck + ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 140, "signal message is invalid") //nolint:staticcheck + ErrMetadataTooLong = sdkerrors.Register(ModuleName, 150, "metadata too long") //nolint:staticcheck + ErrMinDepositTooSmall = sdkerrors.Register(ModuleName, 160, "minimum deposit is too small") //nolint:staticcheck + ErrGovernorExists = sdkerrors.Register(ModuleName, 170, "governor already exists") //nolint:staticcheck + ErrUnknownGovernor = sdkerrors.Register(ModuleName, 180, "unknown governor") //nolint:staticcheck + ErrInvalidGovernorStatus = sdkerrors.Register(ModuleName, 190, "invalid governor status") //nolint:staticcheck + ErrGovernanceDelegationExists = sdkerrors.Register(ModuleName, 200, "governance delegation already exists") //nolint:staticcheck + ErrUnknownGovernanceDelegation = sdkerrors.Register(ModuleName, 210, "unknown governance delegation") //nolint:staticcheck + ErrInvalidGovernanceDescription = sdkerrors.Register(ModuleName, 220, "invalid governance description") //nolint:staticcheck + ErrDelegatorIsGovernor = sdkerrors.Register(ModuleName, 230, "cannot delegate, delegator is an active governor") //nolint:staticcheck + ErrGovernorStatusEqual = sdkerrors.Register(ModuleName, 240, "cannot change governor status to the same status") //nolint:staticcheck + ErrGovernorStatusChangePeriod = sdkerrors.Register(ModuleName, 250, "governor status change period not elapsed") //nolint:staticcheck + ErrInsufficientGovernorDelegation = sdkerrors.Register(ModuleName, 260, "insufficient governor self-delegation") //nolint:staticcheck ) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index e5e8df1cd..a73f51931 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -883,6 +883,10 @@ type Params struct { MaxGovernors uint64 `protobuf:"varint,23,opt,name=max_governors,json=maxGovernors,proto3" json:"max_governors,omitempty"` // defines the duration of time that need to elapse between governor status changes. GovernorStatusChangePeriod *time.Duration `protobuf:"bytes,24,opt,name=governor_status_change_period,json=governorStatusChangePeriod,proto3,stdduration" json:"governor_status_change_period,omitempty"` + // defines the minimum amound of bonded tokens, aka the "self-delegation" (because active governors + // must have the governance VP from the base account automatically delegated to them), that a governor + // must have to be considered active. + MinGovernorSelfDelegation string `protobuf:"bytes,25,opt,name=min_governor_self_delegation,json=minGovernorSelfDelegation,proto3" json:"min_governor_self_delegation,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -1044,6 +1048,13 @@ func (m *Params) GetGovernorStatusChangePeriod() *time.Duration { return nil } +func (m *Params) GetMinGovernorSelfDelegation() string { + if m != nil { + return m.MinGovernorSelfDelegation + } + return "" +} + // Governor defines a governor, together with the total amount of delegated // validator's bond shares for a set amount of validators. When a delegator // delegates a percentage of its x/gov power to a governor, the resulting @@ -1282,127 +1293,129 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1909 bytes of a gzipped FileDescriptorProto + // 1937 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0x1b, 0xc7, - 0xf5, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x4a, 0xd4, 0x6a,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4c, 0xe1, 0xd8, 0x8f, 0x41, 0x89, - 0xc6, 0x6b, 0x5c, 0xba, 0xa4, 0xae, 0x15, 0x49, 0x0c, 0x97, 0x98, 0xe1, 0x65, 0xc2, 0xb0, 0x8d, - 0x19, 0x36, 0x80, 0x17, 0xae, 0x39, 0x1a, 0xa3, 0x75, 0x58, 0x60, 0x0e, 0xeb, 0x12, 0x23, 0x25, - 0x26, 0xe4, 0x00, 0x19, 0xb0, 0x18, 0xf4, 0x5d, 0x17, 0xfb, 0x43, 0x63, 0x59, 0xc8, 0xc3, 0x21, - 0xfa, 0x11, 0x24, 0x65, 0x4f, 0x10, 0xdf, 0x58, 0xb9, 0xa0, 0x09, 0x46, 0xc8, 0xfc, 0xaf, 0x34, - 0x48, 0x45, 0x6b, 0xe0, 0xff, 0x61, 0x69, 0x48, 0x02, 0xab, 0x2d, 0xda, 0x42, 0x3b, 0xd3, 0xa3, - 0x55, 0x8f, 0x99, 0xc9, 0x21, 0x09, 0xf6, 0xf9, 0x3c, 0xba, 0x07, 0x2b, 0xb8, 0x15, 0x30, 0xec, - 0x78, 0x8a, 0x10, 0x9b, 0x49, 0x58, 0x56, 0x20, 0x49, 0xfa, 0x08, 0x92, 0x1e, 0x55, 0xf8, 0xf9, - 0x99, 0xf8, 0x45, 0x8f, 0x0a, 0x68, 0xfe, 0xf7, 0x1a, 0xc4, 0xf9, 0x26, 0x72, 0xf1, 0x16, 0x50, - 0x80, 0x85, 0x01, 0x65, 0xe4, 0xe2, 0xf6, 0x97, 0x30, 0xf4, 0x29, 0x2c, 0xca, 0x1d, 0x29, 0x30, - 0xe2, 0xa2, 0xaa, 0xf2, 0xd3, 0xad, 0x72, 0x76, 0xc3, 0x33, 0x43, 0xca, 0x44, 0xda, 0x16, 0x26, - 0xd3, 0xf6, 0x30, 0x9e, 0x9c, 0xd7, 0xe3, 0xf9, 0x3f, 0x6a, 0x70, 0xfd, 0xb3, 0x3e, 0xf5, 0xfb, - 0xee, 0xfe, 0x31, 0x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1b, 0x41, 0x1a, 0xee, 0x45, 0xbf, 0xfa, 0x7b, 0x56, 0x33, 0x40, 0x92, 0xb8, + 0x19, 0x3d, 0x82, 0x94, 0x5a, 0x5f, 0x93, 0xb8, 0x96, 0xd4, 0x89, 0x5d, 0x51, 0x27, 0xa9, 0x98, + 0x65, 0xd7, 0x12, 0x5a, 0x15, 0x58, 0x62, 0x94, 0xe1, 0x8e, 0xa9, 0xec, 0xfa, 0xfc, 0x35, 0xa2, + 0xb4, 0x28, 0xa8, 0x41, 0x0a, 0x3d, 0x86, 0x95, 0x3e, 0x65, 0xb6, 0xdb, 0x36, 0x7d, 0x86, 0x3d, + 0x35, 0xbf, 0xf8, 0x15, 0xfd, 0x5a, 0x96, 0xd4, 0x3a, 0x67, 0x0a, 0xc7, 0x7e, 0x0a, 0xca, 0x34, + 0x9a, 0xe3, 0xc2, 0x15, 0xb5, 0x96, 0x24, 0x31, 0x98, 0x62, 0x9a, 0xa7, 0x09, 0xc3, 0x16, 0x66, + 0x58, 0x07, 0x9e, 0xb8, 0xc6, 0xb0, 0x8d, 0x56, 0x61, 0x8e, 0xd9, 0xac, 0x43, 0xf4, 0x84, 0xe8, + 0x90, 0x0d, 0xa4, 0xc3, 0xbc, 0xdf, 0x73, 0x1c, 0xec, 0x0d, 0xf4, 0x45, 0x61, 0x0f, 0x9a, 0xe8, + 0x27, 0x10, 0x97, 0x35, 0x41, 0x3c, 0x7d, 0xe9, 0x92, 0x22, 0x18, 0x22, 0x73, 0xbf, 0xd1, 0x20, + 0x11, 0xce, 0x81, 0x1f, 0xc3, 0xc2, 0x80, 0xf8, 0x66, 0x4b, 0x94, 0x85, 0x76, 0xae, 0x46, 0x2b, + 0x2e, 0x33, 0xe2, 0x03, 0xe2, 0xef, 0xf3, 0x7e, 0x74, 0x1f, 0x96, 0x70, 0xd3, 0x67, 0xd8, 0x76, + 0x15, 0x21, 0x32, 0x95, 0xb0, 0xa8, 0x40, 0x92, 0xf4, 0x21, 0xc4, 0x5d,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 0xe5, 0x2c, 0xb1, 0xdb, 0x22, 0xa3, 0x62, 0x41, 0x65, + 0x58, 0x51, 0xb5, 0x36, 0x39, 0xd3, 0xff, 0xf1, 0x5a, 0x48, 0x0d, 0x29, 0x81, 0xd3, 0xd3, 0xd6, + 0x2b, 0x32, 0x75, 0xbd, 0x46, 0x4e, 0x6d, 0x3f, 0x05, 0x08, 0xfd, 0x6e, 0xb2, 0x0e, 0xb7, 0x8f, + 0xaa, 0x8d, 0xb2, 0x59, 0xad, 0x35, 0x2a, 0xd5, 0x43, 0xf3, 0xc9, 0x61, 0xbd, 0x56, 0xde, 0xaf, + 0x3c, 0xac, 0x94, 0x4b, 0xa9, 0x19, 0x74, 0x03, 0x96, 0xc3, 0x9d, 0x9f, 0x97, 0xeb, 0x29, 0x0d, + 0xdd, 0x86, 0x1b, 0x61, 0x63, 0x71, 0xaf, 0xde, 0x28, 0x56, 0x0e, 0x53, 0x11, 0x84, 0x20, 0x19, + 0xee, 0x38, 0xac, 0xa6, 0x66, 0xb7, 0xff, 0xac, 0x41, 0x72, 0xfc, 0xb7, 0x02, 0x94, 0x85, 0xf5, + 0x9a, 0x51, 0xad, 0x55, 0xeb, 0xc5, 0xc7, 0x66, 0xbd, 0x51, 0x6c, 0x3c, 0xa9, 0x4f, 0x8c, 0x9a, + 0x83, 0xcc, 0x24, 0xa0, 0x54, 0xae, 0x55, 0xeb, 0x95, 0x86, 0x59, 0x2b, 0x1b, 0x95, 0x6a, 0x29, + 0xa5, 0xa1, 0xf7, 0x60, 0x63, 0x12, 0x73, 0x54, 0x6d, 0x54, 0x0e, 0x0f, 0x02, 0x48, 0x04, 0xa5, + 0xe1, 0xd6, 0x24, 0xa4, 0x56, 0xac, 0xd7, 0xcb, 0xa5, 0xd4, 0x2c, 0xba, 0x03, 0xfa, 0x64, 0x9f, + 0x51, 0x7e, 0x54, 0xde, 0x6f, 0x94, 0x4b, 0xa9, 0xe8, 0x34, 0xe6, 0xc3, 0x62, 0xe5, 0x71, 0xb9, + 0x94, 0x9a, 0xdb, 0xfe, 0xad, 0x06, 0xc9, 0xf1, 0x1d, 0x09, 0x7d, 0x04, 0xeb, 0x07, 0xd5, 0xa3, + 0xb2, 0x71, 0x58, 0x35, 0xa6, 0x4e, 0x28, 0xbd, 0xfc, 0xec, 0xf9, 0x66, 0xe2, 0x89, 0xeb, 0x77, + 0x49, 0xcb, 0x3e, 0xb6, 0x09, 0xbf, 0x37, 0xdd, 0x9a, 0x64, 0x14, 0xf7, 0x1b, 0x95, 0xa3, 0x72, + 0x4a, 0x4b, 0xc3, 0xb3, 0xe7, 0x9b, 0xb1, 0x62, 0x8b, 0xd9, 0x7d, 0x82, 0xb6, 0x41, 0x9f, 0xc4, + 0x55, 0x0e, 0x15, 0x32, 0x92, 0x5e, 0x7c, 0xf6, 0x7c, 0x33, 0x5e, 0x71, 0xb1, 0xc0, 0xa6, 0xa3, + 0x5f, 0xfe, 0x2e, 0x33, 0xb3, 0x77, 0xf0, 0xcd, 0x9b, 0x8c, 0xf6, 0xed, 0x9b, 0x8c, 0xf6, 0x8f, + 0x37, 0x19, 0xed, 0xab, 0xb7, 0x99, 0x99, 0x6f, 0xdf, 0x66, 0x66, 0xfe, 0xf2, 0x36, 0x33, 0xf3, + 0x8b, 0x9d, 0xb6, 0xcd, 0x4e, 0x7a, 0xcd, 0x7c, 0x8b, 0x3a, 0x05, 0xb5, 0x49, 0xee, 0x9c, 0xf4, + 0x9a, 0xc1, 0x77, 0xe1, 0x4c, 0xfc, 0x72, 0xc8, 0x06, 0x5d, 0xe2, 0x17, 0xfa, 0xbb, 0xcd, 0x98, + 0xd8, 0x8d, 0xee, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0x23, 0x13, 0x27, 0x7c, 0x58, 0x14, 0x00, + 0x00, } func (this *GovernorDescription) Equal(that interface{}) bool { @@ -1974,6 +1987,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.MinGovernorSelfDelegation) > 0 { + i -= len(m.MinGovernorSelfDelegation) + copy(dAtA[i:], m.MinGovernorSelfDelegation) + i = encodeVarintGov(dAtA, i, uint64(len(m.MinGovernorSelfDelegation))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } if m.GovernorStatusChangePeriod != nil { n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.GovernorStatusChangePeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.GovernorStatusChangePeriod):]) if err9 != nil { @@ -2671,6 +2693,10 @@ func (m *Params) Size() (n int) { l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.GovernorStatusChangePeriod) n += 2 + l + sovGov(uint64(l)) } + l = len(m.MinGovernorSelfDelegation) + if l > 0 { + n += 2 + l + sovGov(uint64(l)) + } return n } @@ -4931,6 +4957,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinGovernorSelfDelegation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinGovernorSelfDelegation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 1143ba09f..56c4f5729 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -32,10 +32,11 @@ var ( DefaultBurnVoteQuorom = false // set to false to replicate behavior of when this change was made (0.47) DefaultMinDepositRatio = sdk.NewDecWithPrec(1, 2) // NOTE: backport from v50 - DefaultQuorumTimeout time.Duration = DefaultVotingPeriod - (time.Hour * 24 * 1) // disabled by default (DefaultQuorumCheckCount must be set to a non-zero value to enable) - DefaultMaxVotingPeriodExtension time.Duration = DefaultVotingPeriod - DefaultQuorumTimeout // disabled by default (DefaultQuorumCheckCount must be set to a non-zero value to enable) - DefaultQuorumCheckCount uint64 = 0 // disabled by default (0 means no check) - DefaultMaxGovernors uint64 = 100 + DefaultQuorumTimeout time.Duration = DefaultVotingPeriod - (time.Hour * 24 * 1) // disabled by default (DefaultQuorumCheckCount must be set to a non-zero value to enable) + DefaultMaxVotingPeriodExtension time.Duration = DefaultVotingPeriod - DefaultQuorumTimeout // disabled by default (DefaultQuorumCheckCount must be set to a non-zero value to enable) + DefaultQuorumCheckCount uint64 = 0 // disabled by default (0 means no check) + DefaultMaxGovernors uint64 = 100 + DefaultMinGovernorSelfDelegation = sdk.NewInt(1000_000000) ) // Deprecated: NewDepositParams creates a new DepositParams object @@ -67,7 +68,7 @@ func NewParams( quorum, threshold, constitutionAmendmentQuorum, constitutionAmendmentThreshold, lawQuorum, lawThreshold, minInitialDepositRatio string, burnProposalDeposit, burnVoteQuorum bool, minDepositRatio string, quorumTimeout, maxVotingPeriodExtension time.Duration, quorumCheckCount uint64, - maxGovernors uint64, governorStatusChangePeriod time.Duration, + maxGovernors uint64, governorStatusChangePeriod time.Duration, minGovernorSelfDelegation string, ) Params { return Params{ MinDeposit: minDeposit, @@ -88,6 +89,7 @@ func NewParams( QuorumCheckCount: quorumCheckCount, MaxGovernors: maxGovernors, GovernorStatusChangePeriod: &governorStatusChangePeriod, + MinGovernorSelfDelegation: minGovernorSelfDelegation, } } @@ -112,6 +114,7 @@ func DefaultParams() Params { DefaultQuorumCheckCount, DefaultMaxGovernors, DefaultGovernorStatusChangePeriod, + DefaultMinGovernorSelfDelegation.String(), ) } @@ -260,5 +263,13 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("governor status change period must be positive: %d", p.GovernorStatusChangePeriod) } + minGovernorSelfDelegation, ok := sdk.NewIntFromString(p.MinGovernorSelfDelegation) + if !ok { + return fmt.Errorf("invalid minimum governor self delegation: %s", p.MinGovernorSelfDelegation) + } + if minGovernorSelfDelegation.IsNegative() { + return fmt.Errorf("minimum governor self delegation must be positive: %s", minGovernorSelfDelegation) + } + return nil } From 86031e615134a2f02175c5ab17adf552e1c1d023 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:21:35 +0200 Subject: [PATCH 30/43] governance delegations invariant --- x/gov/keeper/delegation.go | 16 ++++++++ x/gov/keeper/invariants.go | 79 +++++++++++++++++++++++++++++++++++--- 2 files changed, 90 insertions(+), 5 deletions(-) diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index d733bf009..77c779f0a 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -93,6 +93,22 @@ func (k Keeper) IterateGovernorValShares(ctx sdk.Context, governorAddr types.Gov } } +// IterateGovernorDelegations iterates over all governor delegations +func (k Keeper) IterateGovernorDelegations(ctx sdk.Context, governorAddr types.GovernorAddress, cb func(index int64, delegation v1.GovernanceDelegation) (stop bool)) { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.GovernanceDelegationsByGovernorKey(governorAddr, []byte{})) + defer iterator.Close() + + for i := int64(0); iterator.Valid(); iterator.Next() { + var delegation v1.GovernanceDelegation + k.cdc.MustUnmarshal(iterator.Value(), &delegation) + if cb(i, delegation) { + break + } + i++ + } +} + // GetGovernorValSharesByValidator gets all governor validator shares for a specific validator func (k Keeper) GetGovernorValSharesByValidator(ctx sdk.Context, validatorAddr sdk.ValAddress) []v1.GovernorValShares { store := ctx.KVStore(k.storeKey) diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index 494ebbcb0..45891f2e1 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -6,6 +6,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" @@ -15,6 +16,7 @@ import ( func RegisterInvariants(ir sdk.InvariantRegistry, keeper *Keeper, bk types.BankKeeper) { ir.RegisterRoute(types.ModuleName, "module-account", ModuleAccountInvariant(keeper, bk)) ir.RegisterRoute(types.ModuleName, "governors-voting-power", GovernorsVotingPowerInvariant(keeper, keeper.sk)) + ir.RegisterRoute(types.ModuleName, "governors-delegations", GovernorsDelegationsInvariant(keeper, keeper.sk)) } // AllInvariants runs all invariants of the governance module @@ -69,14 +71,14 @@ func GovernorsVotingPowerInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I keeper.IterateGovernorValShares(ctx, governor.GetAddress(), func(index int64, shares v1.GovernorValShares) bool { validatorAddr, err := sdk.ValAddressFromBech32(shares.ValidatorAddress) if err != nil { - invariantStr = sdk.FormatInvariant(types.ModuleName, "governor %s voting power", + invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s voting power", governor.GetAddress().String()), fmt.Sprintf("failed to parse validator address %s: %v", shares.ValidatorAddress, err)) fail = true return true } validator, found := sk.GetValidator(ctx, validatorAddr) if !found { - invariantStr = sdk.FormatInvariant(types.ModuleName, "governor %s voting power", + invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s voting power", governor.GetAddress().String()), fmt.Sprintf("validator %s not found", validatorAddr.String())) fail = true return true @@ -95,10 +97,77 @@ func GovernorsVotingPowerInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I return broken // break on first broken invariant }) if !fail { - invariantStr = sdk.FormatInvariant(types.ModuleName, "governor %s voting power", - fmt.Sprintf("\texpected %s voting power: %s\n\tactual voting power: %s\n", - brokenGovernorAddr, expectedVotingPower, actualVotingPower)) + invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s voting power", brokenGovernorAddr), + fmt.Sprintf("\texpected voting power: %s\n\tactual voting power: %s\n", expectedVotingPower, actualVotingPower)) } return invariantStr, broken } } + +// GovernorsDelegationsInvariant checks that the validator shares resulting from all +// governor delegations actually correspond to the stored governor validator shares +func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.Invariant { + return func(ctx sdk.Context) (string, bool) { + var ( + broken bool = false + invariantStr string + ) + + keeper.IterateGovernors(ctx, func(index int64, governor v1.GovernorI) bool { + // check that if governor is active, it has a valid governance self-delegation + if governor.IsActive() { + if del, ok := keeper.GetGovernanceDelegation(ctx, sdk.AccAddress(governor.GetAddress())); !ok || !governor.GetAddress().Equals(types.MustGovernorAddressFromBech32(del.GovernorAddress)) { + invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s delegations", governor.GetAddress().String()), + "active governor without governance self-delegation") + broken = true + return true + } + } + + valShares := make(map[string]sdk.Dec) + keeper.IterateGovernorDelegations(ctx, governor.GetAddress(), func(index int64, delegation v1.GovernanceDelegation) bool { + delAddr := sdk.MustAccAddressFromBech32(delegation.DelegatorAddress) + keeper.sk.IterateDelegations(ctx, delAddr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { + validatorAddr := delegation.GetValidatorAddr() + shares := delegation.GetShares() + if _, ok := valShares[validatorAddr.String()]; !ok { + valShares[validatorAddr.String()] = sdk.ZeroDec() + } + valShares[validatorAddr.String()] = valShares[validatorAddr.String()].Add(shares) + return false + }) + return false + }) + + for valAddrStr, shares := range valShares { + validatorAddr, _ := sdk.ValAddressFromBech32(valAddrStr) + valShares, ok := keeper.GetGovernorValShares(ctx, governor.GetAddress(), validatorAddr) + if !ok { + invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s delegations", governor.GetAddress().String()), + fmt.Sprintf("validator %s shares not found", valAddrStr)) + broken = true + return true + } + if !valShares.Shares.Equal(shares) { + invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s delegations", governor.GetAddress().String()), + fmt.Sprintf("stored shares %s for validator %s do not match actual shares %s", valShares.Shares, valAddrStr, shares)) + broken = true + return true + } + } + + keeper.IterateGovernorValShares(ctx, governor.GetAddress(), func(index int64, shares v1.GovernorValShares) bool { + if _, ok := valShares[shares.ValidatorAddress]; !ok && shares.Shares.GT(sdk.ZeroDec()) { + invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s delegations", governor.GetAddress().String()), + fmt.Sprintf("non-zero (%s) shares stored for validator %s where there should be none", shares.Shares, shares.ValidatorAddress)) + broken = true + return true + } + return false + }) + + return broken + }) + return invariantStr, broken + } +} From 3a9f71f6ad0cce228e16341d7487062721b99efa Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:27:06 +0200 Subject: [PATCH 31/43] fmt pass --- x/gov/keeper/governor.go | 6 ++++-- x/gov/keeper/invariants.go | 2 +- x/gov/keeper/msg_server.go | 6 +++--- x/gov/simulation/genesis.go | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index 50a2eade4..5b6461816 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -1,6 +1,8 @@ package keeper import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -117,7 +119,7 @@ func (k Keeper) IterateMaxGovernorsByGovernancePower(ctx sdk.Context, cb func(in } } -func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorAddress) (bondedTokens sdk.Int) { +func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorAddress) (bondedTokens math.Int) { bondedTokens = sdk.ZeroInt() addr := sdk.AccAddress(govAddr) k.sk.IterateDelegations(ctx, addr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { @@ -134,7 +136,7 @@ func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorA } func (k Keeper) ValidateGovernorMinSelfDelegation(ctx sdk.Context, governor v1.Governor) bool { - minGovernorSelfDelegation, _ := sdk.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) + minGovernorSelfDelegation, _ := math.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) bondedTokens := k.getGovernorBondedTokens(ctx, governor.GetAddress()) delAddr := sdk.AccAddress(governor.GetAddress()) diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index 45891f2e1..2955ed829 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -109,7 +109,7 @@ func GovernorsVotingPowerInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { var ( - broken bool = false + broken = false invariantStr string ) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 55a43ac21..087d10318 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -5,11 +5,11 @@ import ( "fmt" "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors1 "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/atomone-hub/atomone/x/gov/types" govtypes "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" "github.com/atomone-hub/atomone/x/gov/types/v1beta1" @@ -223,10 +223,10 @@ func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovern return nil, err } - minSelfDelegation, _ := sdk.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) + minSelfDelegation, _ := math.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) bondedTokens := k.getGovernorBondedTokens(ctx, govAddr) if bondedTokens.LT(minSelfDelegation) { - types.ErrInsufficientGovernorDelegation.Wrapf("minimum self-delegation required: %s, total bonded tokens: %s", minSelfDelegation, bondedTokens) + return nil, govtypes.ErrInsufficientGovernorDelegation.Wrapf("minimum self-delegation required: %s, total bonded tokens: %s", minSelfDelegation, bondedTokens) } governor, err := v1.NewGovernor(govAddr.String(), msg.Description, ctx.BlockTime()) diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 4306acda8..10aa98c39 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -104,8 +104,8 @@ func GenQuorumCheckCount(r *rand.Rand) uint64 { } // GenMinGovernorSelfDelegation returns a randomized MinGovernorSelfDelegation -func GenMinGovernorSelfDelegation(r *rand.Rand) sdk.Int { - return sdk.NewInt(int64(simulation.RandIntBetween(r, 1000, 10000000))) +func GenMinGovernorSelfDelegation(r *rand.Rand) math.Int { + return math.NewInt(int64(simulation.RandIntBetween(r, 1000, 10000000))) } // RandomizedGenState generates a random GenesisState for gov @@ -194,7 +194,7 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { governorStatusChangePeriod = GenDepositParamsDepositPeriod(r) }, ) - var minGovernorSelfDelegation sdk.Int + var minGovernorSelfDelegation math.Int simState.AppParams.GetOrGenerate( simState.Cdc, MinGovernorSelfDelegation, &minGovernorSelfDelegation, simState.Rand, func(r *rand.Rand) { minGovernorSelfDelegation = GenMinGovernorSelfDelegation(r) }, From b8eac36e1a3123cbad10c56a483aa3f83af9cf8d Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 09:47:00 +0200 Subject: [PATCH 32/43] use math --- x/gov/types/v1/params.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 56c4f5729..3350bbdba 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -263,7 +263,7 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("governor status change period must be positive: %d", p.GovernorStatusChangePeriod) } - minGovernorSelfDelegation, ok := sdk.NewIntFromString(p.MinGovernorSelfDelegation) + minGovernorSelfDelegation, ok := math.NewIntFromString(p.MinGovernorSelfDelegation) if !ok { return fmt.Errorf("invalid minimum governor self delegation: %s", p.MinGovernorSelfDelegation) } From 9bcbd0f8477307923bcbfe1ef6345db5360ca116 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:50:46 +0200 Subject: [PATCH 33/43] remove iteration over map --- x/gov/keeper/invariants.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index 2955ed829..b90e5fb93 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -4,6 +4,7 @@ package keeper import ( "fmt" + "sort" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -139,7 +140,16 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I return false }) - for valAddrStr, shares := range valShares { + // Extract keys and sort them + // since the order of the keys in the map is not guaranteed + keys := make([]string, 0, len(valShares)) + for key := range valShares { + keys = append(keys, key) + } + sort.Strings(keys) + + for _, valAddrStr := range keys { + shares := valShares[valAddrStr] validatorAddr, _ := sdk.ValAddressFromBech32(valAddrStr) valShares, ok := keeper.GetGovernorValShares(ctx, governor.GetAddress(), validatorAddr) if !ok { From 8daaffb57f3049a6f677ee7d1c855867a1e23d60 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:53:10 +0200 Subject: [PATCH 34/43] more efficient --- x/gov/keeper/invariants.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index b90e5fb93..bbb1a6c21 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -4,7 +4,6 @@ package keeper import ( "fmt" - "sort" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -126,6 +125,7 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I } valShares := make(map[string]sdk.Dec) + valSharesKeys := make([]string, 0) keeper.IterateGovernorDelegations(ctx, governor.GetAddress(), func(index int64, delegation v1.GovernanceDelegation) bool { delAddr := sdk.MustAccAddressFromBech32(delegation.DelegatorAddress) keeper.sk.IterateDelegations(ctx, delAddr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { @@ -135,20 +135,13 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I valShares[validatorAddr.String()] = sdk.ZeroDec() } valShares[validatorAddr.String()] = valShares[validatorAddr.String()].Add(shares) + valSharesKeys = append(valSharesKeys, validatorAddr.String()) return false }) return false }) - // Extract keys and sort them - // since the order of the keys in the map is not guaranteed - keys := make([]string, 0, len(valShares)) - for key := range valShares { - keys = append(keys, key) - } - sort.Strings(keys) - - for _, valAddrStr := range keys { + for _, valAddrStr := range valSharesKeys { shares := valShares[valAddrStr] validatorAddr, _ := sdk.ValAddressFromBech32(valAddrStr) valShares, ok := keeper.GetGovernorValShares(ctx, governor.GetAddress(), validatorAddr) From 26ff811af04527409a1b623d1f2f7f2e15fd5d70 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:54:19 +0200 Subject: [PATCH 35/43] fix --- x/gov/keeper/invariants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index bbb1a6c21..e4b264b39 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -133,9 +133,9 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I shares := delegation.GetShares() if _, ok := valShares[validatorAddr.String()]; !ok { valShares[validatorAddr.String()] = sdk.ZeroDec() + valSharesKeys = append(valSharesKeys, validatorAddr.String()) } valShares[validatorAddr.String()] = valShares[validatorAddr.String()].Add(shares) - valSharesKeys = append(valSharesKeys, validatorAddr.String()) return false }) return false From ec48fe53446365feeda1ef6fefa8fe4f44ab1b65 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:55:32 +0200 Subject: [PATCH 36/43] remove ambiguity --- x/gov/keeper/invariants.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index e4b264b39..41d0f4813 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -144,14 +144,14 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I for _, valAddrStr := range valSharesKeys { shares := valShares[valAddrStr] validatorAddr, _ := sdk.ValAddressFromBech32(valAddrStr) - valShares, ok := keeper.GetGovernorValShares(ctx, governor.GetAddress(), validatorAddr) + vs, ok := keeper.GetGovernorValShares(ctx, governor.GetAddress(), validatorAddr) if !ok { invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s delegations", governor.GetAddress().String()), fmt.Sprintf("validator %s shares not found", valAddrStr)) broken = true return true } - if !valShares.Shares.Equal(shares) { + if !vs.Shares.Equal(shares) { invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s delegations", governor.GetAddress().String()), fmt.Sprintf("stored shares %s for validator %s do not match actual shares %s", valShares.Shares, valAddrStr, shares)) broken = true From 180e1c1ae14292361c1acc56ad7be28439065a32 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:56:34 +0200 Subject: [PATCH 37/43] ... --- x/gov/keeper/invariants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index 41d0f4813..f4e644cd9 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -153,7 +153,7 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I } if !vs.Shares.Equal(shares) { invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s delegations", governor.GetAddress().String()), - fmt.Sprintf("stored shares %s for validator %s do not match actual shares %s", valShares.Shares, valAddrStr, shares)) + fmt.Sprintf("stored shares %s for validator %s do not match actual shares %s", vs.Shares, valAddrStr, shares)) broken = true return true } From e1478271f749c7d22c792fa9ab9ef4a25a5313e4 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:11:13 +0200 Subject: [PATCH 38/43] various fixes --- x/gov/keeper/msg_server.go | 2 +- x/gov/keeper/tally.go | 12 ++++++++---- x/gov/types/v1/tally.go | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 087d10318..3c297ab99 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -288,7 +288,7 @@ func (k msgServer) UpdateGovernorStatus(goCtx context.Context, msg *v1.MsgUpdate // Ensure the governor has been in the current status for the required period governorStatusChangePeriod := *k.GetParams(ctx).GovernorStatusChangePeriod changeTime := ctx.BlockTime() - if governor.LastStatusChangeTime.Add(governorStatusChangePeriod).Before(changeTime) { + if governor.LastStatusChangeTime.Add(governorStatusChangePeriod).After(changeTime) { return nil, govtypes.ErrGovernorStatusChangePeriod.Wrapf("last status change time: %s, need to wait until: %s", governor.LastStatusChangeTime, governor.LastStatusChangeTime.Add(governorStatusChangePeriod)) } diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 18e782430..418924f58 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -150,6 +150,8 @@ func (keeper Keeper) tallyVotes( if hasGovernor { if gi, ok := currGovernors[gd.GovernorAddress]; ok { governor = gi + } else { + hasGovernor = false } } @@ -220,10 +222,12 @@ func (keeper Keeper) tallyVotes( sharesAfterDeductions := shares.Sub(gov.ValSharesDeductions[valAddrStr]) votingPower := sharesAfterDeductions.MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares()) - for _, option := range gov.Vote { - weight, _ := sdk.NewDecFromStr(option.Weight) - subPower := votingPower.Mul(weight) - results[option.Option] = results[option.Option].Add(subPower) + if isFinal { + for _, option := range gov.Vote { + weight, _ := sdk.NewDecFromStr(option.Weight) + subPower := votingPower.Mul(weight) + results[option.Option] = results[option.Option].Add(subPower) + } } totalVotingPower = totalVotingPower.Add(votingPower) } diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index 2755339a4..2d623eb2a 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -20,14 +20,16 @@ type GovernorGovInfo struct { // NewGovernorGovInfo creates a GovernorGovInfo instance func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValShares, options WeightedVoteOptions, votingPower sdk.Dec) GovernorGovInfo { valSharesMap := make(map[string]sdk.Dec) + valSharesDeductionsMap := make(map[string]sdk.Dec) for _, valShare := range valShares { valSharesMap[valShare.ValidatorAddress] = valShare.Shares + valSharesDeductionsMap[valShare.ValidatorAddress] = math.LegacyZeroDec() } return GovernorGovInfo{ Address: address, ValShares: valSharesMap, - ValSharesDeductions: make(map[string]sdk.Dec), + ValSharesDeductions: valSharesDeductionsMap, Vote: options, VotingPower: votingPower, } From 48f45bed33410ea05813a809e642ccfbe7aa79b4 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:36:47 +0200 Subject: [PATCH 39/43] fix error codes --- x/gov/types/errors.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index abb3c7475..2891a47e7 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -22,15 +22,15 @@ var ( ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 140, "signal message is invalid") //nolint:staticcheck ErrMetadataTooLong = sdkerrors.Register(ModuleName, 150, "metadata too long") //nolint:staticcheck ErrMinDepositTooSmall = sdkerrors.Register(ModuleName, 160, "minimum deposit is too small") //nolint:staticcheck - ErrInvalidConstitutionAmendment = sdkerrors.Register(ModuleName, 170, "invalid constitution amendment") - ErrGovernorExists = sdkerrors.Register(ModuleName, 170, "governor already exists") //nolint:staticcheck - ErrUnknownGovernor = sdkerrors.Register(ModuleName, 180, "unknown governor") //nolint:staticcheck - ErrInvalidGovernorStatus = sdkerrors.Register(ModuleName, 190, "invalid governor status") //nolint:staticcheck - ErrGovernanceDelegationExists = sdkerrors.Register(ModuleName, 200, "governance delegation already exists") //nolint:staticcheck - ErrUnknownGovernanceDelegation = sdkerrors.Register(ModuleName, 210, "unknown governance delegation") //nolint:staticcheck - ErrInvalidGovernanceDescription = sdkerrors.Register(ModuleName, 220, "invalid governance description") //nolint:staticcheck - ErrDelegatorIsGovernor = sdkerrors.Register(ModuleName, 230, "cannot delegate, delegator is an active governor") //nolint:staticcheck - ErrGovernorStatusEqual = sdkerrors.Register(ModuleName, 240, "cannot change governor status to the same status") //nolint:staticcheck - ErrGovernorStatusChangePeriod = sdkerrors.Register(ModuleName, 250, "governor status change period not elapsed") //nolint:staticcheck - ErrInsufficientGovernorDelegation = sdkerrors.Register(ModuleName, 260, "insufficient governor self-delegation") //nolint:staticcheck + ErrInvalidConstitutionAmendment = sdkerrors.Register(ModuleName, 170, "invalid constitution amendment") //nolint:staticcheck + ErrGovernorExists = sdkerrors.Register(ModuleName, 300, "governor already exists") //nolint:staticcheck + ErrUnknownGovernor = sdkerrors.Register(ModuleName, 310, "unknown governor") //nolint:staticcheck + ErrInvalidGovernorStatus = sdkerrors.Register(ModuleName, 320, "invalid governor status") //nolint:staticcheck + ErrGovernanceDelegationExists = sdkerrors.Register(ModuleName, 330, "governance delegation already exists") //nolint:staticcheck + ErrUnknownGovernanceDelegation = sdkerrors.Register(ModuleName, 340, "unknown governance delegation") //nolint:staticcheck + ErrInvalidGovernanceDescription = sdkerrors.Register(ModuleName, 350, "invalid governance description") //nolint:staticcheck + ErrDelegatorIsGovernor = sdkerrors.Register(ModuleName, 360, "cannot delegate, delegator is an active governor") //nolint:staticcheck + ErrGovernorStatusEqual = sdkerrors.Register(ModuleName, 370, "cannot change governor status to the same status") //nolint:staticcheck + ErrGovernorStatusChangePeriod = sdkerrors.Register(ModuleName, 380, "governor status change period not elapsed") //nolint:staticcheck + ErrInsufficientGovernorDelegation = sdkerrors.Register(ModuleName, 390, "insufficient governor self-delegation") //nolint:staticcheck ) From 0659b9d116e95a6b6f1d567af3951d7370f35e2c Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:55:44 +0200 Subject: [PATCH 40/43] add alternative for tallying governors VP --- x/gov/keeper/tally.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 418924f58..6fdde55a0 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -232,6 +232,25 @@ func (keeper Keeper) tallyVotes( totalVotingPower = totalVotingPower.Add(votingPower) } } + + /* + // Alternative to the for loop above. It assumes a VotingPowerDeductions + // field in the GovernorGovInfo struct that is updated when iterating over votes + // instead of updating the ValSharesDeductions map. + // This also assumes that gov.VotingPower is always accurate, which needs to be fully verified. + // However, in such a case, this would be the more efficient way to calculate the voting power. + + votingPower := gov.VotingPower.Sub(gov.VotingPowerDeductions)) + if isFinal { + for _, option := range gov.Vote { + weight, _ := sdk.NewDecFromStr(option.Weight) + subPower := votingPower.Mul(weight) + results[option.Option] = results[option.Option].Add(subPower) + } + } + totalVotingPower = totalVotingPower.Add(votingPower) + */ + } return totalVotingPower, results } From 8b79c438ef3de76a0bc03af8924ca54f627e0136 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:38:53 +0200 Subject: [PATCH 41/43] tally results updated only once only per voter --- x/gov/keeper/tally.go | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 6fdde55a0..42e7f022b 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -158,19 +158,11 @@ func (keeper Keeper) tallyVotes( // iterate over all delegations from voter keeper.sk.IterateDelegations(ctx, voter, func(index int64, delegation stakingtypes.DelegationI) (stop bool) { valAddrStr := delegation.GetValidatorAddr().String() + votingPower := math.LegacyZeroDec() if val, ok := currValidators[valAddrStr]; ok { // delegation shares * bonded / total shares - votingPower := delegation.GetShares().MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares()) - - if isFinal { - for _, option := range vote.Options { - weight, _ := math.LegacyNewDecFromStr(option.Weight) - subPower := votingPower.Mul(weight) - results[option.Option] = results[option.Option].Add(subPower) - } - } - totalVotingPower = totalVotingPower.Add(votingPower) + votingPower = votingPower.Add(delegation.GetShares().MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares())) // remove the delegation shares from the governor if hasGovernor { @@ -178,6 +170,15 @@ func (keeper Keeper) tallyVotes( } } + totalVotingPower = totalVotingPower.Add(votingPower) + if isFinal { + for _, option := range vote.Options { + weight, _ := math.LegacyNewDecFromStr(option.Weight) + subPower := votingPower.Mul(weight) + results[option.Option] = results[option.Option].Add(subPower) + } + } + return false }) @@ -218,19 +219,19 @@ func (keeper Keeper) tallyVotes( // delegated to them and their shares were deducted when iterating over votes // we don't need to handle special cases. for valAddrStr, shares := range gov.ValShares { + votingPower := math.LegacyZeroDec() if val, ok := currValidators[valAddrStr]; ok { sharesAfterDeductions := shares.Sub(gov.ValSharesDeductions[valAddrStr]) - votingPower := sharesAfterDeductions.MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares()) - - if isFinal { - for _, option := range gov.Vote { - weight, _ := sdk.NewDecFromStr(option.Weight) - subPower := votingPower.Mul(weight) - results[option.Option] = results[option.Option].Add(subPower) - } + votingPower = votingPower.Add(sharesAfterDeductions.MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares())) + } + if isFinal { + for _, option := range gov.Vote { + weight, _ := sdk.NewDecFromStr(option.Weight) + subPower := votingPower.Mul(weight) + results[option.Option] = results[option.Option].Add(subPower) } - totalVotingPower = totalVotingPower.Add(votingPower) } + totalVotingPower = totalVotingPower.Add(votingPower) } /* From 1f8e5a9ad31a0148f02ac2cff261e1fc6344e662 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:45:17 +0200 Subject: [PATCH 42/43] ... --- x/gov/keeper/tally.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 42e7f022b..8ae90bb1a 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -218,21 +218,21 @@ func (keeper Keeper) tallyVotes( // As governor are simply voters that need to have 100% of their bonded tokens // delegated to them and their shares were deducted when iterating over votes // we don't need to handle special cases. + votingPower := math.LegacyZeroDec() for valAddrStr, shares := range gov.ValShares { - votingPower := math.LegacyZeroDec() if val, ok := currValidators[valAddrStr]; ok { sharesAfterDeductions := shares.Sub(gov.ValSharesDeductions[valAddrStr]) votingPower = votingPower.Add(sharesAfterDeductions.MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares())) } - if isFinal { - for _, option := range gov.Vote { - weight, _ := sdk.NewDecFromStr(option.Weight) - subPower := votingPower.Mul(weight) - results[option.Option] = results[option.Option].Add(subPower) - } + } + if isFinal { + for _, option := range gov.Vote { + weight, _ := sdk.NewDecFromStr(option.Weight) + subPower := votingPower.Mul(weight) + results[option.Option] = results[option.Option].Add(subPower) } - totalVotingPower = totalVotingPower.Add(votingPower) } + totalVotingPower = totalVotingPower.Add(votingPower) /* // Alternative to the for loop above. It assumes a VotingPowerDeductions From c5e5ce481d5b019d0054c4064a1bff7a3777fb47 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:55:08 +0200 Subject: [PATCH 43/43] fmt --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4f8ae59d2..5e6f8d293 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 google.golang.org/grpc v1.62.1 google.golang.org/protobuf v1.33.0 - gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v2 v2.4.0 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 )