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/70] 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 9c335f52..84e0a4a5 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/70] 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 6ab8bea4..017d749c 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 da89a6a3..b4ba930c 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 1856e844..b1a72a19 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, 0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 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, 0x0a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, 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, 0x8b,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 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, 0xe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, 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 b9585162..628840e7 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, 0x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fe, 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, 0x71, 0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x25, 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, 0x60,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x76, 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/70] 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 84e0a4a5..3d89a558 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 00000000..f5a738ed --- /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 00000000..23db45a4 --- /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 a134a43d..bef21da8 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/70] 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 017d749c..5e4bfc54 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 3d89a558..d65634c9 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 00000000..ca1af36f --- /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 f5a738ed..554dedea 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 b1a72a19..553a01d5 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, 0x32, 0x1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, 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, 0x52, 0xcb,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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, 0xc2, 0x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65, + 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, 0x2e, 0xc9,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e, 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 23db45a4..5b1e445c 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 bef21da8..313c15f0 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/70] 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 5e4bfc54..03a4a5c2 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 b4ba930c..f9002c0a 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 d65634c9..c2b7f8d8 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 ca1af36f..943f94f4 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 554dedea..c6926770 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 553a01d5..44aed8a2 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, 0x48, 0xc8, 0xb1,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 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, - 0xe3, 0x2c, 0x34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, 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, 0x8d, 0x8e, 0xb2, 0x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1, 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, 0x14, 0x30, 0xf7,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15, 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, + 0x03, 0xd2, 0xb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c, + 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 5b1e445c..0adb7f8e 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 313c15f0..622b4817 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/70] ... --- 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 03a4a5c2..9aa13f81 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 943f94f4..7d87ba9b 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 3aebc6c9..504c4f3a 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 c6926770..99962aa0 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 0adb7f8e..080b6afb 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 622b4817..0c6d56bd 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/70] ... --- 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 00000000..4dd3882f --- /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 00000000..3f7bc21f --- /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 c2b7f8d8..b6e6d04c 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 504c4f3a..abc6e789 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 0c6d56bd..938f6d0c 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/70] 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 3f7bc21f..b8b556e7 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 b6e6d04c..52a6d9bd 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 080b6afb..b430373d 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/70] 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 9aa13f81..259a5950 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 b8b556e7..c88c478e 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 52a6d9bd..66877dd3 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 82b78f21..dd11faec 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 44aed8a2..59827199 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, - 0xd9, 0x25, 0x58, 0x98, 0x33, 0x9f, 0x05, 0xa4, 0xd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, 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, 0x2b, 0x40, 0xf1, 0x6d, 0x1e, 0x67, 0x42, 0x21, 0xd0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 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, 0x7c, 0xe9, 0x07, 0x0a, 0xb7, 0xb0, 0x0f, 0x0d,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, 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 ef72de65..e0409480 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/70] 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 09e5efc4..fb769f9b 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 259a5950..dde4229e 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 4dd3882f..7f2344fb 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 c88c478e..a4934330 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 00000000..fbb080c8 --- /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 66877dd3..7f4d765d 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 b486e5da..bb78d19f 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 abc6e789..987fec87 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 00000000..941b17dd --- /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 59827199..c4cfe90a 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, 0xcd, 0x85, 0x12, 0x19, 0x67, 0x0d, 0x57, 0x64, - 0x97, 0x34, 0x8d, 0xf4, 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 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, 0xee, 0xd3, 0x60, 0xd2, 0x08, 0xc6, 0x45, 0x8d, 0x70, - 0x53, 0x34, 0x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x00, } 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 b430373d..4a0b722a 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/70] 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 f9002c0a..e02e712e 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 7f2344fb..554f784f 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 a6f43c81..b25a1169 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 19b41082..882d0640 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 4a0b722a..b4f866a7 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 628840e7..2309bf0f 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, 0xc4, 0xa9, 0x42, 0xc9, 0x21, 0x88, 0xff, 0x01, 0x09, 0xed, 0xfc, 0x58, 0xef, - 0x7a,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 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, 0x59, 0x9b, 0x07, 0x73, 0x43, 0xa6, 0x78, - 0x4f, 0x80, 0x26, 0xb6, 0xc5, 0x76, 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 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, 0x03, 0x12, 0xda, 0x9d, 0x99, 0xf5, + 0xae, 0x77, 0x1d, 0x47, 0x48, 0xe5, 0x62, 0xed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 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, + 0x4f, 0x80, 0x26, 0xb1, 0xc4, 0x76, 0xff, 0x8f, 0xaa, 0xdc, 0x01, 0xd3, 0xfc,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d7, 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/70] 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 3b02fe1f..8c970ab3 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 3492e16a..97885d2c 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/70] ... --- 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 554f784f..8cc0bfb4 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 a4934330..f242581c 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 fbb080c8..594025a5 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 99962aa0..ddd7a74a 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/70] 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 fb769f9b..f9b254a7 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 e02e712e..64f6a9b6 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 594025a5..20a0f022 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 882d0640..ac23e76b 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 633bbb7b..d2d43876 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 941b17dd..acefc2d9 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 b4f866a7..017762df 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 fc4cfda3..613dc56e 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 2309bf0f..360e3e24 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, 0xd9, 0x6c, 0x1a, 0x3b, 0xd9, 0x82, - 0x48, 0x03, 0xde, 0x25, 0x0e, 0x54, 0xc2, 0x8a, 0x10, 0x75, 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x94, 0xb1, 0x85, 0x88, 0x87, 0x5d, 0x82, 0x60, 0x05, 0xcc, - 0x78, 0xdc, 0xb6, 0x67, 0x9b, 0xb2, 0xb4, 0x24, 0xad, 0x5c, 0x69, 0x01, 0x61, 0xba, 0x6f, 0xaa, - 0x4f, 0x24, 0x50, 0x6a, 0x12, 0x6b, 0xfb, 0x10, 0x75, 0x1e, 0x20, 0xcb, 0xe8, 0xf4, 0x37, 0xb1, - 0x4b, 0x91, 0x4b, 0xe1, 0x43, 0x50, 0xe8, 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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, 0x49, 0x4c, 0x9b, 0x4c, - 0x77, 0xcd, 0x4a, 0x9a, 0xa1, 0x06, 0x80, 0x87, 0xfc, 0x0e, 0x72, 0xa9, 0x61, 0x21, 0xf6, 0xa2, - 0x68, 0x14, 0x4f, 0x8e, 0xab, 0x80, 0xb3, 0xd9, 0x42, 0x9d, 0x56, 0x0c, 0x51, 0xff, 0x20, 0x2e, - 0x56, 0xba, 0x9e, 0x40, 0xb6, 0x85, 0x58, 0x67, 0x0d, 0x8b, 0xa0, 0x2e, 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, + // 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, +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d3, 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/70] 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 9052a450..d902fbcf 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 be807bd2..e31d78be 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 240c5fcd..d49cea63 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 8cc0bfb4..4238e503 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 f242581c..f0cbd7c9 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 8314d898..0df0545e 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 017762df..0cae95a1 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 8d29bb15..e67ef3d0 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, 0x75, 0xd5, 0xe7, 0xdc, 0x6f, 0x7b, 0xcc, 0x8d, 0x02, 0xe6, 0x86, 0x21, 0x97, 0xea, 0x52, - 0xd0, 0xad, 0x59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ba, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x38, 0x1f, 0x8d, 0x5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0c, 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 57431991..e48eb8a1 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/70] 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 dde4229e..9afcfaa4 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 64f6a9b6..0e0bcc15 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 d49cea63..58ec9299 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 4238e503..98c275a0 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 f0cbd7c9..63351c1e 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 20a0f022..c35f5f15 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 b25a1169..53da082d 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 dd11faec..ab975b4c 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 ac23e76b..0578d812 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 c4cfe90a..b91b705d 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, 0x0e, 0x3a, 0x84, 0xe3, 0x83, 0x72, 0x97, 0xd1, - 0x40, 0xe1, 0x73, 0x5b, 0x3d, 0xd6, 0x63, 0xf2, 0xb1, 0x2c, 0x9e, 0xb4,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, 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,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 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, + 0x7b, 0xa9, 0x5b, 0xdb, 0xf3, 0x3a, 0x9a, 0x02, 0x63, 0x85, 0x10, 0x4b, 0x0f, 0x69, 0x33, 0x12, + 0x54, 0x86, 0x54, 0x30, 0x6c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6, 0xe7, 0x65, 0xf3, 0x4e, 0xb5, 0xa2, 0xaf, + 0xec, 0xff, 0x41, 0x83, 0xcc, 0xd9, 0x21, 0x87, 0x3e, 0x82, 0xed, 0x93, 0x5a, 0xab, 0x6a, 0x9d, + 0xd6, 0xac, 0x85, 0x0e, 0x65, 0x37, 0x1e, 0x3d, 0xde, 0x4d, 0xdd, 0xf5, 0x82, 0x01, 0xe9, 0xd0, + 0xfb, 0x94, 0x88, 0xcb, 0xf8, 0xfa, 0x3c, 0xa3, 0x7c, 0xdc, 0x34, 0x5b, 0x55, 0x5d, 0xcb, 0xc2, + 0xa3, 0xc7, 0xbb, 0x89, 0x72, 0x87, 0xd3, 0x11, 0x41, 0xfb, 0x60, 0xcc, 0xe3, 0xcc, 0x53, 0x85, + 0x8c, 0x65, 0xd3, 0x8f, 0x1e, 0xef, 0x26, 0x4d, 0x0f, 0x87, 0xd8, 0x6c, 0xfc, 0xeb, 0x3f, 0xe6, + 0x96, 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, } 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 0cae95a1..744e14dd 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 613dc56e..39431e17 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 e0409480..0ece68ff 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 360e3e24..d5fb45ea 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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, 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, 0xf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xfe, 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, 0xff, 0x01, 0x09, 0xd9, 0x33, 0xe3, 0xf8, + 0x95, 0x26, 0x42, 0x02, 0x71, 0x89, 0x3c, 0xbf, 0xd7, 0x7c, 0xdf, 0x37, 0xbf, 0x79, 0x04,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12, 0xbe, 0xee, + 0x2c, 0xb0, 0x90, 0x7e, 0xb8, 0xbd, 0x9a, 0x91, 0x9f, 0x8a, 0x52, 0xde, 0x1c, 0x25, 0x2a, 0x9c, + 0xe8, 0x03, 0x30, 0x11, 0xbc, 0xa2, 0x16, 0x33, 0xb2, 0x7c, 0x87, 0x52, 0x1e, 0xe0, 0x08, 0x2b, + 0x7c, 0x02, 0x5e, 0x8a, 0x3d, 0x47, 0x06, 0x25, 0x88, 0x00, 0xe5, 0xf5, 0x21, 0x01, 0x61, 0xe5, + 0xfb, 0xa0, 0x20, 0x6e, 0x73, 0x25, 0x23, 0x87, 0xfb, 0x14, 0x75, 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, } // 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/70] 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 b382bdb8..195c5b0c 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 b6f928d8..90ea55a6 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 98c275a0..13a591a2 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 53da082d..161746eb 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 0065eb9e..17d25f14 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 a761a4d3..1874375b 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, 0x02, 0xff, 0x74, 0x92, 0xc1, 0xae, 0xd2, 0x40, + 0x14, 0x86, 0xe9, 0xbd, 0x5c, 0xbc, 0x77, 0xe0, 0xde, 0xc5, 0x04, 0x71, 0xa2, 0xd8, 0x10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5e, 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/70] 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 7dd9ad28..64704ea6 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/70] 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 13a591a2..30652405 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 fcb1b4f8..494ebbcb 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 161746eb..37242802 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/70] 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 63351c1e..b8a0cf91 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/70] 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 e31d78be..1231ca8b 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 30652405..d733bf00 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 7d87ba9b..eec4d670 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 ddd7a74a..343d1235 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 744e14dd..465e5b26 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 938f6d0c..a43d535c 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/70] 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 39431e17..0a1d5340 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/70] 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 9afcfaa4..0ab233a7 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 0e0bcc15..5f036da3 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 b91b705d..d5bdf2f6 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, -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08, 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,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f, 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, 0x52, 0x14, 0x13, 0x49, 0xbe, 0xd8, 0x3b, 0x6f, 0x7e, 0xbf, 0xf7, 0xde, 0xbc, + 0x7f, 0x33, 0x14, 0x98, 0x98, 0x33, 0x8f, 0xf9, 0xa4, 0xd4, 0x65, 0xa3, 0xd2, 0xe8, 0x50, 0xfc, + 0x57, 0x1c, 0x04, 0x8c, 0x33, 0x94, 0xd6, 0x3b, 0x45, 0x21, 0x1a, 0x1d, 0x66, 0x73, 0x1d, 0x16, + 0x7a, 0x2c, 0x2c, 0xb5, 0x71, 0x48, 0x4a, 0xa3, 0xc3, 0x36, 0xe1, 0xf8, 0xb0, 0xd4, 0x61, 0xd4, + 0x57, 0xf8, 0xec, 0x56, 0x97, 0x75, 0x99, 0xfc, 0x2c, 0x89, 0x2f, 0x2d, 0xcd, 0x77, 0x19, 0xeb, + 0xf6, 0x49, 0x49, 0xae, 0xda, 0xc3, 0x07, 0x25, 0x4e, 0x3d, 0x12, 0x72, 0xec, 0x0d, 0x34, 0xe0, + 0xd6, 0x3c, 0x00, 0xfb, 0x63, 0xbd, 0x95, 0x9b, 0xdf, 0x72, 0x87, 0x01, 0xe6, 0x94, 0x45, 0x16, + 0x6f, 0x29, 0x8f, 0x1c, 0x65, 0x54, 0x2d, 0xf4, 0xd6, 0x35, 0xec, 0x51, 0x9f, 0x95, 0xe4, 0xbf, + 0x4a, 0x54, 0x18, 0x00, 0xba, 0x4f, 0x68, 0xb7, 0xc7, 0x89, 0xdb, 0x62, 0x9c, 0xd4, 0x06, 0x42, + 0x13, 0xba, 0x0d, 0x09, 0x26, 0xbf, 0x4c, 0x63, 0xd7, 0xd8, 0x4b, 0xdf, 0xce, 0x16, 0xcf, 0x1e, + 0xbb, 0x38, 0xc5, 0xda, 0x1a, 0x89, 0xde, 0x85, 0xc4, 0x43, 0xa9, 0xc9, 0x8c, 0xed, 0x1a, 0x7b, + 0x6b, 0x47, 0xe9, 0xe7, 0xcf, 0x0e, 0x40, 0x9b, 0xaf, 0x90, 0x8e, 0xad, 0x77, 0x0b, 0x4f, 0x0d, + 0x58, 0xad, 0x90, 0x01, 0x0b, 0x29, 0x47, 0x79, 0x48, 0x0d, 0x02, 0x36, 0x60, 0x21, 0xee, 0x3b, + 0xd4, 0x95, 0xc6, 0xe2, 0x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 0xac, 0xec, 0xff, + 0xc9, 0x80, 0xf4, 0xd9, 0x81, 0x85, 0x3e, 0x80, 0xed, 0x93, 0x5a, 0xab, 0x6a, 0x9f, 0xd6, 0xec, + 0x85, 0x07, 0xca, 0x6e, 0x3e, 0x7e, 0xb2, 0x9b, 0xba, 0xe7, 0x87, 0x03, 0xd2, 0xa1, 0x0f, 0x28, + 0x11, 0xd7, 0xe7, 0x8d, 0x79, 0x46, 0xf9, 0xb8, 0x69, 0xb5, 0xaa, 0x19, 0x23, 0x0b, 0x8f, 0x9f, + 0xec, 0x26, 0xca, 0x1d, 0x4e, 0x47, 0x04, 0xed, 0x83, 0x39, 0x8f, 0xb3, 0x4e, 0x35, 0x32, 0x96, + 0x5d, 0x7f, 0xfc, 0x64, 0x37, 0x69, 0xf9, 0x58, 0x62, 0xb3, 0xf1, 0x2f, 0xff, 0x9c, 0x5b, 0x3a, + 0x3a, 0xf9, 0xe6, 0x65, 0xce, 0xf8, 0xf6, 0x65, 0xce, 0xf8, 0xcf, 0xcb, 0x9c, 0xf1, 0xd5, 0xab, + 0xdc, 0xd2, 0xb7, 0xaf, 0x72, 0x4b, 0xdf, 0xbd, 0xca, 0x2d, 0xfd, 0xe6, 0xa0, 0x4b, 0x79, 0x6f, + 0xd8, 0x2e, 0x76, 0x98, 0x57, 0xd2, 0x33, 0xf4, 0xa0, 0x37, 0x6c, 0x47, 0xdf, 0xa5, 0x47, 0xf2, + 0x4f, 0x1b, 0x7c, 0x3c, 0x20, 0x61, 0x69, 0x74, 0xd8, 0x4e, 0xc8, 0x61, 0xf5, 0xe1, 0xff, 0x03, + 0x00, 0x00, 0xff, 0xff, 0xa1, 0xbe, 0x5b, 0xda, 0xf9, 0x10, 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 d5fb45ea..13740e0f 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, 0x6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, 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, 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, - 0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a8, 0x04, 0x4e, 0xbe, 0xa4, 0x51, 0x53, 0x48, 0xeb, 0x37, 0x29, - 0xb8, 0x49, 0xf6, 0x3c, 0x64, 0x50, 0x74, 0x0f, 0x77, 0x91, 0xe7, 0x62, 0x0f, 0x1e, 0x80, 0x19, - 0x13, 0x91, 0x96, 0x67, 0xb3, 0xed, 0xc8, 0xce, 0xb0, 0x9b, 0x49, 0x94, 0x22, 0xfc, 0x6e, 0x3f, - 0x34, 0x0a, 0x39, 0x5a, 0x02, 0x56, 0x41, 0xc1, 0x60, 0x72, 0x0c, 0x5d, 0x72, 0x11, 0x58, 0xab, - 0x7e, 0xf3, 0xa8, 0x9c, 0xfb, 0xf3, 0x51, 0x39, 0xe7, 0x73, 0x16, 0x56, 0x9f, 0xf1, 0x92, 0x60, - 0x9c, 0x42, 0xae, 0x2e, 0x07, 0x07, 0x7a, 0xdc, 0x18, 0x92, 0xfd, 0x95, 0xad, 0xe1, 0xbe, 0x69, - 0xd3, 0xff, 0x19, 0xd5, 0xed, 0x41, 0x54, 0x15, 0x96, 0x57, 0x21, 0xe6, 0x97, 0x7a, 0x02, 0x3a, - 0x5f, 0xd6, 0xa8, 0x29, 0x64, 0xfa, 0x93, 0x14, 0x59, 0x72, 0xe1, 0x3d, 0xa4, 0x06, 0xed, 0x90, - 0x28, 0x3e, 0x69, 0x44, 0x7c, 0xf0, 0x36, 0xc8, 0x93, 0x20, 0x3b, 0xa0, 0x34, 0x5b, 0x2d, 0x0d, - 0x12, 0x88, 0xcd, 0xd1, 0xe0, 0xd1, 0xb5, 0xf7, 0x06, 0xf1, 0x52, 0xe3, 0xbc, 0xb2, 0x80, 0xaa, - 0xeb, 0xa0, 0x3c, 0xc0, 0x15, 0xf2, 0x7c, 0x21, 0x81, 0x97, 0x83, 0xcd, 0x7a, 0x82, 0xac, 0x68, - 0x03, 0xef, 0x83, 0x05, 0x93, 0xd9, 0xb0, 0x77, 0x34, 0x2a, 0xdb, 0xf9, 0x30, 0x85, 0xdb,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ec, 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, 0xcd, 0x6f, 0x1b, 0xc5, + 0x1b, 0xf6, 0x36, 0x8d, 0xdd, 0x4c, 0x7e, 0x4a, 0x9b, 0xfd, 0xb9, 0x64, 0xb3, 0x69, 0xed, 0x64, + 0x0b, 0x22, 0x09, 0x78, 0x97, 0x38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 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, 0x8e, 0xe5, 0x05, 0x95, 0xe2, 0x29, 0x96, 0x34, 0x6e, + 0x8a, 0x64, 0xfd, 0xa2, 0xb0, 0x9b, 0x64, 0x27, 0x84, 0x36, 0x81, 0xf7, 0x50, 0x1f, 0x86, 0x01, + 0xa2, 0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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/70] 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 480455a5..e04395f6 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/70] 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 03629510..5ea5efdc 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 56cc170b..2b423aef 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 ddab7f2a..9e9d4d76 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 7cb5aca0..82f20567 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/70] 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 cc41f68e..18e78243 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 e1024242..2755339a 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/70] 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 2b423aef..29f0500d 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 40f39719..773c1c7f 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 9e9d4d76..b36111a7 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 c86dfc86..13110d2b 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 b8a0cf91..6c4c936a 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 465e5b26..00724b7b 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/70] 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 773c1c7f..69e8fb5a 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 235cfd68..e5e8df1c 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 e6e7fff6..d5b42a65 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, 0xcf, 0x6f, 0x13, 0xc7, - 0x17, 0x67, 0x4c, 0x02, 0xc9, 0x4b, 0x08, 0x61, 0xbe, 0x01, 0xcc, 0x42, 0xfc, 0x25, 0x4b, 0x0a, - 0x81, 0xe2, 0x5d, 0x1c, 0x7e, 0x0a, 0x95, 0x96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 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, 0x9e, 0x97, 0x89, 0x65, 0x58, 0xbc, 0x9d, 0x0e, 0x5a, 0xf1, - 0xe1, 0xe0, 0x12, 0x0f, 0xab, 0x84, 0x97, 0xb8, 0xc4, 0x66, 0x5d, 0xe2, 0x41, 0x4c, 0x80, 0x54, - 0x6b, 0x89, 0x74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c4, 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, 0x89, 0x89, 0x1a, 0x0f, 0x18, 0x63, 0x8c, 0xfc, 0x01, 0x5e, 0x4c, 0x3c, 0xc1, 0xc1, 0x9b, + 0x47, 0x8f, 0x04, 0x2f, 0x1e, 0x0d, 0xeb, 0x1f, 0x62, 0xba, 0xea, 0x55, 0xff,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 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 4ea97107..ba192018 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/70] 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 29f0500d..e7d2d867 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 0981a3cb..ee74279d 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 6c4c936a..50a2eade 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 5185b065..55a43ac2 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 e04395f6..4306acda 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 0578d812..11ef3bfa 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 e5e8df1c..a73f5193 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, 0x2c, 0xdb, 0x6b, 0x2a, 0x22, 0x15, 0xe6, - 0x8b, 0xc0, 0xd1, 0xd7, 0x22, 0x23, 0xbb, 0xc8, 0xc1, 0xc8, 0x85, 0x12, 0x69, 0x95, 0x86, 0x2b, - 0x32, 0x4b, 0x5a, 0x69, 0x7a, 0xe8, 0x62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 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, 0x69, 0x3f, 0xfd, 0xac, 0x4f, 0xfa, 0xa4, 0xe2, 0x31, 0x7f, 0x88, 0xea, 0x70, - 0xed, 0x4b, 0x31, 0x21, 0x0a, 0x87, 0xf6, 0x55, 0x31, 0x6a, 0x97, 0x2c, 0xa0, 0x35, 0x49, 0x6e, - 0x4a, 0xae,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f4, 0x09, 0xc4, 0xb0, 0x43, 0x7b, 0x2e, + 0xd3, 0x67, 0x37, 0x67, 0xb7, 0x12, 0xf7, 0xd6, 0xf2, 0x8a, 0xc1, 0xe3, 0x94, 0x57, 0x71, 0xca, + 0xef, 0x53, 0xdb, 0xdd, 0x5b, 0xf8, 0xe6, 0x75, 0x76, 0xe6, 0xf7, 0xff, 0xfc, 0x7a, 0x5b, 0x33, + 0x14, 0x27, 0xf7, 0xc7, 0x39, 0x88, 0xd7, 0x94, 0x13, 0x28, 0x09, 0x91, 0xa1, 0x6b, 0x11, 0xdb, + 0x42, 0x1f, 0x41, 0xdc, 0x21, 0xbe, 0x8f, 0xdb, 0xc4, 0xd7, 0x23, 0x42, 0x7c, 0x35, 0x2f, 0x43, + 0x92, 0x0f, 0x42, 0x92, 0x2f, 0xba, 0x03, 0x63, 0x88, 0x42, 0x1f, 0x43, 0xcc, 0x67, 0x98, 0xf5, + 0x7c, 0x7d, 0x56, 0xac, 0x66, 0x66, 0x72, 0x35, 0x83, 0xb1, 0xea, 0x02, 0x65, 0x28, 0x34, 0xaa, + 0x00, 0x3a, 0xb6, 0x5d, 0xdc, 0x31, 0x19, 0xee, 0x74, 0x06, 0xa6, 0x47, 0xfc, 0x5e, 0x87, 0xe9, + 0xd1, 0x4d, 0x6d, 0x2b, 0x71, 0x6f, 0x7d, 0x52, 0xa3, 0xc1, 0x31, 0x86, 0x80, 0x18, 0x29, 0x41, + 0x0b, 0x59, 0x50, 0x11, 0x12, 0x7e, 0xaf, 0xe9, 0xd8, 0xcc, 0xe4, 0x99, 0xa6, 0xcf, 0x09, 0x8d, + 0xf4, 0x39, 0xbf, 0x1b, 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, 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 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 1143ba09..56c4f572 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/70] 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 d733bf00..77c779f0 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 494ebbcb..45891f2e 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/70] 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 50a2eade..5b646181 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 45891f2e..2955ed82 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 55a43ac2..087d1031 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 4306acda..10aa98c3 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/70] 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 56c4f572..3350bbdb 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/70] 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 2955ed82..b90e5fb9 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/70] 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 b90e5fb9..bbb1a6c2 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/70] 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 bbb1a6c2..e4b264b3 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/70] 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 e4b264b3..41d0f481 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/70] ... --- 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 41d0f481..f4e644cd 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/70] 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 087d1031..3c297ab9 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 18e78243..418924f5 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 2755339a..2d623eb2 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/70] 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 abb3c747..2891a47e 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/70] 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 418924f5..6fdde55a 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 8418fed3bd7f45c157e6a28e09d282da71d772a7 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:20:07 +0200 Subject: [PATCH 41/70] remove aggregate VP for governors change also the governors election logic, now only voting governors are counted removes a lot of logic that could cause performance issues --- proto/atomone/gov/v1/gov.proto | 8 +- x/gov/keeper/delegation.go | 50 ------ x/gov/keeper/governor.go | 47 +----- x/gov/keeper/grpc_query.go | 2 +- x/gov/keeper/hooks.go | 16 -- x/gov/keeper/invariants.go | 54 ------ x/gov/keeper/tally.go | 189 ++++++++++----------- x/gov/types/keys.go | 21 +-- x/gov/types/v1/exported.go | 3 - x/gov/types/v1/gov.pb.go | 295 ++++++++++++++------------------- x/gov/types/v1/governor.go | 61 +------ x/gov/types/v1/tally.go | 5 +- 12 files changed, 222 insertions(+), 529 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index e7d2d867..d123b045 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -299,15 +299,9 @@ 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 (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]; + google.protobuf.Timestamp last_status_change_time = 4 [(gogoproto.stdtime) = true]; } // GovernorStatus is the status of a governor. diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 77c779f0..2f13b721 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -59,10 +59,6 @@ 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 @@ -109,42 +105,10 @@ func (k Keeper) IterateGovernorDelegations(ctx sdk.Context, governorAddr types.G } } -// 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 := 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 @@ -185,11 +149,6 @@ func (k Keeper) IncreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover 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.VotingPower = governor.GetVotingPower().Add(vp) - k.UpdateGovernorByPowerIndex(ctx, governor) } // DecreaseGovernorShares decreases the governor validator shares in the store @@ -207,15 +166,6 @@ func (k Keeper) DecreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover } 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.VotingPower = governorVP - k.UpdateGovernorByPowerIndex(ctx, governor) } // UndelegateFromGovernor decreases all governor validator shares in the store diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index 5b646181..eaf4fb6f 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -29,7 +29,7 @@ func (k Keeper) SetGovernor(ctx sdk.Context, governor v1.Governor) { } // GetAllGovernors returns all governors -func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors v1.Governors) { +func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors []*v1.Governor) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.GovernorKeyPrefix) @@ -44,7 +44,7 @@ func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors v1.Governors) { } // GetAllActiveGovernors returns all active governors -func (k Keeper) GetAllActiveGovernors(ctx sdk.Context) (governors v1.Governors) { +func (k Keeper) GetAllActiveGovernors(ctx sdk.Context) (governors []*v1.Governor) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.GovernorKeyPrefix) @@ -76,49 +76,6 @@ func (k Keeper) IterateGovernors(ctx sdk.Context, cb func(index int64, governor } } -// 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) 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 -// 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 - var totGovernors uint64 = 0 - - iterator := sdk.KVStoreReversePrefixIterator(store, types.GovernorsByPowerKeyPrefix) - defer iterator.Close() - - 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() && k.ValidateGovernorMinSelfDelegation(ctx, governor) { - if cb(int64(totGovernors), governor) { - break - } - totGovernors++ - } - } -} - func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorAddress) (bondedTokens math.Int) { bondedTokens = sdk.ZeroInt() addr := sdk.AccAddress(govAddr) diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 01e4c099..f23f621b 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -322,7 +322,7 @@ func (q Keeper) Governors(c context.Context, req *v1.QueryGovernorsRequest) (*v1 store := ctx.KVStore(q.storeKey) governorStore := prefix.NewStore(store, types.GovernorKeyPrefix) - var governors v1.Governors + var governors []*v1.Governor 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 { diff --git a/x/gov/keeper/hooks.go b/x/gov/keeper/hooks.go index c35f5f15..d2ef28c4 100644 --- a/x/gov/keeper/hooks.go +++ b/x/gov/keeper/hooks.go @@ -5,7 +5,6 @@ import ( 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 @@ -68,21 +67,6 @@ func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, // 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.VotingPower = governorVP - h.k.UpdateGovernorByPowerIndex(ctx, governor) - return false - }) - return nil } diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index f4e644cd..c1d3ab31 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -15,7 +15,6 @@ 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)) ir.RegisterRoute(types.ModuleName, "governors-delegations", GovernorsDelegationsInvariant(keeper, keeper.sk)) } @@ -51,59 +50,6 @@ func ModuleAccountInvariant(keeper *Keeper, bk types.BankKeeper) sdk.Invariant { } } -// 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, 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, fmt.Sprintf("governor %s voting power", governor.GetAddress().String()), - 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, 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 { diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 6fdde55a..ede71623 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "sort" "cosmossdk.io/math" @@ -16,8 +17,7 @@ import ( // voters func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, burnDeposits bool, tallyResults v1.TallyResult) { currValidators := keeper.getBondedValidatorsByAddress(ctx) - currGovernors := keeper.getGovernorsByAddress(ctx) - totalVotingPower, results := keeper.tallyVotes(ctx, proposal, currValidators, currGovernors, true) + totalVotingPower, results := keeper.tallyVotes(ctx, proposal, currValidators, true) params := keeper.GetParams(ctx) tallyResults = v1.NewTallyResultFromMap(results) @@ -61,25 +61,8 @@ func (keeper Keeper) HasReachedQuorum(ctx sdk.Context, proposal v1.Proposal) (qu } 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 _, gov := range currGovernors { - _, ok := keeper.GetVote(ctx, proposal.Id, sdk.AccAddress(gov.Address)) - if ok { - approxTotalVotingPower = approxTotalVotingPower.Add(gov.VotingPower) - } - } - // check and return whether or not the proposal has reached quorum - approxPercentVoting := approxTotalVotingPower.Quo(math.LegacyNewDecFromInt(totalBonded)) - if approxPercentVoting.GTE(quorum) { - return true, nil - } - currValidators := keeper.getBondedValidatorsByAddress(ctx) - totalVotingPower, _ := keeper.tallyVotes(ctx, proposal, currValidators, currGovernors, false) + totalVotingPower, _ := keeper.tallyVotes(ctx, proposal, currValidators, false) // check and return whether or not the proposal has reached quorum percentVoting := totalVotingPower.Quo(math.LegacyNewDecFromInt(totalBonded)) @@ -100,22 +83,6 @@ func (keeper Keeper) getBondedValidatorsByAddress(ctx sdk.Context) map[string]st return vals } -// getGovernorsByAddress fetches all the active param.MaxGovernors top governors by voting power -// and puts them in map using their operator address as the key. -func (keeper Keeper) getGovernorsByAddress(ctx sdk.Context) map[string]v1.GovernorGovInfo { - govs := make(map[string]v1.GovernorGovInfo) - keeper.IterateMaxGovernorsByGovernancePower(ctx, func(index int64, governor v1.GovernorI) (stop bool) { - govs[governor.GetAddress().String()] = v1.NewGovernorGovInfo( - governor.GetAddress(), - keeper.GetAllGovernorValShares(ctx, governor.GetAddress()), - v1.WeightedVoteOptions{}, - governor.GetVotingPower(), - ) - return false - }) - return govs -} - // tallyVotes returns the total voting power and tally results of the votes // on a proposal. If `isFinal` is true, results will be stored in `results` // map and votes will be deleted. Otherwise, only the total voting power @@ -123,10 +90,12 @@ func (keeper Keeper) getGovernorsByAddress(ctx sdk.Context) map[string]v1.Govern func (keeper Keeper) tallyVotes( ctx sdk.Context, proposal v1.Proposal, currValidators map[string]stakingtypes.ValidatorI, - currGovernors map[string]v1.GovernorGovInfo, isFinal bool, ) (totalVotingPower math.LegacyDec, results map[v1.VoteOption]math.LegacyDec) { totalVotingPower = math.LegacyZeroDec() + // keeps track of governors that voted or have delegators that voted + allGovernors := make(map[string]v1.GovernorGovInfo) + if isFinal { results = make(map[v1.VoteOption]math.LegacyDec) results[v1.OptionYes] = math.LegacyZeroDec() @@ -140,18 +109,36 @@ func (keeper Keeper) tallyVotes( voter := sdk.MustAccAddressFromBech32(vote.Voter) // if voter is a governor record it in the map - govAddrStr := types.GovernorAddress(voter.Bytes()).String() - if gov, ok := currGovernors[govAddrStr]; ok { - gov.Vote = vote.Options - currGovernors[govAddrStr] = gov + selfGovAddr := types.GovernorAddress(voter.Bytes()) + selfGovAddrStr := selfGovAddr.String() + if gov, ok := keeper.GetGovernor(ctx, selfGovAddr); ok { + gi, ok := allGovernors[selfGovAddrStr] + if ok { + gi.Vote = vote.Options + allGovernors[selfGovAddrStr] = gi + } else { + allGovernors[selfGovAddrStr] = v1.NewGovernorGovInfo( + selfGovAddr, + keeper.GetAllGovernorValShares(ctx, selfGovAddr), + vote.Options, + gov.IsActive(), + ) + } } gd, hasGovernor := keeper.GetGovernanceDelegation(ctx, voter) if hasGovernor { - if gi, ok := currGovernors[gd.GovernorAddress]; ok { + if gi, ok := allGovernors[gd.GovernorAddress]; ok { governor = gi } else { - hasGovernor = false + govAddr := types.MustGovernorAddressFromBech32(gd.GovernorAddress) + gov, _ := keeper.GetGovernor(ctx, govAddr) + governor = v1.NewGovernorGovInfo( + types.GovernorAddress(voter.Bytes()), + keeper.GetAllGovernorValShares(ctx, types.MustGovernorAddressFromBech32(gd.GovernorAddress)), + nil, + gov.IsActive(), + ) } } @@ -187,70 +174,26 @@ func (keeper Keeper) tallyVotes( return false }) - /* DISABLED on AtomOne - Voting can only be done with your own stake - // iterate over the validators again to tally their voting power - for _, val := range currValidators { - if len(val.Vote) == 0 { - continue - } - - sharesAfterDeductions := val.DelegatorShares.Sub(val.DelegatorDeductions) - votingPower := sharesAfterDeductions.MulInt(val.BondedTokens).Quo(val.DelegatorShares) - - for _, option := range val.Vote { - weight, _ := sdk.NewDecFromStr(option.Weight) - subPower := votingPower.Mul(weight) - results[option.Option] = results[option.Option].Add(subPower) - } - totalVotingPower = totalVotingPower.Add(votingPower) - } - */ + // sort governors by voting power, and insert in currGovernors only + // the top param.MaxGovernors among the voting governors that are + // active and have the niminum self-delegation requirement met. + // As active 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. + currGovernors := keeper.getCurrGovernors(ctx, allGovernors, currValidators) // iterate over the governors again to tally their voting power for _, gov := range currGovernors { - if len(gov.Vote) == 0 { - continue - } + votingPower := gov.VotingPower - // 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.ValShares { - 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) - } - } - totalVotingPower = totalVotingPower.Add(votingPower) + if isFinal { + for _, option := range gov.Vote { + weight, _ := sdk.NewDecFromStr(option.Weight) + subPower := votingPower.Mul(weight) + results[option.Option] = results[option.Option].Add(subPower) } } - - /* - // 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) - */ - + totalVotingPower = totalVotingPower.Add(votingPower) } return totalVotingPower, results } @@ -312,3 +255,47 @@ func (keeper Keeper) getQuorumAndThreshold(ctx sdk.Context, proposal v1.Proposal } return quorum, threshold, nil } + +// getCurrGovernors sorts the governors by voting power and returns the top params.MaxGovernors +// among the validators that voted, are active and meet the minimum self-delegation requirement +func (k Keeper) getCurrGovernors(ctx sdk.Context, allGovernors map[string]v1.GovernorGovInfo, currValidators map[string]stakingtypes.ValidatorI) (governors []v1.GovernorGovInfo) { + governorInfos := make([]v1.GovernorGovInfo, 0) + for _, govInfo := range allGovernors { + governor, _ := k.GetGovernor(ctx, govInfo.Address) + + if k.ValidateGovernorMinSelfDelegation(ctx, governor) && len(govInfo.Vote) > 0 && govInfo.IsActive { + governorInfos = append(governorInfos, govInfo) + } + } + + // sort governors by voting power + sort.Slice(governorInfos, func(i, j int) bool { + if governorInfos[i].VotingPower.IsNil() { + governorInfos[i].VotingPower = getGovernorVotingPower(governorInfos[i], currValidators) + } + if governorInfos[j].VotingPower.IsNil() { + governorInfos[j].VotingPower = getGovernorVotingPower(governorInfos[j], currValidators) + } + + // using GT so that order is descending + return governorInfos[i].VotingPower.GT(governorInfos[j].VotingPower) + }) + + // get the top params.MaxGovernors governors + if len(governorInfos) > int(k.GetParams(ctx).MaxGovernors) { + governorInfos = governorInfos[:k.GetParams(ctx).MaxGovernors] + } + + return governorInfos +} + +func getGovernorVotingPower(governor v1.GovernorGovInfo, currValidators map[string]stakingtypes.ValidatorI) (votingPower math.LegacyDec) { + votingPower = math.LegacyZeroDec() + for valAddrStr, shares := range governor.ValShares { + if val, ok := currValidators[valAddrStr]; ok { + sharesAfterDeductions := shares.Sub(governor.ValSharesDeductions[valAddrStr]) + votingPower = votingPower.Add(sharesAfterDeductions.MulInt(val.GetBondedTokens()).Quo(val.GetDelegatorShares())) + } + } + return votingPower +} diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index 51db49f0..dd98fef3 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -58,11 +58,9 @@ var ( // GovernorKeyPrefix is the prefix for governor key GovernorKeyPrefix = []byte{0x50} - GovernorsByPowerKeyPrefix = []byte{0x51} - GovernanceDelegationKeyPrefix = []byte{0x52} - ValidatorSharesByGovernorKeyPrefix = []byte{0x53} - GovernanceDelegationsByGovernorKeyPrefix = []byte{0x54} - ValidatorSharesByValidatorKeyPrefix = []byte{0x55} + GovernanceDelegationKeyPrefix = []byte{0x51} + ValidatorSharesByGovernorKeyPrefix = []byte{0x52} + GovernanceDelegationsByGovernorKeyPrefix = []byte{0x53} ) var lenTime = len(sdk.FormatTimeBytes(time.Now())) @@ -144,13 +142,6 @@ 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())...) @@ -168,12 +159,6 @@ 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/exported.go b/x/gov/types/v1/exported.go index 343d1235..132d4000 100644 --- a/x/gov/types/v1/exported.go +++ b/x/gov/types/v1/exported.go @@ -1,8 +1,6 @@ package v1 import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/atomone-hub/atomone/x/gov/types" ) @@ -13,5 +11,4 @@ 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 } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index a73f5193..9470e736 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -1067,10 +1067,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 (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"` + LastStatusChangeTime *time.Time `protobuf:"bytes,4,opt,name=last_status_change_time,json=lastStatusChangeTime,proto3,stdtime" json:"last_status_change_time,omitempty"` } func (m *Governor) Reset() { *m = Governor{} } @@ -1293,129 +1291,128 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1937 bytes of a gzipped FileDescriptorProto + // 1922 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0x1b, 0xc7, - 0x15, 0xd6, 0x52, 0x14, 0x45, 0x3d, 0x4a, 0x14, 0x35, 0x96, 0xed, 0x15, 0x65, 0x91, 0x0a, 0x53, - 0x04, 0x8a, 0x6a, 0x91,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x11, 0xdb, - 0x42, 0x1f, 0x41, 0xdc, 0x21, 0xbe, 0x8f, 0xdb, 0xc4, 0xd7, 0x23, 0x42, 0x7c, 0x35, 0x2f, 0x43, - 0x92, 0x0f, 0x42, 0x92, 0x2f, 0xba, 0x03, 0x63, 0x88, 0x42, 0x1f, 0x43, 0xcc, 0x67, 0x98, 0xf5, - 0x7c, 0x7d, 0x56, 0xac, 0x66, 0x66, 0x72, 0x35, 0x83, 0xb1, 0xea, 0x02, 0x65, 0x28, 0x34, 0xaa, - 0x00, 0x3a, 0xb6, 0x5d, 0xdc, 0x31, 0x19, 0xee, 0x74, 0x06, 0xa6, 0x47, 0xfc, 0x5e, 0x87, 0xe9, - 0xd1, 0x4d, 0x6d, 0x2b, 0x71, 0x6f, 0x7d, 0x52, 0xa3, 0xc1, 0x31, 0x86, 0x80, 0x18, 0x29, 0x41, - 0x0b, 0x59, 0x50, 0x11, 0x12, 0x7e, 0xaf, 0xe9, 0xd8, 0xcc, 0xe4, 0x99, 0xa6, 0xcf, 0x09, 0x8d, - 0xf4, 0x39, 0xbf, 0x1b, 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, 0x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0xaa, 0xc1, 0x8d, - 0x2f, 0x44, 0x87, 0x48, 0x1c, 0xda, 0x53, 0xc9, 0xa8, 0x5d, 0x31, 0x81, 0x56, 0x24, 0xb9, 0x21, - 0xb9, 0x22, 0x89, 0xee, 0x02, 0x52, 0x8a, 0x2d, 0x3e, 0x56, 0x28, 0x14, 0x51, 0x23, 0xf5, 0xc5, - 0xc8, 0x09, 0xb9, 0xfc, 0x13, 0x68, 0xdf, 0xb4, 0xa8, 0x4b, 0x44, 0x20, 0xc6, 0xd1, 0x7e, 0x89, - 0xba, 0x24, 0xf7, 0x57, 0x0d, 0x96, 0x54, 0x11, 0xd5, 0xb0, 0x87, 0x1d, 0x1f, 0x7d, 0x0e, 0x09, - 0xc7, 0x76, 0x87, 0x35, 0xa9, 0x5d, 0x56, 0x93, 0x1b, 0xbc, 0x26, 0xbf, 0x7f, 0x9d, 0xbd, 0x19, - 0x62, 0xdd, 0xa5, 0x8e, 0xcd, 0x88, 0xd3, 0x65, 0x03, 0x03, 0x1c, 0xdb, 0x0d, 0xaa, 0xd4, 0x01, - 0xe4, 0xe0, 0xb3, 0x00, 0x64, 0x76, 0x89, 0x67, 0x53, 0x4b, 0x4c, 0x84, 0x8f, 0x30, 0xb9, 0x32, - 0x25, 0x75, 0xa2, 0xed, 0xfd, 0xe8, 0xfb, 0xd7, 0xd9, 0x3b, 0xe7, 0x89, 0xa3, 0x41, 0x7e, 0xcd, - 0x17, 0x2e, 0xe5, 0xe0, 0xb3, 0x60, 0x26, 0xa2, 0x3f, 0xd7, 0x80, 0xc5, 0x23, 0x51, 0x8d, 0x6a, - 0x66, 0x25, 0x50, 0xd5, 0x19, 0x8c, 0xac, 0x5d, 0x36, 0x72, 0x54, 0x28, 0x2f, 0x4a, 0x96, 0x52, - 0xfd, 0x77, 0x44, 0x15, 0x94, 0x52, 0xfd, 0x00, 0x62, 0x72, 0x55, 0xa7, 0x54, 0x93, 0x38, 0xf1, - 0x64, 0x2f, 0xba, 0x0b, 0x0b, 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, 0x36, 0x04, 0x72, 0xb8, 0xb3, 0x0f, 0x57, 0xda, - 0x23, 0x9c, 0xad, 0x27, 0x05, 0x2d, 0xcd, 0x41, 0xc1, 0xe5, 0x27, 0x58, 0x52, 0x89, 0x40, 0x0f, - 0x60, 0x25, 0x14, 0x69, 0xe5, 0xef, 0xf2, 0x54, 0x7f, 0x97, 0x47, 0x91, 0x95, 0x8e, 0x5e, 0x5a, - 0x42, 0xa9, 0x1f, 0xa6, 0x84, 0x56, 0xfe, 0x0f, 0x25, 0x84, 0xae, 0x5d, 0x42, 0x37, 0x2e, 0x2f, - 0x21, 0xf4, 0x10, 0x92, 0xe3, 0x47, 0x93, 0xbe, 0x7a, 0xb5, 0x14, 0x5d, 0x1a, 0x3b, 0x94, 0xd0, - 0x2f, 0x61, 0x9d, 0x17, 0xce, 0x58, 0xb6, 0x9b, 0xe4, 0x8c, 0x11, 0xd7, 0xe7, 0xaf, 0x85, 0x9b, - 0x57, 0x13, 0xd5, 0x1d, 0x7c, 0x76, 0x14, 0x4a, 0xfd, 0x72, 0x20, 0x70, 0xc1, 0x81, 0x77, 0xeb, - 0x82, 0x03, 0xef, 0x7d, 0x58, 0xe2, 0xde, 0xb4, 0x69, 0x9f, 0x78, 0x2e, 0xf5, 0x7c, 0xfd, 0xb6, - 0x00, 0x2e, 0x3a, 0xf8, 0xec, 0x20, 0xb0, 0xa1, 0x26, 0x6c, 0x04, 0x00, 0x53, 0x5e, 0xac, 0xcd, - 0xd6, 0x09, 0x76, 0xdb, 0x24, 0x28, 0x56, 0xfd, 0x6a, 0x4e, 0xa7, 0x03, 0x15, 0x79, 0x4b, 0xdf, - 0x17, 0x1a, 0xaa, 0x74, 0xab, 0x70, 0x87, 0x27, 0xeb, 0x68, 0x1c, 0xd2, 0x39, 0x36, 0x2d, 0xd2, - 0x21, 0x6d, 0xa1, 0xa0, 0xaf, 0x4d, 0xbd, 0x0c, 0xf1, 0xc2, 0x0c, 0xfc, 0xac, 0x93, 0xce, 0x71,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5f, 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, + 0xf5, 0xd7, 0x52, 0x14, 0x45, 0x3d, 0x49, 0x14, 0x35, 0x96, 0xed, 0x15, 0x65, 0x91, 0x0a, 0xf3, + 0x45, 0xa0, 0xe8, 0x6b, 0x91, 0x91, 0x5d, 0xe4, 0x60, 0xe4, 0x42, 0x89, 0xb4, 0x4a, 0xc3, 0x15, + 0x99, 0x25, 0xad, 0x34, 0x3d, 0x74, 0x31, 0xe4, 0x8e, 0xa8, 0x85, 0x77, 0x77, 0x98, 0xdd, 0x21, + 0x25, 0xfe, 0x07, 0x81, 0x4f, 0x41, 0x4f, 0x45, 0x51, 0x03, 0x46, 0x7b, 0xe9, 0x31, 0x07, 0x03, + 0xfd, 0x03, 0x8a, 0x02, 0x39, 0x15, 0x81, 0x4f, 0x6d, 0x0f, 0x6e, 0x61, 0x1f, 0x1a, 0xe4, 0xd4, + 0x4b, 0xef, 0xc5, 0xfc, 0x58, 0x72, 0x49, 0x51, 0x95, 0x1c, 0xb4, 0x17, 0x9b, 0xf3, 0xe6, 0xf3, + 0x3e, 0xef, 0xcd, 0xfb, 0x31, 0xf3, 0x56, 0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 0xcd, 0x87, 0xa5, 0xea, 0xe3, 0x4a, + 0x39, 0x3d, 0xb7, 0xf3, 0x6b, 0x0d, 0x52, 0xe3, 0x77, 0x07, 0xfa, 0x08, 0x36, 0x0e, 0x6b, 0xc7, + 0x15, 0xe3, 0xa8, 0x66, 0x4c, 0x3d, 0x50, 0x66, 0xe5, 0xd9, 0xf3, 0xad, 0xc5, 0x27, 0x5e, 0xd0, + 0x25, 0x6d, 0xfb, 0xc4, 0x26, 0x7c, 0xc2, 0xb9, 0x35, 0xa9, 0x51, 0x3a, 0x68, 0x56, 0x8f, 0x2b, + 0x69, 0x2d, 0x03, 0xcf, 0x9e, 0x6f, 0x25, 0x4a, 0x6d, 0x66, 0xf7, 0x09, 0xda, 0x01, 0x7d, 0x12, + 0x57, 0x3d, 0x52, 0xc8, 0x58, 0x66, 0xe9, 0xd9, 0xf3, 0xad, 0x64, 0xd5, 0xc3, 0x02, 0x9b, 0x89, + 0x7f, 0xf9, 0xdb, 0xec, 0xcc, 0xfe, 0xe1, 0x37, 0x6f, 0xb2, 0xda, 0xb7, 0x6f, 0xb2, 0xda, 0xdf, + 0xdf, 0x64, 0xb5, 0xaf, 0xde, 0x66, 0x67, 0xbe, 0x7d, 0x9b, 0x9d, 0xf9, 0xf3, 0xdb, 0xec, 0xcc, + 0xcf, 0x76, 0x3b, 0x36, 0x3b, 0xed, 0xb5, 0x0a, 0x6d, 0xea, 0x16, 0xd5, 0x75, 0xb6, 0x7b, 0xda, + 0x6b, 0x85, 0xbf, 0x8b, 0xe7, 0xe2, 0x6f, 0x7c, 0x6c, 0xd0, 0x25, 0x41, 0xb1, 0xbf, 0xd7, 0x4a, + 0x88, 0xdb, 0xe8, 0xfe, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x93, 0x2d, 0x7b, 0xc2, 0x02, 0x14, + 0x00, 0x00, } func (this *GovernorDescription) Equal(that interface{}) bool { @@ -2195,18 +2192,8 @@ func (m *Governor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n14 i = encodeVarintGov(dAtA, i, uint64(n14)) i-- - dAtA[i] = 0x2a - } - { - size := m.VotingPower.Size() - i -= size - if _, err := m.VotingPower.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x22 { size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2715,8 +2702,6 @@ 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)) if m.LastStatusChangeTime != nil { l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.LastStatusChangeTime) n += 1 + l + sovGov(uint64(l)) @@ -5124,40 +5109,6 @@ func (m *Governor) Unmarshal(dAtA []byte) error { } 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 - case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastStatusChangeTime", wireType) } diff --git a/x/gov/types/v1/governor.go b/x/gov/types/v1/governor.go index 00724b7b..eeb0cd52 100644 --- a/x/gov/types/v1/governor.go +++ b/x/gov/types/v1/governor.go @@ -1,15 +1,11 @@ package v1 import ( - "bytes" - "sort" - "strings" time "time" "cosmossdk.io/errors" "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" @@ -30,63 +26,10 @@ func NewGovernor(address string, description GovernorDescription, creationTime t GovernorAddress: address, Description: description, Status: Active, - VotingPower: sdk.ZeroDec(), LastStatusChangeTime: &creationTime, }, nil } -// Governors is a collection of Governor -type Governors []*Governor - -func (g Governors) String() (out string) { - for _, gov := range g { - out += gov.String() + "\n" - } - - return strings.TrimSpace(out) -} - -// 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) -} - -// Implements sort interface -func (g Governors) Less(i, j int) bool { - return bytes.Compare(g[i].GetAddress().Bytes(), g[j].GetAddress().Bytes()) == -1 -} - -// Implements sort interface -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) } @@ -205,8 +148,7 @@ func GovernorStatusFromString(str string) (GovernorStatus, error) { func (g *Governor) MinEqual(other *Governor) bool { return g.GovernorAddress == other.GovernorAddress && g.Status == other.Status && - g.Description.Equal(other.Description) && - g.GetVotingPower().Equal(other.GetVotingPower()) + g.Description.Equal(other.Description) } // Equal checks if the receiver equals the parameter @@ -214,7 +156,6 @@ func (g *Governor) Equal(v2 *Governor) bool { return g.MinEqual(v2) } -func (g Governor) GetVotingPower() sdk.Dec { return g.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 } diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index 2d623eb2..61496e70 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -14,11 +14,12 @@ 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 + IsActive bool // whether the governor is active VotingPower sdk.Dec // voting power of the governor } // NewGovernorGovInfo creates a GovernorGovInfo instance -func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValShares, options WeightedVoteOptions, votingPower sdk.Dec) GovernorGovInfo { +func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValShares, options WeightedVoteOptions, isActive bool) GovernorGovInfo { valSharesMap := make(map[string]sdk.Dec) valSharesDeductionsMap := make(map[string]sdk.Dec) for _, valShare := range valShares { @@ -31,7 +32,7 @@ func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValSh ValShares: valSharesMap, ValSharesDeductions: valSharesDeductionsMap, Vote: options, - VotingPower: votingPower, + IsActive: isActive, } } From 7bd0a30a9befe1e2630e2c23d4af6a60cddd3ca9 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:36:05 +0200 Subject: [PATCH 42/70] don't use nil --- x/gov/keeper/tally.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index ede71623..2e60cb62 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -136,7 +136,7 @@ func (keeper Keeper) tallyVotes( governor = v1.NewGovernorGovInfo( types.GovernorAddress(voter.Bytes()), keeper.GetAllGovernorValShares(ctx, types.MustGovernorAddressFromBech32(gd.GovernorAddress)), - nil, + v1.WeightedVoteOptions{}, gov.IsActive(), ) } From abe5fc2f022d256d50d25f4e62d4b2a7cf5825fe Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:19:01 +0200 Subject: [PATCH 43/70] remove maxGovernors param no need to limit governors number, all voting governors are counted --- proto/atomone/gov/v1/gov.proto | 6 +- x/gov/keeper/tally.go | 44 ++--- x/gov/types/v1/gov.pb.go | 288 ++++++++++++++------------------- x/gov/types/v1/params.go | 1 - x/gov/types/v1/tally.go | 1 - 5 files changed, 137 insertions(+), 203 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index d123b045..b4d197e6 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -273,14 +273,12 @@ message Params { // has elapsed. Used to compute the amount of time in between quorum checks. uint64 quorum_check_count = 22; - // defines the maximum number of governors that can be active at any given time. - 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]; + google.protobuf.Duration governor_status_change_period = 23 [(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" ]; + string min_governor_self_delegation = 24 [(cosmos_proto.scalar) = "cosmos.Int" ]; } diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 2e60cb62..41cd50fb 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "sort" "cosmossdk.io/math" @@ -174,17 +173,15 @@ func (keeper Keeper) tallyVotes( return false }) - // sort governors by voting power, and insert in currGovernors only - // the top param.MaxGovernors among the voting governors that are - // active and have the niminum self-delegation requirement met. + // get only the voting governors that are active and have the niminum self-delegation requirement met. + currGovernors := keeper.getCurrGovernors(ctx, allGovernors) + + // iterate over the governors again to tally their voting power // As active 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. - currGovernors := keeper.getCurrGovernors(ctx, allGovernors, currValidators) - - // iterate over the governors again to tally their voting power for _, gov := range currGovernors { - votingPower := gov.VotingPower + votingPower := getGovernorVotingPower(gov, currValidators) if isFinal { for _, option := range gov.Vote { @@ -256,37 +253,18 @@ func (keeper Keeper) getQuorumAndThreshold(ctx sdk.Context, proposal v1.Proposal return quorum, threshold, nil } -// getCurrGovernors sorts the governors by voting power and returns the top params.MaxGovernors -// among the validators that voted, are active and meet the minimum self-delegation requirement -func (k Keeper) getCurrGovernors(ctx sdk.Context, allGovernors map[string]v1.GovernorGovInfo, currValidators map[string]stakingtypes.ValidatorI) (governors []v1.GovernorGovInfo) { - governorInfos := make([]v1.GovernorGovInfo, 0) +// getCurrGovernors returns the governors that voted, are active and meet the minimum self-delegation requirement +func (k Keeper) getCurrGovernors(ctx sdk.Context, allGovernors map[string]v1.GovernorGovInfo) (governors []v1.GovernorGovInfo) { + governorsInfos := make([]v1.GovernorGovInfo, 0) for _, govInfo := range allGovernors { governor, _ := k.GetGovernor(ctx, govInfo.Address) - if k.ValidateGovernorMinSelfDelegation(ctx, governor) && len(govInfo.Vote) > 0 && govInfo.IsActive { - governorInfos = append(governorInfos, govInfo) + if k.ValidateGovernorMinSelfDelegation(ctx, governor) && len(govInfo.Vote) > 0 { + governorsInfos = append(governorsInfos, govInfo) } } - // sort governors by voting power - sort.Slice(governorInfos, func(i, j int) bool { - if governorInfos[i].VotingPower.IsNil() { - governorInfos[i].VotingPower = getGovernorVotingPower(governorInfos[i], currValidators) - } - if governorInfos[j].VotingPower.IsNil() { - governorInfos[j].VotingPower = getGovernorVotingPower(governorInfos[j], currValidators) - } - - // using GT so that order is descending - return governorInfos[i].VotingPower.GT(governorInfos[j].VotingPower) - }) - - // get the top params.MaxGovernors governors - if len(governorInfos) > int(k.GetParams(ctx).MaxGovernors) { - governorInfos = governorInfos[:k.GetParams(ctx).MaxGovernors] - } - - return governorInfos + return governorsInfos } func getGovernorVotingPower(governor v1.GovernorGovInfo, currValidators map[string]stakingtypes.ValidatorI) (votingPower math.LegacyDec) { diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 9470e736..a470e727 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -879,14 +879,12 @@ type Params struct { // Number of times a proposal should be checked for quorum after the quorum timeout // has elapsed. Used to compute the amount of time in between quorum checks. QuorumCheckCount uint64 `protobuf:"varint,22,opt,name=quorum_check_count,json=quorumCheckCount,proto3" json:"quorum_check_count,omitempty"` - // defines the maximum number of governors that can be active at any given time. - 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"` + GovernorStatusChangePeriod *time.Duration `protobuf:"bytes,23,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"` + MinGovernorSelfDelegation string `protobuf:"bytes,24,opt,name=min_governor_self_delegation,json=minGovernorSelfDelegation,proto3" json:"min_governor_self_delegation,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -1034,13 +1032,6 @@ func (m *Params) GetQuorumCheckCount() uint64 { return 0 } -func (m *Params) GetMaxGovernors() uint64 { - if m != nil { - return m.MaxGovernors - } - return 0 -} - func (m *Params) GetGovernorStatusChangePeriod() *time.Duration { if m != nil { return m.GovernorStatusChangePeriod @@ -1291,128 +1282,126 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1922 bytes of a gzipped FileDescriptorProto + // 1903 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, 0x49, 0x14, 0x35, 0x96, 0xed, 0x15, 0x65, 0x91, 0x0a, 0xf3, - 0x45, 0xa0, 0xe8, 0x6b, 0x91, 0x91, 0x5d, 0xe4, 0x60, 0xe4, 0x42, 0x89, 0xb4, 0x4a, 0xc3, 0x15, - 0x99, 0x25, 0xad, 0x34, 0x3d, 0x74, 0x31, 0xe4, 0x8e, 0xa8, 0x85, 0x77, 0x77, 0x98, 0xdd, 0x21, - 0x25, 0xfe, 0x07, 0x81, 0x4f, 0x41, 0x4f, 0x45, 0x51, 0x03, 0x46, 0x7b, 0xe9, 0x31, 0x07, 0x03, - 0xfd, 0x03, 0x8a, 0x02, 0x39, 0x15, 0x81, 0x4f, 0x6d, 0x0f, 0x6e, 0x61, 0x1f, 0x1a, 0xe4, 0xd4, - 0x4b, 0xef, 0xc5, 0xfc, 0x58, 0x72, 0x49, 0x51, 0x95, 0x1c, 0xb4, 0x17, 0x9b, 0xf3, 0xe6, 0xf3, - 0x3e, 0xef, 0xcd, 0xfb, 0x31, 0xf3, 0x56, 0xa0, 0x63, 0x46, 0x5d, 0xea,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xda, + 0xe7, 0x62, 0x41, 0x24, 0x0e, 0xed, 0xa9, 0x64, 0xd4, 0xae, 0x99, 0x40, 0xab, 0x92, 0xdc, 0x94, + 0x5c, 0x91, 0x44, 0x77, 0x01, 0x29, 0xc5, 0x36, 0xdf, 0x2b, 0x12, 0x8a, 0xb8, 0x91, 0xfe, 0x7c, + 0x64, 0x84, 0x74, 0xff, 0x04, 0x3a, 0x30, 0x2d, 0xea, 0x11, 0x11, 0x88, 0x71, 0x74, 0x50, 0xa6, + 0x1e, 0xc9, 0xff, 0x4d, 0x83, 0x65, 0x55, 0x44, 0x75, 0xec, 0x63, 0x37, 0x40, 0x9f, 0xc1, 0xa2, + 0x6b, 0x7b, 0xc3, 0x9a, 0xd4, 0xae, 0xaa, 0xc9, 0x4d, 0x5e, 0x93, 0xdf, 0xbd, 0xce, 0xdd, 0x88, + 0xb0, 0xee, 0x52, 0xd7, 0x66, 0xc4, 0xed, 0xb2, 0x81, 0x01, 0xae, 0xed, 0x85, 0x55, 0xea, 0x02, + 0x72, 0xf1, 0x79, 0x08, 0x32, 0xbb, 0xc4, 0xb7, 0xa9, 0x25, 0x0e, 0xc2, 0x77, 0x98, 0xf4, 0x4c, + 0x59, 0xbd, 0x68, 0xfb, 0x3f, 0xfc, 0xee, 0x75, 0xee, 0xce, 0x45, 0xe2, 0x68, 0x93, 0x5f, 0x71, + 0xc7, 0xa5, 0x5d, 0x7c, 0x1e, 0x9e, 0x44, 0xac, 0xe7, 0x9b, 0xb0, 0x74, 0x2c, 0xaa, 0x51, 0x9d, + 0xac, 0x0c, 0xaa, 0x3a, 0xc3, 0x9d, 0xb5, 0xab, 0x76, 0x8e, 0x0b, 0xe5, 0x25, 0xc9, 0x52, 0xaa, + 0xff, 0x8e, 0xa9, 0x82, 0x52, 0xaa, 0xef, 0x43, 0x42, 0x7a, 0x75, 0x4a, 0x35, 0x89, 0x17, 0x4f, + 0xae, 0xa2, 0xbb, 0xb0, 0xc0, 0x4e, 0x7d, 0x12, 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 0x15, 0xda, 0xd4, 0x2d, 0xaa, 0xeb, 0x6c, 0xf7, 0xb4, 0xd7, 0x0a, 0x7f, + 0x17, 0xcf, 0xc5, 0x9f, 0xef, 0xd8, 0xa0, 0x4b, 0x82, 0x62, 0x7f, 0xaf, 0x95, 0x10, 0xb7, 0xd1, + 0xfd, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x8d, 0x7e, 0x12, 0xdd, 0x13, 0x00, 0x00, } func (this *GovernorDescription) Equal(that interface{}) bool { @@ -1991,7 +1980,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0xca + dAtA[i] = 0xc2 } if m.GovernorStatusChangePeriod != nil { n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.GovernorStatusChangePeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.GovernorStatusChangePeriod):]) @@ -2003,14 +1992,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0xc2 - } - if m.MaxGovernors != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.MaxGovernors)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb8 + dAtA[i] = 0xba } if m.QuorumCheckCount != 0 { i = encodeVarintGov(dAtA, i, uint64(m.QuorumCheckCount)) @@ -2673,9 +2655,6 @@ func (m *Params) Size() (n int) { if m.QuorumCheckCount != 0 { n += 2 + sovGov(uint64(m.QuorumCheckCount)) } - 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)) @@ -4888,25 +4867,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } case 23: - 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 - } - } - case 24: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field GovernorStatusChangePeriod", wireType) } @@ -4942,7 +4902,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 25: + case 24: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MinGovernorSelfDelegation", wireType) } diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 3350bbdb..cd491c63 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -87,7 +87,6 @@ func NewParams( QuorumTimeout: &quorumTimeout, MaxVotingPeriodExtension: &maxVotingPeriodExtension, QuorumCheckCount: quorumCheckCount, - MaxGovernors: maxGovernors, GovernorStatusChangePeriod: &governorStatusChangePeriod, MinGovernorSelfDelegation: minGovernorSelfDelegation, } diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index 61496e70..6b6ebc68 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -15,7 +15,6 @@ type GovernorGovInfo struct { ValSharesDeductions map[string]sdk.Dec // deductions from validator's shares when a delegator votes independently Vote WeightedVoteOptions // vote of the governor IsActive bool // whether the governor is active - VotingPower sdk.Dec // voting power of the governor } // NewGovernorGovInfo creates a GovernorGovInfo instance 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 44/70] 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 6fdde55a..42e7f022 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 45/70] ... --- 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 42e7f022..8ae90bb1 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 46/70] fmt --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4f8ae59d..5e6f8d29 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 ) From 7a792a861991b454522e130f8d8d49e4f04d3223 Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Fri, 11 Oct 2024 10:58:02 +0200 Subject: [PATCH 47/70] fix/refac: tally with governors (#2) --- x/gov/keeper/tally.go | 26 +--- x/gov/keeper/tally_test.go | 299 +++++++++++++++++++++++++++++++++++-- 2 files changed, 294 insertions(+), 31 deletions(-) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index bbaf5ea8..0ffc531e 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -107,24 +107,6 @@ func (keeper Keeper) tallyVotes( voter := sdk.MustAccAddressFromBech32(vote.Voter) - // if voter is a governor record it in the map - selfGovAddr := types.GovernorAddress(voter.Bytes()) - selfGovAddrStr := selfGovAddr.String() - if gov, ok := keeper.GetGovernor(ctx, selfGovAddr); ok { - gi, ok := allGovernors[selfGovAddrStr] - if ok { - gi.Vote = vote.Options - allGovernors[selfGovAddrStr] = gi - } else { - allGovernors[selfGovAddrStr] = v1.NewGovernorGovInfo( - selfGovAddr, - keeper.GetAllGovernorValShares(ctx, selfGovAddr), - vote.Options, - gov.IsActive(), - ) - } - } - gd, hasGovernor := keeper.GetGovernanceDelegation(ctx, voter) if hasGovernor { if gi, ok := allGovernors[gd.GovernorAddress]; ok { @@ -133,12 +115,18 @@ func (keeper Keeper) tallyVotes( govAddr := types.MustGovernorAddressFromBech32(gd.GovernorAddress) gov, _ := keeper.GetGovernor(ctx, govAddr) governor = v1.NewGovernorGovInfo( - types.GovernorAddress(voter.Bytes()), + govAddr, keeper.GetAllGovernorValShares(ctx, types.MustGovernorAddressFromBech32(gd.GovernorAddress)), v1.WeightedVoteOptions{}, gov.IsActive(), ) } + if gd.GovernorAddress == types.GovernorAddress(voter).String() { + // voter and governor are the same account, record his vote + governor.Vote = vote.Options + } + // Ensure allGovernors contains the updated governor + allGovernors[gd.GovernorAddress] = governor } // iterate over all delegations from voter diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index d1deed9d..de91c36f 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "context" "testing" + "time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" @@ -15,6 +16,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/atomone-hub/atomone/x/gov/keeper" + "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" ) @@ -24,6 +26,7 @@ type tallyFixture struct { proposal v1.Proposal valAddrs []sdk.ValAddress delAddrs []sdk.AccAddress + govAddrs []types.GovernorAddress totalBonded int64 validators []stakingtypes.Validator delegations []stakingtypes.Delegation @@ -40,8 +43,8 @@ type tallyFixture struct { // - setup IterateBondedValidatorsByPower call // - setup IterateDelegations call for validators func newTallyFixture(t *testing.T, ctx sdk.Context, proposal v1.Proposal, - valAddrs []sdk.ValAddress, delAddrs []sdk.AccAddress, govKeeper *keeper.Keeper, - mocks mocks, + valAddrs []sdk.ValAddress, delAddrs []sdk.AccAddress, govAddrs []types.GovernorAddress, + govKeeper *keeper.Keeper, mocks mocks, ) *tallyFixture { s := &tallyFixture{ t: t, @@ -49,6 +52,7 @@ func newTallyFixture(t *testing.T, ctx sdk.Context, proposal v1.Proposal, proposal: proposal, valAddrs: valAddrs, delAddrs: delAddrs, + govAddrs: govAddrs, keeper: govKeeper, mocks: mocks, } @@ -56,6 +60,7 @@ func newTallyFixture(t *testing.T, ctx sdk.Context, proposal v1.Proposal, DoAndReturn(func(_ context.Context) sdkmath.Int { return sdkmath.NewInt(s.totalBonded) }).MaxTimes(1) + // Mocks a bunch of validators for i := 0; i < len(valAddrs); i++ { s.validators = append(s.validators, stakingtypes.Validator{ @@ -87,10 +92,52 @@ func newTallyFixture(t *testing.T, ctx sdk.Context, proposal v1.Proposal, } return nil }).AnyTimes() + mocks.stakingKeeper.EXPECT().GetValidator(ctx, gomock.Any()).DoAndReturn( + func(ctx context.Context, addr sdk.ValAddress) (stakingtypes.ValidatorI, bool) { + for i := 0; i < len(valAddrs); i++ { + if valAddrs[i].String() == addr.String() { + return s.validators[i], true + } + } + return nil, false + }).AnyTimes() + mocks.stakingKeeper.EXPECT().GetDelegation(ctx, gomock.Any(), gomock.Any()).DoAndReturn( + func(_ context.Context, del sdk.AccAddress, val sdk.ValAddress) (stakingtypes.Delegation, bool) { + for _, d := range s.delegations { + if d.DelegatorAddress == del.String() && d.ValidatorAddress == val.String() { + return d, true + } + } + return stakingtypes.Delegation{}, false + }).AnyTimes() + + // Create active governors + for i := 0; i < len(govAddrs)-1; i++ { + governor, err := v1.NewGovernor(govAddrs[i].String(), v1.GovernorDescription{}, time.Now()) + require.NoError(t, err) + govKeeper.SetGovernor(ctx, governor) + // governor self delegation + accAddr := sdk.AccAddress(govAddrs[i]) + s.delegate(accAddr, valAddrs[0], 1) + s.delegate(accAddr, valAddrs[1], 2) + govKeeper.DelegateToGovernor(ctx, accAddr, govAddrs[i]) + } + // Create one inactive governor + inactiveGovAddr := govAddrs[len(govAddrs)-1] + governor, err := v1.NewGovernor(inactiveGovAddr.String(), v1.GovernorDescription{}, time.Now()) + require.NoError(t, err) + governor.Status = v1.Inactive + govKeeper.SetGovernor(ctx, governor) + accAddr := sdk.AccAddress(inactiveGovAddr) + s.delegate(accAddr, valAddrs[0], 1) + s.delegate(accAddr, valAddrs[1], 2) + govKeeper.DelegateToGovernor(ctx, accAddr, inactiveGovAddr) return s } // delegate updates the tallyFixture delegations and validators fields. +// WARNING: delegate must be called *after* any calls to govKeeper.DelegateToGovernor +// because the hooks are not invoked in this test setup. func (s *tallyFixture) delegate(delegator sdk.AccAddress, validator sdk.ValAddress, m int64) { // Increment total bonded according to each delegations s.totalBonded += m @@ -98,6 +145,7 @@ func (s *tallyFixture) delegate(delegator sdk.AccAddress, validator sdk.ValAddre DelegatorAddress: delegator.String(), ValidatorAddress: validator.String(), } + // Increase validator shares and tokens, compute delegation.Shares for i := 0; i < len(s.validators); i++ { if s.validators[i].OperatorAddress == validator.String() { s.validators[i], delegation.Shares = s.validators[i].AddTokensFromDel(sdk.NewInt(m)) @@ -117,6 +165,10 @@ func (s *tallyFixture) validatorVote(voter sdk.ValAddress, vote v1.VoteOption) { s.vote(sdk.AccAddress(voter), vote) } +func (s *tallyFixture) governorVote(voter types.GovernorAddress, vote v1.VoteOption) { + s.vote(sdk.AccAddress(voter), vote) +} + func TestTally(t *testing.T) { tests := []struct { name string @@ -181,6 +233,198 @@ func TestTally(t *testing.T) { NoCount: "0", }, }, + { + name: "one governor vote w/o delegation: prop fails/burn deposit", + setup: func(s *tallyFixture) { + // gov0 VP=3 vote=yes + s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + }, + proposalMsgs: TestProposal, + expectedPass: false, + expectedBurn: true, // burn because quorum not reached + expectedTally: v1.TallyResult{ + YesCount: "3", + AbstainCount: "0", + NoCount: "0", + }, + }, + { + name: "one governor vote inherits delegation that didn't vote", + setup: func(s *tallyFixture) { + // del0 VP=5 del=gov0 didn't vote + s.delegate(s.delAddrs[0], s.valAddrs[0], 2) + s.delegate(s.delAddrs[0], s.valAddrs[1], 3) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + // gov0 VP=3 vote=yes + s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + }, + proposalMsgs: TestProposal, + expectedPass: true, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "8", + AbstainCount: "0", + NoCount: "0", + }, + }, + { + name: "inactive governor vote doesn't inherit delegation that didn't vote", + setup: func(s *tallyFixture) { + // del0 VP=5 del=gov2(inactive) didn't vote + s.delegate(s.delAddrs[0], s.valAddrs[0], 2) + s.delegate(s.delAddrs[0], s.valAddrs[1], 3) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[2]) + // gov2(inactive) VP=3 vote=yes + s.governorVote(s.govAddrs[2], v1.VoteOption_VOTE_OPTION_YES) + }, + proposalMsgs: TestProposal, + expectedPass: false, + expectedBurn: true, + expectedTally: v1.TallyResult{ + YesCount: "3", + AbstainCount: "0", + NoCount: "0", + }, + }, + { + name: "one governor votes yes, one delegator votes yes", + setup: func(s *tallyFixture) { + // del0 VP=5 del=gov0 vote=yes + s.delegate(s.delAddrs[0], s.valAddrs[0], 2) + s.delegate(s.delAddrs[0], s.valAddrs[1], 3) + s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + // gov0 VP=3 vote=yes + s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + }, + proposalMsgs: TestProposal, + expectedPass: true, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "8", + AbstainCount: "0", + NoCount: "0", + }, + }, + { + name: "one governor votes yes, one delegator votes no", + setup: func(s *tallyFixture) { + // del0 VP=5 del=gov0 vote=no + s.delegate(s.delAddrs[0], s.valAddrs[0], 2) + s.delegate(s.delAddrs[0], s.valAddrs[1], 3) + s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_NO) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + // gov0 VP=3 vote=yes + s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + }, + proposalMsgs: TestProposal, + expectedPass: false, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "3", + AbstainCount: "0", + NoCount: "5", + }, + }, + { + // Same case as previous one but with reverted vote order + name: "one delegator votes no, one governor votes yes", + setup: func(s *tallyFixture) { + // gov0 VP=3 del=gov0 vote=yes + s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + // del0 VP=5 vote=no + s.delegate(s.delAddrs[0], s.valAddrs[0], 2) + s.delegate(s.delAddrs[0], s.valAddrs[1], 3) + s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_NO) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + }, + proposalMsgs: TestProposal, + expectedPass: false, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "3", + AbstainCount: "0", + NoCount: "5", + }, + }, + { + name: "one governor votes and some delegations vote", + setup: func(s *tallyFixture) { + // del0 VP=2 del=gov0 vote=no + s.delegate(s.delAddrs[0], s.valAddrs[0], 2) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_NO) + // del1 VP=3 del=gov0 didn't vote (so VP goes to gov0's vote) + s.delegate(s.delAddrs[1], s.valAddrs[1], 3) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[1], s.govAddrs[0]) + // del2 VP=4 del=gov0 vote=abstain + s.delegate(s.delAddrs[2], s.valAddrs[0], 4) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[2], s.govAddrs[0]) + s.vote(s.delAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) + // del3 VP=5 del=gov0 vote=yes + s.delegate(s.delAddrs[3], s.valAddrs[1], 2) + s.delegate(s.delAddrs[3], s.valAddrs[2], 3) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[3], s.govAddrs[0]) + s.vote(s.delAddrs[3], v1.VoteOption_VOTE_OPTION_YES) + // del4 VP=4 del=gov1 vote=no + s.delegate(s.delAddrs[4], s.valAddrs[3], 4) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[4], s.govAddrs[1]) + s.vote(s.delAddrs[4], v1.VoteOption_VOTE_OPTION_NO) + // del5 VP=6 del=gov1 didn't vote (so VP does to gov1's vote) + s.delegate(s.delAddrs[5], s.valAddrs[3], 6) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[5], s.govAddrs[1]) + // gov0 VP=3 vote=yes + s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + }, + proposalMsgs: TestProposal, + expectedPass: false, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "11", + AbstainCount: "4", + NoCount: "6", + }, + }, + { + name: "two governors vote and some delegations vote", + setup: func(s *tallyFixture) { + // del0 VP=2 del=gov0 vote=no + s.delegate(s.delAddrs[0], s.valAddrs[0], 2) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_NO) + // del1 VP=3 del=gov0 didn't vote (so VP goes to gov0's vote) + s.delegate(s.delAddrs[1], s.valAddrs[1], 3) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[1], s.govAddrs[0]) + // del2 VP=4 del=gov0 vote=abstain + s.delegate(s.delAddrs[2], s.valAddrs[0], 4) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[2], s.govAddrs[0]) + s.vote(s.delAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) + // del3 VP=5 del=gov0 vote=yes + s.delegate(s.delAddrs[3], s.valAddrs[1], 2) + s.delegate(s.delAddrs[3], s.valAddrs[2], 3) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[3], s.govAddrs[0]) + s.vote(s.delAddrs[3], v1.VoteOption_VOTE_OPTION_YES) + // del4 VP=4 del=gov1 vote=no + s.delegate(s.delAddrs[4], s.valAddrs[3], 4) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[4], s.govAddrs[1]) + s.vote(s.delAddrs[4], v1.VoteOption_VOTE_OPTION_NO) + // del5 VP=6 del=gov1 didn't vote (so VP does to gov1's vote) + s.delegate(s.delAddrs[5], s.valAddrs[3], 6) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[5], s.govAddrs[1]) + // gov0 VP=3 vote=yes + s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + // gov1 VP=3 vote=abstain + s.governorVote(s.govAddrs[1], v1.VoteOption_VOTE_OPTION_ABSTAIN) + }, + proposalMsgs: TestProposal, + expectedPass: false, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "11", + AbstainCount: "13", + NoCount: "6", + }, + }, { name: "one delegator votes yes, validator votes also yes: prop fails/burn deposit", setup: func(s *tallyFixture) { @@ -260,13 +504,14 @@ func TestTally(t *testing.T) { s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ABSTAIN) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ABSTAIN) + s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_ABSTAIN) }, proposalMsgs: TestProposal, expectedPass: false, expectedBurn: false, expectedTally: v1.TallyResult{ YesCount: "0", - AbstainCount: "4", + AbstainCount: "5", NoCount: "0", }, }, @@ -277,6 +522,7 @@ func TestTally(t *testing.T) { s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_NO) + s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_NO) }, proposalMsgs: TestProposal, expectedPass: false, @@ -284,7 +530,7 @@ func TestTally(t *testing.T) { expectedTally: v1.TallyResult{ YesCount: "2", AbstainCount: "0", - NoCount: "2", + NoCount: "3", }, }, { @@ -422,6 +668,7 @@ func TestTally(t *testing.T) { setup: func(s *tallyFixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_ABSTAIN) }, @@ -429,7 +676,7 @@ func TestTally(t *testing.T) { expectedPass: true, expectedBurn: false, expectedTally: v1.TallyResult{ - YesCount: "3", + YesCount: "4", AbstainCount: "1", NoCount: "0", }, @@ -441,21 +688,24 @@ func TestTally(t *testing.T) { params := v1.DefaultParams() // Ensure params value are different than false params.BurnVoteQuorum = true + params.MinGovernorSelfDelegation = "1" err := govKeeper.SetParams(ctx, params) require.NoError(t, err) var ( numVals = 10 - numDelegators = 5 - addrs = simtestutil.CreateRandomAccounts(numVals + numDelegators) + numDelegators = 6 + numGovernors = 3 + addrs = simtestutil.CreateRandomAccounts(numVals + numDelegators + numGovernors) valAddrs = simtestutil.ConvertAddrsToValAddrs(addrs[:numVals]) - delAddrs = addrs[numVals:] + delAddrs = addrs[numVals : numVals+numDelegators] + govAddrs = convertAddrsToGovAddrs(addrs[numVals+numDelegators:]) ) // Submit and activate a proposal proposal, err := govKeeper.SubmitProposal(ctx, tt.proposalMsgs, "", "title", "summary", delAddrs[0]) require.NoError(t, err) govKeeper.ActivateVotingPeriod(ctx, proposal) // Create the test fixture - s := newTallyFixture(t, ctx, proposal, valAddrs, delAddrs, govKeeper, mocks) + s := newTallyFixture(t, ctx, proposal, valAddrs, delAddrs, govAddrs, govKeeper, mocks) if tt.setup != nil { tt.setup(s) } @@ -507,6 +757,16 @@ func TestHasReachedQuorum(t *testing.T) { }, expectedQuorum: true, }, + { + name: "quorum reached by governor vote inheritance", + proposalMsgs: TestProposal, + setup: func(s *tallyFixture) { + s.delegate(s.delAddrs[0], s.valAddrs[0], 500000) + s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_ABSTAIN) + }, + expectedQuorum: true, + }, { name: "amendment quorum not reached", setup: func(s *tallyFixture) { @@ -548,6 +808,7 @@ func TestHasReachedQuorum(t *testing.T) { setup: func(s *tallyFixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_ABSTAIN) }, @@ -558,18 +819,24 @@ func TestHasReachedQuorum(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { govKeeper, mocks, _, ctx := setupGovKeeper(t, mockAccountKeeperExpectations) + params := v1.DefaultParams() + params.MinGovernorSelfDelegation = "1" + err := govKeeper.SetParams(ctx, params) + require.NoError(t, err) var ( numVals = 10 numDelegators = 5 - addrs = simtestutil.CreateRandomAccounts(numVals + numDelegators) + numGovernors = 3 + addrs = simtestutil.CreateRandomAccounts(numVals + numDelegators + numGovernors) valAddrs = simtestutil.ConvertAddrsToValAddrs(addrs[:numVals]) - delAddrs = addrs[numVals:] + delAddrs = addrs[numVals : numVals+numDelegators] + govAddrs = convertAddrsToGovAddrs(addrs[numVals+numDelegators:]) ) // Submit and activate a proposal proposal, err := govKeeper.SubmitProposal(ctx, tt.proposalMsgs, "", "title", "summary", delAddrs[0]) require.NoError(t, err) govKeeper.ActivateVotingPeriod(ctx, proposal) - suite := newTallyFixture(t, ctx, proposal, valAddrs, delAddrs, govKeeper, mocks) + suite := newTallyFixture(t, ctx, proposal, valAddrs, delAddrs, govAddrs, govKeeper, mocks) tt.setup(suite) quorum, err := govKeeper.HasReachedQuorum(ctx, proposal) @@ -584,3 +851,11 @@ func TestHasReachedQuorum(t *testing.T) { }) } } + +func convertAddrsToGovAddrs(addrs []sdk.AccAddress) []types.GovernorAddress { + govAddrs := make([]types.GovernorAddress, len(addrs)) + for i, addr := range addrs { + govAddrs[i] = types.GovernorAddress(addr) + } + return govAddrs +} From 8f1448d83786efb27abe670e1fc162f03e7ccd7d Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Tue, 15 Oct 2024 20:33:55 +0200 Subject: [PATCH 48/70] test: keeper governor funcs (#3) * test: keeper governor * test: ValidateGovernorMinSelfDelegation * test: governance delegation * perf: check IsActive first * chore: remove deprecated maxGovernors --- tests/e2e/genesis.go | 3 +- x/gov/keeper/delegation_test.go | 176 ++++++++++++++++++++ x/gov/keeper/fixture_test.go | 170 ++++++++++++++++++++ x/gov/keeper/governor.go | 8 +- x/gov/keeper/governor_test.go | 163 +++++++++++++++++++ x/gov/keeper/tally_test.go | 275 +++++++------------------------- x/gov/simulation/genesis.go | 4 +- x/gov/types/v1/params.go | 3 +- 8 files changed, 574 insertions(+), 228 deletions(-) create mode 100644 x/gov/keeper/delegation_test.go create mode 100644 x/gov/keeper/fixture_test.go create mode 100644 x/gov/keeper/governor_test.go diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index ebb145a9..1b24e476 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -177,7 +177,6 @@ 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, @@ -189,7 +188,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, minGovernorSelfDelegation.String(), + governorStatusChangePeriod, minGovernorSelfDelegation.String(), ), ) govGenState.Constitution = "This is a test constitution" diff --git a/x/gov/keeper/delegation_test.go b/x/gov/keeper/delegation_test.go new file mode 100644 index 00000000..509039cf --- /dev/null +++ b/x/gov/keeper/delegation_test.go @@ -0,0 +1,176 @@ +package keeper_test + +import ( + "testing" + + v1 "github.com/atomone-hub/atomone/x/gov/types/v1" + "github.com/stretchr/testify/assert" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func TestGovernanceDelegate(t *testing.T) { + assert := assert.New(t) + govKeeper, mocks, _, ctx := setupGovKeeper(t, mockAccountKeeperExpectations) + s := newFixture(t, ctx, 2, 3, 2, govKeeper, mocks) + // Setup the delegators + s.delegate(s.delAddrs[0], s.valAddrs[0], 1) + s.delegate(s.delAddrs[0], s.valAddrs[1], 2) + s.delegate(s.delAddrs[1], s.valAddrs[0], 5) + s.delegate(s.delAddrs[2], s.valAddrs[1], 8) + + // Delegate to active governor + govKeeper.DelegateToGovernor(ctx, s.delAddrs[0], s.activeGovernors[0].GetAddress()) + govKeeper.DelegateToGovernor(ctx, s.delAddrs[1], s.activeGovernors[0].GetAddress()) + // Delegate to inactive governor + govKeeper.DelegateToGovernor(ctx, s.delAddrs[2], s.inactiveGovernor.GetAddress()) + + // Assert GetGovernanceDelegation + deleg1, found := govKeeper.GetGovernanceDelegation(ctx, s.delAddrs[0]) + if assert.True(found, "deleg1 not found") { + assert.Equal(deleg1.DelegatorAddress, s.delAddrs[0].String()) + assert.Equal(deleg1.GovernorAddress, s.activeGovernors[0].GovernorAddress) + } + deleg2, found := govKeeper.GetGovernanceDelegation(ctx, s.delAddrs[1]) + if assert.True(found, "deleg2 not found") { + assert.Equal(deleg2.DelegatorAddress, s.delAddrs[1].String()) + assert.Equal(deleg2.GovernorAddress, s.activeGovernors[0].GovernorAddress) + } + deleg3, found := govKeeper.GetGovernanceDelegation(ctx, s.delAddrs[2]) + if assert.True(found, "deleg3 not found") { + assert.Equal(deleg3.DelegatorAddress, s.delAddrs[2].String()) + assert.Equal(deleg3.GovernorAddress, s.inactiveGovernor.GovernorAddress) + } + + // Assert IterateGovernorDelegations + var delegs []v1.GovernanceDelegation + govKeeper.IterateGovernorDelegations(ctx, s.activeGovernors[0].GetAddress(), + func(i int64, d v1.GovernanceDelegation) bool { + delegs = append(delegs, d) + return false + }) + assert.ElementsMatch(delegs, []v1.GovernanceDelegation{deleg1, deleg2}) + delegs = nil + govKeeper.IterateGovernorDelegations(ctx, s.inactiveGovernor.GetAddress(), + func(i int64, d v1.GovernanceDelegation) bool { + delegs = append(delegs, d) + return false + }) + assert.ElementsMatch(delegs, []v1.GovernanceDelegation{deleg3}) + + // Assert GetAllGovernanceDelegationsByGovernor + allDelegs := govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.activeGovernors[0].GetAddress()) + assert.ElementsMatch(allDelegs, []*v1.GovernanceDelegation{&deleg1, &deleg2}) + allDelegs = govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.inactiveGovernor.GetAddress()) + assert.ElementsMatch(allDelegs, []*v1.GovernanceDelegation{&deleg3}) + + // Assert GetGovernorValShares + valShare1, found := govKeeper.GetGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), s.valAddrs[0]) + if assert.True(found, "valShare1 not found") { + assert.Equal(valShare1, v1.GovernorValShares{ + GovernorAddress: s.activeGovernors[0].GovernorAddress, + ValidatorAddress: s.valAddrs[0].String(), + Shares: sdk.NewDec(1 + 5), + }) + } + valShare2, found := govKeeper.GetGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), s.valAddrs[1]) + if assert.True(found, "valShare2 not found") { + assert.Equal(valShare2, v1.GovernorValShares{ + GovernorAddress: s.activeGovernors[0].GovernorAddress, + ValidatorAddress: s.valAddrs[1].String(), + Shares: sdk.NewDec(2), + }) + } + _, found = govKeeper.GetGovernorValShares(ctx, s.inactiveGovernor.GetAddress(), s.valAddrs[0]) + assert.False(found) + valShare3, found := govKeeper.GetGovernorValShares(ctx, s.inactiveGovernor.GetAddress(), s.valAddrs[1]) + if assert.True(found, "valShare3 not found") { + assert.Equal(valShare3, v1.GovernorValShares{ + GovernorAddress: s.inactiveGovernor.GovernorAddress, + ValidatorAddress: s.valAddrs[1].String(), + Shares: sdk.NewDec(8), + }) + } + + // Assert GetAllGovernorValShares + activeGovValShares := govKeeper.GetAllGovernorValShares(ctx, s.activeGovernors[0].GetAddress()) + assert.ElementsMatch(activeGovValShares, []v1.GovernorValShares{valShare1, valShare2}) + inactiveGovValShares := govKeeper.GetAllGovernorValShares(ctx, s.inactiveGovernor.GetAddress()) + assert.ElementsMatch(inactiveGovValShares, []v1.GovernorValShares{valShare3}) + + // Assert IterateGovernorValShares + var valShares []v1.GovernorValShares + govKeeper.IterateGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), func(i int64, v v1.GovernorValShares) bool { + valShares = append(valShares, v) + return false + }) + assert.ElementsMatch(valShares, activeGovValShares) + valShares = nil + govKeeper.IterateGovernorValShares(ctx, s.inactiveGovernor.GetAddress(), func(i int64, v v1.GovernorValShares) bool { + valShares = append(valShares, v) + return false + }) + assert.ElementsMatch(valShares, inactiveGovValShares) + + // Assert RedelegateToGovernor + govKeeper.RedelegateToGovernor(ctx, s.delAddrs[0], s.inactiveGovernor.GetAddress()) + allDelegs = govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.activeGovernors[0].GetAddress()) + assert.ElementsMatch(allDelegs, []*v1.GovernanceDelegation{&deleg2}) + allDelegs = govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.inactiveGovernor.GetAddress()) + deleg1.GovernorAddress = s.inactiveGovernor.GovernorAddress + assert.ElementsMatch(allDelegs, []*v1.GovernanceDelegation{&deleg1, &deleg3}) + valShare1, found = govKeeper.GetGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), s.valAddrs[0]) + if assert.True(found, "valShare1 not found") { + assert.Equal(valShare1, v1.GovernorValShares{ + GovernorAddress: s.activeGovernors[0].GovernorAddress, + ValidatorAddress: s.valAddrs[0].String(), + Shares: sdk.NewDec(5), + }) + } + _, found = govKeeper.GetGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), s.valAddrs[1]) + assert.False(found) + valShare2, found = govKeeper.GetGovernorValShares(ctx, s.inactiveGovernor.GetAddress(), s.valAddrs[0]) + if assert.True(found, "valShare2 not found") { + assert.Equal(valShare2, v1.GovernorValShares{ + GovernorAddress: s.inactiveGovernor.GovernorAddress, + ValidatorAddress: s.valAddrs[0].String(), + Shares: sdk.NewDec(1), + }) + } + valShare3, found = govKeeper.GetGovernorValShares(ctx, s.inactiveGovernor.GetAddress(), s.valAddrs[1]) + if assert.True(found, "valShare3 not found") { + assert.Equal(valShare3, v1.GovernorValShares{ + GovernorAddress: s.inactiveGovernor.GovernorAddress, + ValidatorAddress: s.valAddrs[1].String(), + Shares: sdk.NewDec(10), + }) + } + + // Assert UndelegateFromGovernor + govKeeper.UndelegateFromGovernor(ctx, s.delAddrs[0]) + allDelegs = govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.activeGovernors[0].GetAddress()) + assert.ElementsMatch(allDelegs, []*v1.GovernanceDelegation{&deleg2}) + allDelegs = govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.inactiveGovernor.GetAddress()) + deleg1.GovernorAddress = s.inactiveGovernor.GovernorAddress + assert.ElementsMatch(allDelegs, []*v1.GovernanceDelegation{&deleg3}) + valShare1, found = govKeeper.GetGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), s.valAddrs[0]) + if assert.True(found, "valShare1 not found") { + assert.Equal(valShare1, v1.GovernorValShares{ + GovernorAddress: s.activeGovernors[0].GovernorAddress, + ValidatorAddress: s.valAddrs[0].String(), + Shares: sdk.NewDec(5), + }) + } + _, found = govKeeper.GetGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), s.valAddrs[1]) + assert.False(found) + _, found = govKeeper.GetGovernorValShares(ctx, s.inactiveGovernor.GetAddress(), s.valAddrs[0]) + assert.False(found) + valShare3, found = govKeeper.GetGovernorValShares(ctx, s.inactiveGovernor.GetAddress(), s.valAddrs[1]) + if assert.True(found, "valShare3 not found") { + assert.Equal(valShare3, v1.GovernorValShares{ + GovernorAddress: s.inactiveGovernor.GovernorAddress, + ValidatorAddress: s.valAddrs[1].String(), + Shares: sdk.NewDec(8), + }) + } +} diff --git a/x/gov/keeper/fixture_test.go b/x/gov/keeper/fixture_test.go new file mode 100644 index 00000000..b145f069 --- /dev/null +++ b/x/gov/keeper/fixture_test.go @@ -0,0 +1,170 @@ +package keeper_test + +import ( + "context" + "testing" + "time" + + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + + sdkmath "cosmossdk.io/math" + + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "github.com/atomone-hub/atomone/x/gov/keeper" + "github.com/atomone-hub/atomone/x/gov/types" + v1 "github.com/atomone-hub/atomone/x/gov/types/v1" +) + +type fixture struct { + t *testing.T + + valAddrs []sdk.ValAddress + delAddrs []sdk.AccAddress + govAddrs []types.GovernorAddress + totalBonded int64 + validators []stakingtypes.Validator + delegations []stakingtypes.Delegation + + keeper *keeper.Keeper + ctx sdk.Context + mocks mocks + + activeGovernors []v1.Governor + inactiveGovernor v1.Governor + proposal v1.Proposal +} + +// newFixture returns a configured fixture for testing the govKeeper methods. +// - track staking delegations and ensure the mock staking keeper replies +// accordingly. +// - setup 1 active and 1 inactive governors +// - initiates the validators with a self delegation of 1: +// - setup IterateBondedValidatorsByPower call +// - setup IterateDelegations call for validators +func newFixture(t *testing.T, ctx sdk.Context, numVals, numDelegators, + numGovernors int, govKeeper *keeper.Keeper, mocks mocks, +) *fixture { + var ( + addrs = simtestutil.CreateRandomAccounts(numVals + numDelegators + numGovernors) + valAddrs = simtestutil.ConvertAddrsToValAddrs(addrs[:numVals]) + delAddrs = addrs[numVals : numVals+numDelegators] + govAddrs = convertAddrsToGovAddrs(addrs[numVals+numDelegators:]) + s = &fixture{ + t: t, + ctx: ctx, + valAddrs: valAddrs, + delAddrs: delAddrs, + govAddrs: govAddrs, + keeper: govKeeper, + mocks: mocks, + } + ) + mocks.stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()). + DoAndReturn(func(_ context.Context) sdkmath.Int { + return sdkmath.NewInt(s.totalBonded) + }).MaxTimes(1) + + // Mocks a bunch of validators + for i := 0; i < len(valAddrs); i++ { + s.validators = append(s.validators, stakingtypes.Validator{ + OperatorAddress: valAddrs[i].String(), + Status: stakingtypes.Bonded, + Tokens: sdkmath.ZeroInt(), + DelegatorShares: sdkmath.LegacyZeroDec(), + }) + // validator self delegation + s.delegate(sdk.AccAddress(valAddrs[i]), valAddrs[i], 1) + } + mocks.stakingKeeper.EXPECT(). + IterateBondedValidatorsByPower(ctx, gomock.Any()). + DoAndReturn( + func(ctx context.Context, fn func(index int64, validator stakingtypes.ValidatorI) bool) error { + for i := 0; i < len(valAddrs); i++ { + fn(int64(i), s.validators[i]) + } + return nil + }).AnyTimes() + mocks.stakingKeeper.EXPECT(). + IterateDelegations(ctx, gomock.Any(), gomock.Any()). + DoAndReturn( + func(ctx context.Context, voter sdk.AccAddress, fn func(index int64, d stakingtypes.DelegationI) bool) error { + for i, d := range s.delegations { + if d.DelegatorAddress == voter.String() { + fn(int64(i), d) + } + } + return nil + }).AnyTimes() + mocks.stakingKeeper.EXPECT().GetValidator(ctx, gomock.Any()).DoAndReturn( + func(ctx context.Context, addr sdk.ValAddress) (stakingtypes.ValidatorI, bool) { + for i := 0; i < len(valAddrs); i++ { + if valAddrs[i].String() == addr.String() { + return s.validators[i], true + } + } + return nil, false + }).AnyTimes() + mocks.stakingKeeper.EXPECT().GetDelegation(ctx, gomock.Any(), gomock.Any()).DoAndReturn( + func(_ context.Context, del sdk.AccAddress, val sdk.ValAddress) (stakingtypes.Delegation, bool) { + for _, d := range s.delegations { + if d.DelegatorAddress == del.String() && d.ValidatorAddress == val.String() { + return d, true + } + } + return stakingtypes.Delegation{}, false + }).AnyTimes() + + // Create active governors + for i := 0; i < len(govAddrs)-1; i++ { + governor, err := v1.NewGovernor(govAddrs[i].String(), v1.GovernorDescription{}, time.Now()) + require.NoError(t, err) + govKeeper.SetGovernor(ctx, governor) + s.activeGovernors = append(s.activeGovernors, governor) + } + // Create one inactive governor + inactiveGovAddr := govAddrs[len(govAddrs)-1] + governor, err := v1.NewGovernor(inactiveGovAddr.String(), v1.GovernorDescription{}, time.Now()) + require.NoError(t, err) + governor.Status = v1.Inactive + govKeeper.SetGovernor(ctx, governor) + s.inactiveGovernor = governor + return s +} + +// delegate updates the tallyFixture delegations and validators fields. +// WARNING: delegate must be called *after* any calls to govKeeper.DelegateToGovernor +// because the hooks are not invoked in this test setup. +func (s *fixture) delegate(delegator sdk.AccAddress, validator sdk.ValAddress, m int64) { + // Increment total bonded according to each delegations + s.totalBonded += m + delegation := stakingtypes.Delegation{ + DelegatorAddress: delegator.String(), + ValidatorAddress: validator.String(), + } + // Increase validator shares and tokens, compute delegation.Shares + for i := 0; i < len(s.validators); i++ { + if s.validators[i].OperatorAddress == validator.String() { + s.validators[i], delegation.Shares = s.validators[i].AddTokensFromDel(sdk.NewInt(m)) + break + } + } + s.delegations = append(s.delegations, delegation) +} + +// vote calls govKeeper.Vote() +func (s *fixture) vote(voter sdk.AccAddress, vote v1.VoteOption) { + err := s.keeper.AddVote(s.ctx, s.proposal.Id, voter, v1.NewNonSplitVoteOption(vote), "") + require.NoError(s.t, err) +} + +func (s *fixture) validatorVote(voter sdk.ValAddress, vote v1.VoteOption) { + s.vote(sdk.AccAddress(voter), vote) +} + +func (s *fixture) governorVote(voter types.GovernorAddress, vote v1.VoteOption) { + s.vote(sdk.AccAddress(voter), vote) +} diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index eaf4fb6f..477c6465 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -93,14 +93,14 @@ func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorA } func (k Keeper) ValidateGovernorMinSelfDelegation(ctx sdk.Context, governor v1.Governor) bool { - minGovernorSelfDelegation, _ := math.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 } + minGovernorSelfDelegation, _ := math.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) + bondedTokens := k.getGovernorBondedTokens(ctx, governor.GetAddress()) + delAddr := sdk.AccAddress(governor.GetAddress()) + if del, found := k.GetGovernanceDelegation(ctx, delAddr); !found || !governor.GetAddress().Equals(types.MustGovernorAddressFromBech32(del.GovernorAddress)) { panic("active governor without governance self-delegation") } diff --git a/x/gov/keeper/governor_test.go b/x/gov/keeper/governor_test.go new file mode 100644 index 00000000..40fa9693 --- /dev/null +++ b/x/gov/keeper/governor_test.go @@ -0,0 +1,163 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + v1 "github.com/atomone-hub/atomone/x/gov/types/v1" +) + +func TestGovernor(t *testing.T) { + assert := assert.New(t) + require := require.New(t) + govKeeper, _, _, ctx := setupGovKeeper(t) + addrs := simtestutil.CreateRandomAccounts(3) + govAddrs := convertAddrsToGovAddrs(addrs) + + // Add 2 governors + gov1Desc := v1.NewGovernorDescription("moniker1", "id1", "website1", "sec1", "detail1") + gov1, err := v1.NewGovernor(govAddrs[0].String(), gov1Desc, time.Now().UTC()) + require.NoError(err) + gov2Desc := v1.NewGovernorDescription("moniker2", "id2", "website2", "sec2", "detail2") + gov2, err := v1.NewGovernor(govAddrs[1].String(), gov2Desc, time.Now().UTC()) + gov2.Status = v1.Inactive + require.NoError(err) + govKeeper.SetGovernor(ctx, gov1) + govKeeper.SetGovernor(ctx, gov2) + + // Get gov1 + gov, found := govKeeper.GetGovernor(ctx, govAddrs[0]) + if assert.True(found, "cant find gov1") { + assert.Equal(gov1, gov) + } + + // Get gov2 + gov, found = govKeeper.GetGovernor(ctx, govAddrs[1]) + if assert.True(found, "cant find gov2") { + assert.Equal(gov2, gov) + } + + // Get all govs + govs := govKeeper.GetAllGovernors(ctx) + if assert.Len(govs, 2, "expected 2 governors") { + // Insert order is not preserved, order is related to the address which is + // generated randomly, so the order of govs is random. + for i := 0; i < 2; i++ { + switch govs[i].GetAddress().String() { + case gov1.GetAddress().String(): + assert.Equal(gov1, *govs[i]) + case gov2.GetAddress().String(): + assert.Equal(gov2, *govs[i]) + } + } + } + + // Get all active govs + govs = govKeeper.GetAllActiveGovernors(ctx) + if assert.Len(govs, 1, "expected 1 active governor") { + assert.Equal(gov1, *govs[0]) + } + + // IterateGovernors + govs = nil + govKeeper.IterateGovernors(ctx, func(i int64, govI v1.GovernorI) bool { + gov := govI.(v1.Governor) + govs = append(govs, &gov) + return false + }) + if assert.Len(govs, 2, "expected 2 governors") { + for i := 0; i < 2; i++ { + switch govs[i].GetAddress().String() { + case gov1.GetAddress().String(): + assert.Equal(gov1, *govs[i]) + case gov2.GetAddress().String(): + assert.Equal(gov2, *govs[i]) + } + } + } +} + +func TestValidateGovernorMinSelfDelegation(t *testing.T) { + tests := []struct { + name string + setup func(*fixture) v1.Governor + selfDelegation bool + valDelegations []stakingtypes.Delegation + expectedPanic bool + expectedValid bool + }{ + { + name: "inactive governor", + setup: func(s *fixture) v1.Governor { + return s.inactiveGovernor + }, + expectedPanic: false, + expectedValid: false, + }, + { + name: "active governor w/o self delegation w/o validator delegation", + setup: func(s *fixture) v1.Governor { + return s.activeGovernors[0] + }, + expectedPanic: true, + expectedValid: false, + }, + { + name: "active governor w self delegation w/o validator delegation", + setup: func(s *fixture) v1.Governor { + govAddr := s.activeGovernors[0].GetAddress() + delAddr := sdk.AccAddress(govAddr) + s.keeper.DelegateToGovernor(s.ctx, delAddr, govAddr) + return s.activeGovernors[0] + }, + expectedPanic: false, + expectedValid: false, + }, + { + name: "active governor w self delegation w not enough validator delegation", + setup: func(s *fixture) v1.Governor { + govAddr := s.activeGovernors[0].GetAddress() + delAddr := sdk.AccAddress(govAddr) + s.keeper.DelegateToGovernor(s.ctx, delAddr, govAddr) + s.delegate(delAddr, s.valAddrs[0], 1) + return s.activeGovernors[0] + }, + expectedPanic: false, + expectedValid: false, + }, + { + name: "active governor w self delegation w enough validator delegation", + setup: func(s *fixture) v1.Governor { + govAddr := s.activeGovernors[0].GetAddress() + delAddr := sdk.AccAddress(govAddr) + s.keeper.DelegateToGovernor(s.ctx, delAddr, govAddr) + s.delegate(delAddr, s.valAddrs[0], v1.DefaultMinGovernorSelfDelegation.Int64()) + return s.activeGovernors[0] + }, + expectedPanic: false, + expectedValid: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + govKeeper, mocks, _, ctx := setupGovKeeper(t, mockAccountKeeperExpectations) + s := newFixture(t, ctx, 2, 2, 2, govKeeper, mocks) + governor := tt.setup(s) + + if tt.expectedPanic { + assert.Panics(t, func() { govKeeper.ValidateGovernorMinSelfDelegation(ctx, governor) }) + } else { + valid := govKeeper.ValidateGovernorMinSelfDelegation(ctx, governor) + + assert.Equal(t, tt.expectedValid, valid, "return of ValidateGovernorMinSelfDelegation") + } + }) + } +} diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index de91c36f..6b0a8315 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -1,178 +1,21 @@ package keeper_test import ( - "context" "testing" - "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - sdkmath "cosmossdk.io/math" - - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/atomone-hub/atomone/x/gov/keeper" "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" ) -type tallyFixture struct { - t *testing.T - - proposal v1.Proposal - valAddrs []sdk.ValAddress - delAddrs []sdk.AccAddress - govAddrs []types.GovernorAddress - totalBonded int64 - validators []stakingtypes.Validator - delegations []stakingtypes.Delegation - - keeper *keeper.Keeper - ctx sdk.Context - mocks mocks -} - -// newTallyFixture returns a configured fixture for testing the govKeeper.Tally -// method. -// - setup TotalBondedTokens call -// - initiates the validators with a self delegation of 1: -// - setup IterateBondedValidatorsByPower call -// - setup IterateDelegations call for validators -func newTallyFixture(t *testing.T, ctx sdk.Context, proposal v1.Proposal, - valAddrs []sdk.ValAddress, delAddrs []sdk.AccAddress, govAddrs []types.GovernorAddress, - govKeeper *keeper.Keeper, mocks mocks, -) *tallyFixture { - s := &tallyFixture{ - t: t, - ctx: ctx, - proposal: proposal, - valAddrs: valAddrs, - delAddrs: delAddrs, - govAddrs: govAddrs, - keeper: govKeeper, - mocks: mocks, - } - mocks.stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()). - DoAndReturn(func(_ context.Context) sdkmath.Int { - return sdkmath.NewInt(s.totalBonded) - }).MaxTimes(1) - - // Mocks a bunch of validators - for i := 0; i < len(valAddrs); i++ { - s.validators = append(s.validators, stakingtypes.Validator{ - OperatorAddress: valAddrs[i].String(), - Status: stakingtypes.Bonded, - Tokens: sdkmath.ZeroInt(), - DelegatorShares: sdkmath.LegacyZeroDec(), - }) - // validator self delegation - s.delegate(sdk.AccAddress(valAddrs[i]), valAddrs[i], 1) - } - mocks.stakingKeeper.EXPECT(). - IterateBondedValidatorsByPower(ctx, gomock.Any()). - DoAndReturn( - func(ctx context.Context, fn func(index int64, validator stakingtypes.ValidatorI) bool) error { - for i := 0; i < len(valAddrs); i++ { - fn(int64(i), s.validators[i]) - } - return nil - }) - mocks.stakingKeeper.EXPECT(). - IterateDelegations(ctx, gomock.Any(), gomock.Any()). - DoAndReturn( - func(ctx context.Context, voter sdk.AccAddress, fn func(index int64, d stakingtypes.DelegationI) bool) error { - for i, d := range s.delegations { - if d.DelegatorAddress == voter.String() { - fn(int64(i), d) - } - } - return nil - }).AnyTimes() - mocks.stakingKeeper.EXPECT().GetValidator(ctx, gomock.Any()).DoAndReturn( - func(ctx context.Context, addr sdk.ValAddress) (stakingtypes.ValidatorI, bool) { - for i := 0; i < len(valAddrs); i++ { - if valAddrs[i].String() == addr.String() { - return s.validators[i], true - } - } - return nil, false - }).AnyTimes() - mocks.stakingKeeper.EXPECT().GetDelegation(ctx, gomock.Any(), gomock.Any()).DoAndReturn( - func(_ context.Context, del sdk.AccAddress, val sdk.ValAddress) (stakingtypes.Delegation, bool) { - for _, d := range s.delegations { - if d.DelegatorAddress == del.String() && d.ValidatorAddress == val.String() { - return d, true - } - } - return stakingtypes.Delegation{}, false - }).AnyTimes() - - // Create active governors - for i := 0; i < len(govAddrs)-1; i++ { - governor, err := v1.NewGovernor(govAddrs[i].String(), v1.GovernorDescription{}, time.Now()) - require.NoError(t, err) - govKeeper.SetGovernor(ctx, governor) - // governor self delegation - accAddr := sdk.AccAddress(govAddrs[i]) - s.delegate(accAddr, valAddrs[0], 1) - s.delegate(accAddr, valAddrs[1], 2) - govKeeper.DelegateToGovernor(ctx, accAddr, govAddrs[i]) - } - // Create one inactive governor - inactiveGovAddr := govAddrs[len(govAddrs)-1] - governor, err := v1.NewGovernor(inactiveGovAddr.String(), v1.GovernorDescription{}, time.Now()) - require.NoError(t, err) - governor.Status = v1.Inactive - govKeeper.SetGovernor(ctx, governor) - accAddr := sdk.AccAddress(inactiveGovAddr) - s.delegate(accAddr, valAddrs[0], 1) - s.delegate(accAddr, valAddrs[1], 2) - govKeeper.DelegateToGovernor(ctx, accAddr, inactiveGovAddr) - return s -} - -// delegate updates the tallyFixture delegations and validators fields. -// WARNING: delegate must be called *after* any calls to govKeeper.DelegateToGovernor -// because the hooks are not invoked in this test setup. -func (s *tallyFixture) delegate(delegator sdk.AccAddress, validator sdk.ValAddress, m int64) { - // Increment total bonded according to each delegations - s.totalBonded += m - delegation := stakingtypes.Delegation{ - DelegatorAddress: delegator.String(), - ValidatorAddress: validator.String(), - } - // Increase validator shares and tokens, compute delegation.Shares - for i := 0; i < len(s.validators); i++ { - if s.validators[i].OperatorAddress == validator.String() { - s.validators[i], delegation.Shares = s.validators[i].AddTokensFromDel(sdk.NewInt(m)) - break - } - } - s.delegations = append(s.delegations, delegation) -} - -// vote calls govKeeper.Vote() -func (s *tallyFixture) vote(voter sdk.AccAddress, vote v1.VoteOption) { - err := s.keeper.AddVote(s.ctx, s.proposal.Id, voter, v1.NewNonSplitVoteOption(vote), "") - require.NoError(s.t, err) -} - -func (s *tallyFixture) validatorVote(voter sdk.ValAddress, vote v1.VoteOption) { - s.vote(sdk.AccAddress(voter), vote) -} - -func (s *tallyFixture) governorVote(voter types.GovernorAddress, vote v1.VoteOption) { - s.vote(sdk.AccAddress(voter), vote) -} - func TestTally(t *testing.T) { tests := []struct { name string - setup func(*tallyFixture) + setup func(*fixture) proposalMsgs []sdk.Msg expectedPass bool expectedBurn bool @@ -192,7 +35,7 @@ func TestTally(t *testing.T) { }, { name: "one validator votes: prop fails/burn deposit", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) }, proposalMsgs: TestProposal, @@ -206,7 +49,7 @@ func TestTally(t *testing.T) { }, { name: "one account votes without delegation: prop fails/burn deposit", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, proposalMsgs: TestProposal, @@ -220,7 +63,7 @@ func TestTally(t *testing.T) { }, { name: "one delegator votes: prop fails/burn deposit", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, @@ -235,7 +78,7 @@ func TestTally(t *testing.T) { }, { name: "one governor vote w/o delegation: prop fails/burn deposit", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { // gov0 VP=3 vote=yes s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, @@ -250,7 +93,7 @@ func TestTally(t *testing.T) { }, { name: "one governor vote inherits delegation that didn't vote", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { // del0 VP=5 del=gov0 didn't vote s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 3) @@ -269,7 +112,7 @@ func TestTally(t *testing.T) { }, { name: "inactive governor vote doesn't inherit delegation that didn't vote", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { // del0 VP=5 del=gov2(inactive) didn't vote s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 3) @@ -288,7 +131,7 @@ func TestTally(t *testing.T) { }, { name: "one governor votes yes, one delegator votes yes", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { // del0 VP=5 del=gov0 vote=yes s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 3) @@ -308,7 +151,7 @@ func TestTally(t *testing.T) { }, { name: "one governor votes yes, one delegator votes no", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { // del0 VP=5 del=gov0 vote=no s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 3) @@ -329,7 +172,7 @@ func TestTally(t *testing.T) { { // Same case as previous one but with reverted vote order name: "one delegator votes no, one governor votes yes", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { // gov0 VP=3 del=gov0 vote=yes s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) // del0 VP=5 vote=no @@ -349,7 +192,7 @@ func TestTally(t *testing.T) { }, { name: "one governor votes and some delegations vote", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { // del0 VP=2 del=gov0 vote=no s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) @@ -387,7 +230,7 @@ func TestTally(t *testing.T) { }, { name: "two governors vote and some delegations vote", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { // del0 VP=2 del=gov0 vote=no s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) @@ -427,7 +270,7 @@ func TestTally(t *testing.T) { }, { name: "one delegator votes yes, validator votes also yes: prop fails/burn deposit", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.delegate(s.delAddrs[0], s.valAddrs[0], 1) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) @@ -443,7 +286,7 @@ func TestTally(t *testing.T) { }, { name: "one delegator votes yes, validator votes no: prop fails/burn deposit", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.delegate(s.delAddrs[0], s.valAddrs[0], 1) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) @@ -459,7 +302,7 @@ func TestTally(t *testing.T) { }, { name: "validator votes yes, doesn't inherit delegations", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[1], s.valAddrs[0], 2) s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) @@ -480,7 +323,7 @@ func TestTally(t *testing.T) { // second validator votes no // third validator (no delegation) votes abstain name: "delegator with mixed delegations: prop pass", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 2) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) @@ -499,7 +342,7 @@ func TestTally(t *testing.T) { }, { name: "quorum reached with only abstain: prop fails", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ABSTAIN) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ABSTAIN) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) @@ -517,7 +360,7 @@ func TestTally(t *testing.T) { }, { name: "quorum reached with yes<=.667: prop fails", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) @@ -535,7 +378,7 @@ func TestTally(t *testing.T) { }, { name: "quorum reached with yes>.667: prop succeeds", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) @@ -554,7 +397,7 @@ func TestTally(t *testing.T) { }, { name: "quorum reached thanks to abstain, yes>.667: prop succeeds", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) @@ -573,7 +416,7 @@ func TestTally(t *testing.T) { }, { name: "amendment quorum not reached: prop fails", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) }, @@ -588,7 +431,7 @@ func TestTally(t *testing.T) { }, { name: "amendment quorum reached and threshold not reached: prop fails", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) @@ -607,7 +450,7 @@ func TestTally(t *testing.T) { }, { name: "amendment quorum reached and threshold reached: prop passes", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) @@ -631,7 +474,7 @@ func TestTally(t *testing.T) { }, { name: "law quorum not reached: prop fails", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) }, @@ -646,7 +489,7 @@ func TestTally(t *testing.T) { }, { name: "law quorum reached and threshold not reached: prop fails", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) @@ -665,7 +508,7 @@ func TestTally(t *testing.T) { }, { name: "law quorum reached and threshold reached: prop passes", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) @@ -691,21 +534,20 @@ func TestTally(t *testing.T) { params.MinGovernorSelfDelegation = "1" err := govKeeper.SetParams(ctx, params) require.NoError(t, err) - var ( - numVals = 10 - numDelegators = 6 - numGovernors = 3 - addrs = simtestutil.CreateRandomAccounts(numVals + numDelegators + numGovernors) - valAddrs = simtestutil.ConvertAddrsToValAddrs(addrs[:numVals]) - delAddrs = addrs[numVals : numVals+numDelegators] - govAddrs = convertAddrsToGovAddrs(addrs[numVals+numDelegators:]) - ) + // Create the test fixture + s := newFixture(t, ctx, 10, 6, 3, govKeeper, mocks) + // Setup governor self delegation + for _, govAddr := range s.govAddrs { + accAddr := sdk.AccAddress(govAddr) + s.delegate(accAddr, s.valAddrs[0], 1) + s.delegate(accAddr, s.valAddrs[1], 2) + govKeeper.DelegateToGovernor(ctx, accAddr, govAddr) + } // Submit and activate a proposal - proposal, err := govKeeper.SubmitProposal(ctx, tt.proposalMsgs, "", "title", "summary", delAddrs[0]) + proposal, err := govKeeper.SubmitProposal(ctx, tt.proposalMsgs, "", "title", "summary", s.delAddrs[0]) require.NoError(t, err) govKeeper.ActivateVotingPeriod(ctx, proposal) - // Create the test fixture - s := newTallyFixture(t, ctx, proposal, valAddrs, delAddrs, govAddrs, govKeeper, mocks) + s.proposal = proposal if tt.setup != nil { tt.setup(s) } @@ -724,20 +566,20 @@ func TestHasReachedQuorum(t *testing.T) { tests := []struct { name string proposalMsgs []sdk.Msg - setup func(*tallyFixture) + setup func(*fixture) expectedQuorum bool }{ { name: "no votes: no quorum", proposalMsgs: TestProposal, - setup: func(s *tallyFixture) { + setup: func(s *fixture) { }, expectedQuorum: false, }, { name: "not enough votes: no quorum", proposalMsgs: TestProposal, - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) }, @@ -746,7 +588,7 @@ func TestHasReachedQuorum(t *testing.T) { { name: "enough votes: quorum", proposalMsgs: TestProposal, - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.delegate(s.delAddrs[0], s.valAddrs[2], 500000) @@ -760,7 +602,7 @@ func TestHasReachedQuorum(t *testing.T) { { name: "quorum reached by governor vote inheritance", proposalMsgs: TestProposal, - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.delegate(s.delAddrs[0], s.valAddrs[0], 500000) s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_ABSTAIN) @@ -769,7 +611,7 @@ func TestHasReachedQuorum(t *testing.T) { }, { name: "amendment quorum not reached", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) }, @@ -778,7 +620,7 @@ func TestHasReachedQuorum(t *testing.T) { }, { name: "amendment quorum reached", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) @@ -796,7 +638,7 @@ func TestHasReachedQuorum(t *testing.T) { }, { name: "law quorum not reached", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) }, @@ -805,7 +647,7 @@ func TestHasReachedQuorum(t *testing.T) { }, { name: "law quorum reached", - setup: func(s *tallyFixture) { + setup: func(s *fixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) @@ -823,21 +665,20 @@ func TestHasReachedQuorum(t *testing.T) { params.MinGovernorSelfDelegation = "1" err := govKeeper.SetParams(ctx, params) require.NoError(t, err) - var ( - numVals = 10 - numDelegators = 5 - numGovernors = 3 - addrs = simtestutil.CreateRandomAccounts(numVals + numDelegators + numGovernors) - valAddrs = simtestutil.ConvertAddrsToValAddrs(addrs[:numVals]) - delAddrs = addrs[numVals : numVals+numDelegators] - govAddrs = convertAddrsToGovAddrs(addrs[numVals+numDelegators:]) - ) // Submit and activate a proposal - proposal, err := govKeeper.SubmitProposal(ctx, tt.proposalMsgs, "", "title", "summary", delAddrs[0]) + s := newFixture(t, ctx, 10, 5, 3, govKeeper, mocks) + // Setup governor self delegation + for _, govAddr := range s.govAddrs { + accAddr := sdk.AccAddress(govAddr) + s.delegate(accAddr, s.valAddrs[0], 1) + s.delegate(accAddr, s.valAddrs[1], 2) + govKeeper.DelegateToGovernor(ctx, accAddr, govAddr) + } + proposal, err := govKeeper.SubmitProposal(ctx, tt.proposalMsgs, "", "title", "summary", s.delAddrs[0]) require.NoError(t, err) + s.proposal = proposal govKeeper.ActivateVotingPeriod(ctx, proposal) - suite := newTallyFixture(t, ctx, proposal, valAddrs, delAddrs, govAddrs, govKeeper, mocks) - tt.setup(suite) + tt.setup(s) quorum, err := govKeeper.HasReachedQuorum(ctx, proposal) @@ -845,7 +686,7 @@ func TestHasReachedQuorum(t *testing.T) { assert.Equal(t, tt.expectedQuorum, quorum) if tt.expectedQuorum { // Assert votes are still here after HasReachedQuorum - votes := suite.keeper.GetVotes(suite.ctx, proposal.Id) + votes := s.keeper.GetVotes(s.ctx, proposal.Id) assert.NotEmpty(t, votes, "votes must be kept after HasReachedQuorum") } }) diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 10aa98c3..366749ad 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -186,8 +186,6 @@ func RandomizedGenState(simState *module.SimulationState) { var quorumCheckCount uint64 simState.AppParams.GetOrGenerate(simState.Cdc, QuorumCheckCount, &quorumCheckCount, simState.Rand, func(r *rand.Rand) { quorumCheckCount = GenQuorumCheckCount(r) }) - maxGovernors := uint64(simState.Rand.Intn(100)) - var governorStatusChangePeriod time.Duration simState.AppParams.GetOrGenerate( simState.Cdc, GovernorStatusChangePeriod, &governorStatusChangePeriod, simState.Rand, @@ -202,7 +200,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, minGovernorSelfDelegation.String()), + 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, governorStatusChangePeriod, minGovernorSelfDelegation.String()), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index cd491c63..c8195997 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -68,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, minGovernorSelfDelegation string, + governorStatusChangePeriod time.Duration, minGovernorSelfDelegation string, ) Params { return Params{ MinDeposit: minDeposit, @@ -111,7 +111,6 @@ func DefaultParams() Params { DefaultQuorumTimeout, DefaultMaxVotingPeriodExtension, DefaultQuorumCheckCount, - DefaultMaxGovernors, DefaultGovernorStatusChangePeriod, DefaultMinGovernorSelfDelegation.String(), ) From 2713498849895954f5e1b7132edf1475a8c7b20c Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:12:09 +0100 Subject: [PATCH 49/70] fix merge conflicts --- go.mod | 1 + x/gov/types/v1/params.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ceb18e44..aa44a55d 100644 --- a/go.mod +++ b/go.mod @@ -37,6 +37,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 google.golang.org/grpc v1.67.0 google.golang.org/protobuf v1.34.2 + gopkg.in/yaml.v2 v2.4.0 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 ) diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 0a4aaef2..72aaab00 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -12,7 +12,6 @@ import ( // Default period for deposits & voting and min voting period const ( DefaultVotingPeriod time.Duration = time.Hour * 24 * 21 // 21 days - MinVotingPeriod time.Duration = time.Hour * 24 * 21 // 21 days DefaultDepositPeriod time.Duration = time.Hour * 24 * 14 // 14 days DefaultGovernorStatusChangePeriod time.Duration = time.Hour * 24 * 28 // 28 days ) From 8dee330f9bc290a823026662f7909b1539ca0e60 Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Thu, 16 Jan 2025 09:57:26 +0100 Subject: [PATCH 50/70] test(x/gov): add e2e tests for governors (#4) --- tests/e2e/e2e_exec_test.go | 24 +++++- tests/e2e/e2e_gov_test.go | 116 ++++++++++++++++++++++++-- tests/e2e/e2e_rest_regression_test.go | 2 +- tests/e2e/e2e_setup_test.go | 1 + tests/e2e/e2e_staking_test.go | 33 ++------ tests/e2e/e2e_test.go | 1 + tests/e2e/e2e_vesting_test.go | 48 +---------- tests/e2e/query_test.go | 62 ++++++++++++-- 8 files changed, 196 insertions(+), 91 deletions(-) diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index f712b845..8d047b49 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -469,11 +469,17 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g // }) // } -func (s *IntegrationTestSuite) execDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home string) { //nolint:unparam +func (s *IntegrationTestSuite) execDelegate(c *chain, valIdx int, amount sdk.Coin, valOperAddress, delegatorAddr string) { //nolint:unparam ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() + existingDelegation := sdk.ZeroDec() + res, err := s.queryDelegation(valOperAddress, delegatorAddr) + if err == nil { + existingDelegation = res.GetDelegationResponse().GetDelegation().GetShares() + } + s.T().Logf("Executing atomoned tx staking delegate %s", c.id) atomoneCommand := []string{ @@ -482,17 +488,29 @@ func (s *IntegrationTestSuite) execDelegate(c *chain, valIdx int, amount, valOpe stakingtypes.ModuleName, "delegate", valOperAddress, - amount, + amount.String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()), "--keyring-backend=test", - fmt.Sprintf("--%s=%s", flags.FlagHome, home), "--output=json", "-y", } s.executeAtomoneTxCommand(ctx, c, atomoneCommand, valIdx, s.defaultExecValidation(c, valIdx, nil)) + + // Validate delegation successful + s.Require().Eventually( + func() bool { + res, err := s.queryDelegation(valOperAddress, delegatorAddr) + s.Require().NoError(err) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + + return amt.Equal(existingDelegation.Add(sdk.NewDecFromInt(amount.Amount))) + }, + 20*time.Second, + time.Second, + ) s.T().Logf("%s successfully delegated %s to %s", delegatorAddr, amount, valOperAddress) } diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index d14096fd..c60d948e 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -15,7 +15,6 @@ import ( govtypes "github.com/atomone-hub/atomone/x/gov/types" govtypesv1 "github.com/atomone-hub/atomone/x/gov/types/v1" - govtypesv1beta1 "github.com/atomone-hub/atomone/x/gov/types/v1beta1" photontypes "github.com/atomone-hub/atomone/x/photon/types" ) @@ -242,6 +241,92 @@ func (s *IntegrationTestSuite) testGovConstitutionAmendment() { }) } +// testGovGovernors tests passing a text proposal and vote with governors. +func (s *IntegrationTestSuite) testGovGovernors() { + s.Run("governors", func() { + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + senderAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() + sender := senderAddress.String() + s.writeGovTextProposal(s.chainA) + + // create a governor + acc1Addr, _ := s.chainA.genesisAccounts[1].keyInfo.GetAddress() + governorAddr := govtypes.GovernorAddress(acc1Addr).String() + // a governor must have a delegation of at least 10atone + valAddr, _ := s.chainA.validators[0].keyInfo.GetAddress() + validatorAddr := sdk.ValAddress(valAddr).String() + govDelegatorAddr := acc1Addr.String() + govDelegation := sdk.NewInt64Coin("uatone", 10_000_000) + s.execDelegate(s.chainA, 0, govDelegation, validatorAddr, govDelegatorAddr) + // run create-governor + s.runGovExec(s.chainA, 0, govDelegatorAddr, "create-governor", []string{ + govDelegatorAddr, "moniker", "identity", "website", "security-contact", "details", + }) + // check governor is created + s.Require().Eventually( + func() bool { + governor, err := queryGovGovernor(chainAAPIEndpoint, governorAddr) + s.Require().NoError(err) + return governor.Governor != nil + }, + 15*time.Second, + time.Second, + ) + + // delegate to this governor + // first create a delegator + acc2Addr, _ := s.chainA.genesisAccounts[2].keyInfo.GetAddress() + delegatorAddr := acc2Addr.String() + delDelegation := sdk.NewInt64Coin("uatone", 10_000_000) + s.execDelegate(s.chainA, 0, delDelegation, validatorAddr, delegatorAddr) + // then delegate to governor + s.runGovExec(s.chainA, 0, delegatorAddr, "delegate-governor", []string{ + delegatorAddr, governorAddr, + }) + // check governor delegation is created + s.Require().Eventually( + func() bool { + resp, err := queryGovGovernorDelegation(chainAAPIEndpoint, delegatorAddr) + s.Require().NoError(err) + return resp.GovernorAddress == governorAddr + }, + 15*time.Second, + time.Second, + ) + // assert governor valshares + resp, err := queryGovGovernorValShares(chainAAPIEndpoint, governorAddr) + s.Require().NoError(err) + s.Require().Len(resp.ValShares, 1, "expected 1 valshare") + s.Require().Equal(governorAddr, resp.ValShares[0].GovernorAddress) + s.Require().Equal(validatorAddr, resp.ValShares[0].ValidatorAddress) + validator, err := queryValidator(chainAAPIEndpoint, validatorAddr) + s.Require().NoError(err) + totalDelegations := delDelegation.Add(govDelegation) + expectedShares, err := validator.SharesFromTokens(totalDelegations.Amount) + s.Require().NoError(err) + s.Require().True(expectedShares.Equal(resp.ValShares[0].Shares), "want shares %s, got %s", expectedShares, resp.ValShares[0].Shares) + + // Create a governance proposal + proposalCounter++ + submitGovFlags := []string{configFile(proposalTextFilename)} + s.submitGovCommand(chainAAPIEndpoint, sender, proposalCounter, "submit-proposal", submitGovFlags, govtypesv1.StatusVotingPeriod) + + // Vote with governor + voteFlags := []string{strconv.Itoa(proposalCounter), "yes"} + s.submitGovCommand(chainAAPIEndpoint, govDelegatorAddr, proposalCounter, "vote", voteFlags, govtypesv1.StatusPassed) + + // assert tally result + prop, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) + s.Require().NoError(err) + expectedTally := &govtypesv1.TallyResult{ + YesCount: totalDelegations.Amount.String(), + NoCount: "0", + AbstainCount: "0", + } + s.Require().Equal(expectedTally, prop.Proposal.FinalTallyResult) + }) +} + func (s *IntegrationTestSuite) submitLegacyGovProposal(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) { s.T().Logf("Submitting Gov Proposal: %s", proposalType) // min deposit of 1000uatone is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped @@ -249,11 +334,11 @@ func (s *IntegrationTestSuite) submitLegacyGovProposal(chainAAPIEndpoint, sender if withDeposit { sflags = append(sflags, "--deposit="+initialDepositAmount.String()) } - s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-legacy-proposal", sflags, govtypesv1beta1.StatusDepositPeriod) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-legacy-proposal", sflags, govtypesv1.StatusDepositPeriod) s.T().Logf("Depositing Gov Proposal: %s", proposalType) - s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypesv1beta1.StatusVotingPeriod) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypesv1.StatusVotingPeriod) s.T().Logf("Voting Gov Proposal: %s", proposalType) - s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypesv1beta1.StatusPassed) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypesv1.StatusPassed) } // NOTE: in SDK >= v0.47 the submit-proposal does not have a --deposit flag @@ -263,11 +348,11 @@ func (s *IntegrationTestSuite) submitLegacyGovProposal(chainAAPIEndpoint, sender func (s *IntegrationTestSuite) submitGovProposal(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string) { s.T().Logf("Submitting Gov Proposal: %s", proposalType) sflags := submitFlags - s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-proposal", sflags, govtypesv1beta1.StatusDepositPeriod) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-proposal", sflags, govtypesv1.StatusDepositPeriod) s.T().Logf("Depositing Gov Proposal: %s", proposalType) - s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypesv1beta1.StatusVotingPeriod) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypesv1.StatusVotingPeriod) s.T().Logf("Voting Gov Proposal: %s", proposalType) - s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypesv1beta1.StatusPassed) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypesv1.StatusPassed) } func (s *IntegrationTestSuite) verifyChainHaltedAtUpgradeHeight(c *chain, valIdx int, upgradeHeight int64) { @@ -312,7 +397,7 @@ func (s *IntegrationTestSuite) verifyChainPassesUpgradeHeight(c *chain, valIdx i ) } -func (s *IntegrationTestSuite) submitGovCommand(chainAAPIEndpoint, sender string, proposalID int, govCommand string, proposalFlags []string, expectedSuccessStatus govtypesv1beta1.ProposalStatus) { +func (s *IntegrationTestSuite) submitGovCommand(chainAAPIEndpoint, sender string, proposalID int, govCommand string, proposalFlags []string, expectedSuccessStatus govtypesv1.ProposalStatus) { s.runGovExec(s.chainA, 0, sender, govCommand, proposalFlags) s.Require().Eventually( @@ -374,6 +459,21 @@ func (s *IntegrationTestSuite) writePhotonParamChangeProposal(c *chain, params p s.Require().NoError(err) } +// writeGovTextProposal creates a text proposal JSON file with full required deposit. +func (s *IntegrationTestSuite) writeGovTextProposal(c *chain) { + template := ` + { + "deposit": "%s", + "metadata": "The metadata", + "title": "A text proposal", + "summary": "The summary" + } + ` + propMsgBody := fmt.Sprintf(template, depositAmount) + err := writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalTextFilename), []byte(propMsgBody)) + s.Require().NoError(err) +} + func (s *IntegrationTestSuite) writeGovConstitutionAmendmentProposal(c *chain, amendment string) { govModuleAddress := authtypes.NewModuleAddress(govtypes.ModuleName).String() // escape newlines in amendment diff --git a/tests/e2e/e2e_rest_regression_test.go b/tests/e2e/e2e_rest_regression_test.go index 0432dc45..29890b50 100644 --- a/tests/e2e/e2e_rest_regression_test.go +++ b/tests/e2e/e2e_rest_regression_test.go @@ -37,7 +37,7 @@ const ( authParamsModuleQueryPath = "/cosmos/auth/v1beta1/params" distributionCommPoolModuleQueryPath = "/cosmos/distribution/v1beta1/community_pool" evidenceModuleQueryPath = "/cosmos/evidence/v1beta1/evidence" - govPropsModuleQueryPath = "/atomone/gov/v1beta1/proposals" + govPropsModuleQueryPath = "/atomone/gov/v1/proposals" mintParamsModuleQueryPath = "/cosmos/mint/v1beta1/params" slashingParamsModuleQueryPath = "/cosmos/slashing/v1beta1/params" stakingParamsModuleQueryPath = "/cosmos/staking/v1beta1/params" diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 302a6601..c5a258cf 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -65,6 +65,7 @@ const ( proposalMaxTotalBypassFilename = "proposal_max_total_bypass.json" proposalCommunitySpendFilename = "proposal_community_spend.json" proposalParamChangeFilename = "param_change.json" + proposalTextFilename = "text.json" proposalConstitutionAmendmentFilename = "constitution_amendment.json" newConstitutionFilename = "new_constitution.md" diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index ee4766b7..eda97f0e 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -25,30 +25,11 @@ func (s *IntegrationTestSuite) testStaking() { delegatorAddress, _ := s.chainA.genesisAccounts[2].keyInfo.GetAddress() - existingDelegation := sdk.ZeroDec() - res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) - if err == nil { - existingDelegation = res.GetDelegationResponse().GetDelegation().GetShares() - } - delegationAmount := sdk.NewInt(500000000) delegation := sdk.NewCoin(uatoneDenom, delegationAmount) // 500 atom // Alice delegate uatone to Validator A - s.execDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress.String(), atomoneHomePath) - - // Validate delegation successful - s.Require().Eventually( - func() bool { - res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) - amt := res.GetDelegationResponse().GetDelegation().GetShares() - s.Require().NoError(err) - - return amt.Equal(existingDelegation.Add(sdk.NewDecFromInt(delegationAmount))) - }, - 20*time.Second, - time.Second, - ) + s.execDelegate(s.chainA, 0, delegation, validatorAddressA, delegatorAddress.String()) redelegationAmount := delegationAmount.Quo(sdk.NewInt(2)) redelegation := sdk.NewCoin(uatoneDenom, redelegationAmount) // 250 atom @@ -59,9 +40,9 @@ func (s *IntegrationTestSuite) testStaking() { // Validate re-delegation successful s.Require().Eventually( func() bool { - res, err := queryDelegation(chainEndpoint, validatorAddressB, delegatorAddress.String()) - amt := res.GetDelegationResponse().GetDelegation().GetShares() + res, err := s.queryDelegation(validatorAddressB, delegatorAddress.String()) s.Require().NoError(err) + amt := res.GetDelegationResponse().GetDelegation().GetShares() return amt.Equal(sdk.NewDecFromInt(redelegationAmount)) }, @@ -77,9 +58,9 @@ func (s *IntegrationTestSuite) testStaking() { // query alice's current delegation from validator A s.Require().Eventually( func() bool { - res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) - amt := res.GetDelegationResponse().GetDelegation().GetShares() + res, err := s.queryDelegation(validatorAddressA, delegatorAddress.String()) s.Require().NoError(err) + amt := res.GetDelegationResponse().GetDelegation().GetShares() currDelegationAmount = amt.TruncateInt() currDelegation = sdk.NewCoin(uatoneDenom, currDelegationAmount) @@ -124,9 +105,9 @@ func (s *IntegrationTestSuite) testStaking() { // validate that unbonding delegation was successfully canceled s.Require().Eventually( func() bool { - resDel, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) - amt := resDel.GetDelegationResponse().GetDelegation().GetShares() + resDel, err := s.queryDelegation(validatorAddressA, delegatorAddress.String()) s.Require().NoError(err) + amt := resDel.GetDelegationResponse().GetDelegation().GetShares() // expect that no unbonding delegations are found for validator A _, err = queryUnbondingDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index a2f53e63..522e389d 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -61,6 +61,7 @@ func (s *IntegrationTestSuite) TestGov() { s.testGovCommunityPoolSpend() s.testGovParamChange() s.testGovConstitutionAmendment() + s.testGovGovernors() } func (s *IntegrationTestSuite) TestIBC() { diff --git a/tests/e2e/e2e_vesting_test.go b/tests/e2e/e2e_vesting_test.go index 614e5695..ed70ad71 100644 --- a/tests/e2e/e2e_vesting_test.go +++ b/tests/e2e/e2e_vesting_test.go @@ -61,21 +61,7 @@ func (s *IntegrationTestSuite) testDelayedVestingAccount(api string) { s.Require().Equal(vestingBalance.AmountOf(uatoneDenom), balance.Amount) // Delegate coins should succeed - s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, - vestingDelayedAcc.String(), atomoneHomePath) - - // Validate delegation successful - s.Require().Eventually( - func() bool { - res, err := queryDelegation(api, valOpAddr, vestingDelayedAcc.String()) - amt := res.GetDelegationResponse().GetDelegation().GetShares() - s.Require().NoError(err) - - return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) - }, - 20*time.Second, - time.Second, - ) + s.execDelegate(chain, valIdx, vestingDelegationAmount, valOpAddr, vestingDelayedAcc.String()) waitTime := acc.EndTime - time.Now().Unix() if waitTime > vestingTxDelay { @@ -128,21 +114,7 @@ func (s *IntegrationTestSuite) testContinuousVestingAccount(api string) { s.Require().Equal(vestingBalance.AmountOf(uatoneDenom), balance.Amount) // Delegate coins should succeed - s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), - valOpAddr, continuousVestingAcc.String(), atomoneHomePath) - - // Validate delegation successful - s.Require().Eventually( - func() bool { - res, err := queryDelegation(api, valOpAddr, continuousVestingAcc.String()) - amt := res.GetDelegationResponse().GetDelegation().GetShares() - s.Require().NoError(err) - - return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) - }, - 20*time.Second, - time.Second, - ) + s.execDelegate(chain, valIdx, vestingDelegationAmount, valOpAddr, continuousVestingAcc.String()) waitStartTime := acc.StartTime - time.Now().Unix() if waitStartTime > vestingTxDelay { @@ -262,21 +234,7 @@ func (s *IntegrationTestSuite) testPeriodicVestingAccount(api string) { //nolint } // Delegate coins should succeed - s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, - periodicVestingAddr, atomoneHomePath) - - // Validate delegation successful - s.Require().Eventually( - func() bool { - res, err := queryDelegation(api, valOpAddr, periodicVestingAddr) - amt := res.GetDelegationResponse().GetDelegation().GetShares() - s.Require().NoError(err) - - return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) - }, - 20*time.Second, - time.Second, - ) + s.execDelegate(chain, valIdx, vestingDelegationAmount, valOpAddr, periodicVestingAddr) // Transfer coins should succeed balance, err = getSpecificBalance(api, periodicVestingAddr, uatoneDenom) diff --git a/tests/e2e/query_test.go b/tests/e2e/query_test.go index c9a1a4cb..d18b2a56 100644 --- a/tests/e2e/query_test.go +++ b/tests/e2e/query_test.go @@ -18,7 +18,6 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" govtypesv1 "github.com/atomone-hub/atomone/x/gov/types/v1" - govtypesv1beta1 "github.com/atomone-hub/atomone/x/gov/types/v1beta1" photontypes "github.com/atomone-hub/atomone/x/photon/types" ) @@ -105,15 +104,14 @@ func queryStakingParams(endpoint string) (stakingtypes.QueryParamsResponse, erro return params, nil } -func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryDelegationResponse, error) { +func (s *IntegrationTestSuite) queryDelegation(validatorAddr string, delegatorAddr string) (stakingtypes.QueryDelegationResponse, error) { var res stakingtypes.QueryDelegationResponse - + endpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s/delegations/%s", endpoint, validatorAddr, delegatorAddr)) if err != nil { return res, err } - - if err = cdc.UnmarshalJSON(body, &res); err != nil { + if err := cdc.UnmarshalJSON(body, &res); err != nil { return res, err } return res, nil @@ -161,10 +159,10 @@ func queryDelegatorTotalRewards(endpoint, delegatorAddr string) (disttypes.Query return res, nil } -func queryGovProposal(endpoint string, proposalID int) (govtypesv1beta1.QueryProposalResponse, error) { - var govProposalResp govtypesv1beta1.QueryProposalResponse +func queryGovProposal(endpoint string, proposalID int) (govtypesv1.QueryProposalResponse, error) { + var govProposalResp govtypesv1.QueryProposalResponse - path := fmt.Sprintf("%s/atomone/gov/v1beta1/proposals/%d", endpoint, proposalID) + path := fmt.Sprintf("%s/atomone/gov/v1/proposals/%d", endpoint, proposalID) body, err := httpGet(path) if err != nil { @@ -177,6 +175,54 @@ func queryGovProposal(endpoint string, proposalID int) (govtypesv1beta1.QueryPro return govProposalResp, nil } +func queryGovGovernor(endpoint string, govAddr string) (govtypesv1.QueryGovernorResponse, error) { + var resp govtypesv1.QueryGovernorResponse + + path := fmt.Sprintf("%s/atomone/gov/v1/governor/%s", endpoint, govAddr) + + body, err := httpGet(path) + if err != nil { + return resp, fmt.Errorf("failed to execute HTTP request: %w", err) + } + if err := cdc.UnmarshalJSON(body, &resp); err != nil { + return resp, err + } + + return resp, nil +} + +func queryGovGovernorDelegation(endpoint string, delAddr string) (govtypesv1.QueryGovernanceDelegationResponse, error) { + var resp govtypesv1.QueryGovernanceDelegationResponse + + path := fmt.Sprintf("%s/atomone/gov/v1/delegations/%s", endpoint, delAddr) + + body, err := httpGet(path) + if err != nil { + return resp, fmt.Errorf("failed to execute HTTP request: %w", err) + } + if err := cdc.UnmarshalJSON(body, &resp); err != nil { + return resp, err + } + + return resp, nil +} + +func queryGovGovernorValShares(endpoint string, govAddr string) (govtypesv1.QueryGovernorValSharesResponse, error) { + var resp govtypesv1.QueryGovernorValSharesResponse + + path := fmt.Sprintf("%s/atomone/gov/v1/vshares/%s", endpoint, govAddr) + + body, err := httpGet(path) + if err != nil { + return resp, fmt.Errorf("failed to execute HTTP request: %w", err) + } + if err := cdc.UnmarshalJSON(body, &resp); err != nil { + return resp, err + } + + return resp, nil +} + func queryAccount(endpoint, address string) (acc authtypes.AccountI, err error) { var res authtypes.QueryAccountResponse resp, err := http.Get(fmt.Sprintf("%s/cosmos/auth/v1beta1/accounts/%s", endpoint, address)) From f25a8a4a8af752a8d04ad8ee7e850c9cf32ff447 Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Thu, 16 Jan 2025 10:40:21 +0100 Subject: [PATCH 51/70] fix(x/gov): REST query governor URL --- proto/atomone/gov/v1/query.proto | 2 +- tests/e2e/query_test.go | 2 +- x/gov/types/v1/query.pb.go | 178 +++++++++++++++---------------- x/gov/types/v1/query.pb.gw.go | 2 +- 4 files changed, 92 insertions(+), 92 deletions(-) diff --git a/proto/atomone/gov/v1/query.proto b/proto/atomone/gov/v1/query.proto index cc0c481e..8be8b73e 100644 --- a/proto/atomone/gov/v1/query.proto +++ b/proto/atomone/gov/v1/query.proto @@ -64,7 +64,7 @@ service Query { // Governor queries governor information based on governor address. rpc Governor(QueryGovernorRequest) returns (QueryGovernorResponse) { - option (google.api.http).get = "/atomone/gov/v1/governor/{governor_address}"; + option (google.api.http).get = "/atomone/gov/v1/governors/{governor_address}"; } // Governors queries all governors. diff --git a/tests/e2e/query_test.go b/tests/e2e/query_test.go index d18b2a56..0ea18589 100644 --- a/tests/e2e/query_test.go +++ b/tests/e2e/query_test.go @@ -178,7 +178,7 @@ func queryGovProposal(endpoint string, proposalID int) (govtypesv1.QueryProposal func queryGovGovernor(endpoint string, govAddr string) (govtypesv1.QueryGovernorResponse, error) { var resp govtypesv1.QueryGovernorResponse - path := fmt.Sprintf("%s/atomone/gov/v1/governor/%s", endpoint, govAddr) + path := fmt.Sprintf("%s/atomone/gov/v1/governors/%s", endpoint, govAddr) body, err := httpGet(path) if err != nil { diff --git a/x/gov/types/v1/query.pb.go b/x/gov/types/v1/query.pb.go index ed5738da..af428b57 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{ - // 1399 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, 0xc0, 0xc8, 0xb6, 0x2b, - 0x2c, 0xc8, 0x74, 0x33, 0x83, 0xfc, 0x08, 0x11, 0xc5, 0x15, 0x58, 0x49, 0xd4, 0xe0, 0x40, 0x38, - 0x78, 0x99, 0xf4, 0xee, 0x74, 0x9a, 0x49, 0x66, 0xbb, 0x86, 0xe9, 0x9e, 0x8e, 0x9b, 0x75, 0x42, - 0x62, 0x62, 0x22, 0xc6, 0x03, 0xc6, 0x18, 0x23, 0x7f, 0x80, 0x17, 0x0f, 0x5e, 0xe0, 0xe0, 0xcd, - 0xa3, 0x47, 0x82, 0x17, 0x8f, 0x66, 0xd7, 0x3f, 0xc4, 0x74, 0xd5, 0xab, 0xfe, 0x35, 0xdd, 0x3d, - 0x33, 0x38, 0x1a, 0x6f, 0x3b, 0xd5, 0xdf, 0x7b, 0xef, 0xab, 0xaf, 0x5e, 0x55, 0x7d, 0xb5, 0xa0, - 0x18, 0x2e, 0xdb, 0x60, 0xb6, 0xa9, 0x5b, 0xcc, 0xd3, 0xbd, 0x8a, 0xfe, 0xa0, 0x6b, 0x76, 0x36, - 0xb5, 0x76, 0x87, 0xb9, 0x8c, 0xce, 0xe1, 0x37, 0xcd, 0x62, 0x9e, 0xe6, 0x55, 0x94, 0x33, 0xeb, - 0xcc, 0xd9, 0x60, 0x8e, 0xbe, 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7, 0x61, 0xb1, 0x3f, 0x36, 0x58, 0xa3, 0x49, - 0xde, 0x6a, 0xb8, 0x42, 0xe9, 0x8d, 0x89, 0x31, 0x02, 0xa9, 0x36, 0x70, 0x8d, 0x56, 0x99, 0x67, - 0x76, 0x6c, 0xd6, 0x91, 0x3c, 0x3e, 0x80, 0x79, 0x0b, 0x87, 0xea, 0x86, 0xe8, 0x15, 0xb1, 0x73, - 0x57, 0x16, 0x5f, 0x3c, 0x2d, 0x1f, 0x97, 0x89, 0x65, 0x58, 0xbc, 0x9d, 0xf6, 0x5b, 0xf1, 0xe1, - 0xe0, 0x12, 0x0f, 0xab, 0x84, 0x97, 0xb8, 0xc4, 0x66, 0x5d, 0xe2, 0x41, 0x4c, 0x80, 0x54, 0xeb, - 0x89, 0x74, 0x41, 0x67, 0xc5, 0x1b, 0x87, 0xfc, 0xf3, 0x2b, 0x31, 0x52, 0x21, 0xbc, 0x12, 0x25, - 0x8f, 0xcc, 0x2b, 0x31, 0xa0, 0x1c, 0x42, 0xc7, 0xd7, 0x3c, 0xbf, 0x10, 0x58, 0x8c, 0x70, 0x33, - 0xec, 0x75, 0xf3, 0xba, 0xd9, 0x32, 0x2d, 0x61, 0x00, 0xff, 0x95, 0xf5, 0x1b, 0xdb, 0x86, 0x7c, - 0x46, 0x40, 0xcd, 0xe3, 0x8e, 0x1a, 0xdf, 0x84, 0x99, 0x46, 0x38, 0x8c, 0x2a, 0x2f, 0xa5, 0xab, - 0x1c, 0xcf, 0x51, 0x8b, 0x06, 0x8e, 0x4f, 0xf3, 0x26, 0x9c, 0xc8, 0xa4, 0x2d, 0x15, 0xbf, 0x01, - 0x07, 0xb0, 0x76, 0x9f, 0xe4, 0xd9, 0x07, 0xef, 0x7c, 0x10, 0x22, 0xb7, 0xca, 0x47, 0x39, 0xab, - 0x1b, 0x08, 0x74, 0x3a, 0x6b, 0x75, 0xfb, 0xb7, 0xde, 0x33, 0x02, 0xc7, 0x63, 0xad, 0x7c, 0xcf, - 0x68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56, 0x4e, 0xa9, 0x8e, 0x12, - 0x82, 0x1c, 0xaf, 0x71, 0x8e, 0x57, 0xe8, 0xe5, 0x4c, 0x8e, 0x29, 0xaa, 0xe9, 0x51, 0xef, 0xf4, - 0x94, 0xc0, 0x42, 0x5a, 0x0d, 0x7a, 0x6e, 0x68, 0x3a, 0x72, 0x02, 0x95, 0x11, 0x22, 0x90, 0xff, - 0x25, 0xce, 0xbf, 0x42, 0xf5, 0x24, 0xff, 0x08, 0x45, 0x7f, 0xb7, 0x26, 0xfc, 0x56, 0x8f, 0xfe, - 0x48, 0xe0, 0x40, 0xdf, 0x95, 0x4f, 0xcb, 0xb9, 0x4b, 0x9b, 0x74, 0x44, 0x8a, 0x36, 0x2c, 0x1c, - 0xd9, 0x56, 0x39, 0xdb, 0xb3, 0xf4, 0x4c, 0x92, 0xad, 0x27, 0xbc, 0x49, 0x8a, 0xd6, 0x2b, 0xab, - 0xbf, 0x6d, 0x97, 0xc8, 0xf3, 0xed, 0x12, 0xf9, 0x73, 0xbb, 0x44, 0x1e, 0xef, 0x94, 0x76, 0x3d, - 0xdf, 0x29, 0xed, 0xfa, 0x63, 0xa7, 0xb4, 0xeb, 0x93, 0xb2, 0xd5, 0x74, 0xef, 0x77, 0xd7, 0xb4, - 0x75, 0xb6, 0x21, 0xf3, 0x95, 0xef, 0x77, 0xd7, 0x82, 0xdc, 0x9f, 0xf2, 0xec, 0xfe, 0x09, 0xea, - 0xe8, 0x5e, 0x65, 0x6d, 0x0f, 0xff, 0xef, 0xed, 0xf9, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x4e, - 0xec, 0x5f, 0xb6, 0x6a, 0x16, 0x00, 0x00, + // 1397 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcf, 0x6f, 0x13, 0x47, + 0x14, 0x66, 0x4c, 0x02, 0xc9, 0x4b, 0x08, 0x61, 0x1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xc0, + 0x81, 0xbe, 0x3b, 0x9f, 0x96, 0x73, 0x97, 0x36, 0x69, 0x89, 0x14, 0x6d, 0x58, 0x38, 0xb2, 0xad, + 0x72, 0xb6, 0x67, 0xe9, 0x99, 0x24, 0x5b, 0x4f, 0x98, 0x93, 0x14, 0xad, 0x57, 0x56, 0x7f, 0xdb, + 0x2e, 0x91, 0x17, 0xdb, 0x25, 0xf2, 0xe7, 0x76, 0x89, 0x3c, 0xd9, 0x29, 0xed, 0x7a, 0xb1, 0x53, + 0xda, 0xf5, 0xc7, 0x4e, 0x69, 0xd7, 0x27, 0x65, 0xab, 0xe9, 0x3e, 0xe8, 0xae, 0x69, 0xeb, 0x6c, + 0x43, 0xe6, 0x2b, 0x3f, 0xe8, 0xae, 0x05, 0xb9, 0x3f, 0xe5, 0xd9, 0xfd, 0x23, 0xd4, 0xd1, 0xbd, + 0xca, 0xda, 0x1e, 0xfe, 0xef, 0xdb, 0xf3, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x0d, 0x21, + 0xc8, 0x6b, 0x16, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/gov/types/v1/query.pb.gw.go b/x/gov/types/v1/query.pb.gw.go index 9ed7707f..fe6fed82 100644 --- a/x/gov/types/v1/query.pb.gw.go +++ b/x/gov/types/v1/query.pb.gw.go @@ -1504,7 +1504,7 @@ var ( 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_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", "governors", "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))) From 539ee0ea3b33211ce90a9c6679911893f72b8d26 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Mon, 20 Jan 2025 14:38:33 +0100 Subject: [PATCH 52/70] docs(x/gov): add governors ADR (#5) * add governors adr * Update docs/architecture/adr-004-governors.md Co-authored-by: Thomas Bruyelle --------- Co-authored-by: Thomas Bruyelle --- docs/architecture/adr-004-governors.md | 121 +++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 docs/architecture/adr-004-governors.md diff --git a/docs/architecture/adr-004-governors.md b/docs/architecture/adr-004-governors.md new file mode 100644 index 00000000..f9e45b2b --- /dev/null +++ b/docs/architecture/adr-004-governors.md @@ -0,0 +1,121 @@ +# ADR 004: Governors System + +## Changelog + +- 2025-01-17: Initial version + +## Status + +Implemented (https://github.com/atomone-hub/atomone/pull/73) + +## Abstract + +This ADR proposes an enhanced governance model introducing “*Governors*” as a +special class of participants within the governance module. Unlike traditional +Cosmos-SDK governance, users can delegate their governance power to active +governors who meet specific eligibility criteria (e.g., minimum governance +self-delegation) while staking delegations to validators are not counted towards +determining their governance voting power (no validator inheritance). +The proposed changes alters vote tallying adding a separate and governance-specific +delegation mechanism to the one in `x/staking`, while trying to minimize impact on +tally and overall chain performance, and also define rules for transitioning +between governor statuses. The aim is to give the governance system a flexible +structure, enabling representative governance while maintaining the separation +of powers between validators and governors. + +## Context + +While the standard Cosmos-SDK governance module allows validators to vote on +proposals with all their delegated tokens unless delegators override their votes, +AtomOne removes this feature to prevent validators from having undue influence and +segregate the role of validator to securing the network. However, this approach +leads to the necessity for all users to be actively involved in governance, which +is not necessarily ideal. As of now, the governance module primarily relies on +on direct token voting (where each delegator votes with their own staked tokens). +However, as on-chain governance grows more complex, certain community members +might still prefer to delegate their voting power to specialized actors (governors) +that represent their political views. This shift requires formalizing participant +roles and creating processes for delegating power, ensuring alignment with the +network’s interests and enabling accurate tally calculations. + +## Decision + +1. Introduction of `Governor` Entities: + - A `Governor` is created through a `MsgCreateGovernor` transaction. + - The system enforces a minimum governance self-delegation requirement + before an account can achieve active governor status, which in practice + translates to a minimum stake requirement. + - The system tracks each governor’s address, description, status (e.g., active), + and last status change time (to limit frequent status toggles). + +2. Delegation and Undelegation: + - Users (delegators) can delegate their governance power to a governor via + `MsgDelegateGovernor`. Only a single governor can be chosen at a time, and + the delegation is always for the full voting power of the delegator. + - If a delegator wishes to delegate to a different governor, they may do so + directly, automatically redelegating from any existing governor, and this + can be done at any time with no restrictions, except for active governors + themselves which are force to delegate their governance power to themselves. + - A user can also choose to undelegate from a governor with + `MsgUndelegateGovernor`, reverting to direct voting only. + +3. Tally Logic: + - Each delegator’s staked tokens contribute to the total voting power of their + chosen governor since governance delegations are for the full voting power. + - During tallying, the system aggregates all delegated voting power plus any + governor’s own staked tokens (minus any deducted shares for direct votes by + delegators). + - Only votes from active governors or direct votes made by delegators are + counted. If a delegator votes directly, the corresponding shares are deducted + from the governor’s aggregated shares to avoid double counting (similarly + to how it's done in canonical Cosmos-SDK governance for validators). + +4. Transitioning Governor Status: + - A governor can switch their status (e.g., from inactive to active) by meeting + the min self-delegation threshold and updating their status with a + `MsgUpdateGovernorStatus`. Governors that set themselves to inactive are allowed + to delegate their governance voting power to another governor. A status change + can however only occur after a waiting period (`GovernorStatusChangePeriod`). + - Attempts to rapidly change status are disallowed; changes can only occur + after the specified waiting period (`GovernorStatusChangePeriod`). + +5. Parameters: + - `MinGovernorSelfDelegation`: The minimum number of tokens a governor must + stake to achieve or maintain active status. + - `GovernorStatusChangePeriod`: The time a governor must wait since the last + status change before being allowed to change status again. + +## Consequences + +### Positive + +- Allows specialized participants (governors) to manage governance responsibilities, +potentially improving governance participation. +- Reduces complexity for casual stakers by letting them delegate governance +authority without having to participate actively every proposal, while always retaining +the option to vote directly. +- Retain segregation from the staking delegations system allowing governance and +staking delegations to be managed independently. This however does not prevent a +validator from also being a governor, but the two roles are kept separate. + +### Negative + +- Introduces more complexity in the governance codebase and state, with potential +performance implications for tallying and querying. +- Requires users to learn how to delegate to or become a governor, which in itself +may be a hurdle for some users. +- Requires clients and frontends to adapt to the new governance model, potentially +requiring changes to existing interfaces. + +### Neutral + +- The fundamental governance mechanisms (e.g., proposals, deposit structures) +remain largely the same. +- Governor-based delegation is optional; delegators can still vote independently +if they prefer. + +## References + +- [GIST following discussions during AtomOne Constitution Working Group](https://gist.github.com/giunatale/95e9b43f6e265ba32b29e2769f7b8a37) +- [Governors System PR](https://github.com/atomone-hub/atomone/pull/73) +- [Governors Initial Implementation Draft PR](https://github.com/atomone-hub/atomone/pull/16) From 1b03975d5816d77746df2403f1e5414969885c97 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 23 Jan 2025 13:11:48 +0100 Subject: [PATCH 53/70] docs(x/gov): add governors documentation (#6) * add governors documentation * add txs in CLI section --- x/gov/README.md | 558 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 499 insertions(+), 59 deletions(-) diff --git a/x/gov/README.md b/x/gov/README.md index 99519fc8..30c3941c 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -13,16 +13,24 @@ June 2016. The module enables Cosmos SDK based blockchain to support an on-chain governance system. In this system, holders of the native staking token of the chain can vote -on proposals on a 1 token 1 vote basis. Next is a list of features the module -currently supports: +on proposals on a 1 token 1 vote basis. Specialized participants called +"*governors*" can hold delegated voting power to streamline governance. Next is a +list of features the module currently supports: * **Proposal submission:** Users can submit proposals with a deposit. Once the minimum deposit is reached, the proposal enters voting period. The minimum deposit -can be reached by collecting deposits from different users (including proposer) within deposit period. -* **Vote:** Participants can vote on proposals that reached `MinDeposit` and entered voting period. +can be reached by collecting deposits from different users (including proposer) +within deposit period. +* **Vote:** Participants can vote on proposals that reached `MinDeposit` and +entered voting period. * **Claiming deposit:** Users that deposited on proposals can recover their -deposits if the proposal was accepted or rejected. If the proposal never entered voting period -(minimum deposit not reached within deposit period), the deposit is burned. +deposits if the proposal was accepted or rejected. If the proposal never entered +voting period (minimum deposit not reached within deposit period), the deposit +is burned. +* **Governors Creation and Delegations** Users can self-elect themselves as +governors if certain criterias are met. Other users can delegate their voting +power to these governors that can vote in their stead. However delegators +always retain the right to vote directly. This module is in use in [AtomOne](https://github.com/atomone-hub/atomone)). Features that may be added in the future are described in [Future Improvements](#future-improvements). @@ -34,38 +42,119 @@ can be adapted to any Proof-Of-Stake blockchain by replacing *ATONE* with the na staking token of the chain. -* [Concepts](#concepts) - * [Proposal submission](#proposal-submission) - * [Deposit](#deposit) - * [Vote](#vote) - * [Software Upgrade](#software-upgrade) -* [State](#state) - * [Proposals](#proposals) - * [Parameters and base types](#parameters-and-base-types) - * [Deposit](#deposit-1) - * [ValidatorGovInfo](#validatorgovinfo) - * [Stores](#stores) - * [Proposal Processing Queue](#proposal-processing-queue) - * [Legacy Proposal](#legacy-proposal) - * [Quorum Checks and Voting Period Extension](#quorum-checks-and-voting-period-extension) - * [Constitution](#constitution) - * [Law and Constitution Amendment Proposals](#law-and-constitution-amendment-proposals) -* [Messages](#messages) - * [Proposal Submission](#proposal-submission-1) - * [Deposit](#deposit-2) - * [Vote](#vote-1) -* [Events](#events) - * [EndBlocker](#endblocker) - * [Handlers](#handlers) -* [Parameters](#parameters) -* [Client](#client) - * [CLI](#cli) - * [gRPC](#grpc) - * [REST](#rest) -* [Metadata](#metadata) - * [Proposal](#proposal-3) - * [Vote](#vote-5) -* [Future Improvements](#future-improvements) +- [`x/gov`](#xgov) + - [Abstract](#abstract) + - [Contents](#contents) + - [Concepts](#concepts) + - [Proposal submission](#proposal-submission) + - [Right to submit a proposal](#right-to-submit-a-proposal) + - [Proposal Messages](#proposal-messages) + - [Deposit](#deposit) + - [Deposit refund](#deposit-refund) + - [Vote](#vote) + - [Participants](#participants) + - [Voting period](#voting-period) + - [Option set](#option-set) + - [Weighted Votes](#weighted-votes) + - [Quorum](#quorum) + - [Threshold](#threshold) + - [No inheritance for validartors](#no-inheritance-for-validartors) + - [Validator’s or governor's punishment for non-voting](#validators-or-governors-punishment-for-non-voting) + - [Burnable Params](#burnable-params) + - [Governors and delegations](#governors-and-delegations) + - [State](#state) + - [Proposals](#proposals) + - [Writing a module that uses governance](#writing-a-module-that-uses-governance) + - [Parameters and base types](#parameters-and-base-types) + - [DepositParams](#depositparams) + - [VotingParams](#votingparams) + - [TallyParams](#tallyparams) + - [Deposit](#deposit-1) + - [Governors](#governors) + - [Stores](#stores) + - [Proposal Processing Queue](#proposal-processing-queue) + - [Legacy Proposal](#legacy-proposal) + - [Quorum Checks and Voting Period Extension](#quorum-checks-and-voting-period-extension) + - [Constitution](#constitution) + - [Law and Constitution Amendment Proposals](#law-and-constitution-amendment-proposals) + - [Governance Delegations](#governance-delegations) + - [Messages](#messages) + - [Proposal Submission](#proposal-submission-1) + - [Deposit](#deposit-2) + - [Vote](#vote-1) + - [Governor Creation](#governor-creation) + - [Edit Governor](#edit-governor) + - [Update Governor Status](#update-governor-status) + - [Delegate Governance Voting Power](#delegate-governance-voting-power) + - [Undelegate Governance Voting Power](#undelegate-governance-voting-power) + - [Events](#events) + - [EndBlocker](#endblocker) + - [Handlers](#handlers) + - [MsgSubmitProposal](#msgsubmitproposal) + - [MsgVote](#msgvote) + - [MsgVoteWeighted](#msgvoteweighted) + - [MsgDeposit](#msgdeposit) + - [Parameters](#parameters) + - [Client](#client) + - [CLI](#cli) + - [Query](#query) + - [deposit](#deposit-3) + - [deposits](#deposits) + - [governor](#governor) + - [governors](#governors-1) + - [governance delegation](#governance-delegation) + - [governance delegations for a governor](#governance-delegations-for-a-governor) + - [param](#param) + - [params](#params) + - [proposal](#proposal) + - [proposals](#proposals-1) + - [proposer](#proposer) + - [tally](#tally) + - [vote](#vote-2) + - [votes](#votes) + - [Transactions](#transactions) + - [deposit](#deposit-4) + - [draft-proposal](#draft-proposal) + - [generate-constitution-amendment](#generate-constitution-amendment) + - [submit-proposal](#submit-proposal) + - [submit-legacy-proposal](#submit-legacy-proposal) + - [vote](#vote-3) + - [weighted-vote](#weighted-vote) + - [create-governor](#create-governor) + - [edit-governor](#edit-governor-1) + - [update-governor-status](#update-governor-status-1) + - [delegate-governor](#delegate-governor) + - [undelegate-governor](#undelegate-governor) + - [gRPC](#grpc) + - [Proposal](#proposal-1) + - [Proposals](#proposals-2) + - [Vote](#vote-4) + - [Votes](#votes-1) + - [Params](#params-1) + - [Deposit](#deposit-5) + - [Deposits](#deposits-1) + - [TallyResult](#tallyresult) + - [Governor](#governor-1) + - [Governors](#governors-2) + - [Delegation](#delegation) + - [Delegations](#delegations) + - [REST](#rest) + - [proposal](#proposal-2) + - [proposals](#proposals-3) + - [voter vote](#voter-vote) + - [votes](#votes-2) + - [params](#params-2) + - [deposits](#deposits-2) + - [proposal deposits](#proposal-deposits) + - [tally](#tally-1) + - [governor](#governor-2) + - [governors](#governors-3) + - [delegation](#delegation-1) + - [delegations](#delegations-1) + - [Metadata](#metadata) + - [Proposal](#proposal-3) + - [Vote](#vote-5) + - [Future Improvements](#future-improvements) ## Concepts @@ -210,27 +299,21 @@ which is modifiable by governance. This means that proposals are accepted if: * The proportion of `Yes` votes, excluding `Abstain` votes, at the end of the voting period is superior to 2/3. -#### No inheritance +#### No inheritance for validartors If a delegator does not vote, it won't inherit its validator vote. Similarly, a validator's voting power is only equal to its own stake. -#### Validator’s punishment for non-voting +Governance delegations are allowed to active governors only. -At present, validators are not punished for failing to vote. +#### Validator’s or governor's punishment for non-voting -#### Governance address - -Later, we may add permissioned keys that could only sign txs from certain modules. -For the MVP, the `Governance address` will be the main validator address generated -at account creation. This address corresponds to a different PrivKey than the CometBFT -PrivKey which is responsible for signing consensus messages. Validators thus do not -have to sign governance transactions with the sensitive CometBFT PrivKey. +At present, validators or governors are not punished for failing to vote. #### Burnable Params -There are three parameters that define if the deposit of a proposal should +There are two parameters that define if the deposit of a proposal should be burned or returned to the depositors. * `BurnVoteQuorum` burns the proposal deposit if the proposal deposit if the vote does not reach quorum. @@ -238,6 +321,19 @@ be burned or returned to the depositors. > Note: These parameters are modifiable via governance. +### Governors and delegations + +A governor is a specialized role within the governance system who can +receive delegated voting power from other users. A user can register as a +governor by meeting certain governance self-delegation requirements, and since +governors auto delegate their governance power to themselves that translates to +a staking requirement. + +Delegators can assign their staked tokens’ governance voting power to a +governor. During tally, direct delegator votes and governors’ aggregated votes +are taken into account. Any direct votes from a delegator reduce the effective +voting power of that delegator’s chosen governor by the relevant stake. + ## State ### Proposals @@ -351,6 +447,12 @@ const ( https://github.com/atomone-hub/atomone/blob/b9631ed2e3b781cd82a14316f6086802d8cb4dcf/proto/atomone/gov/v1/gov.proto#L37-L49 ``` +### Governors + +```protobuf reference +https://github.com/atomone-hub/atomone/blob/f25a8a4a8af752a8d04ad8ee7e850c9cf32ff447/proto/atomone/gov/v1/gov.proto#L285-331 +``` + ## Stores :::note @@ -597,6 +699,24 @@ The `constitution` string will be updated by applying the patch defined in the ` An error will be returned if the `amendment` string is malformed, so constitution amendment proposals need to be crafted with care. +### Governance Delegations + +Governance delegations are tracked via the `GovernanceDelegation` object, +and express a mapping from a delegator to a governor. + +```protobuf reference +https://github.com/atomone-hub/atomone/blob/f25a8a4a8af752a8d04ad8ee7e850c9cf32ff447/proto/atomone/gov/v1/gov.proto#L349-357 +``` + +When a governance delegation is performed, the governance voting power of a +governor is updated via adding the corresponding number of "virtual shares" +that result from the underlying staking delegation from the corresponding +validator. This is tracked via the `GovernorValShares` object. + +```protobuf reference +https://github.com/atomone-hub/atomone/blob/f25a8a4a8af752a8d04ad8ee7e850c9cf32ff447/proto/atomone/gov/v1/gov.proto#L333-347 +``` + ## Messages ### Proposal Submission @@ -795,6 +915,55 @@ Next is a pseudocode outline of the way `MsgVote` transactions are handled: store(Governance, , txGovVote.Vote) // Voters can vote multiple times. Re-voting overrides previous vote. This is ok because tallying is done once at the end. ``` +### Governor Creation + +Governors can be created by sending a `MsgCreateGovernor` transaction. + +```protobuf reference +https://github.com/atomone-hub/atomone/blob/539ee0ea3b33211ce90a9c6679911893f72b8d26/proto/atomone/gov/v1/tx.proto#L242-L253 +``` + +**State modifications:** + +* Create a new governor account from the sender base account. The minimum self-delegation + required to become a governor is checked during the creation process. + +### Edit Governor + +Governors can edit their details by sending a `MsgEditGovernor` transaction. + +```protobuf reference +https://github.com/atomone-hub/atomone/blob/539ee0ea3b33211ce90a9c6679911893f72b8d26/proto/atomone/gov/v1/tx.proto#L258-L269 +``` + +### Update Governor Status + +Governors can set their status to inactive or active by sending a +`MsgUpdateGovernorStatus` transaction. However for the transition to active the minimum +self-delegation required to become a governor need also to be satisfied. + +```protobuf reference +https://github.com/atomone-hub/atomone/blob/539ee0ea3b33211ce90a9c6679911893f72b8d26/proto/atomone/gov/v1/tx.proto#L274-L285 +``` + +### Delegate Governance Voting Power + +Stakers can delegate their governance voting power to a governor by sending a +`MsgDelegateGovernancePower` transaction. + +```protobuf reference +https://github.com/atomone-hub/atomone/blob/539ee0ea3b33211ce90a9c6679911893f72b8d26/proto/atomone/gov/v1/tx.proto#L290-L301 +``` + +### Undelegate Governance Voting Power + +Stakers can undelegate their governance voting power from a governor by sending a +`MsgUndelegateGovernancePower` transaction. + +```protobuf reference +https://github.com/atomone-hub/atomone/blob/539ee0ea3b33211ce90a9c6679911893f72b8d26/proto/atomone/gov/v1/tx.proto#L306-L315 +``` + ## Events The governance module emits the following events: @@ -865,9 +1034,9 @@ The governance module contains the following parameters: | Key | Type | Example | |----------------------------------|------------------|-----------------------------------------| -| min_deposit | array (coins) | [{"denom":"uatone","amount":"10000000"}] | -| max_deposit_period | string (time ns) | "172800000000000" (17280s) | -| voting_period | string (time ns) | "172800000000000" (17280s) | +| min_deposit | array (coins) | [{"denom":"uatone","amount":"10000000"}]| +| max_deposit_period | string (time ns) | "12066000000000000" (1206600s) | +| voting_period | string (time ns) | "18144000000000000" (1814400s) | | quorum | string (dec) | "0.334000000000000000" | | threshold | string (dec) | "0.500000000000000000" | | burn_proposal_deposit_prevote | bool | false | @@ -881,6 +1050,8 @@ The governance module contains the following parameters: | quorum_timeout | string (time ns) | "172800000000000" (17280s) | | max_voting_period_extension | string (time ns) | "172800000000000" (17280s) | | quorum_check_count | uint64 | 2 | +| governor_status_change_period | string (time ns) | "24192000000000000" (2419200s) | +| min_governor_self_delegation | string (int ) | 1000000000 | **NOTE**: The governance module contains parameters that are objects unlike other @@ -953,6 +1124,64 @@ pagination: total: "0" ``` +##### governor + +The `governor` command allows users to query a governor for a given address. + +```bash +atomoned query gov governor [address] [flags] +``` + +Example: + +```bash +atomoned query gov governor atonegov1.. +``` + +##### governors + +The `governors` command allows users to query all governors. + +```bash +atomoned query gov governors [flags] +``` + +Example: + +```bash +atomoned query gov governors +``` + +##### governance delegation + +The `delegation` command allows users to query a governance delegation for a +given delegator, if it exists. + +```bash +atomoned query gov delegation [delegator-addr] [flags] +``` + +Example: + +```bash +atomoned query gov delegation atone1.. +``` + +##### governance delegations for a governor + +The `delegations` command allows users to query all governance delegations for +a given governor. + +```bash +atomoned query gov delegations [governor-addr] [flags] +``` + +Example: + +```bash +atomoned query gov delegations atonegov1.. +``` + ##### param The `param` command allows users to query a given parameter for the `gov` module. @@ -1359,6 +1588,80 @@ Example: atomoned tx gov weighted-vote 1 yes=0.5,no=0.5 --from atone1.. ``` +##### create-governor + +The `create-governor` command allows users to create a governor. + +```bash +atomoned tx gov create-governor [base-address] [moniker] [identity] [website] [security-contact] [details] [flags] +``` + +Example: + +```bash +atomoned tx gov create-governor atone1.. "NewGovernor" "ABC123DEF5678" "www.mywebsite.com" "" "-" --from atone1.. +``` + +##### edit-governor + +The `edit-governor` command allows users to edit a governor. + +```bash +atomoned tx gov edit-governor [base-address] [moniker] [identity] [website] [security-contact] [details] [flags] +``` + +Example: + +```bash +atomoned tx gov edit-governor atone1.. "EditedGovernor" "ABC123DEF5678" "www.mywebsite.com" "" "-" --from atone1.. +``` + +##### update-governor-status + +The `update-governor-status` command allows users to update a governor's status. +The update from inactive to active also requires the minimum self-delegation to +be satisfied. + +```bash +atomoned tx gov update-governor-status [base-address] [status] [flags] +``` + +Example: + +```bash +atomoned tx gov update-governor-status atone1.. active --from atone1.. +``` + +##### delegate-governor + +The `delegate-governor` command allows users to delegate governance voting power +to a governor. + +```bash +atomoned tx gov delegate-governor [delegator-address] [governor-address] [flags] +``` + +Example: + +```bash +atomoned tx gov delegate-governor atone1.. atonegov1.. --from atone1.. +``` + +##### undelegate-governor + +The `undelegate-governor` command allows users to undelegate governance voting power +and return to direct voting only. + +```bash +atomoned tx gov undelegate-governor [delegator-address] [flags] +``` + +Example: + +```bash +atomoned tx gov undelegate-governor atone1.. --from atone1.. +``` + ### gRPC A user can query the `gov` module using gRPC endpoints. @@ -1881,7 +2184,7 @@ Example Output: } ``` -#### deposits +#### Deposits The `Deposits` endpoint allows users to query all deposits for a given proposal. @@ -2017,6 +2320,83 @@ Example Output: } ``` +#### Governor + +The `Governor` endpoint allows users to query a governor for a given address. + +using v1: + +```bash +atomone.gov.v1.Query/Governor +``` + +Example: + +```bash +grpcurl -plaintext \ + -d '{"governor_address":"atone1.."}' \ + localhost:9090 \ + atomone.gov.v1.Query/Governor +``` + +#### Governors + +The `Governors` endpoint allows users to query all governors. + +Using legacy v1: + +```bash +atomone.gov.v1beta1.Query/Governors +``` + +Example: + +```bash +grpcurl -plaintext \ + localhost:9090 \ + atomone.gov.v1beta1.Query/Governors +``` + +#### Delegation + +The `Delegation` endpoint allows users to query a governance delegation for a +given delegator. + +Using legacy v1: + +```bash +atomone.gov.v1beta1.Query/Delegation +``` + +Example: + +```bash +grpcurl -plaintext \ + -d '{"delegator_address":"atone1.."}' \ + localhost:9090 \ + atomone.gov.v1beta1.Query/Delegation +``` + +#### Delegations + +The `Delegations` endpoint allows users to query all governance delegations for +a given governor. + +Using legacy v1: + +```bash +atomone.gov.v1beta1.Query/Delegations +``` + +Example: + +```bash +grpcurl -plaintext \ + -d '{"governor_address":"atonegov1.."}' \ + localhost:9090 \ + atomone.gov.v1beta1.Query/Delegations +``` + ### REST A user can query the `gov` module using REST endpoints. @@ -2679,6 +3059,72 @@ Example Output: ``` +#### governor + +The `governor` endpoint allows users to query a governor for a given address. + +Using v1: + +```bash +/atomone/gov/v1/governors/{governor_address} +``` + +Example: + +```bash +curl localhost:1317/atomone/gov/v1/governors/atonegov1.. +``` + +#### governors + +The `governors` endpoint allows users to query all governors. + +Using v1: + +```bash +/atomone/gov/v1/governors +``` + +Example: + +```bash +curl localhost:1317/atomone/gov/v1/governors +``` + +#### delegation + +The `delegation` endpoint allows users to query a governance delegation for a +given delegator. + +Using v1: + +```bash +/atomone/gov/v1/delegations/{delegator_address} +``` + +Example: + +```bash +curl localhost:1317/atomone/gov/v1/delegations/atone1.. +``` + +#### delegations + +The `delegations` endpoint allows users to query all governance delegations for +a given governor. + +Using v1: + +```bash +/atomone/gov/v1/governors/{governor_address}/delegations +``` + +Example: + +```bash +curl localhost:1317/atomone/gov/v1/governors/atonegov1../delegations +``` + ## Metadata The gov module has two locations for metadata where users can provide further context about the on-chain actions they are taking. By default all metadata fields have a 255 character length field where metadata can be stored in json format, either on-chain or off-chain depending on the amount of data required. Here we provide a recommendation for the json structure and where the data should be stored. There are two important factors in making these recommendations. First, that the gov and group modules are consistent with one another, note the number of proposals made by all groups may be quite large. Second, that client applications such as block explorers and governance interfaces have confidence in the consistency of metadata structure accross chains. @@ -2730,12 +3176,6 @@ governance module. Future improvements may include: If a `SoftwareUpgradeProposal` linked to an open bounty is accepted by governance, the funds that were reserved are automatically transferred to the submitter. -* **Complex delegation:** Delegators could choose other representatives than - their validators. Ultimately, the chain of representatives would always end - up to a validator, but delegators could inherit the vote of their chosen - representative before they inherit the vote of their validator. In other - words, they would only inherit the vote of their validator if their other - appointed representative did not vote. * **Better process for proposal review:** There would be two parts to `proposal.Deposit`, one for anti-spam (same as in MVP) and an other one to reward third party auditors. From e48e30b5871bbf8ff3902391b4b091b26c9820d0 Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Thu, 23 Jan 2025 13:12:22 +0100 Subject: [PATCH 54/70] fix: gov init genesis order (#7) The gov module InitGenesis must happen after staking because governors requires to access the validator delegations. --- app/modules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/modules.go b/app/modules.go index 8517a575..e1224755 100644 --- a/app/modules.go +++ b/app/modules.go @@ -253,8 +253,8 @@ func orderInitBlockers() []string { authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, - govtypes.ModuleName, stakingtypes.ModuleName, + govtypes.ModuleName, photontypes.ModuleName, slashingtypes.ModuleName, minttypes.ModuleName, From e3a22b367dfc42c733a9952fd7f380c30f33ea05 Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Thu, 23 Jan 2025 13:12:37 +0100 Subject: [PATCH 55/70] perf(x/gov): bunch of tally improvements (#8) * perf(x/gov): remove useless bech32 conversion Accessing `delegation.ValidatorAddress` is similar to calling `delegation.GetValidatorAddress().String()` but w/o useless conversions. * perf(x/gov): remove useless address conversion * perf(x/gov): remove useless bech32 conversion * perf(x/gov): remove unused active field from GovernorGovInfo * perf(x/gov): assume vote weight is 1 most of the time --- x/gov/keeper/governor.go | 2 +- x/gov/keeper/tally.go | 12 ++++-------- x/gov/types/v1/tally.go | 4 +--- x/gov/types/v1/vote.go | 13 +++++++++++++ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index 477c6465..fa41ef98 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -101,7 +101,7 @@ func (k Keeper) ValidateGovernorMinSelfDelegation(ctx sdk.Context, governor v1.G bondedTokens := k.getGovernorBondedTokens(ctx, governor.GetAddress()) delAddr := sdk.AccAddress(governor.GetAddress()) - if del, found := k.GetGovernanceDelegation(ctx, delAddr); !found || !governor.GetAddress().Equals(types.MustGovernorAddressFromBech32(del.GovernorAddress)) { + if del, found := k.GetGovernanceDelegation(ctx, delAddr); !found || governor.GovernorAddress != del.GovernorAddress { panic("active governor without governance self-delegation") } diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 0ffc531e..c08c2797 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -113,12 +113,10 @@ func (keeper Keeper) tallyVotes( governor = gi } else { govAddr := types.MustGovernorAddressFromBech32(gd.GovernorAddress) - gov, _ := keeper.GetGovernor(ctx, govAddr) governor = v1.NewGovernorGovInfo( govAddr, - keeper.GetAllGovernorValShares(ctx, types.MustGovernorAddressFromBech32(gd.GovernorAddress)), + keeper.GetAllGovernorValShares(ctx, govAddr), v1.WeightedVoteOptions{}, - gov.IsActive(), ) } if gd.GovernorAddress == types.GovernorAddress(voter).String() { @@ -131,7 +129,7 @@ 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() + valAddrStr := delegation.(stakingtypes.Delegation).ValidatorAddress votingPower := math.LegacyZeroDec() if val, ok := currValidators[valAddrStr]; ok { @@ -147,8 +145,7 @@ func (keeper Keeper) tallyVotes( totalVotingPower = totalVotingPower.Add(votingPower) if isFinal { for _, option := range vote.Options { - weight, _ := math.LegacyNewDecFromStr(option.Weight) - subPower := votingPower.Mul(weight) + subPower := option.Power(votingPower) results[option.Option] = results[option.Option].Add(subPower) } } @@ -174,8 +171,7 @@ func (keeper Keeper) tallyVotes( if isFinal { for _, option := range gov.Vote { - weight, _ := sdk.NewDecFromStr(option.Weight) - subPower := votingPower.Mul(weight) + subPower := option.Power(votingPower) results[option.Option] = results[option.Option].Add(subPower) } } diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index 6b6ebc68..12f44dc1 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -14,11 +14,10 @@ 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 - IsActive bool // whether the governor is active } // NewGovernorGovInfo creates a GovernorGovInfo instance -func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValShares, options WeightedVoteOptions, isActive bool) GovernorGovInfo { +func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValShares, options WeightedVoteOptions) GovernorGovInfo { valSharesMap := make(map[string]sdk.Dec) valSharesDeductionsMap := make(map[string]sdk.Dec) for _, valShare := range valShares { @@ -31,7 +30,6 @@ func NewGovernorGovInfo(address types.GovernorAddress, valShares []GovernorValSh ValShares: valSharesMap, ValSharesDeductions: valSharesDeductionsMap, Vote: options, - IsActive: isActive, } } diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index e426faa0..388b28c8 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -76,6 +76,19 @@ func (w *WeightedVoteOption) IsValid() bool { return ValidVoteOption(w.Option) } +var oneDecStr = math.LegacyOneDec().String() + +func (v WeightedVoteOption) Power(totalPower math.LegacyDec) math.LegacyDec { + // v.Weight is very often equal to 1, because most voters do not + // use weighted votes. By using this stat, we can save on calls to + // the costly `math.LegacyNewDecFromStr` function. + if v.Weight == oneDecStr { + return totalPower + } + weight, _ := math.LegacyNewDecFromStr(v.Weight) + return totalPower.Mul(weight) +} + // NewNonSplitVoteOption creates a single option vote with weight 1 func NewNonSplitVoteOption(option VoteOption) WeightedVoteOptions { return WeightedVoteOptions{{option, math.LegacyNewDec(1).String()}} From fabb95d83e9ddcbf6b0c237491020c12efc357a6 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 12 Mar 2025 18:46:13 +0100 Subject: [PATCH 56/70] Update go.mod --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 254a9b7c..3839e2c4 100644 --- a/go.mod +++ b/go.mod @@ -37,6 +37,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 google.golang.org/grpc v1.68.0 google.golang.org/protobuf v1.36.1 + gopkg.in/yaml.v2 v2.4.0 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 ) From 78f74da0dee9e24643cd72896f759af7b48c019f Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 16 Jul 2025 18:23:05 +0200 Subject: [PATCH 57/70] fix gov e2e test --- tests/e2e/e2e_gov_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index 44b94542..1fc71df5 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -142,7 +142,7 @@ func (s *IntegrationTestSuite) testGovCommunityPoolSpend() { submitGovFlags := []string{configFile(proposalCommunitySpendFilename)} depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusPassed) // Check that sender is refunded with the proposal deposit s.Require().Eventually( @@ -187,7 +187,7 @@ func (s *IntegrationTestSuite) testGovCommunityPoolSpend() { submitGovFlags := []string{configFile(proposalCommunitySpendFilename)} depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "no"} - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusRejected) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusRejected) // Check that sender is not refunded with the proposal deposit s.Require().Eventually( @@ -234,7 +234,7 @@ func (s *IntegrationTestSuite) testGovParamChange() { submitGovFlags := []string{configFile(proposalParamChangeFilename)} depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "cosmos.staking.v1beta1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "cosmos.staking.v1beta1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusPassed) newParams := s.queryStakingParams(chainAAPIEndpoint) s.Assert().NotEqual(oldMaxValidator, newParams.Params.MaxValidators) @@ -257,7 +257,7 @@ func (s *IntegrationTestSuite) testGovParamChange() { submitGovFlags := []string{configFile(proposalParamChangeFilename)} depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "atomone.photon.v1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "atomone.photon.v1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusPassed) newParams := s.queryPhotonParams(chainAAPIEndpoint) s.Assert().True(newParams.Params.MintDisabled, "expected photon param mint disabled to be true") @@ -268,7 +268,7 @@ func (s *IntegrationTestSuite) testGovParamChange() { depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()} voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} s.writePhotonParamChangeProposal(s.chainA, params.Params) - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "atomone.photon.v1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "atomone.photon.v1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusPassed) newParams = s.queryPhotonParams(chainAAPIEndpoint) s.Require().False(newParams.Params.MintDisabled, "expected photon param mint disabled to be false") @@ -289,7 +289,7 @@ func (s *IntegrationTestSuite) testGovParamChange() { submitGovFlags := []string{configFile(proposalParamChangeFilename)} depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "atomone.feemarket.v1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "atomone.feemarket.v1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusPassed) newParams := s.queryFeemarketParams(chainAAPIEndpoint) s.Require().Equal(newParams.Params.Alpha, oldAlpha.Add(sdk.NewDec(1))) @@ -311,7 +311,7 @@ func (s *IntegrationTestSuite) testGovConstitutionAmendment() { submitGovFlags := []string{configFile(proposalConstitutionAmendmentFilename)} depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "gov/MsgSubmitProposal", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "gov/MsgSubmitProposal", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusPassed) s.Require().Eventually( func() bool { @@ -428,7 +428,7 @@ func (s *IntegrationTestSuite) submitLegacyGovProposal(chainAAPIEndpoint, sender // Instead, the deposit is added to the "deposit" field of the proposal JSON (usually stored as a file) // you can use `atomoned tx gov draft-proposal` to create a proposal file that you can use // min initial deposit of 100uatone is required in e2e tests, otherwise the proposal would be dropped -func (s *IntegrationTestSuite) submitGovProposal(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, expectedStatusAfterVote govtypesv1beta1.ProposalStatus) { +func (s *IntegrationTestSuite) submitGovProposal(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, expectedStatusAfterVote govtypesv1.ProposalStatus) { s.T().Logf("Submitting Gov Proposal: %s", proposalType) sflags := submitFlags s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-proposal", sflags, govtypesv1.StatusDepositPeriod) From 07edfa82f49b992f5b92703e9db25bbcf6fc8435 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 17 Jul 2025 15:00:47 +0200 Subject: [PATCH 58/70] proto-pulsar-gen --- api/atomone/dynamicfee/v1/params.pulsar.go | 156 +- api/atomone/gov/v1/genesis.pulsar.go | 381 +- api/atomone/gov/v1/gov.pulsar.go | 3386 +++++++++- api/atomone/gov/v1/query.pulsar.go | 6820 ++++++++++++++++++-- api/atomone/gov/v1/query_grpc.pb.go | 224 +- api/atomone/gov/v1/tx.pulsar.go | 5629 ++++++++++++++-- api/atomone/gov/v1/tx_grpc.pb.go | 204 + 7 files changed, 15400 insertions(+), 1400 deletions(-) diff --git a/api/atomone/dynamicfee/v1/params.pulsar.go b/api/atomone/dynamicfee/v1/params.pulsar.go index 319e3415..8a18e554 100644 --- a/api/atomone/dynamicfee/v1/params.pulsar.go +++ b/api/atomone/dynamicfee/v1/params.pulsar.go @@ -21,6 +21,7 @@ var ( fd_Params_gamma protoreflect.FieldDescriptor fd_Params_min_base_gas_price protoreflect.FieldDescriptor fd_Params_target_block_utilization protoreflect.FieldDescriptor + fd_Params_default_max_block_gas protoreflect.FieldDescriptor fd_Params_min_learning_rate protoreflect.FieldDescriptor fd_Params_max_learning_rate protoreflect.FieldDescriptor fd_Params_window protoreflect.FieldDescriptor @@ -36,6 +37,7 @@ func init() { fd_Params_gamma = md_Params.Fields().ByName("gamma") fd_Params_min_base_gas_price = md_Params.Fields().ByName("min_base_gas_price") fd_Params_target_block_utilization = md_Params.Fields().ByName("target_block_utilization") + fd_Params_default_max_block_gas = md_Params.Fields().ByName("default_max_block_gas") fd_Params_min_learning_rate = md_Params.Fields().ByName("min_learning_rate") fd_Params_max_learning_rate = md_Params.Fields().ByName("max_learning_rate") fd_Params_window = md_Params.Fields().ByName("window") @@ -138,6 +140,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.DefaultMaxBlockGas != uint64(0) { + value := protoreflect.ValueOfUint64(x.DefaultMaxBlockGas) + if !f(fd_Params_default_max_block_gas, value) { + return + } + } if x.MinLearningRate != "" { value := protoreflect.ValueOfString(x.MinLearningRate) if !f(fd_Params_min_learning_rate, value) { @@ -193,6 +201,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.MinBaseGasPrice != "" case "atomone.dynamicfee.v1.Params.target_block_utilization": return x.TargetBlockUtilization != "" + case "atomone.dynamicfee.v1.Params.default_max_block_gas": + return x.DefaultMaxBlockGas != uint64(0) case "atomone.dynamicfee.v1.Params.min_learning_rate": return x.MinLearningRate != "" case "atomone.dynamicfee.v1.Params.max_learning_rate": @@ -229,6 +239,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.MinBaseGasPrice = "" case "atomone.dynamicfee.v1.Params.target_block_utilization": x.TargetBlockUtilization = "" + case "atomone.dynamicfee.v1.Params.default_max_block_gas": + x.DefaultMaxBlockGas = uint64(0) case "atomone.dynamicfee.v1.Params.min_learning_rate": x.MinLearningRate = "" case "atomone.dynamicfee.v1.Params.max_learning_rate": @@ -270,6 +282,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "atomone.dynamicfee.v1.Params.target_block_utilization": value := x.TargetBlockUtilization return protoreflect.ValueOfString(value) + case "atomone.dynamicfee.v1.Params.default_max_block_gas": + value := x.DefaultMaxBlockGas + return protoreflect.ValueOfUint64(value) case "atomone.dynamicfee.v1.Params.min_learning_rate": value := x.MinLearningRate return protoreflect.ValueOfString(value) @@ -315,6 +330,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.MinBaseGasPrice = value.Interface().(string) case "atomone.dynamicfee.v1.Params.target_block_utilization": x.TargetBlockUtilization = value.Interface().(string) + case "atomone.dynamicfee.v1.Params.default_max_block_gas": + x.DefaultMaxBlockGas = value.Uint() case "atomone.dynamicfee.v1.Params.min_learning_rate": x.MinLearningRate = value.Interface().(string) case "atomone.dynamicfee.v1.Params.max_learning_rate": @@ -355,6 +372,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field min_base_gas_price of message atomone.dynamicfee.v1.Params is not mutable")) case "atomone.dynamicfee.v1.Params.target_block_utilization": panic(fmt.Errorf("field target_block_utilization of message atomone.dynamicfee.v1.Params is not mutable")) + case "atomone.dynamicfee.v1.Params.default_max_block_gas": + panic(fmt.Errorf("field default_max_block_gas of message atomone.dynamicfee.v1.Params is not mutable")) case "atomone.dynamicfee.v1.Params.min_learning_rate": panic(fmt.Errorf("field min_learning_rate of message atomone.dynamicfee.v1.Params is not mutable")) case "atomone.dynamicfee.v1.Params.max_learning_rate": @@ -388,6 +407,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "atomone.dynamicfee.v1.Params.target_block_utilization": return protoreflect.ValueOfString("") + case "atomone.dynamicfee.v1.Params.default_max_block_gas": + return protoreflect.ValueOfUint64(uint64(0)) case "atomone.dynamicfee.v1.Params.min_learning_rate": return protoreflect.ValueOfString("") case "atomone.dynamicfee.v1.Params.max_learning_rate": @@ -487,6 +508,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.DefaultMaxBlockGas != 0 { + n += 1 + runtime.Sov(uint64(x.DefaultMaxBlockGas)) + } l = len(x.MinLearningRate) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -542,33 +566,38 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { dAtA[i] = 0 } i-- - dAtA[i] = 0x58 + dAtA[i] = 0x60 } if len(x.FeeDenom) > 0 { i -= len(x.FeeDenom) copy(dAtA[i:], x.FeeDenom) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeeDenom))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x5a } if x.Window != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Window)) i-- - dAtA[i] = 0x48 + dAtA[i] = 0x50 } if len(x.MaxLearningRate) > 0 { i -= len(x.MaxLearningRate) copy(dAtA[i:], x.MaxLearningRate) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaxLearningRate))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x4a } if len(x.MinLearningRate) > 0 { i -= len(x.MinLearningRate) copy(dAtA[i:], x.MinLearningRate) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinLearningRate))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 + } + if x.DefaultMaxBlockGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DefaultMaxBlockGas)) + i-- + dAtA[i] = 0x38 } if len(x.TargetBlockUtilization) > 0 { i -= len(x.TargetBlockUtilization) @@ -815,6 +844,25 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { x.TargetBlockUtilization = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DefaultMaxBlockGas", wireType) + } + x.DefaultMaxBlockGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.DefaultMaxBlockGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinLearningRate", wireType) } @@ -846,7 +894,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.MinLearningRate = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 9: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxLearningRate", wireType) } @@ -878,7 +926,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.MaxLearningRate = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 10: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Window", wireType) } @@ -897,7 +945,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { break } } - case 10: + case 11: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeeDenom", wireType) } @@ -929,7 +977,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.FeeDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: + case 12: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) } @@ -1028,18 +1076,22 @@ type Params struct { // decimal value between 0 and 1. It is the target percentage utilization // of the block in relation to the consensus_params.block.max_gas parameter. TargetBlockUtilization string `protobuf:"bytes,6,opt,name=target_block_utilization,json=targetBlockUtilization,proto3" json:"target_block_utilization,omitempty"` + // DefaultMaxBlockGas is the default max block gas. + // This parameter is used by the dynamicfee module + // in the case consensus_params.block.max_gas returns 0 or -1. + DefaultMaxBlockGas uint64 `protobuf:"varint,7,opt,name=default_max_block_gas,json=defaultMaxBlockGas,proto3" json:"default_max_block_gas,omitempty"` // MinLearningRate is the lower bound for the learning rate. - MinLearningRate string `protobuf:"bytes,7,opt,name=min_learning_rate,json=minLearningRate,proto3" json:"min_learning_rate,omitempty"` + MinLearningRate string `protobuf:"bytes,8,opt,name=min_learning_rate,json=minLearningRate,proto3" json:"min_learning_rate,omitempty"` // MaxLearningRate is the upper bound for the learning rate. - MaxLearningRate string `protobuf:"bytes,8,opt,name=max_learning_rate,json=maxLearningRate,proto3" json:"max_learning_rate,omitempty"` + MaxLearningRate string `protobuf:"bytes,9,opt,name=max_learning_rate,json=maxLearningRate,proto3" json:"max_learning_rate,omitempty"` // Window defines the window size for calculating an adaptive learning rate // over a moving window of blocks. - Window uint64 `protobuf:"varint,9,opt,name=window,proto3" json:"window,omitempty"` + Window uint64 `protobuf:"varint,10,opt,name=window,proto3" json:"window,omitempty"` // FeeDenom is the denom that will be used for all fee payments. - FeeDenom string `protobuf:"bytes,10,opt,name=fee_denom,json=feeDenom,proto3" json:"fee_denom,omitempty"` + FeeDenom string `protobuf:"bytes,11,opt,name=fee_denom,json=feeDenom,proto3" json:"fee_denom,omitempty"` // Enabled is a boolean that determines whether the EIP1559 dynamic fee // pricing is enabled. - Enabled bool `protobuf:"varint,11,opt,name=enabled,proto3" json:"enabled,omitempty"` + Enabled bool `protobuf:"varint,12,opt,name=enabled,proto3" json:"enabled,omitempty"` } func (x *Params) Reset() { @@ -1097,6 +1149,13 @@ func (x *Params) GetTargetBlockUtilization() string { return "" } +func (x *Params) GetDefaultMaxBlockGas() uint64 { + if x != nil { + return x.DefaultMaxBlockGas + } + return 0 +} + func (x *Params) GetMinLearningRate() string { if x != nil { return x.MinLearningRate @@ -1141,7 +1200,7 @@ var file_atomone_dynamicfee_v1_params_proto_rawDesc = []byte{ 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x05, 0x0a, + 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x05, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, @@ -1168,38 +1227,41 @@ var file_atomone_dynamicfee_v1_params_proto_rawDesc = []byte{ 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5d, 0x0a, - 0x11, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, - 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, - 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, - 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x5d, 0x0a, 0x11, - 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, - 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x4c, - 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x77, - 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x77, 0x69, 0x6e, - 0x64, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x65, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, - 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0xd3, 0x01, 0x0a, 0x19, 0x63, - 0x6f, 0x6d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, - 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, - 0x65, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, - 0x44, 0x58, 0xaa, 0x02, 0x15, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x44, 0x79, 0x6e, - 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x41, 0x74, 0x6f, - 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x21, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x44, 0x79, 0x6e, - 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, - 0x3a, 0x3a, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6b, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, + 0x15, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4d, 0x61, 0x78, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x47, 0x61, 0x73, + 0x12, 0x5d, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, + 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, + 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, + 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, + 0x5d, 0x0a, 0x11, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, + 0x72, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, + 0x61, 0x78, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x65, 0x65, 0x44, 0x65, + 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0xd3, 0x01, + 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x64, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x74, 0x6f, + 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2f, + 0x76, 0x31, 0x3b, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x41, 0x44, 0x58, 0xaa, 0x02, 0x15, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, + 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, + 0x65, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x21, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x41, 0x74, 0x6f, 0x6d, + 0x6f, 0x6e, 0x65, 0x3a, 0x3a, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/atomone/gov/v1/genesis.pulsar.go b/api/atomone/gov/v1/genesis.pulsar.go index a541bd3a..ded33bf3 100644 --- a/api/atomone/gov/v1/genesis.pulsar.go +++ b/api/atomone/gov/v1/genesis.pulsar.go @@ -166,6 +166,108 @@ func (x *_GenesisState_4_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_GenesisState_15_list)(nil) + +type _GenesisState_15_list struct { + list *[]*Governor +} + +func (x *_GenesisState_15_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_15_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_15_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Governor) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_15_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Governor) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_15_list) AppendMutable() protoreflect.Value { + v := new(Governor) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_15_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_15_list) NewElement() protoreflect.Value { + v := new(Governor) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_15_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_16_list)(nil) + +type _GenesisState_16_list struct { + list *[]*GovernanceDelegation +} + +func (x *_GenesisState_16_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_16_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_16_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GovernanceDelegation) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_16_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GovernanceDelegation) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_16_list) AppendMutable() protoreflect.Value { + v := new(GovernanceDelegation) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_16_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_16_list) NewElement() protoreflect.Value { + v := new(GovernanceDelegation) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_16_list) IsValid() bool { + return x.list != nil +} + var ( md_GenesisState protoreflect.MessageDescriptor fd_GenesisState_starting_proposal_id protoreflect.FieldDescriptor @@ -182,6 +284,8 @@ var ( fd_GenesisState_participation_ema protoreflect.FieldDescriptor fd_GenesisState_constitution_amendment_participation_ema protoreflect.FieldDescriptor fd_GenesisState_law_participation_ema protoreflect.FieldDescriptor + fd_GenesisState_governors protoreflect.FieldDescriptor + fd_GenesisState_governance_delegations protoreflect.FieldDescriptor ) func init() { @@ -201,6 +305,8 @@ func init() { fd_GenesisState_participation_ema = md_GenesisState.Fields().ByName("participation_ema") fd_GenesisState_constitution_amendment_participation_ema = md_GenesisState.Fields().ByName("constitution_amendment_participation_ema") fd_GenesisState_law_participation_ema = md_GenesisState.Fields().ByName("law_participation_ema") + fd_GenesisState_governors = md_GenesisState.Fields().ByName("governors") + fd_GenesisState_governance_delegations = md_GenesisState.Fields().ByName("governance_delegations") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -352,6 +458,18 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.Governors) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_15_list{list: &x.Governors}) + if !f(fd_GenesisState_governors, value) { + return + } + } + if len(x.GovernanceDelegations) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_16_list{list: &x.GovernanceDelegations}) + if !f(fd_GenesisState_governance_delegations, value) { + return + } + } } // Has reports whether a field is populated. @@ -395,6 +513,10 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool return x.ConstitutionAmendmentParticipationEma != "" case "atomone.gov.v1.GenesisState.law_participation_ema": return x.LawParticipationEma != "" + case "atomone.gov.v1.GenesisState.governors": + return len(x.Governors) != 0 + case "atomone.gov.v1.GenesisState.governance_delegations": + return len(x.GovernanceDelegations) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GenesisState")) @@ -439,6 +561,10 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { x.ConstitutionAmendmentParticipationEma = "" case "atomone.gov.v1.GenesisState.law_participation_ema": x.LawParticipationEma = "" + case "atomone.gov.v1.GenesisState.governors": + x.Governors = nil + case "atomone.gov.v1.GenesisState.governance_delegations": + x.GovernanceDelegations = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GenesisState")) @@ -506,6 +632,18 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "atomone.gov.v1.GenesisState.law_participation_ema": value := x.LawParticipationEma return protoreflect.ValueOfString(value) + case "atomone.gov.v1.GenesisState.governors": + if len(x.Governors) == 0 { + return protoreflect.ValueOfList(&_GenesisState_15_list{}) + } + listValue := &_GenesisState_15_list{list: &x.Governors} + return protoreflect.ValueOfList(listValue) + case "atomone.gov.v1.GenesisState.governance_delegations": + if len(x.GovernanceDelegations) == 0 { + return protoreflect.ValueOfList(&_GenesisState_16_list{}) + } + listValue := &_GenesisState_16_list{list: &x.GovernanceDelegations} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GenesisState")) @@ -560,6 +698,14 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value x.ConstitutionAmendmentParticipationEma = value.Interface().(string) case "atomone.gov.v1.GenesisState.law_participation_ema": x.LawParticipationEma = value.Interface().(string) + case "atomone.gov.v1.GenesisState.governors": + lv := value.List() + clv := lv.(*_GenesisState_15_list) + x.Governors = *clv.list + case "atomone.gov.v1.GenesisState.governance_delegations": + lv := value.List() + clv := lv.(*_GenesisState_16_list) + x.GovernanceDelegations = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GenesisState")) @@ -628,6 +774,18 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.LastMinInitialDeposit = new(LastMinDeposit) } return protoreflect.ValueOfMessage(x.LastMinInitialDeposit.ProtoReflect()) + case "atomone.gov.v1.GenesisState.governors": + if x.Governors == nil { + x.Governors = []*Governor{} + } + value := &_GenesisState_15_list{list: &x.Governors} + return protoreflect.ValueOfList(value) + case "atomone.gov.v1.GenesisState.governance_delegations": + if x.GovernanceDelegations == nil { + x.GovernanceDelegations = []*GovernanceDelegation{} + } + value := &_GenesisState_16_list{list: &x.GovernanceDelegations} + return protoreflect.ValueOfList(value) case "atomone.gov.v1.GenesisState.starting_proposal_id": panic(fmt.Errorf("field starting_proposal_id of message atomone.gov.v1.GenesisState is not mutable")) case "atomone.gov.v1.GenesisState.constitution": @@ -688,6 +846,12 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfString("") case "atomone.gov.v1.GenesisState.law_participation_ema": return protoreflect.ValueOfString("") + case "atomone.gov.v1.GenesisState.governors": + list := []*Governor{} + return protoreflect.ValueOfList(&_GenesisState_15_list{list: &list}) + case "atomone.gov.v1.GenesisState.governance_delegations": + list := []*GovernanceDelegation{} + return protoreflect.ValueOfList(&_GenesisState_16_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GenesisState")) @@ -818,6 +982,18 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.Governors) > 0 { + for _, e := range x.Governors { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.GovernanceDelegations) > 0 { + for _, e := range x.GovernanceDelegations { + l = options.Size(e) + n += 2 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -847,6 +1023,40 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.GovernanceDelegations) > 0 { + for iNdEx := len(x.GovernanceDelegations) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.GovernanceDelegations[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + } + if len(x.Governors) > 0 { + for iNdEx := len(x.Governors) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Governors[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x7a + } + } if len(x.LawParticipationEma) > 0 { i -= len(x.LawParticipationEma) copy(dAtA[i:], x.LawParticipationEma) @@ -1526,6 +1736,74 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { } x.LawParticipationEma = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 15: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Governors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Governors = append(x.Governors, &Governor{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Governors[len(x.Governors)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernanceDelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GovernanceDelegations = append(x.GovernanceDelegations, &GovernanceDelegation{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.GovernanceDelegations[len(x.GovernanceDelegations)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1629,6 +1907,10 @@ type GenesisState struct { // If unset or set to 0, the quorum for the next law proposal will be set to // the params.LawMinQuorum value. LawParticipationEma string `protobuf:"bytes,14,opt,name=law_participation_ema,json=lawParticipationEma,proto3" json:"law_participation_ema,omitempty"` + // governors defines all the governors present at genesis. + Governors []*Governor `protobuf:"bytes,15,rep,name=governors,proto3" json:"governors,omitempty"` + // governance_delegations defines all the governance delegations present at genesis. + GovernanceDelegations []*GovernanceDelegation `protobuf:"bytes,16,rep,name=governance_delegations,json=governanceDelegations,proto3" json:"governance_delegations,omitempty"` } func (x *GenesisState) Reset() { @@ -1752,6 +2034,20 @@ func (x *GenesisState) GetLawParticipationEma() string { return "" } +func (x *GenesisState) GetGovernors() []*Governor { + if x != nil { + return x.Governors + } + return nil +} + +func (x *GenesisState) GetGovernanceDelegations() []*GovernanceDelegation { + if x != nil { + return x.GovernanceDelegations + } + return nil +} + var File_atomone_gov_v1_genesis_proto protoreflect.FileDescriptor var file_atomone_gov_v1_genesis_proto_rawDesc = []byte{ @@ -1761,7 +2057,7 @@ var file_atomone_gov_v1_genesis_proto_rawDesc = []byte{ 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x8f, 0x07, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, + 0x6f, 0x74, 0x6f, 0x22, 0xa4, 0x08, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x73, 0x74, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, @@ -1818,18 +2114,27 @@ var file_atomone_gov_v1_genesis_proto_rawDesc = []byte{ 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6d, 0x61, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x13, 0x6c, 0x61, 0x77, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x45, 0x6d, 0x61, 0x42, 0xa3, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x74, - 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, - 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, - 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x47, 0x58, 0xaa, 0x02, 0x0e, 0x41, 0x74, 0x6f, 0x6d, - 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x41, 0x74, 0x6f, - 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x41, 0x74, - 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x41, 0x74, 0x6f, 0x6d, 0x6f, - 0x6e, 0x65, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x45, 0x6d, 0x61, 0x12, 0x36, 0x0a, 0x09, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, + 0x72, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x6f, 0x72, 0x52, 0x09, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x73, 0x12, 0x5b, 0x0a, + 0x16, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x15, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xa3, 0x01, 0x0a, 0x12, 0x63, + 0x6f, 0x6d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, + 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x47, 0x58, 0xaa, 0x02, + 0x0e, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x0e, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1a, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, + 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1846,31 +2151,35 @@ func file_atomone_gov_v1_genesis_proto_rawDescGZIP() []byte { var file_atomone_gov_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_atomone_gov_v1_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: atomone.gov.v1.GenesisState - (*Deposit)(nil), // 1: atomone.gov.v1.Deposit - (*Vote)(nil), // 2: atomone.gov.v1.Vote - (*Proposal)(nil), // 3: atomone.gov.v1.Proposal - (*DepositParams)(nil), // 4: atomone.gov.v1.DepositParams - (*VotingParams)(nil), // 5: atomone.gov.v1.VotingParams - (*TallyParams)(nil), // 6: atomone.gov.v1.TallyParams - (*Params)(nil), // 7: atomone.gov.v1.Params - (*LastMinDeposit)(nil), // 8: atomone.gov.v1.LastMinDeposit + (*GenesisState)(nil), // 0: atomone.gov.v1.GenesisState + (*Deposit)(nil), // 1: atomone.gov.v1.Deposit + (*Vote)(nil), // 2: atomone.gov.v1.Vote + (*Proposal)(nil), // 3: atomone.gov.v1.Proposal + (*DepositParams)(nil), // 4: atomone.gov.v1.DepositParams + (*VotingParams)(nil), // 5: atomone.gov.v1.VotingParams + (*TallyParams)(nil), // 6: atomone.gov.v1.TallyParams + (*Params)(nil), // 7: atomone.gov.v1.Params + (*LastMinDeposit)(nil), // 8: atomone.gov.v1.LastMinDeposit + (*Governor)(nil), // 9: atomone.gov.v1.Governor + (*GovernanceDelegation)(nil), // 10: atomone.gov.v1.GovernanceDelegation } var file_atomone_gov_v1_genesis_proto_depIdxs = []int32{ - 1, // 0: atomone.gov.v1.GenesisState.deposits:type_name -> atomone.gov.v1.Deposit - 2, // 1: atomone.gov.v1.GenesisState.votes:type_name -> atomone.gov.v1.Vote - 3, // 2: atomone.gov.v1.GenesisState.proposals:type_name -> atomone.gov.v1.Proposal - 4, // 3: atomone.gov.v1.GenesisState.deposit_params:type_name -> atomone.gov.v1.DepositParams - 5, // 4: atomone.gov.v1.GenesisState.voting_params:type_name -> atomone.gov.v1.VotingParams - 6, // 5: atomone.gov.v1.GenesisState.tally_params:type_name -> atomone.gov.v1.TallyParams - 7, // 6: atomone.gov.v1.GenesisState.params:type_name -> atomone.gov.v1.Params - 8, // 7: atomone.gov.v1.GenesisState.last_min_deposit:type_name -> atomone.gov.v1.LastMinDeposit - 8, // 8: atomone.gov.v1.GenesisState.last_min_initial_deposit:type_name -> atomone.gov.v1.LastMinDeposit - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 1, // 0: atomone.gov.v1.GenesisState.deposits:type_name -> atomone.gov.v1.Deposit + 2, // 1: atomone.gov.v1.GenesisState.votes:type_name -> atomone.gov.v1.Vote + 3, // 2: atomone.gov.v1.GenesisState.proposals:type_name -> atomone.gov.v1.Proposal + 4, // 3: atomone.gov.v1.GenesisState.deposit_params:type_name -> atomone.gov.v1.DepositParams + 5, // 4: atomone.gov.v1.GenesisState.voting_params:type_name -> atomone.gov.v1.VotingParams + 6, // 5: atomone.gov.v1.GenesisState.tally_params:type_name -> atomone.gov.v1.TallyParams + 7, // 6: atomone.gov.v1.GenesisState.params:type_name -> atomone.gov.v1.Params + 8, // 7: atomone.gov.v1.GenesisState.last_min_deposit:type_name -> atomone.gov.v1.LastMinDeposit + 8, // 8: atomone.gov.v1.GenesisState.last_min_initial_deposit:type_name -> atomone.gov.v1.LastMinDeposit + 9, // 9: atomone.gov.v1.GenesisState.governors:type_name -> atomone.gov.v1.Governor + 10, // 10: atomone.gov.v1.GenesisState.governance_delegations:type_name -> atomone.gov.v1.GovernanceDelegation + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_atomone_gov_v1_genesis_proto_init() } diff --git a/api/atomone/gov/v1/gov.pulsar.go b/api/atomone/gov/v1/gov.pulsar.go index bc9dec9e..0cc607c9 100644 --- a/api/atomone/gov/v1/gov.pulsar.go +++ b/api/atomone/gov/v1/gov.pulsar.go @@ -8211,6 +8211,8 @@ var ( fd_Params_quorum_range protoreflect.FieldDescriptor fd_Params_constitution_amendment_quorum_range protoreflect.FieldDescriptor fd_Params_law_quorum_range protoreflect.FieldDescriptor + fd_Params_governor_status_change_period protoreflect.FieldDescriptor + fd_Params_min_governor_self_delegation protoreflect.FieldDescriptor ) func init() { @@ -8238,6 +8240,8 @@ func init() { fd_Params_quorum_range = md_Params.Fields().ByName("quorum_range") fd_Params_constitution_amendment_quorum_range = md_Params.Fields().ByName("constitution_amendment_quorum_range") fd_Params_law_quorum_range = md_Params.Fields().ByName("law_quorum_range") + fd_Params_governor_status_change_period = md_Params.Fields().ByName("governor_status_change_period") + fd_Params_min_governor_self_delegation = md_Params.Fields().ByName("min_governor_self_delegation") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -8437,6 +8441,18 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.GovernorStatusChangePeriod != nil { + value := protoreflect.ValueOfMessage(x.GovernorStatusChangePeriod.ProtoReflect()) + if !f(fd_Params_governor_status_change_period, value) { + return + } + } + if x.MinGovernorSelfDelegation != "" { + value := protoreflect.ValueOfString(x.MinGovernorSelfDelegation) + if !f(fd_Params_min_governor_self_delegation, value) { + return + } + } } // Has reports whether a field is populated. @@ -8496,6 +8512,10 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.ConstitutionAmendmentQuorumRange != nil case "atomone.gov.v1.Params.law_quorum_range": return x.LawQuorumRange != nil + case "atomone.gov.v1.Params.governor_status_change_period": + return x.GovernorStatusChangePeriod != nil + case "atomone.gov.v1.Params.min_governor_self_delegation": + return x.MinGovernorSelfDelegation != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Params")) @@ -8556,6 +8576,10 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.ConstitutionAmendmentQuorumRange = nil case "atomone.gov.v1.Params.law_quorum_range": x.LawQuorumRange = nil + case "atomone.gov.v1.Params.governor_status_change_period": + x.GovernorStatusChangePeriod = nil + case "atomone.gov.v1.Params.min_governor_self_delegation": + x.MinGovernorSelfDelegation = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Params")) @@ -8641,6 +8665,12 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "atomone.gov.v1.Params.law_quorum_range": value := x.LawQuorumRange return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "atomone.gov.v1.Params.governor_status_change_period": + value := x.GovernorStatusChangePeriod + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "atomone.gov.v1.Params.min_governor_self_delegation": + value := x.MinGovernorSelfDelegation + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Params")) @@ -8707,6 +8737,10 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.ConstitutionAmendmentQuorumRange = value.Message().Interface().(*QuorumRange) case "atomone.gov.v1.Params.law_quorum_range": x.LawQuorumRange = value.Message().Interface().(*QuorumRange) + case "atomone.gov.v1.Params.governor_status_change_period": + x.GovernorStatusChangePeriod = value.Message().Interface().(*durationpb.Duration) + case "atomone.gov.v1.Params.min_governor_self_delegation": + x.MinGovernorSelfDelegation = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Params")) @@ -8778,6 +8812,11 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore x.LawQuorumRange = new(QuorumRange) } return protoreflect.ValueOfMessage(x.LawQuorumRange.ProtoReflect()) + case "atomone.gov.v1.Params.governor_status_change_period": + if x.GovernorStatusChangePeriod == nil { + x.GovernorStatusChangePeriod = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.GovernorStatusChangePeriod.ProtoReflect()) case "atomone.gov.v1.Params.quorum": panic(fmt.Errorf("field quorum of message atomone.gov.v1.Params is not mutable")) case "atomone.gov.v1.Params.threshold": @@ -8802,6 +8841,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field quorum_check_count of message atomone.gov.v1.Params is not mutable")) case "atomone.gov.v1.Params.burn_deposit_no_threshold": panic(fmt.Errorf("field burn_deposit_no_threshold of message atomone.gov.v1.Params is not mutable")) + case "atomone.gov.v1.Params.min_governor_self_delegation": + panic(fmt.Errorf("field min_governor_self_delegation of message atomone.gov.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Params")) @@ -8869,6 +8910,11 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor case "atomone.gov.v1.Params.law_quorum_range": m := new(QuorumRange) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "atomone.gov.v1.Params.governor_status_change_period": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "atomone.gov.v1.Params.min_governor_self_delegation": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Params")) @@ -9025,6 +9071,14 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { l = options.Size(x.LawQuorumRange) n += 2 + l + runtime.Sov(uint64(l)) } + if x.GovernorStatusChangePeriod != nil { + l = options.Size(x.GovernorStatusChangePeriod) + n += 2 + l + runtime.Sov(uint64(l)) + } + l = len(x.MinGovernorSelfDelegation) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -9054,6 +9108,31 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.MinGovernorSelfDelegation) > 0 { + i -= len(x.MinGovernorSelfDelegation) + copy(dAtA[i:], x.MinGovernorSelfDelegation) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinGovernorSelfDelegation))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + if x.GovernorStatusChangePeriod != nil { + encoded, err := options.Marshal(x.GovernorStatusChangePeriod) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xea + } if x.LawQuorumRange != nil { encoded, err := options.Marshal(x.LawQuorumRange) if err != nil { @@ -10064,6 +10143,74 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 29: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernorStatusChangePeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.GovernorStatusChangePeriod == nil { + x.GovernorStatusChangePeriod = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.GovernorStatusChangePeriod); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 30: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinGovernorSelfDelegation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MinGovernorSelfDelegation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -10583,169 +10730,2556 @@ func (x *fastReflection_QuorumRange) ProtoMethods() *protoiface.Methods { } } -// Since: cosmos-sdk 0.46 - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: atomone/gov/v1/gov.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// VoteOption enumerates the valid vote options for a given governance proposal. -type VoteOption int32 - -const ( - // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 - // VOTE_OPTION_YES defines a yes vote option. - VoteOption_VOTE_OPTION_YES VoteOption = 1 - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 - // VOTE_OPTION_NO defines a no vote option. - VoteOption_VOTE_OPTION_NO VoteOption = 3 -) - -// Enum value maps for VoteOption. var ( - VoteOption_name = map[int32]string{ - 0: "VOTE_OPTION_UNSPECIFIED", - 1: "VOTE_OPTION_YES", - 2: "VOTE_OPTION_ABSTAIN", - 3: "VOTE_OPTION_NO", - } - VoteOption_value = map[string]int32{ - "VOTE_OPTION_UNSPECIFIED": 0, - "VOTE_OPTION_YES": 1, - "VOTE_OPTION_ABSTAIN": 2, - "VOTE_OPTION_NO": 3, - } + md_Governor protoreflect.MessageDescriptor + fd_Governor_governor_address protoreflect.FieldDescriptor + fd_Governor_status protoreflect.FieldDescriptor + fd_Governor_description protoreflect.FieldDescriptor + fd_Governor_last_status_change_time protoreflect.FieldDescriptor ) -func (x VoteOption) Enum() *VoteOption { - p := new(VoteOption) - *p = x - return p -} - -func (x VoteOption) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +func init() { + file_atomone_gov_v1_gov_proto_init() + md_Governor = File_atomone_gov_v1_gov_proto.Messages().ByName("Governor") + fd_Governor_governor_address = md_Governor.Fields().ByName("governor_address") + fd_Governor_status = md_Governor.Fields().ByName("status") + fd_Governor_description = md_Governor.Fields().ByName("description") + fd_Governor_last_status_change_time = md_Governor.Fields().ByName("last_status_change_time") } -func (VoteOption) Descriptor() protoreflect.EnumDescriptor { - return file_atomone_gov_v1_gov_proto_enumTypes[0].Descriptor() -} +var _ protoreflect.Message = (*fastReflection_Governor)(nil) -func (VoteOption) Type() protoreflect.EnumType { - return &file_atomone_gov_v1_gov_proto_enumTypes[0] -} +type fastReflection_Governor Governor -func (x VoteOption) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) +func (x *Governor) ProtoReflect() protoreflect.Message { + return (*fastReflection_Governor)(x) } -// Deprecated: Use VoteOption.Descriptor instead. -func (VoteOption) EnumDescriptor() ([]byte, []int) { - return file_atomone_gov_v1_gov_proto_rawDescGZIP(), []int{0} +func (x *Governor) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_gov_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -// ProposalStatus enumerates the valid statuses of a proposal. -type ProposalStatus int32 - -const ( - // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED ProposalStatus = 0 - // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - // period. - ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD ProposalStatus = 1 - // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - // period. - ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD ProposalStatus = 2 - // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - // passed. - ProposalStatus_PROPOSAL_STATUS_PASSED ProposalStatus = 3 - // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - // been rejected. - ProposalStatus_PROPOSAL_STATUS_REJECTED ProposalStatus = 4 - // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - // failed. - ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 -) +var _fastReflection_Governor_messageType fastReflection_Governor_messageType +var _ protoreflect.MessageType = fastReflection_Governor_messageType{} -// Enum value maps for ProposalStatus. -var ( - ProposalStatus_name = map[int32]string{ - 0: "PROPOSAL_STATUS_UNSPECIFIED", - 1: "PROPOSAL_STATUS_DEPOSIT_PERIOD", - 2: "PROPOSAL_STATUS_VOTING_PERIOD", - 3: "PROPOSAL_STATUS_PASSED", - 4: "PROPOSAL_STATUS_REJECTED", - 5: "PROPOSAL_STATUS_FAILED", - } - ProposalStatus_value = map[string]int32{ - "PROPOSAL_STATUS_UNSPECIFIED": 0, - "PROPOSAL_STATUS_DEPOSIT_PERIOD": 1, - "PROPOSAL_STATUS_VOTING_PERIOD": 2, - "PROPOSAL_STATUS_PASSED": 3, - "PROPOSAL_STATUS_REJECTED": 4, - "PROPOSAL_STATUS_FAILED": 5, - } -) +type fastReflection_Governor_messageType struct{} -func (x ProposalStatus) Enum() *ProposalStatus { - p := new(ProposalStatus) - *p = x - return p +func (x fastReflection_Governor_messageType) Zero() protoreflect.Message { + return (*fastReflection_Governor)(nil) } - -func (x ProposalStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +func (x fastReflection_Governor_messageType) New() protoreflect.Message { + return new(fastReflection_Governor) } - -func (ProposalStatus) Descriptor() protoreflect.EnumDescriptor { - return file_atomone_gov_v1_gov_proto_enumTypes[1].Descriptor() +func (x fastReflection_Governor_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Governor } -func (ProposalStatus) Type() protoreflect.EnumType { - return &file_atomone_gov_v1_gov_proto_enumTypes[1] +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Governor) Descriptor() protoreflect.MessageDescriptor { + return md_Governor } -func (x ProposalStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Governor) Type() protoreflect.MessageType { + return _fastReflection_Governor_messageType } -// Deprecated: Use ProposalStatus.Descriptor instead. -func (ProposalStatus) EnumDescriptor() ([]byte, []int) { - return file_atomone_gov_v1_gov_proto_rawDescGZIP(), []int{1} +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Governor) New() protoreflect.Message { + return new(fastReflection_Governor) } -// WeightedVoteOption defines a unit of vote for vote split. -type WeightedVoteOption struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // option defines the valid vote options, it must not contain duplicate vote - // options. - Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=atomone.gov.v1.VoteOption" json:"option,omitempty"` - // weight is the vote weight associated with the vote option. - Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Governor) Interface() protoreflect.ProtoMessage { + return (*Governor)(x) } -func (x *WeightedVoteOption) Reset() { - *x = WeightedVoteOption{} - if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_gov_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Governor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.GovernorAddress != "" { + value := protoreflect.ValueOfString(x.GovernorAddress) + if !f(fd_Governor_governor_address, value) { + return + } } -} + if x.Status != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Status)) + if !f(fd_Governor_status, value) { + return + } + } + if x.Description != nil { + value := protoreflect.ValueOfMessage(x.Description.ProtoReflect()) + if !f(fd_Governor_description, value) { + return + } + } + if x.LastStatusChangeTime != nil { + value := protoreflect.ValueOfMessage(x.LastStatusChangeTime.ProtoReflect()) + if !f(fd_Governor_last_status_change_time, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Governor) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.Governor.governor_address": + return x.GovernorAddress != "" + case "atomone.gov.v1.Governor.status": + return x.Status != 0 + case "atomone.gov.v1.Governor.description": + return x.Description != nil + case "atomone.gov.v1.Governor.last_status_change_time": + return x.LastStatusChangeTime != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Governor")) + } + panic(fmt.Errorf("message atomone.gov.v1.Governor does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Governor) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.Governor.governor_address": + x.GovernorAddress = "" + case "atomone.gov.v1.Governor.status": + x.Status = 0 + case "atomone.gov.v1.Governor.description": + x.Description = nil + case "atomone.gov.v1.Governor.last_status_change_time": + x.LastStatusChangeTime = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Governor")) + } + panic(fmt.Errorf("message atomone.gov.v1.Governor does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Governor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.Governor.governor_address": + value := x.GovernorAddress + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.Governor.status": + value := x.Status + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "atomone.gov.v1.Governor.description": + value := x.Description + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "atomone.gov.v1.Governor.last_status_change_time": + value := x.LastStatusChangeTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Governor")) + } + panic(fmt.Errorf("message atomone.gov.v1.Governor does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Governor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.Governor.governor_address": + x.GovernorAddress = value.Interface().(string) + case "atomone.gov.v1.Governor.status": + x.Status = (GovernorStatus)(value.Enum()) + case "atomone.gov.v1.Governor.description": + x.Description = value.Message().Interface().(*GovernorDescription) + case "atomone.gov.v1.Governor.last_status_change_time": + x.LastStatusChangeTime = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Governor")) + } + panic(fmt.Errorf("message atomone.gov.v1.Governor does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Governor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.Governor.description": + if x.Description == nil { + x.Description = new(GovernorDescription) + } + return protoreflect.ValueOfMessage(x.Description.ProtoReflect()) + case "atomone.gov.v1.Governor.last_status_change_time": + if x.LastStatusChangeTime == nil { + x.LastStatusChangeTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.LastStatusChangeTime.ProtoReflect()) + case "atomone.gov.v1.Governor.governor_address": + panic(fmt.Errorf("field governor_address of message atomone.gov.v1.Governor is not mutable")) + case "atomone.gov.v1.Governor.status": + panic(fmt.Errorf("field status of message atomone.gov.v1.Governor is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Governor")) + } + panic(fmt.Errorf("message atomone.gov.v1.Governor does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Governor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.Governor.governor_address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.Governor.status": + return protoreflect.ValueOfEnum(0) + case "atomone.gov.v1.Governor.description": + m := new(GovernorDescription) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "atomone.gov.v1.Governor.last_status_change_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.Governor")) + } + panic(fmt.Errorf("message atomone.gov.v1.Governor does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Governor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.Governor", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Governor) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Governor) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Governor) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Governor) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Governor) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.GovernorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + if x.Description != nil { + l = options.Size(x.Description) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.LastStatusChangeTime != nil { + l = options.Size(x.LastStatusChangeTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Governor) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.LastStatusChangeTime != nil { + encoded, err := options.Marshal(x.LastStatusChangeTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x22 + } + if x.Description != nil { + encoded, err := options.Marshal(x.Description) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x10 + } + if len(x.GovernorAddress) > 0 { + i -= len(x.GovernorAddress) + copy(dAtA[i:], x.GovernorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Governor) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Governor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Governor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Status |= GovernorStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Description == nil { + x.Description = &GovernorDescription{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Description); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastStatusChangeTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.LastStatusChangeTime == nil { + x.LastStatusChangeTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LastStatusChangeTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_GovernorDescription protoreflect.MessageDescriptor + fd_GovernorDescription_moniker protoreflect.FieldDescriptor + fd_GovernorDescription_identity protoreflect.FieldDescriptor + fd_GovernorDescription_website protoreflect.FieldDescriptor + fd_GovernorDescription_security_contact protoreflect.FieldDescriptor + fd_GovernorDescription_details protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_gov_proto_init() + md_GovernorDescription = File_atomone_gov_v1_gov_proto.Messages().ByName("GovernorDescription") + fd_GovernorDescription_moniker = md_GovernorDescription.Fields().ByName("moniker") + fd_GovernorDescription_identity = md_GovernorDescription.Fields().ByName("identity") + fd_GovernorDescription_website = md_GovernorDescription.Fields().ByName("website") + fd_GovernorDescription_security_contact = md_GovernorDescription.Fields().ByName("security_contact") + fd_GovernorDescription_details = md_GovernorDescription.Fields().ByName("details") +} + +var _ protoreflect.Message = (*fastReflection_GovernorDescription)(nil) + +type fastReflection_GovernorDescription GovernorDescription + +func (x *GovernorDescription) ProtoReflect() protoreflect.Message { + return (*fastReflection_GovernorDescription)(x) +} + +func (x *GovernorDescription) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_gov_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GovernorDescription_messageType fastReflection_GovernorDescription_messageType +var _ protoreflect.MessageType = fastReflection_GovernorDescription_messageType{} + +type fastReflection_GovernorDescription_messageType struct{} + +func (x fastReflection_GovernorDescription_messageType) Zero() protoreflect.Message { + return (*fastReflection_GovernorDescription)(nil) +} +func (x fastReflection_GovernorDescription_messageType) New() protoreflect.Message { + return new(fastReflection_GovernorDescription) +} +func (x fastReflection_GovernorDescription_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GovernorDescription +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GovernorDescription) Descriptor() protoreflect.MessageDescriptor { + return md_GovernorDescription +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GovernorDescription) Type() protoreflect.MessageType { + return _fastReflection_GovernorDescription_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GovernorDescription) New() protoreflect.Message { + return new(fastReflection_GovernorDescription) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GovernorDescription) Interface() protoreflect.ProtoMessage { + return (*GovernorDescription)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GovernorDescription) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Moniker != "" { + value := protoreflect.ValueOfString(x.Moniker) + if !f(fd_GovernorDescription_moniker, value) { + return + } + } + if x.Identity != "" { + value := protoreflect.ValueOfString(x.Identity) + if !f(fd_GovernorDescription_identity, value) { + return + } + } + if x.Website != "" { + value := protoreflect.ValueOfString(x.Website) + if !f(fd_GovernorDescription_website, value) { + return + } + } + if x.SecurityContact != "" { + value := protoreflect.ValueOfString(x.SecurityContact) + if !f(fd_GovernorDescription_security_contact, value) { + return + } + } + if x.Details != "" { + value := protoreflect.ValueOfString(x.Details) + if !f(fd_GovernorDescription_details, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GovernorDescription) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.GovernorDescription.moniker": + return x.Moniker != "" + case "atomone.gov.v1.GovernorDescription.identity": + return x.Identity != "" + case "atomone.gov.v1.GovernorDescription.website": + return x.Website != "" + case "atomone.gov.v1.GovernorDescription.security_contact": + return x.SecurityContact != "" + case "atomone.gov.v1.GovernorDescription.details": + return x.Details != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorDescription")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorDescription does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernorDescription) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.GovernorDescription.moniker": + x.Moniker = "" + case "atomone.gov.v1.GovernorDescription.identity": + x.Identity = "" + case "atomone.gov.v1.GovernorDescription.website": + x.Website = "" + case "atomone.gov.v1.GovernorDescription.security_contact": + x.SecurityContact = "" + case "atomone.gov.v1.GovernorDescription.details": + x.Details = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorDescription")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorDescription does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GovernorDescription) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.GovernorDescription.moniker": + value := x.Moniker + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.GovernorDescription.identity": + value := x.Identity + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.GovernorDescription.website": + value := x.Website + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.GovernorDescription.security_contact": + value := x.SecurityContact + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.GovernorDescription.details": + value := x.Details + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorDescription")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorDescription does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernorDescription) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.GovernorDescription.moniker": + x.Moniker = value.Interface().(string) + case "atomone.gov.v1.GovernorDescription.identity": + x.Identity = value.Interface().(string) + case "atomone.gov.v1.GovernorDescription.website": + x.Website = value.Interface().(string) + case "atomone.gov.v1.GovernorDescription.security_contact": + x.SecurityContact = value.Interface().(string) + case "atomone.gov.v1.GovernorDescription.details": + x.Details = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorDescription")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorDescription does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernorDescription) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.GovernorDescription.moniker": + panic(fmt.Errorf("field moniker of message atomone.gov.v1.GovernorDescription is not mutable")) + case "atomone.gov.v1.GovernorDescription.identity": + panic(fmt.Errorf("field identity of message atomone.gov.v1.GovernorDescription is not mutable")) + case "atomone.gov.v1.GovernorDescription.website": + panic(fmt.Errorf("field website of message atomone.gov.v1.GovernorDescription is not mutable")) + case "atomone.gov.v1.GovernorDescription.security_contact": + panic(fmt.Errorf("field security_contact of message atomone.gov.v1.GovernorDescription is not mutable")) + case "atomone.gov.v1.GovernorDescription.details": + panic(fmt.Errorf("field details of message atomone.gov.v1.GovernorDescription is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorDescription")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorDescription does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GovernorDescription) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.GovernorDescription.moniker": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.GovernorDescription.identity": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.GovernorDescription.website": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.GovernorDescription.security_contact": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.GovernorDescription.details": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorDescription")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorDescription does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GovernorDescription) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.GovernorDescription", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GovernorDescription) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernorDescription) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GovernorDescription) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GovernorDescription) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GovernorDescription) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Moniker) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Identity) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Website) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SecurityContact) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Details) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GovernorDescription) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Details) > 0 { + i -= len(x.Details) + copy(dAtA[i:], x.Details) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Details))) + i-- + dAtA[i] = 0x2a + } + if len(x.SecurityContact) > 0 { + i -= len(x.SecurityContact) + copy(dAtA[i:], x.SecurityContact) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SecurityContact))) + i-- + dAtA[i] = 0x22 + } + if len(x.Website) > 0 { + i -= len(x.Website) + copy(dAtA[i:], x.Website) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Website))) + i-- + dAtA[i] = 0x1a + } + if len(x.Identity) > 0 { + i -= len(x.Identity) + copy(dAtA[i:], x.Identity) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Identity))) + i-- + dAtA[i] = 0x12 + } + if len(x.Moniker) > 0 { + i -= len(x.Moniker) + copy(dAtA[i:], x.Moniker) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Moniker))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GovernorDescription) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GovernorDescription: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GovernorDescription: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Identity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SecurityContact", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SecurityContact = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Details = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_GovernorValShares protoreflect.MessageDescriptor + fd_GovernorValShares_governor_address protoreflect.FieldDescriptor + fd_GovernorValShares_validator_address protoreflect.FieldDescriptor + fd_GovernorValShares_shares protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_gov_proto_init() + md_GovernorValShares = File_atomone_gov_v1_gov_proto.Messages().ByName("GovernorValShares") + fd_GovernorValShares_governor_address = md_GovernorValShares.Fields().ByName("governor_address") + fd_GovernorValShares_validator_address = md_GovernorValShares.Fields().ByName("validator_address") + fd_GovernorValShares_shares = md_GovernorValShares.Fields().ByName("shares") +} + +var _ protoreflect.Message = (*fastReflection_GovernorValShares)(nil) + +type fastReflection_GovernorValShares GovernorValShares + +func (x *GovernorValShares) ProtoReflect() protoreflect.Message { + return (*fastReflection_GovernorValShares)(x) +} + +func (x *GovernorValShares) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_gov_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GovernorValShares_messageType fastReflection_GovernorValShares_messageType +var _ protoreflect.MessageType = fastReflection_GovernorValShares_messageType{} + +type fastReflection_GovernorValShares_messageType struct{} + +func (x fastReflection_GovernorValShares_messageType) Zero() protoreflect.Message { + return (*fastReflection_GovernorValShares)(nil) +} +func (x fastReflection_GovernorValShares_messageType) New() protoreflect.Message { + return new(fastReflection_GovernorValShares) +} +func (x fastReflection_GovernorValShares_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GovernorValShares +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GovernorValShares) Descriptor() protoreflect.MessageDescriptor { + return md_GovernorValShares +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GovernorValShares) Type() protoreflect.MessageType { + return _fastReflection_GovernorValShares_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GovernorValShares) New() protoreflect.Message { + return new(fastReflection_GovernorValShares) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GovernorValShares) Interface() protoreflect.ProtoMessage { + return (*GovernorValShares)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GovernorValShares) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.GovernorAddress != "" { + value := protoreflect.ValueOfString(x.GovernorAddress) + if !f(fd_GovernorValShares_governor_address, value) { + return + } + } + if x.ValidatorAddress != "" { + value := protoreflect.ValueOfString(x.ValidatorAddress) + if !f(fd_GovernorValShares_validator_address, value) { + return + } + } + if x.Shares != "" { + value := protoreflect.ValueOfString(x.Shares) + if !f(fd_GovernorValShares_shares, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GovernorValShares) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.GovernorValShares.governor_address": + return x.GovernorAddress != "" + case "atomone.gov.v1.GovernorValShares.validator_address": + return x.ValidatorAddress != "" + case "atomone.gov.v1.GovernorValShares.shares": + return x.Shares != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorValShares")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorValShares does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernorValShares) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.GovernorValShares.governor_address": + x.GovernorAddress = "" + case "atomone.gov.v1.GovernorValShares.validator_address": + x.ValidatorAddress = "" + case "atomone.gov.v1.GovernorValShares.shares": + x.Shares = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorValShares")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorValShares does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GovernorValShares) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.GovernorValShares.governor_address": + value := x.GovernorAddress + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.GovernorValShares.validator_address": + value := x.ValidatorAddress + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.GovernorValShares.shares": + value := x.Shares + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorValShares")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorValShares does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernorValShares) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.GovernorValShares.governor_address": + x.GovernorAddress = value.Interface().(string) + case "atomone.gov.v1.GovernorValShares.validator_address": + x.ValidatorAddress = value.Interface().(string) + case "atomone.gov.v1.GovernorValShares.shares": + x.Shares = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorValShares")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorValShares does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernorValShares) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.GovernorValShares.governor_address": + panic(fmt.Errorf("field governor_address of message atomone.gov.v1.GovernorValShares is not mutable")) + case "atomone.gov.v1.GovernorValShares.validator_address": + panic(fmt.Errorf("field validator_address of message atomone.gov.v1.GovernorValShares is not mutable")) + case "atomone.gov.v1.GovernorValShares.shares": + panic(fmt.Errorf("field shares of message atomone.gov.v1.GovernorValShares is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorValShares")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorValShares does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GovernorValShares) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.GovernorValShares.governor_address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.GovernorValShares.validator_address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.GovernorValShares.shares": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernorValShares")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernorValShares does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GovernorValShares) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.GovernorValShares", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GovernorValShares) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernorValShares) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GovernorValShares) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GovernorValShares) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GovernorValShares) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.GovernorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ValidatorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Shares) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GovernorValShares) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Shares) > 0 { + i -= len(x.Shares) + copy(dAtA[i:], x.Shares) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Shares))) + i-- + dAtA[i] = 0x1a + } + if len(x.ValidatorAddress) > 0 { + i -= len(x.ValidatorAddress) + copy(dAtA[i:], x.ValidatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.GovernorAddress) > 0 { + i -= len(x.GovernorAddress) + copy(dAtA[i:], x.GovernorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GovernorValShares) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GovernorValShares: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GovernorValShares: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Shares = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_GovernanceDelegation protoreflect.MessageDescriptor + fd_GovernanceDelegation_delegator_address protoreflect.FieldDescriptor + fd_GovernanceDelegation_governor_address protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_gov_proto_init() + md_GovernanceDelegation = File_atomone_gov_v1_gov_proto.Messages().ByName("GovernanceDelegation") + fd_GovernanceDelegation_delegator_address = md_GovernanceDelegation.Fields().ByName("delegator_address") + fd_GovernanceDelegation_governor_address = md_GovernanceDelegation.Fields().ByName("governor_address") +} + +var _ protoreflect.Message = (*fastReflection_GovernanceDelegation)(nil) + +type fastReflection_GovernanceDelegation GovernanceDelegation + +func (x *GovernanceDelegation) ProtoReflect() protoreflect.Message { + return (*fastReflection_GovernanceDelegation)(x) +} + +func (x *GovernanceDelegation) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_gov_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GovernanceDelegation_messageType fastReflection_GovernanceDelegation_messageType +var _ protoreflect.MessageType = fastReflection_GovernanceDelegation_messageType{} + +type fastReflection_GovernanceDelegation_messageType struct{} + +func (x fastReflection_GovernanceDelegation_messageType) Zero() protoreflect.Message { + return (*fastReflection_GovernanceDelegation)(nil) +} +func (x fastReflection_GovernanceDelegation_messageType) New() protoreflect.Message { + return new(fastReflection_GovernanceDelegation) +} +func (x fastReflection_GovernanceDelegation_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GovernanceDelegation +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GovernanceDelegation) Descriptor() protoreflect.MessageDescriptor { + return md_GovernanceDelegation +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GovernanceDelegation) Type() protoreflect.MessageType { + return _fastReflection_GovernanceDelegation_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GovernanceDelegation) New() protoreflect.Message { + return new(fastReflection_GovernanceDelegation) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GovernanceDelegation) Interface() protoreflect.ProtoMessage { + return (*GovernanceDelegation)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GovernanceDelegation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DelegatorAddress != "" { + value := protoreflect.ValueOfString(x.DelegatorAddress) + if !f(fd_GovernanceDelegation_delegator_address, value) { + return + } + } + if x.GovernorAddress != "" { + value := protoreflect.ValueOfString(x.GovernorAddress) + if !f(fd_GovernanceDelegation_governor_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GovernanceDelegation) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.GovernanceDelegation.delegator_address": + return x.DelegatorAddress != "" + case "atomone.gov.v1.GovernanceDelegation.governor_address": + return x.GovernorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernanceDelegation")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernanceDelegation does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernanceDelegation) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.GovernanceDelegation.delegator_address": + x.DelegatorAddress = "" + case "atomone.gov.v1.GovernanceDelegation.governor_address": + x.GovernorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernanceDelegation")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernanceDelegation does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GovernanceDelegation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.GovernanceDelegation.delegator_address": + value := x.DelegatorAddress + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.GovernanceDelegation.governor_address": + value := x.GovernorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernanceDelegation")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernanceDelegation does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernanceDelegation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.GovernanceDelegation.delegator_address": + x.DelegatorAddress = value.Interface().(string) + case "atomone.gov.v1.GovernanceDelegation.governor_address": + x.GovernorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernanceDelegation")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernanceDelegation does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernanceDelegation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.GovernanceDelegation.delegator_address": + panic(fmt.Errorf("field delegator_address of message atomone.gov.v1.GovernanceDelegation is not mutable")) + case "atomone.gov.v1.GovernanceDelegation.governor_address": + panic(fmt.Errorf("field governor_address of message atomone.gov.v1.GovernanceDelegation is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernanceDelegation")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernanceDelegation does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GovernanceDelegation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.GovernanceDelegation.delegator_address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.GovernanceDelegation.governor_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.GovernanceDelegation")) + } + panic(fmt.Errorf("message atomone.gov.v1.GovernanceDelegation does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GovernanceDelegation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.GovernanceDelegation", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GovernanceDelegation) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GovernanceDelegation) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GovernanceDelegation) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GovernanceDelegation) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GovernanceDelegation) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.DelegatorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.GovernorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GovernanceDelegation) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.GovernorAddress) > 0 { + i -= len(x.GovernorAddress) + copy(dAtA[i:], x.GovernorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GovernorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.DelegatorAddress) > 0 { + i -= len(x.DelegatorAddress) + copy(dAtA[i:], x.DelegatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GovernanceDelegation) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GovernanceDelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GovernanceDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Since: cosmos-sdk 0.46 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: atomone/gov/v1/gov.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// VoteOption enumerates the valid vote options for a given governance proposal. +type VoteOption int32 + +const ( + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 + // VOTE_OPTION_YES defines a yes vote option. + VoteOption_VOTE_OPTION_YES VoteOption = 1 + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 + // VOTE_OPTION_NO defines a no vote option. + VoteOption_VOTE_OPTION_NO VoteOption = 3 +) + +// Enum value maps for VoteOption. +var ( + VoteOption_name = map[int32]string{ + 0: "VOTE_OPTION_UNSPECIFIED", + 1: "VOTE_OPTION_YES", + 2: "VOTE_OPTION_ABSTAIN", + 3: "VOTE_OPTION_NO", + } + VoteOption_value = map[string]int32{ + "VOTE_OPTION_UNSPECIFIED": 0, + "VOTE_OPTION_YES": 1, + "VOTE_OPTION_ABSTAIN": 2, + "VOTE_OPTION_NO": 3, + } +) + +func (x VoteOption) Enum() *VoteOption { + p := new(VoteOption) + *p = x + return p +} + +func (x VoteOption) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (VoteOption) Descriptor() protoreflect.EnumDescriptor { + return file_atomone_gov_v1_gov_proto_enumTypes[0].Descriptor() +} + +func (VoteOption) Type() protoreflect.EnumType { + return &file_atomone_gov_v1_gov_proto_enumTypes[0] +} + +func (x VoteOption) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use VoteOption.Descriptor instead. +func (VoteOption) EnumDescriptor() ([]byte, []int) { + return file_atomone_gov_v1_gov_proto_rawDescGZIP(), []int{0} +} + +// ProposalStatus enumerates the valid statuses of a proposal. +type ProposalStatus int32 + +const ( + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED ProposalStatus = 0 + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD ProposalStatus = 1 + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD ProposalStatus = 2 + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + ProposalStatus_PROPOSAL_STATUS_PASSED ProposalStatus = 3 + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + ProposalStatus_PROPOSAL_STATUS_REJECTED ProposalStatus = 4 + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 +) + +// Enum value maps for ProposalStatus. +var ( + ProposalStatus_name = map[int32]string{ + 0: "PROPOSAL_STATUS_UNSPECIFIED", + 1: "PROPOSAL_STATUS_DEPOSIT_PERIOD", + 2: "PROPOSAL_STATUS_VOTING_PERIOD", + 3: "PROPOSAL_STATUS_PASSED", + 4: "PROPOSAL_STATUS_REJECTED", + 5: "PROPOSAL_STATUS_FAILED", + } + ProposalStatus_value = map[string]int32{ + "PROPOSAL_STATUS_UNSPECIFIED": 0, + "PROPOSAL_STATUS_DEPOSIT_PERIOD": 1, + "PROPOSAL_STATUS_VOTING_PERIOD": 2, + "PROPOSAL_STATUS_PASSED": 3, + "PROPOSAL_STATUS_REJECTED": 4, + "PROPOSAL_STATUS_FAILED": 5, + } +) + +func (x ProposalStatus) Enum() *ProposalStatus { + p := new(ProposalStatus) + *p = x + return p +} + +func (x ProposalStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProposalStatus) Descriptor() protoreflect.EnumDescriptor { + return file_atomone_gov_v1_gov_proto_enumTypes[1].Descriptor() +} + +func (ProposalStatus) Type() protoreflect.EnumType { + return &file_atomone_gov_v1_gov_proto_enumTypes[1] +} + +func (x ProposalStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProposalStatus.Descriptor instead. +func (ProposalStatus) EnumDescriptor() ([]byte, []int) { + return file_atomone_gov_v1_gov_proto_rawDescGZIP(), []int{1} +} + +// GovernorStatus is the status of a governor. +type GovernorStatus int32 + +const ( + // UNSPECIFIED defines an invalid governor status. + GovernorStatus_GOVERNOR_STATUS_UNSPECIFIED GovernorStatus = 0 + // ACTIVE defines a governor that is active. + GovernorStatus_GOVERNOR_STATUS_ACTIVE GovernorStatus = 1 + // INACTIVE defines a governor that is inactive. + GovernorStatus_GOVERNOR_STATUS_INACTIVE GovernorStatus = 2 +) + +// Enum value maps for GovernorStatus. +var ( + GovernorStatus_name = map[int32]string{ + 0: "GOVERNOR_STATUS_UNSPECIFIED", + 1: "GOVERNOR_STATUS_ACTIVE", + 2: "GOVERNOR_STATUS_INACTIVE", + } + GovernorStatus_value = map[string]int32{ + "GOVERNOR_STATUS_UNSPECIFIED": 0, + "GOVERNOR_STATUS_ACTIVE": 1, + "GOVERNOR_STATUS_INACTIVE": 2, + } +) + +func (x GovernorStatus) Enum() *GovernorStatus { + p := new(GovernorStatus) + *p = x + return p +} + +func (x GovernorStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GovernorStatus) Descriptor() protoreflect.EnumDescriptor { + return file_atomone_gov_v1_gov_proto_enumTypes[2].Descriptor() +} + +func (GovernorStatus) Type() protoreflect.EnumType { + return &file_atomone_gov_v1_gov_proto_enumTypes[2] +} + +func (x GovernorStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GovernorStatus.Descriptor instead. +func (GovernorStatus) EnumDescriptor() ([]byte, []int) { + return file_atomone_gov_v1_gov_proto_rawDescGZIP(), []int{2} +} + +// WeightedVoteOption defines a unit of vote for vote split. +type WeightedVoteOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // option defines the valid vote options, it must not contain duplicate vote + // options. + Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=atomone.gov.v1.VoteOption" json:"option,omitempty"` + // weight is the vote weight associated with the vote option. + Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` +} + +func (x *WeightedVoteOption) Reset() { + *x = WeightedVoteOption{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_gov_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} func (x *WeightedVoteOption) String() string { return protoimpl.X.MessageStringOf(x) @@ -11632,6 +14166,12 @@ type Params struct { ConstitutionAmendmentQuorumRange *QuorumRange `protobuf:"bytes,27,opt,name=constitution_amendment_quorum_range,json=constitutionAmendmentQuorumRange,proto3" json:"constitution_amendment_quorum_range,omitempty"` // Achievable quorum for law proposals LawQuorumRange *QuorumRange `protobuf:"bytes,28,opt,name=law_quorum_range,json=lawQuorumRange,proto3" json:"law_quorum_range,omitempty"` + // Defines the duration of time that need to elapse between governor status changes. + GovernorStatusChangePeriod *durationpb.Duration `protobuf:"bytes,29,opt,name=governor_status_change_period,json=governorStatusChangePeriod,proto3" 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,30,opt,name=min_governor_self_delegation,json=minGovernorSelfDelegation,proto3" json:"min_governor_self_delegation,omitempty"` } func (x *Params) Reset() { @@ -11813,6 +14353,20 @@ func (x *Params) GetLawQuorumRange() *QuorumRange { return nil } +func (x *Params) GetGovernorStatusChangePeriod() *durationpb.Duration { + if x != nil { + return x.GovernorStatusChangePeriod + } + return nil +} + +func (x *Params) GetMinGovernorSelfDelegation() string { + if x != nil { + return x.MinGovernorSelfDelegation + } + return "" +} + type QuorumRange struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11858,6 +14412,246 @@ func (x *QuorumRange) GetMin() string { 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 +// shares from each delegators delegations in x/staking are added to the +// governor's total shares. +type Governor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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"` + // description defines the description terms for the governor. + Description *GovernorDescription `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // last_status_change_time is the time when the governor's status was last changed. + LastStatusChangeTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_status_change_time,json=lastStatusChangeTime,proto3" json:"last_status_change_time,omitempty"` +} + +func (x *Governor) Reset() { + *x = Governor{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_gov_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Governor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Governor) ProtoMessage() {} + +// Deprecated: Use Governor.ProtoReflect.Descriptor instead. +func (*Governor) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_gov_proto_rawDescGZIP(), []int{14} +} + +func (x *Governor) GetGovernorAddress() string { + if x != nil { + return x.GovernorAddress + } + return "" +} + +func (x *Governor) GetStatus() GovernorStatus { + if x != nil { + return x.Status + } + return GovernorStatus_GOVERNOR_STATUS_UNSPECIFIED +} + +func (x *Governor) GetDescription() *GovernorDescription { + if x != nil { + return x.Description + } + return nil +} + +func (x *Governor) GetLastStatusChangeTime() *timestamppb.Timestamp { + if x != nil { + return x.LastStatusChangeTime + } + return nil +} + +// Description defines a governor description. +type GovernorDescription struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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 (x *GovernorDescription) Reset() { + *x = GovernorDescription{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_gov_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GovernorDescription) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GovernorDescription) ProtoMessage() {} + +// Deprecated: Use GovernorDescription.ProtoReflect.Descriptor instead. +func (*GovernorDescription) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_gov_proto_rawDescGZIP(), []int{15} +} + +func (x *GovernorDescription) GetMoniker() string { + if x != nil { + return x.Moniker + } + return "" +} + +func (x *GovernorDescription) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +func (x *GovernorDescription) GetWebsite() string { + if x != nil { + return x.Website + } + return "" +} + +func (x *GovernorDescription) GetSecurityContact() string { + if x != nil { + return x.SecurityContact + } + return "" +} + +func (x *GovernorDescription) GetDetails() string { + if x != nil { + return x.Details + } + return "" +} + +// GovernorValShares holds the number of virtual shares from the +// specific validator that a governor can use to vote on proposals. +type GovernorValShares struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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 string `protobuf:"bytes,3,opt,name=shares,proto3" json:"shares,omitempty"` +} + +func (x *GovernorValShares) Reset() { + *x = GovernorValShares{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_gov_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GovernorValShares) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GovernorValShares) ProtoMessage() {} + +// Deprecated: Use GovernorValShares.ProtoReflect.Descriptor instead. +func (*GovernorValShares) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_gov_proto_rawDescGZIP(), []int{16} +} + +func (x *GovernorValShares) GetGovernorAddress() string { + if x != nil { + return x.GovernorAddress + } + return "" +} + +func (x *GovernorValShares) GetValidatorAddress() string { + if x != nil { + return x.ValidatorAddress + } + return "" +} + +func (x *GovernorValShares) GetShares() string { + if x != nil { + return x.Shares + } + return "" +} + +// GovernanceDelegation defines a delegation of governance voting power from a +// delegator to a governor. +type GovernanceDelegation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *GovernanceDelegation) Reset() { + *x = GovernanceDelegation{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_gov_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GovernanceDelegation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GovernanceDelegation) ProtoMessage() {} + +// Deprecated: Use GovernanceDelegation.ProtoReflect.Descriptor instead. +func (*GovernanceDelegation) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_gov_proto_rawDescGZIP(), []int{17} +} + +func (x *GovernanceDelegation) GetDelegatorAddress() string { + if x != nil { + return x.DelegatorAddress + } + return "" +} + +func (x *GovernanceDelegation) GetGovernorAddress() string { + if x != nil { + return x.GovernorAddress + } + return "" +} + var File_atomone_gov_v1_gov_proto protoreflect.FileDescriptor var file_atomone_gov_v1_gov_proto_rawDesc = []byte{ @@ -12073,7 +14867,7 @@ var file_atomone_gov_v1_gov_proto_rawDesc = []byte{ 0x74, 0x79, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x21, 0x64, 0x65, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xd6, 0x0c, 0x0a, 0x06, + 0x67, 0x65, 0x74, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x8b, 0x0e, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, @@ -12175,42 +14969,117 @@ var file_atomone_gov_v1_gov_proto_rawDesc = []byte{ 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0e, 0x6c, 0x61, 0x77, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x22, 0x51, 0x0a, 0x0b, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, - 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, - 0x65, 0x63, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x2a, 0x6b, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, - 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, - 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x4e, 0x4f, 0x10, 0x03, 0x2a, 0xce, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, - 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, - 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, - 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, - 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, - 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, - 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, - 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, - 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, - 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0x9f, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x74, - 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, - 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, - 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x41, 0x47, 0x58, 0xaa, 0x02, 0x0e, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, - 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, - 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, - 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x3a, 0x3a, - 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6e, 0x67, 0x65, 0x12, 0x62, 0x0a, 0x1d, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x70, + 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x1a, 0x67, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x4f, 0x0a, 0x1c, 0x6d, 0x69, 0x6e, 0x5f, + 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x19, + 0x6d, 0x69, 0x6e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x65, 0x6c, 0x66, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x51, 0x0a, 0x0b, 0x51, 0x75, 0x6f, + 0x72, 0x75, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x69, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x22, 0xa2, 0x02, 0x0a, + 0x08, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x67, 0x6f, 0x76, + 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x50, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, + 0x0a, 0x17, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, + 0x01, 0x52, 0x14, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, + 0x00, 0x22, 0xb0, 0x01, 0x0a, 0x13, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, + 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, + 0x6b, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, + 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x3a, 0x04, + 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xe3, 0x01, 0x0a, 0x11, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, + 0x72, 0x56, 0x61, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x67, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, + 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x92, 0x01, 0x0a, 0x14, 0x47, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x67, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x2a, + 0x6b, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, + 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, + 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, + 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, + 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, + 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x2a, 0xce, 0x01, 0x0a, + 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, + 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, + 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, + 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, + 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x2a, 0x9c, 0x01, + 0x0a, 0x0e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x30, 0x0a, 0x1b, 0x47, 0x4f, 0x56, 0x45, 0x52, 0x4e, 0x4f, 0x52, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x1a, 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x55, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x12, 0x26, 0x0a, 0x16, 0x47, 0x4f, 0x56, 0x45, 0x52, 0x4e, 0x4f, 0x52, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x1a, 0x0a, + 0x8a, 0x9d, 0x20, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x2a, 0x0a, 0x18, 0x47, 0x4f, + 0x56, 0x45, 0x52, 0x4e, 0x4f, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, + 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, 0x49, 0x6e, + 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0x9f, 0x01, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, + 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x47, 0x58, 0xaa, 0x02, 0x0e, 0x41, + 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, + 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1a, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x41, 0x74, + 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -12225,67 +15094,76 @@ func file_atomone_gov_v1_gov_proto_rawDescGZIP() []byte { return file_atomone_gov_v1_gov_proto_rawDescData } -var file_atomone_gov_v1_gov_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_atomone_gov_v1_gov_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_atomone_gov_v1_gov_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_atomone_gov_v1_gov_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_atomone_gov_v1_gov_proto_goTypes = []interface{}{ (VoteOption)(0), // 0: atomone.gov.v1.VoteOption (ProposalStatus)(0), // 1: atomone.gov.v1.ProposalStatus - (*WeightedVoteOption)(nil), // 2: atomone.gov.v1.WeightedVoteOption - (*Deposit)(nil), // 3: atomone.gov.v1.Deposit - (*LastMinDeposit)(nil), // 4: atomone.gov.v1.LastMinDeposit - (*Proposal)(nil), // 5: atomone.gov.v1.Proposal - (*TallyResult)(nil), // 6: atomone.gov.v1.TallyResult - (*Vote)(nil), // 7: atomone.gov.v1.Vote - (*QuorumCheckQueueEntry)(nil), // 8: atomone.gov.v1.QuorumCheckQueueEntry - (*DepositParams)(nil), // 9: atomone.gov.v1.DepositParams - (*VotingParams)(nil), // 10: atomone.gov.v1.VotingParams - (*TallyParams)(nil), // 11: atomone.gov.v1.TallyParams - (*MinDepositThrottler)(nil), // 12: atomone.gov.v1.MinDepositThrottler - (*MinInitialDepositThrottler)(nil), // 13: atomone.gov.v1.MinInitialDepositThrottler - (*Params)(nil), // 14: atomone.gov.v1.Params - (*QuorumRange)(nil), // 15: atomone.gov.v1.QuorumRange - (*v1beta1.Coin)(nil), // 16: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp - (*anypb.Any)(nil), // 18: google.protobuf.Any - (*durationpb.Duration)(nil), // 19: google.protobuf.Duration + (GovernorStatus)(0), // 2: atomone.gov.v1.GovernorStatus + (*WeightedVoteOption)(nil), // 3: atomone.gov.v1.WeightedVoteOption + (*Deposit)(nil), // 4: atomone.gov.v1.Deposit + (*LastMinDeposit)(nil), // 5: atomone.gov.v1.LastMinDeposit + (*Proposal)(nil), // 6: atomone.gov.v1.Proposal + (*TallyResult)(nil), // 7: atomone.gov.v1.TallyResult + (*Vote)(nil), // 8: atomone.gov.v1.Vote + (*QuorumCheckQueueEntry)(nil), // 9: atomone.gov.v1.QuorumCheckQueueEntry + (*DepositParams)(nil), // 10: atomone.gov.v1.DepositParams + (*VotingParams)(nil), // 11: atomone.gov.v1.VotingParams + (*TallyParams)(nil), // 12: atomone.gov.v1.TallyParams + (*MinDepositThrottler)(nil), // 13: atomone.gov.v1.MinDepositThrottler + (*MinInitialDepositThrottler)(nil), // 14: atomone.gov.v1.MinInitialDepositThrottler + (*Params)(nil), // 15: atomone.gov.v1.Params + (*QuorumRange)(nil), // 16: atomone.gov.v1.QuorumRange + (*Governor)(nil), // 17: atomone.gov.v1.Governor + (*GovernorDescription)(nil), // 18: atomone.gov.v1.GovernorDescription + (*GovernorValShares)(nil), // 19: atomone.gov.v1.GovernorValShares + (*GovernanceDelegation)(nil), // 20: atomone.gov.v1.GovernanceDelegation + (*v1beta1.Coin)(nil), // 21: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp + (*anypb.Any)(nil), // 23: google.protobuf.Any + (*durationpb.Duration)(nil), // 24: google.protobuf.Duration } var file_atomone_gov_v1_gov_proto_depIdxs = []int32{ 0, // 0: atomone.gov.v1.WeightedVoteOption.option:type_name -> atomone.gov.v1.VoteOption - 16, // 1: atomone.gov.v1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin - 16, // 2: atomone.gov.v1.LastMinDeposit.value:type_name -> cosmos.base.v1beta1.Coin - 17, // 3: atomone.gov.v1.LastMinDeposit.time:type_name -> google.protobuf.Timestamp - 18, // 4: atomone.gov.v1.Proposal.messages:type_name -> google.protobuf.Any + 21, // 1: atomone.gov.v1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin + 21, // 2: atomone.gov.v1.LastMinDeposit.value:type_name -> cosmos.base.v1beta1.Coin + 22, // 3: atomone.gov.v1.LastMinDeposit.time:type_name -> google.protobuf.Timestamp + 23, // 4: atomone.gov.v1.Proposal.messages:type_name -> google.protobuf.Any 1, // 5: atomone.gov.v1.Proposal.status:type_name -> atomone.gov.v1.ProposalStatus - 6, // 6: atomone.gov.v1.Proposal.final_tally_result:type_name -> atomone.gov.v1.TallyResult - 17, // 7: atomone.gov.v1.Proposal.submit_time:type_name -> google.protobuf.Timestamp - 17, // 8: atomone.gov.v1.Proposal.deposit_end_time:type_name -> google.protobuf.Timestamp - 16, // 9: atomone.gov.v1.Proposal.total_deposit:type_name -> cosmos.base.v1beta1.Coin - 17, // 10: atomone.gov.v1.Proposal.voting_start_time:type_name -> google.protobuf.Timestamp - 17, // 11: atomone.gov.v1.Proposal.voting_end_time:type_name -> google.protobuf.Timestamp - 2, // 12: atomone.gov.v1.Vote.options:type_name -> atomone.gov.v1.WeightedVoteOption - 17, // 13: atomone.gov.v1.QuorumCheckQueueEntry.quorum_timeout_time:type_name -> google.protobuf.Timestamp - 16, // 14: atomone.gov.v1.DepositParams.min_deposit:type_name -> cosmos.base.v1beta1.Coin - 19, // 15: atomone.gov.v1.DepositParams.max_deposit_period:type_name -> google.protobuf.Duration - 19, // 16: atomone.gov.v1.VotingParams.voting_period:type_name -> google.protobuf.Duration - 16, // 17: atomone.gov.v1.MinDepositThrottler.floor_value:type_name -> cosmos.base.v1beta1.Coin - 19, // 18: atomone.gov.v1.MinDepositThrottler.update_period:type_name -> google.protobuf.Duration - 16, // 19: atomone.gov.v1.MinInitialDepositThrottler.floor_value:type_name -> cosmos.base.v1beta1.Coin - 19, // 20: atomone.gov.v1.MinInitialDepositThrottler.update_period:type_name -> google.protobuf.Duration - 16, // 21: atomone.gov.v1.Params.min_deposit:type_name -> cosmos.base.v1beta1.Coin - 19, // 22: atomone.gov.v1.Params.max_deposit_period:type_name -> google.protobuf.Duration - 19, // 23: atomone.gov.v1.Params.voting_period:type_name -> google.protobuf.Duration - 19, // 24: atomone.gov.v1.Params.quorum_timeout:type_name -> google.protobuf.Duration - 19, // 25: atomone.gov.v1.Params.max_voting_period_extension:type_name -> google.protobuf.Duration - 12, // 26: atomone.gov.v1.Params.min_deposit_throttler:type_name -> atomone.gov.v1.MinDepositThrottler - 13, // 27: atomone.gov.v1.Params.min_initial_deposit_throttler:type_name -> atomone.gov.v1.MinInitialDepositThrottler - 15, // 28: atomone.gov.v1.Params.quorum_range:type_name -> atomone.gov.v1.QuorumRange - 15, // 29: atomone.gov.v1.Params.constitution_amendment_quorum_range:type_name -> atomone.gov.v1.QuorumRange - 15, // 30: atomone.gov.v1.Params.law_quorum_range:type_name -> atomone.gov.v1.QuorumRange - 31, // [31:31] is the sub-list for method output_type - 31, // [31:31] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name + 7, // 6: atomone.gov.v1.Proposal.final_tally_result:type_name -> atomone.gov.v1.TallyResult + 22, // 7: atomone.gov.v1.Proposal.submit_time:type_name -> google.protobuf.Timestamp + 22, // 8: atomone.gov.v1.Proposal.deposit_end_time:type_name -> google.protobuf.Timestamp + 21, // 9: atomone.gov.v1.Proposal.total_deposit:type_name -> cosmos.base.v1beta1.Coin + 22, // 10: atomone.gov.v1.Proposal.voting_start_time:type_name -> google.protobuf.Timestamp + 22, // 11: atomone.gov.v1.Proposal.voting_end_time:type_name -> google.protobuf.Timestamp + 3, // 12: atomone.gov.v1.Vote.options:type_name -> atomone.gov.v1.WeightedVoteOption + 22, // 13: atomone.gov.v1.QuorumCheckQueueEntry.quorum_timeout_time:type_name -> google.protobuf.Timestamp + 21, // 14: atomone.gov.v1.DepositParams.min_deposit:type_name -> cosmos.base.v1beta1.Coin + 24, // 15: atomone.gov.v1.DepositParams.max_deposit_period:type_name -> google.protobuf.Duration + 24, // 16: atomone.gov.v1.VotingParams.voting_period:type_name -> google.protobuf.Duration + 21, // 17: atomone.gov.v1.MinDepositThrottler.floor_value:type_name -> cosmos.base.v1beta1.Coin + 24, // 18: atomone.gov.v1.MinDepositThrottler.update_period:type_name -> google.protobuf.Duration + 21, // 19: atomone.gov.v1.MinInitialDepositThrottler.floor_value:type_name -> cosmos.base.v1beta1.Coin + 24, // 20: atomone.gov.v1.MinInitialDepositThrottler.update_period:type_name -> google.protobuf.Duration + 21, // 21: atomone.gov.v1.Params.min_deposit:type_name -> cosmos.base.v1beta1.Coin + 24, // 22: atomone.gov.v1.Params.max_deposit_period:type_name -> google.protobuf.Duration + 24, // 23: atomone.gov.v1.Params.voting_period:type_name -> google.protobuf.Duration + 24, // 24: atomone.gov.v1.Params.quorum_timeout:type_name -> google.protobuf.Duration + 24, // 25: atomone.gov.v1.Params.max_voting_period_extension:type_name -> google.protobuf.Duration + 13, // 26: atomone.gov.v1.Params.min_deposit_throttler:type_name -> atomone.gov.v1.MinDepositThrottler + 14, // 27: atomone.gov.v1.Params.min_initial_deposit_throttler:type_name -> atomone.gov.v1.MinInitialDepositThrottler + 16, // 28: atomone.gov.v1.Params.quorum_range:type_name -> atomone.gov.v1.QuorumRange + 16, // 29: atomone.gov.v1.Params.constitution_amendment_quorum_range:type_name -> atomone.gov.v1.QuorumRange + 16, // 30: atomone.gov.v1.Params.law_quorum_range:type_name -> atomone.gov.v1.QuorumRange + 24, // 31: atomone.gov.v1.Params.governor_status_change_period:type_name -> google.protobuf.Duration + 2, // 32: atomone.gov.v1.Governor.status:type_name -> atomone.gov.v1.GovernorStatus + 18, // 33: atomone.gov.v1.Governor.description:type_name -> atomone.gov.v1.GovernorDescription + 22, // 34: atomone.gov.v1.Governor.last_status_change_time:type_name -> google.protobuf.Timestamp + 35, // [35:35] is the sub-list for method output_type + 35, // [35:35] is the sub-list for method input_type + 35, // [35:35] is the sub-list for extension type_name + 35, // [35:35] is the sub-list for extension extendee + 0, // [0:35] is the sub-list for field type_name } func init() { file_atomone_gov_v1_gov_proto_init() } @@ -12462,14 +15340,62 @@ func file_atomone_gov_v1_gov_proto_init() { return nil } } + file_atomone_gov_v1_gov_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Governor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_gov_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GovernorDescription); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_gov_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GovernorValShares); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_gov_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GovernanceDelegation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_atomone_gov_v1_gov_proto_rawDesc, - NumEnums: 2, - NumMessages: 14, + NumEnums: 3, + NumMessages: 18, NumExtensions: 0, NumServices: 0, }, diff --git a/api/atomone/gov/v1/query.pulsar.go b/api/atomone/gov/v1/query.pulsar.go index 57ad0503..85c35c19 100644 --- a/api/atomone/gov/v1/query.pulsar.go +++ b/api/atomone/gov/v1/query.pulsar.go @@ -11269,6 +11269,4853 @@ func (x *fastReflection_QueryQuorumsResponse) ProtoMethods() *protoiface.Methods } } +var ( + md_QueryGovernorRequest protoreflect.MessageDescriptor + fd_QueryGovernorRequest_governor_address protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernorRequest = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernorRequest") + fd_QueryGovernorRequest_governor_address = md_QueryGovernorRequest.Fields().ByName("governor_address") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernorRequest)(nil) + +type fastReflection_QueryGovernorRequest QueryGovernorRequest + +func (x *QueryGovernorRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernorRequest)(x) +} + +func (x *QueryGovernorRequest) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernorRequest_messageType fastReflection_QueryGovernorRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernorRequest_messageType{} + +type fastReflection_QueryGovernorRequest_messageType struct{} + +func (x fastReflection_QueryGovernorRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernorRequest)(nil) +} +func (x fastReflection_QueryGovernorRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernorRequest) +} +func (x fastReflection_QueryGovernorRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernorRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernorRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernorRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernorRequest) New() protoreflect.Message { + return new(fastReflection_QueryGovernorRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernorRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGovernorRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernorRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.GovernorAddress != "" { + value := protoreflect.ValueOfString(x.GovernorAddress) + if !f(fd_QueryGovernorRequest_governor_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernorRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorRequest.governor_address": + return x.GovernorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorRequest.governor_address": + x.GovernorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernorRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernorRequest.governor_address": + value := x.GovernorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorRequest.governor_address": + x.GovernorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorRequest.governor_address": + panic(fmt.Errorf("field governor_address of message atomone.gov.v1.QueryGovernorRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernorRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorRequest.governor_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernorRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernorRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernorRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernorRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernorRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernorRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.GovernorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.GovernorAddress) > 0 { + i -= len(x.GovernorAddress) + copy(dAtA[i:], x.GovernorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGovernorResponse protoreflect.MessageDescriptor + fd_QueryGovernorResponse_governor protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernorResponse = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernorResponse") + fd_QueryGovernorResponse_governor = md_QueryGovernorResponse.Fields().ByName("governor") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernorResponse)(nil) + +type fastReflection_QueryGovernorResponse QueryGovernorResponse + +func (x *QueryGovernorResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernorResponse)(x) +} + +func (x *QueryGovernorResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernorResponse_messageType fastReflection_QueryGovernorResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernorResponse_messageType{} + +type fastReflection_QueryGovernorResponse_messageType struct{} + +func (x fastReflection_QueryGovernorResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernorResponse)(nil) +} +func (x fastReflection_QueryGovernorResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernorResponse) +} +func (x fastReflection_QueryGovernorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernorResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernorResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernorResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernorResponse) New() protoreflect.Message { + return new(fastReflection_QueryGovernorResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernorResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGovernorResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Governor != nil { + value := protoreflect.ValueOfMessage(x.Governor.ProtoReflect()) + if !f(fd_QueryGovernorResponse_governor, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernorResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorResponse.governor": + return x.Governor != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorResponse.governor": + x.Governor = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernorResponse.governor": + value := x.Governor + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorResponse.governor": + x.Governor = value.Message().Interface().(*Governor) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorResponse.governor": + if x.Governor == nil { + x.Governor = new(Governor) + } + return protoreflect.ValueOfMessage(x.Governor.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorResponse.governor": + m := new(Governor) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernorResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernorResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernorResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernorResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernorResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Governor != nil { + l = options.Size(x.Governor) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Governor != nil { + encoded, err := options.Marshal(x.Governor) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Governor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Governor == nil { + x.Governor = &Governor{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Governor); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGovernorsRequest protoreflect.MessageDescriptor + fd_QueryGovernorsRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernorsRequest = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernorsRequest") + fd_QueryGovernorsRequest_pagination = md_QueryGovernorsRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernorsRequest)(nil) + +type fastReflection_QueryGovernorsRequest QueryGovernorsRequest + +func (x *QueryGovernorsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernorsRequest)(x) +} + +func (x *QueryGovernorsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernorsRequest_messageType fastReflection_QueryGovernorsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernorsRequest_messageType{} + +type fastReflection_QueryGovernorsRequest_messageType struct{} + +func (x fastReflection_QueryGovernorsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernorsRequest)(nil) +} +func (x fastReflection_QueryGovernorsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernorsRequest) +} +func (x fastReflection_QueryGovernorsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernorsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernorsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernorsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernorsRequest) New() protoreflect.Message { + return new(fastReflection_QueryGovernorsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernorsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGovernorsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernorsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryGovernorsRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernorsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernorsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernorsRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernorsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernorsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernorsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernorsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernorsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernorsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernorsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryGovernorsResponse_1_list)(nil) + +type _QueryGovernorsResponse_1_list struct { + list *[]*Governor +} + +func (x *_QueryGovernorsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryGovernorsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryGovernorsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Governor) + (*x.list)[i] = concreteValue +} + +func (x *_QueryGovernorsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Governor) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryGovernorsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Governor) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryGovernorsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryGovernorsResponse_1_list) NewElement() protoreflect.Value { + v := new(Governor) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryGovernorsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryGovernorsResponse protoreflect.MessageDescriptor + fd_QueryGovernorsResponse_governors protoreflect.FieldDescriptor + fd_QueryGovernorsResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernorsResponse = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernorsResponse") + fd_QueryGovernorsResponse_governors = md_QueryGovernorsResponse.Fields().ByName("governors") + fd_QueryGovernorsResponse_pagination = md_QueryGovernorsResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernorsResponse)(nil) + +type fastReflection_QueryGovernorsResponse QueryGovernorsResponse + +func (x *QueryGovernorsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernorsResponse)(x) +} + +func (x *QueryGovernorsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernorsResponse_messageType fastReflection_QueryGovernorsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernorsResponse_messageType{} + +type fastReflection_QueryGovernorsResponse_messageType struct{} + +func (x fastReflection_QueryGovernorsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernorsResponse)(nil) +} +func (x fastReflection_QueryGovernorsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernorsResponse) +} +func (x fastReflection_QueryGovernorsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernorsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernorsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernorsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernorsResponse) New() protoreflect.Message { + return new(fastReflection_QueryGovernorsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernorsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGovernorsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernorsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Governors) != 0 { + value := protoreflect.ValueOfList(&_QueryGovernorsResponse_1_list{list: &x.Governors}) + if !f(fd_QueryGovernorsResponse_governors, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryGovernorsResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernorsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsResponse.governors": + return len(x.Governors) != 0 + case "atomone.gov.v1.QueryGovernorsResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsResponse.governors": + x.Governors = nil + case "atomone.gov.v1.QueryGovernorsResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernorsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernorsResponse.governors": + if len(x.Governors) == 0 { + return protoreflect.ValueOfList(&_QueryGovernorsResponse_1_list{}) + } + listValue := &_QueryGovernorsResponse_1_list{list: &x.Governors} + return protoreflect.ValueOfList(listValue) + case "atomone.gov.v1.QueryGovernorsResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsResponse.governors": + lv := value.List() + clv := lv.(*_QueryGovernorsResponse_1_list) + x.Governors = *clv.list + case "atomone.gov.v1.QueryGovernorsResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsResponse.governors": + if x.Governors == nil { + x.Governors = []*Governor{} + } + value := &_QueryGovernorsResponse_1_list{list: &x.Governors} + return protoreflect.ValueOfList(value) + case "atomone.gov.v1.QueryGovernorsResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernorsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorsResponse.governors": + list := []*Governor{} + return protoreflect.ValueOfList(&_QueryGovernorsResponse_1_list{list: &list}) + case "atomone.gov.v1.QueryGovernorsResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernorsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernorsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernorsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernorsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernorsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernorsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Governors) > 0 { + for _, e := range x.Governors { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Governors) > 0 { + for iNdEx := len(x.Governors) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Governors[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Governors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Governors = append(x.Governors, &Governor{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Governors[len(x.Governors)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGovernanceDelegationsRequest protoreflect.MessageDescriptor + fd_QueryGovernanceDelegationsRequest_governor_address protoreflect.FieldDescriptor + fd_QueryGovernanceDelegationsRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernanceDelegationsRequest = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernanceDelegationsRequest") + fd_QueryGovernanceDelegationsRequest_governor_address = md_QueryGovernanceDelegationsRequest.Fields().ByName("governor_address") + fd_QueryGovernanceDelegationsRequest_pagination = md_QueryGovernanceDelegationsRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernanceDelegationsRequest)(nil) + +type fastReflection_QueryGovernanceDelegationsRequest QueryGovernanceDelegationsRequest + +func (x *QueryGovernanceDelegationsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernanceDelegationsRequest)(x) +} + +func (x *QueryGovernanceDelegationsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernanceDelegationsRequest_messageType fastReflection_QueryGovernanceDelegationsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernanceDelegationsRequest_messageType{} + +type fastReflection_QueryGovernanceDelegationsRequest_messageType struct{} + +func (x fastReflection_QueryGovernanceDelegationsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernanceDelegationsRequest)(nil) +} +func (x fastReflection_QueryGovernanceDelegationsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernanceDelegationsRequest) +} +func (x fastReflection_QueryGovernanceDelegationsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernanceDelegationsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernanceDelegationsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernanceDelegationsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernanceDelegationsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernanceDelegationsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernanceDelegationsRequest) New() protoreflect.Message { + return new(fastReflection_QueryGovernanceDelegationsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernanceDelegationsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGovernanceDelegationsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernanceDelegationsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.GovernorAddress != "" { + value := protoreflect.ValueOfString(x.GovernorAddress) + if !f(fd_QueryGovernanceDelegationsRequest_governor_address, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryGovernanceDelegationsRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernanceDelegationsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.governor_address": + return x.GovernorAddress != "" + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.governor_address": + x.GovernorAddress = "" + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernanceDelegationsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.governor_address": + value := x.GovernorAddress + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.governor_address": + x.GovernorAddress = value.Interface().(string) + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.governor_address": + panic(fmt.Errorf("field governor_address of message atomone.gov.v1.QueryGovernanceDelegationsRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernanceDelegationsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.governor_address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.QueryGovernanceDelegationsRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernanceDelegationsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernanceDelegationsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernanceDelegationsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernanceDelegationsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernanceDelegationsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernanceDelegationsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.GovernorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernanceDelegationsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.GovernorAddress) > 0 { + i -= len(x.GovernorAddress) + copy(dAtA[i:], x.GovernorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernanceDelegationsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernanceDelegationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernanceDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryGovernanceDelegationsResponse_1_list)(nil) + +type _QueryGovernanceDelegationsResponse_1_list struct { + list *[]*GovernanceDelegation +} + +func (x *_QueryGovernanceDelegationsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryGovernanceDelegationsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryGovernanceDelegationsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GovernanceDelegation) + (*x.list)[i] = concreteValue +} + +func (x *_QueryGovernanceDelegationsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GovernanceDelegation) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryGovernanceDelegationsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(GovernanceDelegation) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryGovernanceDelegationsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryGovernanceDelegationsResponse_1_list) NewElement() protoreflect.Value { + v := new(GovernanceDelegation) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryGovernanceDelegationsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryGovernanceDelegationsResponse protoreflect.MessageDescriptor + fd_QueryGovernanceDelegationsResponse_delegations protoreflect.FieldDescriptor + fd_QueryGovernanceDelegationsResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernanceDelegationsResponse = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernanceDelegationsResponse") + fd_QueryGovernanceDelegationsResponse_delegations = md_QueryGovernanceDelegationsResponse.Fields().ByName("delegations") + fd_QueryGovernanceDelegationsResponse_pagination = md_QueryGovernanceDelegationsResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernanceDelegationsResponse)(nil) + +type fastReflection_QueryGovernanceDelegationsResponse QueryGovernanceDelegationsResponse + +func (x *QueryGovernanceDelegationsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernanceDelegationsResponse)(x) +} + +func (x *QueryGovernanceDelegationsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernanceDelegationsResponse_messageType fastReflection_QueryGovernanceDelegationsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernanceDelegationsResponse_messageType{} + +type fastReflection_QueryGovernanceDelegationsResponse_messageType struct{} + +func (x fastReflection_QueryGovernanceDelegationsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernanceDelegationsResponse)(nil) +} +func (x fastReflection_QueryGovernanceDelegationsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernanceDelegationsResponse) +} +func (x fastReflection_QueryGovernanceDelegationsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernanceDelegationsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernanceDelegationsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernanceDelegationsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernanceDelegationsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernanceDelegationsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernanceDelegationsResponse) New() protoreflect.Message { + return new(fastReflection_QueryGovernanceDelegationsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernanceDelegationsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGovernanceDelegationsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernanceDelegationsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Delegations) != 0 { + value := protoreflect.ValueOfList(&_QueryGovernanceDelegationsResponse_1_list{list: &x.Delegations}) + if !f(fd_QueryGovernanceDelegationsResponse_delegations, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryGovernanceDelegationsResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernanceDelegationsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.delegations": + return len(x.Delegations) != 0 + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.delegations": + x.Delegations = nil + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernanceDelegationsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.delegations": + if len(x.Delegations) == 0 { + return protoreflect.ValueOfList(&_QueryGovernanceDelegationsResponse_1_list{}) + } + listValue := &_QueryGovernanceDelegationsResponse_1_list{list: &x.Delegations} + return protoreflect.ValueOfList(listValue) + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.delegations": + lv := value.List() + clv := lv.(*_QueryGovernanceDelegationsResponse_1_list) + x.Delegations = *clv.list + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.delegations": + if x.Delegations == nil { + x.Delegations = []*GovernanceDelegation{} + } + value := &_QueryGovernanceDelegationsResponse_1_list{list: &x.Delegations} + return protoreflect.ValueOfList(value) + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernanceDelegationsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.delegations": + list := []*GovernanceDelegation{} + return protoreflect.ValueOfList(&_QueryGovernanceDelegationsResponse_1_list{list: &list}) + case "atomone.gov.v1.QueryGovernanceDelegationsResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationsResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernanceDelegationsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernanceDelegationsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernanceDelegationsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernanceDelegationsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernanceDelegationsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernanceDelegationsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Delegations) > 0 { + for _, e := range x.Delegations { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernanceDelegationsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Delegations) > 0 { + for iNdEx := len(x.Delegations) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Delegations[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernanceDelegationsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernanceDelegationsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernanceDelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Delegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Delegations = append(x.Delegations, &GovernanceDelegation{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Delegations[len(x.Delegations)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGovernanceDelegationRequest protoreflect.MessageDescriptor + fd_QueryGovernanceDelegationRequest_delegator_address protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernanceDelegationRequest = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernanceDelegationRequest") + fd_QueryGovernanceDelegationRequest_delegator_address = md_QueryGovernanceDelegationRequest.Fields().ByName("delegator_address") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernanceDelegationRequest)(nil) + +type fastReflection_QueryGovernanceDelegationRequest QueryGovernanceDelegationRequest + +func (x *QueryGovernanceDelegationRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernanceDelegationRequest)(x) +} + +func (x *QueryGovernanceDelegationRequest) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernanceDelegationRequest_messageType fastReflection_QueryGovernanceDelegationRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernanceDelegationRequest_messageType{} + +type fastReflection_QueryGovernanceDelegationRequest_messageType struct{} + +func (x fastReflection_QueryGovernanceDelegationRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernanceDelegationRequest)(nil) +} +func (x fastReflection_QueryGovernanceDelegationRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernanceDelegationRequest) +} +func (x fastReflection_QueryGovernanceDelegationRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernanceDelegationRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernanceDelegationRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernanceDelegationRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernanceDelegationRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernanceDelegationRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernanceDelegationRequest) New() protoreflect.Message { + return new(fastReflection_QueryGovernanceDelegationRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernanceDelegationRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGovernanceDelegationRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernanceDelegationRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DelegatorAddress != "" { + value := protoreflect.ValueOfString(x.DelegatorAddress) + if !f(fd_QueryGovernanceDelegationRequest_delegator_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernanceDelegationRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationRequest.delegator_address": + return x.DelegatorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationRequest.delegator_address": + x.DelegatorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernanceDelegationRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationRequest.delegator_address": + value := x.DelegatorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationRequest.delegator_address": + x.DelegatorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationRequest.delegator_address": + panic(fmt.Errorf("field delegator_address of message atomone.gov.v1.QueryGovernanceDelegationRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernanceDelegationRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationRequest.delegator_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernanceDelegationRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernanceDelegationRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernanceDelegationRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernanceDelegationRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernanceDelegationRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernanceDelegationRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.DelegatorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernanceDelegationRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.DelegatorAddress) > 0 { + i -= len(x.DelegatorAddress) + copy(dAtA[i:], x.DelegatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernanceDelegationRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernanceDelegationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernanceDelegationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGovernanceDelegationResponse protoreflect.MessageDescriptor + fd_QueryGovernanceDelegationResponse_governor_address protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernanceDelegationResponse = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernanceDelegationResponse") + fd_QueryGovernanceDelegationResponse_governor_address = md_QueryGovernanceDelegationResponse.Fields().ByName("governor_address") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernanceDelegationResponse)(nil) + +type fastReflection_QueryGovernanceDelegationResponse QueryGovernanceDelegationResponse + +func (x *QueryGovernanceDelegationResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernanceDelegationResponse)(x) +} + +func (x *QueryGovernanceDelegationResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernanceDelegationResponse_messageType fastReflection_QueryGovernanceDelegationResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernanceDelegationResponse_messageType{} + +type fastReflection_QueryGovernanceDelegationResponse_messageType struct{} + +func (x fastReflection_QueryGovernanceDelegationResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernanceDelegationResponse)(nil) +} +func (x fastReflection_QueryGovernanceDelegationResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernanceDelegationResponse) +} +func (x fastReflection_QueryGovernanceDelegationResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernanceDelegationResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernanceDelegationResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernanceDelegationResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernanceDelegationResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernanceDelegationResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernanceDelegationResponse) New() protoreflect.Message { + return new(fastReflection_QueryGovernanceDelegationResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernanceDelegationResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGovernanceDelegationResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernanceDelegationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.GovernorAddress != "" { + value := protoreflect.ValueOfString(x.GovernorAddress) + if !f(fd_QueryGovernanceDelegationResponse_governor_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernanceDelegationResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationResponse.governor_address": + return x.GovernorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationResponse.governor_address": + x.GovernorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernanceDelegationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationResponse.governor_address": + value := x.GovernorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationResponse.governor_address": + x.GovernorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationResponse.governor_address": + panic(fmt.Errorf("field governor_address of message atomone.gov.v1.QueryGovernanceDelegationResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernanceDelegationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernanceDelegationResponse.governor_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernanceDelegationResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernanceDelegationResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernanceDelegationResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernanceDelegationResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernanceDelegationResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernanceDelegationResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernanceDelegationResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernanceDelegationResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernanceDelegationResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.GovernorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernanceDelegationResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.GovernorAddress) > 0 { + i -= len(x.GovernorAddress) + copy(dAtA[i:], x.GovernorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernanceDelegationResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernanceDelegationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernanceDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGovernorValSharesRequest protoreflect.MessageDescriptor + fd_QueryGovernorValSharesRequest_governor_address protoreflect.FieldDescriptor + fd_QueryGovernorValSharesRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernorValSharesRequest = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernorValSharesRequest") + fd_QueryGovernorValSharesRequest_governor_address = md_QueryGovernorValSharesRequest.Fields().ByName("governor_address") + fd_QueryGovernorValSharesRequest_pagination = md_QueryGovernorValSharesRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernorValSharesRequest)(nil) + +type fastReflection_QueryGovernorValSharesRequest QueryGovernorValSharesRequest + +func (x *QueryGovernorValSharesRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernorValSharesRequest)(x) +} + +func (x *QueryGovernorValSharesRequest) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernorValSharesRequest_messageType fastReflection_QueryGovernorValSharesRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernorValSharesRequest_messageType{} + +type fastReflection_QueryGovernorValSharesRequest_messageType struct{} + +func (x fastReflection_QueryGovernorValSharesRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernorValSharesRequest)(nil) +} +func (x fastReflection_QueryGovernorValSharesRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernorValSharesRequest) +} +func (x fastReflection_QueryGovernorValSharesRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorValSharesRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernorValSharesRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorValSharesRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernorValSharesRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernorValSharesRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernorValSharesRequest) New() protoreflect.Message { + return new(fastReflection_QueryGovernorValSharesRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernorValSharesRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGovernorValSharesRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernorValSharesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.GovernorAddress != "" { + value := protoreflect.ValueOfString(x.GovernorAddress) + if !f(fd_QueryGovernorValSharesRequest_governor_address, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryGovernorValSharesRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernorValSharesRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesRequest.governor_address": + return x.GovernorAddress != "" + case "atomone.gov.v1.QueryGovernorValSharesRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorValSharesRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesRequest.governor_address": + x.GovernorAddress = "" + case "atomone.gov.v1.QueryGovernorValSharesRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernorValSharesRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesRequest.governor_address": + value := x.GovernorAddress + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.QueryGovernorValSharesRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorValSharesRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesRequest.governor_address": + x.GovernorAddress = value.Interface().(string) + case "atomone.gov.v1.QueryGovernorValSharesRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorValSharesRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "atomone.gov.v1.QueryGovernorValSharesRequest.governor_address": + panic(fmt.Errorf("field governor_address of message atomone.gov.v1.QueryGovernorValSharesRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernorValSharesRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesRequest.governor_address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.QueryGovernorValSharesRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesRequest")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernorValSharesRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernorValSharesRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernorValSharesRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorValSharesRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernorValSharesRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernorValSharesRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernorValSharesRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.GovernorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorValSharesRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.GovernorAddress) > 0 { + i -= len(x.GovernorAddress) + copy(dAtA[i:], x.GovernorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GovernorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorValSharesRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorValSharesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorValSharesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryGovernorValSharesResponse_1_list)(nil) + +type _QueryGovernorValSharesResponse_1_list struct { + list *[]*GovernorValShares +} + +func (x *_QueryGovernorValSharesResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryGovernorValSharesResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryGovernorValSharesResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GovernorValShares) + (*x.list)[i] = concreteValue +} + +func (x *_QueryGovernorValSharesResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*GovernorValShares) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryGovernorValSharesResponse_1_list) AppendMutable() protoreflect.Value { + v := new(GovernorValShares) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryGovernorValSharesResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryGovernorValSharesResponse_1_list) NewElement() protoreflect.Value { + v := new(GovernorValShares) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryGovernorValSharesResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryGovernorValSharesResponse protoreflect.MessageDescriptor + fd_QueryGovernorValSharesResponse_val_shares protoreflect.FieldDescriptor + fd_QueryGovernorValSharesResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_query_proto_init() + md_QueryGovernorValSharesResponse = File_atomone_gov_v1_query_proto.Messages().ByName("QueryGovernorValSharesResponse") + fd_QueryGovernorValSharesResponse_val_shares = md_QueryGovernorValSharesResponse.Fields().ByName("val_shares") + fd_QueryGovernorValSharesResponse_pagination = md_QueryGovernorValSharesResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryGovernorValSharesResponse)(nil) + +type fastReflection_QueryGovernorValSharesResponse QueryGovernorValSharesResponse + +func (x *QueryGovernorValSharesResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGovernorValSharesResponse)(x) +} + +func (x *QueryGovernorValSharesResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_query_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGovernorValSharesResponse_messageType fastReflection_QueryGovernorValSharesResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGovernorValSharesResponse_messageType{} + +type fastReflection_QueryGovernorValSharesResponse_messageType struct{} + +func (x fastReflection_QueryGovernorValSharesResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGovernorValSharesResponse)(nil) +} +func (x fastReflection_QueryGovernorValSharesResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGovernorValSharesResponse) +} +func (x fastReflection_QueryGovernorValSharesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorValSharesResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGovernorValSharesResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGovernorValSharesResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGovernorValSharesResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGovernorValSharesResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGovernorValSharesResponse) New() protoreflect.Message { + return new(fastReflection_QueryGovernorValSharesResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGovernorValSharesResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGovernorValSharesResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGovernorValSharesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.ValShares) != 0 { + value := protoreflect.ValueOfList(&_QueryGovernorValSharesResponse_1_list{list: &x.ValShares}) + if !f(fd_QueryGovernorValSharesResponse_val_shares, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryGovernorValSharesResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGovernorValSharesResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesResponse.val_shares": + return len(x.ValShares) != 0 + case "atomone.gov.v1.QueryGovernorValSharesResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorValSharesResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesResponse.val_shares": + x.ValShares = nil + case "atomone.gov.v1.QueryGovernorValSharesResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGovernorValSharesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesResponse.val_shares": + if len(x.ValShares) == 0 { + return protoreflect.ValueOfList(&_QueryGovernorValSharesResponse_1_list{}) + } + listValue := &_QueryGovernorValSharesResponse_1_list{list: &x.ValShares} + return protoreflect.ValueOfList(listValue) + case "atomone.gov.v1.QueryGovernorValSharesResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorValSharesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesResponse.val_shares": + lv := value.List() + clv := lv.(*_QueryGovernorValSharesResponse_1_list) + x.ValShares = *clv.list + case "atomone.gov.v1.QueryGovernorValSharesResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorValSharesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesResponse.val_shares": + if x.ValShares == nil { + x.ValShares = []*GovernorValShares{} + } + value := &_QueryGovernorValSharesResponse_1_list{list: &x.ValShares} + return protoreflect.ValueOfList(value) + case "atomone.gov.v1.QueryGovernorValSharesResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGovernorValSharesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.QueryGovernorValSharesResponse.val_shares": + list := []*GovernorValShares{} + return protoreflect.ValueOfList(&_QueryGovernorValSharesResponse_1_list{list: &list}) + case "atomone.gov.v1.QueryGovernorValSharesResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.QueryGovernorValSharesResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.QueryGovernorValSharesResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGovernorValSharesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.QueryGovernorValSharesResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGovernorValSharesResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGovernorValSharesResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGovernorValSharesResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGovernorValSharesResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGovernorValSharesResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.ValShares) > 0 { + for _, e := range x.ValShares { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorValSharesResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.ValShares) > 0 { + for iNdEx := len(x.ValShares) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ValShares[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGovernorValSharesResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorValSharesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGovernorValSharesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValShares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ValShares = append(x.ValShares, &GovernorValShares{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ValShares[len(x.ValShares)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Since: cosmos-sdk 0.46 // Code generated by protoc-gen-go. DO NOT EDIT. @@ -11277,346 +16124,637 @@ func (x *fastReflection_QueryQuorumsResponse) ProtoMethods() *protoiface.Methods // protoc (unknown) // source: atomone/gov/v1/query.proto -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryConstitutionRequest is the request type for the Query/Constitution RPC method +type QueryConstitutionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryConstitutionRequest) Reset() { + *x = QueryConstitutionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryConstitutionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryConstitutionRequest) ProtoMessage() {} + +// Deprecated: Use QueryConstitutionRequest.ProtoReflect.Descriptor instead. +func (*QueryConstitutionRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryConstitutionResponse is the response type for the Query/Constitution RPC method +type QueryConstitutionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Constitution string `protobuf:"bytes,1,opt,name=constitution,proto3" json:"constitution,omitempty"` +} + +func (x *QueryConstitutionResponse) Reset() { + *x = QueryConstitutionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryConstitutionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryConstitutionResponse) ProtoMessage() {} + +// Deprecated: Use QueryConstitutionResponse.ProtoReflect.Descriptor instead. +func (*QueryConstitutionResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryConstitutionResponse) GetConstitution() string { + if x != nil { + return x.Constitution + } + return "" +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +type QueryProposalRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (x *QueryProposalRequest) Reset() { + *x = QueryProposalRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryProposalRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryProposalRequest) ProtoMessage() {} + +// Deprecated: Use QueryProposalRequest.ProtoReflect.Descriptor instead. +func (*QueryProposalRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryProposalRequest) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +type QueryProposalResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal is the requested governance proposal. + Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` +} + +func (x *QueryProposalResponse) Reset() { + *x = QueryProposalResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryProposalResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryProposalResponse) ProtoMessage() {} + +// Deprecated: Use QueryProposalResponse.ProtoReflect.Descriptor instead. +func (*QueryProposalResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryProposalResponse) GetProposal() *Proposal { + if x != nil { + return x.Proposal + } + return nil +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +type QueryProposalsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_status defines the status of the proposals. + ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=atomone.gov.v1.ProposalStatus" json:"proposal_status,omitempty"` + // voter defines the voter address for the proposals. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,3,opt,name=depositor,proto3" json:"depositor,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *v1beta1.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryProposalsRequest) Reset() { + *x = QueryProposalsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryProposalsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryProposalsRequest) ProtoMessage() {} + +// Deprecated: Use QueryProposalsRequest.ProtoReflect.Descriptor instead. +func (*QueryProposalsRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryProposalsRequest) GetProposalStatus() ProposalStatus { + if x != nil { + return x.ProposalStatus + } + return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED +} + +func (x *QueryProposalsRequest) GetVoter() string { + if x != nil { + return x.Voter + } + return "" +} + +func (x *QueryProposalsRequest) GetDepositor() string { + if x != nil { + return x.Depositor + } + return "" +} + +func (x *QueryProposalsRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +type QueryProposalsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposals defines all the requested governance proposals. + Proposals []*Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals,omitempty"` + // pagination defines the pagination in the response. + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryProposalsResponse) Reset() { + *x = QueryProposalsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryProposalsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryProposalsResponse) ProtoMessage() {} + +// Deprecated: Use QueryProposalsResponse.ProtoReflect.Descriptor instead. +func (*QueryProposalsResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryProposalsResponse) GetProposals() []*Proposal { + if x != nil { + return x.Proposals + } + return nil +} + +func (x *QueryProposalsResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} -// QueryConstitutionRequest is the request type for the Query/Constitution RPC method -type QueryConstitutionRequest struct { +// QueryVoteRequest is the request type for the Query/Vote RPC method. +type QueryVoteRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // voter defines the voter address for the proposals. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` } -func (x *QueryConstitutionRequest) Reset() { - *x = QueryConstitutionRequest{} +func (x *QueryVoteRequest) Reset() { + *x = QueryVoteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[0] + mi := &file_atomone_gov_v1_query_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryConstitutionRequest) String() string { +func (x *QueryVoteRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryConstitutionRequest) ProtoMessage() {} +func (*QueryVoteRequest) ProtoMessage() {} -// Deprecated: Use QueryConstitutionRequest.ProtoReflect.Descriptor instead. -func (*QueryConstitutionRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{0} +// Deprecated: Use QueryVoteRequest.ProtoReflect.Descriptor instead. +func (*QueryVoteRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{6} } -// QueryConstitutionResponse is the response type for the Query/Constitution RPC method -type QueryConstitutionResponse struct { +func (x *QueryVoteRequest) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +func (x *QueryVoteRequest) GetVoter() string { + if x != nil { + return x.Voter + } + return "" +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +type QueryVoteResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Constitution string `protobuf:"bytes,1,opt,name=constitution,proto3" json:"constitution,omitempty"` + // vote defines the queried vote. + Vote *Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` } -func (x *QueryConstitutionResponse) Reset() { - *x = QueryConstitutionResponse{} +func (x *QueryVoteResponse) Reset() { + *x = QueryVoteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[1] + mi := &file_atomone_gov_v1_query_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryConstitutionResponse) String() string { +func (x *QueryVoteResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryConstitutionResponse) ProtoMessage() {} +func (*QueryVoteResponse) ProtoMessage() {} -// Deprecated: Use QueryConstitutionResponse.ProtoReflect.Descriptor instead. -func (*QueryConstitutionResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{1} +// Deprecated: Use QueryVoteResponse.ProtoReflect.Descriptor instead. +func (*QueryVoteResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{7} } -func (x *QueryConstitutionResponse) GetConstitution() string { +func (x *QueryVoteResponse) GetVote() *Vote { if x != nil { - return x.Constitution + return x.Vote } - return "" + return nil } -// QueryProposalRequest is the request type for the Query/Proposal RPC method. -type QueryProposalRequest struct { +// QueryVotesRequest is the request type for the Query/Votes RPC method. +type QueryVotesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryProposalRequest) Reset() { - *x = QueryProposalRequest{} +func (x *QueryVotesRequest) Reset() { + *x = QueryVotesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[2] + mi := &file_atomone_gov_v1_query_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryProposalRequest) String() string { +func (x *QueryVotesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryProposalRequest) ProtoMessage() {} +func (*QueryVotesRequest) ProtoMessage() {} -// Deprecated: Use QueryProposalRequest.ProtoReflect.Descriptor instead. -func (*QueryProposalRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{2} +// Deprecated: Use QueryVotesRequest.ProtoReflect.Descriptor instead. +func (*QueryVotesRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{8} } -func (x *QueryProposalRequest) GetProposalId() uint64 { +func (x *QueryVotesRequest) GetProposalId() uint64 { if x != nil { return x.ProposalId } return 0 } -// QueryProposalResponse is the response type for the Query/Proposal RPC method. -type QueryProposalResponse struct { +func (x *QueryVotesRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +type QueryVotesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // proposal is the requested governance proposal. - Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` + // votes defines the queried votes. + Votes []*Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes,omitempty"` + // pagination defines the pagination in the response. + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryProposalResponse) Reset() { - *x = QueryProposalResponse{} +func (x *QueryVotesResponse) Reset() { + *x = QueryVotesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[3] + mi := &file_atomone_gov_v1_query_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryProposalResponse) String() string { +func (x *QueryVotesResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryProposalResponse) ProtoMessage() {} +func (*QueryVotesResponse) ProtoMessage() {} -// Deprecated: Use QueryProposalResponse.ProtoReflect.Descriptor instead. -func (*QueryProposalResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{3} +// Deprecated: Use QueryVotesResponse.ProtoReflect.Descriptor instead. +func (*QueryVotesResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{9} } -func (x *QueryProposalResponse) GetProposal() *Proposal { +func (x *QueryVotesResponse) GetVotes() []*Vote { if x != nil { - return x.Proposal + return x.Votes } return nil } -// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -type QueryProposalsRequest struct { +func (x *QueryVotesResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // proposal_status defines the status of the proposals. - ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=atomone.gov.v1.ProposalStatus" json:"proposal_status,omitempty"` - // voter defines the voter address for the proposals. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,3,opt,name=depositor,proto3" json:"depositor,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *v1beta1.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + ParamsType string `protobuf:"bytes,1,opt,name=params_type,json=paramsType,proto3" json:"params_type,omitempty"` } -func (x *QueryProposalsRequest) Reset() { - *x = QueryProposalsRequest{} +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[4] + mi := &file_atomone_gov_v1_query_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryProposalsRequest) String() string { +func (x *QueryParamsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryProposalsRequest) ProtoMessage() {} - -// Deprecated: Use QueryProposalsRequest.ProtoReflect.Descriptor instead. -func (*QueryProposalsRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{4} -} - -func (x *QueryProposalsRequest) GetProposalStatus() ProposalStatus { - if x != nil { - return x.ProposalStatus - } - return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED -} +func (*QueryParamsRequest) ProtoMessage() {} -func (x *QueryProposalsRequest) GetVoter() string { - if x != nil { - return x.Voter - } - return "" +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{10} } -func (x *QueryProposalsRequest) GetDepositor() string { +func (x *QueryParamsRequest) GetParamsType() string { if x != nil { - return x.Depositor + return x.ParamsType } return "" } -func (x *QueryProposalsRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -// QueryProposalsResponse is the response type for the Query/Proposals RPC -// method. -type QueryProposalsResponse struct { +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // proposals defines all the requested governance proposals. - Proposals []*Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals,omitempty"` - // pagination defines the pagination in the response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` + // Deprecated: Prefer to use `params` instead. + // voting_params defines the parameters related to voting. + // + // Deprecated: Do not use. + VotingParams *VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` + // Deprecated: Prefer to use `params` instead. + // deposit_params defines the parameters related to deposit. + // + // Deprecated: Do not use. + DepositParams *DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` + // Deprecated: Prefer to use `params` instead. + // tally_params defines the parameters related to tally. + // + // Deprecated: Do not use. + TallyParams *TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params *Params `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` } -func (x *QueryProposalsResponse) Reset() { - *x = QueryProposalsResponse{} +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[5] + mi := &file_atomone_gov_v1_query_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryProposalsResponse) String() string { +func (x *QueryParamsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryProposalsResponse) ProtoMessage() {} - -// Deprecated: Use QueryProposalsResponse.ProtoReflect.Descriptor instead. -func (*QueryProposalsResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{5} +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{11} +} + +// Deprecated: Do not use. +func (x *QueryParamsResponse) GetVotingParams() *VotingParams { + if x != nil { + return x.VotingParams + } + return nil +} + +// Deprecated: Do not use. +func (x *QueryParamsResponse) GetDepositParams() *DepositParams { + if x != nil { + return x.DepositParams + } + return nil } -func (x *QueryProposalsResponse) GetProposals() []*Proposal { +// Deprecated: Do not use. +func (x *QueryParamsResponse) GetTallyParams() *TallyParams { if x != nil { - return x.Proposals + return x.TallyParams } return nil } -func (x *QueryProposalsResponse) GetPagination() *v1beta1.PageResponse { +func (x *QueryParamsResponse) GetParams() *Params { if x != nil { - return x.Pagination + return x.Params } return nil } -// QueryVoteRequest is the request type for the Query/Vote RPC method. -type QueryVoteRequest struct { +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +type QueryDepositRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // voter defines the voter address for the proposals. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` } -func (x *QueryVoteRequest) Reset() { - *x = QueryVoteRequest{} +func (x *QueryDepositRequest) Reset() { + *x = QueryDepositRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[6] + mi := &file_atomone_gov_v1_query_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryVoteRequest) String() string { +func (x *QueryDepositRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryVoteRequest) ProtoMessage() {} +func (*QueryDepositRequest) ProtoMessage() {} -// Deprecated: Use QueryVoteRequest.ProtoReflect.Descriptor instead. -func (*QueryVoteRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{6} +// Deprecated: Use QueryDepositRequest.ProtoReflect.Descriptor instead. +func (*QueryDepositRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{12} } -func (x *QueryVoteRequest) GetProposalId() uint64 { +func (x *QueryDepositRequest) GetProposalId() uint64 { if x != nil { return x.ProposalId } return 0 } -func (x *QueryVoteRequest) GetVoter() string { +func (x *QueryDepositRequest) GetDepositor() string { if x != nil { - return x.Voter + return x.Depositor } return "" } -// QueryVoteResponse is the response type for the Query/Vote RPC method. -type QueryVoteResponse struct { +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +type QueryDepositResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // vote defines the queried vote. - Vote *Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` + // deposit defines the requested deposit. + Deposit *Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit,omitempty"` } -func (x *QueryVoteResponse) Reset() { - *x = QueryVoteResponse{} +func (x *QueryDepositResponse) Reset() { + *x = QueryDepositResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[7] + mi := &file_atomone_gov_v1_query_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryVoteResponse) String() string { +func (x *QueryDepositResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryVoteResponse) ProtoMessage() {} +func (*QueryDepositResponse) ProtoMessage() {} -// Deprecated: Use QueryVoteResponse.ProtoReflect.Descriptor instead. -func (*QueryVoteResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{7} +// Deprecated: Use QueryDepositResponse.ProtoReflect.Descriptor instead. +func (*QueryDepositResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{13} } -func (x *QueryVoteResponse) GetVote() *Vote { +func (x *QueryDepositResponse) GetDeposit() *Deposit { if x != nil { - return x.Vote + return x.Deposit } return nil } -// QueryVotesRequest is the request type for the Query/Votes RPC method. -type QueryVotesRequest struct { +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +type QueryDepositsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -11627,660 +16765,784 @@ type QueryVotesRequest struct { Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryVotesRequest) Reset() { - *x = QueryVotesRequest{} +func (x *QueryDepositsRequest) Reset() { + *x = QueryDepositsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[8] + mi := &file_atomone_gov_v1_query_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryVotesRequest) String() string { +func (x *QueryDepositsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryVotesRequest) ProtoMessage() {} +func (*QueryDepositsRequest) ProtoMessage() {} -// Deprecated: Use QueryVotesRequest.ProtoReflect.Descriptor instead. -func (*QueryVotesRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{8} +// Deprecated: Use QueryDepositsRequest.ProtoReflect.Descriptor instead. +func (*QueryDepositsRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{14} } -func (x *QueryVotesRequest) GetProposalId() uint64 { +func (x *QueryDepositsRequest) GetProposalId() uint64 { if x != nil { return x.ProposalId } return 0 } -func (x *QueryVotesRequest) GetPagination() *v1beta1.PageRequest { +func (x *QueryDepositsRequest) GetPagination() *v1beta1.PageRequest { if x != nil { return x.Pagination } return nil } -// QueryVotesResponse is the response type for the Query/Votes RPC method. -type QueryVotesResponse struct { +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +type QueryDepositsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // votes defines the queried votes. - Votes []*Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes,omitempty"` + // deposits defines the requested deposits. + Deposits []*Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits,omitempty"` // pagination defines the pagination in the response. Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryVotesResponse) Reset() { - *x = QueryVotesResponse{} +func (x *QueryDepositsResponse) Reset() { + *x = QueryDepositsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[9] + mi := &file_atomone_gov_v1_query_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryVotesResponse) String() string { +func (x *QueryDepositsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryVotesResponse) ProtoMessage() {} +func (*QueryDepositsResponse) ProtoMessage() {} -// Deprecated: Use QueryVotesResponse.ProtoReflect.Descriptor instead. -func (*QueryVotesResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{9} +// Deprecated: Use QueryDepositsResponse.ProtoReflect.Descriptor instead. +func (*QueryDepositsResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{15} } -func (x *QueryVotesResponse) GetVotes() []*Vote { +func (x *QueryDepositsResponse) GetDeposits() []*Deposit { if x != nil { - return x.Votes + return x.Deposits } return nil } -func (x *QueryVotesResponse) GetPagination() *v1beta1.PageResponse { +func (x *QueryDepositsResponse) GetPagination() *v1beta1.PageResponse { if x != nil { return x.Pagination } return nil } -// QueryParamsRequest is the request type for the Query/Params RPC method. -type QueryParamsRequest struct { +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +type QueryTallyResultRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // params_type defines which parameters to query for, can be one of "voting", - // "tallying" or "deposit". - ParamsType string `protobuf:"bytes,1,opt,name=params_type,json=paramsType,proto3" json:"params_type,omitempty"` + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` } -func (x *QueryParamsRequest) Reset() { - *x = QueryParamsRequest{} +func (x *QueryTallyResultRequest) Reset() { + *x = QueryTallyResultRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[10] + mi := &file_atomone_gov_v1_query_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryParamsRequest) String() string { +func (x *QueryTallyResultRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryTallyResultRequest) ProtoMessage() {} -// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{10} +// Deprecated: Use QueryTallyResultRequest.ProtoReflect.Descriptor instead. +func (*QueryTallyResultRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{16} } -func (x *QueryParamsRequest) GetParamsType() string { +func (x *QueryTallyResultRequest) GetProposalId() uint64 { if x != nil { - return x.ParamsType + return x.ProposalId } - return "" + return 0 } -// QueryParamsResponse is the response type for the Query/Params RPC method. -type QueryParamsResponse struct { +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +type QueryTallyResultResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Deprecated: Prefer to use `params` instead. - // voting_params defines the parameters related to voting. - // - // Deprecated: Do not use. - VotingParams *VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` - // Deprecated: Prefer to use `params` instead. - // deposit_params defines the parameters related to deposit. - // - // Deprecated: Do not use. - DepositParams *DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` - // Deprecated: Prefer to use `params` instead. - // tally_params defines the parameters related to tally. - // - // Deprecated: Do not use. - TallyParams *TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` - // params defines all the paramaters of x/gov module. - // - // Since: cosmos-sdk 0.47 - Params *Params `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` + // tally defines the requested tally. + Tally *TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally,omitempty"` } -func (x *QueryParamsResponse) Reset() { - *x = QueryParamsResponse{} +func (x *QueryTallyResultResponse) Reset() { + *x = QueryTallyResultResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTallyResultResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTallyResultResponse) ProtoMessage() {} + +// Deprecated: Use QueryTallyResultResponse.ProtoReflect.Descriptor instead. +func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{17} +} + +func (x *QueryTallyResultResponse) GetTally() *TallyResult { + if x != nil { + return x.Tally + } + return nil +} + +// QueryMinDepositRequest is the request type for the Query/MinDeposit RPC method. +type QueryMinDepositRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryMinDepositRequest) Reset() { + *x = QueryMinDepositRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryMinDepositRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryMinDepositRequest) ProtoMessage() {} + +// Deprecated: Use QueryMinDepositRequest.ProtoReflect.Descriptor instead. +func (*QueryMinDepositRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{18} +} + +// QueryMinDepositResponse is the response type for the Query/MinDeposit RPC method. +type QueryMinDepositResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // min_deposit defines the minimum deposit required for a proposal to enter voting period. + MinDeposit []*v1beta11.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit,omitempty"` +} + +func (x *QueryMinDepositResponse) Reset() { + *x = QueryMinDepositResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[11] + mi := &file_atomone_gov_v1_query_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryParamsResponse) String() string { +func (x *QueryMinDepositResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryMinDepositResponse) ProtoMessage() {} -// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{11} +// Deprecated: Use QueryMinDepositResponse.ProtoReflect.Descriptor instead. +func (*QueryMinDepositResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{19} } -// Deprecated: Do not use. -func (x *QueryParamsResponse) GetVotingParams() *VotingParams { +func (x *QueryMinDepositResponse) GetMinDeposit() []*v1beta11.Coin { if x != nil { - return x.VotingParams + return x.MinDeposit } return nil } -// Deprecated: Do not use. -func (x *QueryParamsResponse) GetDepositParams() *DepositParams { - if x != nil { - return x.DepositParams - } - return nil +// QueryMinInitialDepositRequest is the request type for the Query/MinInitialDeposit RPC method. +type QueryMinInitialDepositRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -// Deprecated: Do not use. -func (x *QueryParamsResponse) GetTallyParams() *TallyParams { - if x != nil { - return x.TallyParams +func (x *QueryMinInitialDepositRequest) Reset() { + *x = QueryMinInitialDepositRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (x *QueryParamsResponse) GetParams() *Params { - if x != nil { - return x.Params - } - return nil +func (x *QueryMinInitialDepositRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -// QueryDepositRequest is the request type for the Query/Deposit RPC method. -type QueryDepositRequest struct { +func (*QueryMinInitialDepositRequest) ProtoMessage() {} + +// Deprecated: Use QueryMinInitialDepositRequest.ProtoReflect.Descriptor instead. +func (*QueryMinInitialDepositRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{20} +} + +// QueryMinInitialDepositResponse is the response type for the Query/MinInitialDeposit RPC method. +type QueryMinInitialDepositResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` + // min_initial_deposit defines the minimum initial deposit required for a proposal to be submitted. + MinInitialDeposit []*v1beta11.Coin `protobuf:"bytes,1,rep,name=min_initial_deposit,json=minInitialDeposit,proto3" json:"min_initial_deposit,omitempty"` } -func (x *QueryDepositRequest) Reset() { - *x = QueryDepositRequest{} +func (x *QueryMinInitialDepositResponse) Reset() { + *x = QueryMinInitialDepositResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[12] + mi := &file_atomone_gov_v1_query_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryDepositRequest) String() string { +func (x *QueryMinInitialDepositResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryDepositRequest) ProtoMessage() {} - -// Deprecated: Use QueryDepositRequest.ProtoReflect.Descriptor instead. -func (*QueryDepositRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{12} -} +func (*QueryMinInitialDepositResponse) ProtoMessage() {} -func (x *QueryDepositRequest) GetProposalId() uint64 { - if x != nil { - return x.ProposalId - } - return 0 +// Deprecated: Use QueryMinInitialDepositResponse.ProtoReflect.Descriptor instead. +func (*QueryMinInitialDepositResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{21} } -func (x *QueryDepositRequest) GetDepositor() string { +func (x *QueryMinInitialDepositResponse) GetMinInitialDeposit() []*v1beta11.Coin { if x != nil { - return x.Depositor + return x.MinInitialDeposit } - return "" + return nil } -// QueryDepositResponse is the response type for the Query/Deposit RPC method. -type QueryDepositResponse struct { +// QueryQuorumsRequest is the request type for the Query/Quorums RPC method. +type QueryQuorumsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // deposit defines the requested deposit. - Deposit *Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit,omitempty"` } -func (x *QueryDepositResponse) Reset() { - *x = QueryDepositResponse{} +func (x *QueryQuorumsRequest) Reset() { + *x = QueryQuorumsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[13] + mi := &file_atomone_gov_v1_query_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryDepositResponse) String() string { +func (x *QueryQuorumsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryDepositResponse) ProtoMessage() {} - -// Deprecated: Use QueryDepositResponse.ProtoReflect.Descriptor instead. -func (*QueryDepositResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{13} -} +func (*QueryQuorumsRequest) ProtoMessage() {} -func (x *QueryDepositResponse) GetDeposit() *Deposit { - if x != nil { - return x.Deposit - } - return nil +// Deprecated: Use QueryQuorumsRequest.ProtoReflect.Descriptor instead. +func (*QueryQuorumsRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{22} } -// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -type QueryDepositsRequest struct { +// QueryQuorumsResponse is the response type for the Query/Quorums RPC method. +type QueryQuorumsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` + // quorum defines the requested quorum. + Quorum string `protobuf:"bytes,1,opt,name=quorum,proto3" json:"quorum,omitempty"` + // constitution_amendment_quorum defines the requested quorum for + // constitution amendment proposals. + ConstitutionAmendmentQuorum string `protobuf:"bytes,2,opt,name=constitution_amendment_quorum,json=constitutionAmendmentQuorum,proto3" json:"constitution_amendment_quorum,omitempty"` + // law_quorum defines the requested quorum for law proposals. + LawQuorum string `protobuf:"bytes,3,opt,name=law_quorum,json=lawQuorum,proto3" json:"law_quorum,omitempty"` } -func (x *QueryDepositsRequest) Reset() { - *x = QueryDepositsRequest{} +func (x *QueryQuorumsResponse) Reset() { + *x = QueryQuorumsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[14] + mi := &file_atomone_gov_v1_query_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryDepositsRequest) String() string { +func (x *QueryQuorumsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryDepositsRequest) ProtoMessage() {} +func (*QueryQuorumsResponse) ProtoMessage() {} -// Deprecated: Use QueryDepositsRequest.ProtoReflect.Descriptor instead. -func (*QueryDepositsRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{14} +// Deprecated: Use QueryQuorumsResponse.ProtoReflect.Descriptor instead. +func (*QueryQuorumsResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{23} } -func (x *QueryDepositsRequest) GetProposalId() uint64 { +func (x *QueryQuorumsResponse) GetQuorum() string { if x != nil { - return x.ProposalId + return x.Quorum } - return 0 + return "" } -func (x *QueryDepositsRequest) GetPagination() *v1beta1.PageRequest { +func (x *QueryQuorumsResponse) GetConstitutionAmendmentQuorum() string { if x != nil { - return x.Pagination + return x.ConstitutionAmendmentQuorum } - return nil + return "" } -// QueryDepositsResponse is the response type for the Query/Deposits RPC method. -type QueryDepositsResponse struct { +func (x *QueryQuorumsResponse) GetLawQuorum() string { + if x != nil { + return x.LawQuorum + } + return "" +} + +// QueryGovernorRequest is the request type for the Query/Governor RPC method. +type QueryGovernorRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // deposits defines the requested deposits. - Deposits []*Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits,omitempty"` - // pagination defines the pagination in the response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` + // 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 (x *QueryDepositsResponse) Reset() { - *x = QueryDepositsResponse{} +func (x *QueryGovernorRequest) Reset() { + *x = QueryGovernorRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[15] + mi := &file_atomone_gov_v1_query_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryDepositsResponse) String() string { +func (x *QueryGovernorRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryDepositsResponse) ProtoMessage() {} +func (*QueryGovernorRequest) ProtoMessage() {} -// Deprecated: Use QueryDepositsResponse.ProtoReflect.Descriptor instead. -func (*QueryDepositsResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{15} +// Deprecated: Use QueryGovernorRequest.ProtoReflect.Descriptor instead. +func (*QueryGovernorRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{24} } -func (x *QueryDepositsResponse) GetDeposits() []*Deposit { +func (x *QueryGovernorRequest) GetGovernorAddress() string { if x != nil { - return x.Deposits + return x.GovernorAddress } - return nil + return "" } -func (x *QueryDepositsResponse) GetPagination() *v1beta1.PageResponse { +// QueryGovernorResponse is the response type for the Query/Governor RPC method. +type QueryGovernorResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // governor defines the requested governor. + Governor *Governor `protobuf:"bytes,1,opt,name=governor,proto3" json:"governor,omitempty"` +} + +func (x *QueryGovernorResponse) Reset() { + *x = QueryGovernorResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_query_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGovernorResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGovernorResponse) ProtoMessage() {} + +// Deprecated: Use QueryGovernorResponse.ProtoReflect.Descriptor instead. +func (*QueryGovernorResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{25} +} + +func (x *QueryGovernorResponse) GetGovernor() *Governor { if x != nil { - return x.Pagination + return x.Governor } return nil } -// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -type QueryTallyResultRequest struct { +// QueryGovernorsRequest is the request type for the Query/Governors RPC method. +type QueryGovernorsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryTallyResultRequest) Reset() { - *x = QueryTallyResultRequest{} +func (x *QueryGovernorsRequest) Reset() { + *x = QueryGovernorsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[16] + mi := &file_atomone_gov_v1_query_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryTallyResultRequest) String() string { +func (x *QueryGovernorsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryTallyResultRequest) ProtoMessage() {} +func (*QueryGovernorsRequest) ProtoMessage() {} -// Deprecated: Use QueryTallyResultRequest.ProtoReflect.Descriptor instead. -func (*QueryTallyResultRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{16} +// Deprecated: Use QueryGovernorsRequest.ProtoReflect.Descriptor instead. +func (*QueryGovernorsRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{26} } -func (x *QueryTallyResultRequest) GetProposalId() uint64 { +func (x *QueryGovernorsRequest) GetPagination() *v1beta1.PageRequest { if x != nil { - return x.ProposalId + return x.Pagination } - return 0 + return nil } -// QueryTallyResultResponse is the response type for the Query/Tally RPC method. -type QueryTallyResultResponse struct { +// QueryGovernorsResponse is the response type for the Query/Governors RPC method. +type QueryGovernorsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // tally defines the requested tally. - Tally *TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally,omitempty"` + // 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 *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryTallyResultResponse) Reset() { - *x = QueryTallyResultResponse{} +func (x *QueryGovernorsResponse) Reset() { + *x = QueryGovernorsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[17] + mi := &file_atomone_gov_v1_query_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryTallyResultResponse) String() string { +func (x *QueryGovernorsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryTallyResultResponse) ProtoMessage() {} +func (*QueryGovernorsResponse) ProtoMessage() {} -// Deprecated: Use QueryTallyResultResponse.ProtoReflect.Descriptor instead. -func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{17} +// Deprecated: Use QueryGovernorsResponse.ProtoReflect.Descriptor instead. +func (*QueryGovernorsResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{27} } -func (x *QueryTallyResultResponse) GetTally() *TallyResult { +func (x *QueryGovernorsResponse) GetGovernors() []*Governor { if x != nil { - return x.Tally + return x.Governors } return nil } -// QueryMinDepositRequest is the request type for the Query/MinDeposit RPC method. -type QueryMinDepositRequest struct { +func (x *QueryGovernorsResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryGovernanceDelegationsRequest is the request type for the Query/GovernanceDelegations RPC method. +type QueryGovernanceDelegationsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // 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 *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryMinDepositRequest) Reset() { - *x = QueryMinDepositRequest{} +func (x *QueryGovernanceDelegationsRequest) Reset() { + *x = QueryGovernanceDelegationsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[18] + mi := &file_atomone_gov_v1_query_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryMinDepositRequest) String() string { +func (x *QueryGovernanceDelegationsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryMinDepositRequest) ProtoMessage() {} +func (*QueryGovernanceDelegationsRequest) ProtoMessage() {} -// Deprecated: Use QueryMinDepositRequest.ProtoReflect.Descriptor instead. -func (*QueryMinDepositRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{18} +// Deprecated: Use QueryGovernanceDelegationsRequest.ProtoReflect.Descriptor instead. +func (*QueryGovernanceDelegationsRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{28} } -// QueryMinDepositResponse is the response type for the Query/MinDeposit RPC method. -type QueryMinDepositResponse struct { +func (x *QueryGovernanceDelegationsRequest) GetGovernorAddress() string { + if x != nil { + return x.GovernorAddress + } + return "" +} + +func (x *QueryGovernanceDelegationsRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryGovernanceDelegationsResponse is the response type for the Query/GovernanceDelegations RPC method. +type QueryGovernanceDelegationsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // min_deposit defines the minimum deposit required for a proposal to enter voting period. - MinDeposit []*v1beta11.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit,omitempty"` + // 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 *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryMinDepositResponse) Reset() { - *x = QueryMinDepositResponse{} +func (x *QueryGovernanceDelegationsResponse) Reset() { + *x = QueryGovernanceDelegationsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[19] + mi := &file_atomone_gov_v1_query_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryMinDepositResponse) String() string { +func (x *QueryGovernanceDelegationsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryMinDepositResponse) ProtoMessage() {} +func (*QueryGovernanceDelegationsResponse) ProtoMessage() {} -// Deprecated: Use QueryMinDepositResponse.ProtoReflect.Descriptor instead. -func (*QueryMinDepositResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{19} +// Deprecated: Use QueryGovernanceDelegationsResponse.ProtoReflect.Descriptor instead. +func (*QueryGovernanceDelegationsResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{29} } -func (x *QueryMinDepositResponse) GetMinDeposit() []*v1beta11.Coin { +func (x *QueryGovernanceDelegationsResponse) GetDelegations() []*GovernanceDelegation { if x != nil { - return x.MinDeposit + return x.Delegations } return nil } -// QueryMinInitialDepositRequest is the request type for the Query/MinInitialDeposit RPC method. -type QueryMinInitialDepositRequest struct { +func (x *QueryGovernanceDelegationsResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryGovernanceDelegationRequest is the request type for the Query/GovernanceDelegation RPC method. +type QueryGovernanceDelegationRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // 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 (x *QueryMinInitialDepositRequest) Reset() { - *x = QueryMinInitialDepositRequest{} +func (x *QueryGovernanceDelegationRequest) Reset() { + *x = QueryGovernanceDelegationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[20] + mi := &file_atomone_gov_v1_query_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryMinInitialDepositRequest) String() string { +func (x *QueryGovernanceDelegationRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryMinInitialDepositRequest) ProtoMessage() {} +func (*QueryGovernanceDelegationRequest) ProtoMessage() {} -// Deprecated: Use QueryMinInitialDepositRequest.ProtoReflect.Descriptor instead. -func (*QueryMinInitialDepositRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{20} +// Deprecated: Use QueryGovernanceDelegationRequest.ProtoReflect.Descriptor instead. +func (*QueryGovernanceDelegationRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{30} } -// QueryMinInitialDepositResponse is the response type for the Query/MinInitialDeposit RPC method. -type QueryMinInitialDepositResponse struct { +func (x *QueryGovernanceDelegationRequest) GetDelegatorAddress() string { + if x != nil { + return x.DelegatorAddress + } + return "" +} + +// QueryGovernanceDelegationResponse is the response type for the Query/GovernanceDelegation RPC method. +type QueryGovernanceDelegationResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // min_initial_deposit defines the minimum initial deposit required for a proposal to be submitted. - MinInitialDeposit []*v1beta11.Coin `protobuf:"bytes,1,rep,name=min_initial_deposit,json=minInitialDeposit,proto3" json:"min_initial_deposit,omitempty"` + // 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 (x *QueryMinInitialDepositResponse) Reset() { - *x = QueryMinInitialDepositResponse{} +func (x *QueryGovernanceDelegationResponse) Reset() { + *x = QueryGovernanceDelegationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[21] + mi := &file_atomone_gov_v1_query_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryMinInitialDepositResponse) String() string { +func (x *QueryGovernanceDelegationResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryMinInitialDepositResponse) ProtoMessage() {} +func (*QueryGovernanceDelegationResponse) ProtoMessage() {} -// Deprecated: Use QueryMinInitialDepositResponse.ProtoReflect.Descriptor instead. -func (*QueryMinInitialDepositResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{21} +// Deprecated: Use QueryGovernanceDelegationResponse.ProtoReflect.Descriptor instead. +func (*QueryGovernanceDelegationResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{31} } -func (x *QueryMinInitialDepositResponse) GetMinInitialDeposit() []*v1beta11.Coin { +func (x *QueryGovernanceDelegationResponse) GetGovernorAddress() string { if x != nil { - return x.MinInitialDeposit + return x.GovernorAddress } - return nil + return "" } -// QueryQuorumsRequest is the request type for the Query/Quorums RPC method. -type QueryQuorumsRequest struct { +// QueryGovernorValSharesRequest is the request type for the Query/GovernorValShares RPC method. +type QueryGovernorValSharesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // 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 *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryQuorumsRequest) Reset() { - *x = QueryQuorumsRequest{} +func (x *QueryGovernorValSharesRequest) Reset() { + *x = QueryGovernorValSharesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[22] + mi := &file_atomone_gov_v1_query_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryQuorumsRequest) String() string { +func (x *QueryGovernorValSharesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryQuorumsRequest) ProtoMessage() {} +func (*QueryGovernorValSharesRequest) ProtoMessage() {} -// Deprecated: Use QueryQuorumsRequest.ProtoReflect.Descriptor instead. -func (*QueryQuorumsRequest) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{22} +// Deprecated: Use QueryGovernorValSharesRequest.ProtoReflect.Descriptor instead. +func (*QueryGovernorValSharesRequest) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{32} } -// QueryQuorumsResponse is the response type for the Query/Quorums RPC method. -type QueryQuorumsResponse struct { +func (x *QueryGovernorValSharesRequest) GetGovernorAddress() string { + if x != nil { + return x.GovernorAddress + } + return "" +} + +func (x *QueryGovernorValSharesRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryGovernorValSharesResponse is the response type for the Query/GovernorValShares RPC method. +type QueryGovernorValSharesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // quorum defines the requested quorum. - Quorum string `protobuf:"bytes,1,opt,name=quorum,proto3" json:"quorum,omitempty"` - // constitution_amendment_quorum defines the requested quorum for - // constitution amendment proposals. - ConstitutionAmendmentQuorum string `protobuf:"bytes,2,opt,name=constitution_amendment_quorum,json=constitutionAmendmentQuorum,proto3" json:"constitution_amendment_quorum,omitempty"` - // law_quorum defines the requested quorum for law proposals. - LawQuorum string `protobuf:"bytes,3,opt,name=law_quorum,json=lawQuorum,proto3" json:"law_quorum,omitempty"` + // 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 *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryQuorumsResponse) Reset() { - *x = QueryQuorumsResponse{} +func (x *QueryGovernorValSharesResponse) Reset() { + *x = QueryGovernorValSharesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_query_proto_msgTypes[23] + mi := &file_atomone_gov_v1_query_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryQuorumsResponse) String() string { +func (x *QueryGovernorValSharesResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryQuorumsResponse) ProtoMessage() {} - -// Deprecated: Use QueryQuorumsResponse.ProtoReflect.Descriptor instead. -func (*QueryQuorumsResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{23} -} +func (*QueryGovernorValSharesResponse) ProtoMessage() {} -func (x *QueryQuorumsResponse) GetQuorum() string { - if x != nil { - return x.Quorum - } - return "" +// Deprecated: Use QueryGovernorValSharesResponse.ProtoReflect.Descriptor instead. +func (*QueryGovernorValSharesResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_query_proto_rawDescGZIP(), []int{33} } -func (x *QueryQuorumsResponse) GetConstitutionAmendmentQuorum() string { +func (x *QueryGovernorValSharesResponse) GetValShares() []*GovernorValShares { if x != nil { - return x.ConstitutionAmendmentQuorum + return x.ValShares } - return "" + return nil } -func (x *QueryQuorumsResponse) GetLawQuorum() string { +func (x *QueryGovernorValSharesResponse) GetPagination() *v1beta1.PageResponse { if x != nil { - return x.LawQuorum + return x.Pagination } - return "" + return nil } var File_atomone_gov_v1_query_proto protoreflect.FileDescriptor @@ -12457,124 +17719,259 @@ var file_atomone_gov_v1_query_proto_rawDesc = []byte{ 0x65, 0x6e, 0x64, 0x6d, 0x65, 0x6e, 0x74, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2d, 0x0a, 0x0a, 0x6c, 0x61, 0x77, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x09, 0x6c, 0x61, 0x77, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x32, 0x99, 0x0d, 0x0a, - 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x89, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x73, 0x74, - 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, - 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, - 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x29, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, - 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x88, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, - 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, - 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, - 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, - 0x09, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x25, 0x2e, 0x61, 0x74, 0x6f, - 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x26, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x63, 0x52, 0x09, 0x6c, 0x61, 0x77, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x22, 0x64, 0x0a, 0x14, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x10, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, + 0xd2, 0xb4, 0x2d, 0x1d, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x0f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x4d, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, + 0x6e, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x67, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, + 0x72, 0x22, 0x5f, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x99, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, + 0x09, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x09, 0x67, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x6f, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb9, + 0x01, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, + 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x10, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, + 0xd2, 0xb4, 0x2d, 0x1d, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x0f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb5, 0x01, 0x0a, 0x22, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, + 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, + 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x69, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, + 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x4e, 0x0a, + 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, + 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xb5, 0x01, + 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x56, + 0x61, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x4c, 0x0a, 0x10, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x61, + 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x67, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xab, 0x01, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x5f, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, + 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x52, + 0x09, 0x76, 0x61, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0xcb, 0x13, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x89, 0x01, + 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, + 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x61, 0x74, + 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x88, 0x01, 0x0a, 0x08, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, + 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, + 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x61, 0x74, + 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x73, 0x12, 0x25, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x8a, 0x01, 0x0a, - 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, - 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x37, 0x12, 0x35, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x6f, 0x74, 0x65, - 0x73, 0x2f, 0x7b, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x7d, 0x12, 0x85, 0x01, 0x0a, 0x05, 0x56, 0x6f, - 0x74, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, - 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x6f, 0x74, 0x65, - 0x73, 0x12, 0x7f, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x61, 0x74, - 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x23, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, - 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x23, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x73, 0x12, 0x8a, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x61, + 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x3d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, 0x35, 0x2f, 0x61, 0x74, 0x6f, 0x6d, + 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, + 0x64, 0x7d, 0x2f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x7d, + 0x12, 0x85, 0x01, 0x0a, 0x05, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x74, 0x6f, + 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, + 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x61, 0x74, 0x6f, 0x6d, + 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, + 0x64, 0x7d, 0x2f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x7f, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, + 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, + 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x07, 0x44, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x23, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, + 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x74, 0x6f, + 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x12, 0x3c, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x73, 0x12, 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x3e, 0x12, 0x3c, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x7d, 0x12, - 0x91, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x24, 0x2e, 0x61, - 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x32, 0x12, 0x30, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x73, 0x12, 0x97, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x12, 0x27, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x74, 0x6f, 0x6d, + 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x97, 0x01, 0x0a, 0x0b, 0x54, + 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x27, 0x2e, 0x61, 0x74, 0x6f, + 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, + 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, + 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, + 0x61, 0x6c, 0x6c, 0x79, 0x12, 0x81, 0x01, 0x0a, 0x0a, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x26, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x74, + 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x61, + 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, + 0x6e, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x9d, 0x01, 0x0a, 0x11, 0x4d, 0x69, 0x6e, + 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x2d, + 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, + 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, + 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x6c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x75, 0x0a, 0x07, 0x51, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x51, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, + 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x73, 0x12, + 0x8d, 0x01, 0x0a, 0x08, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, - 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x12, 0x81, 0x01, - 0x0a, 0x0a, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x26, 0x2e, 0x61, + 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2e, 0x12, 0x2c, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, + 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x67, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, + 0x7d, 0x0a, 0x09, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, - 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6e, 0x44, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, - 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x69, 0x6e, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x12, 0x9d, 0x01, 0x0a, 0x11, 0x4d, 0x69, 0x6e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x2d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, - 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, - 0x6e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, - 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x69, 0x6e, - 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, - 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x12, 0x75, 0x0a, 0x07, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x61, + 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, + 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x73, 0x12, 0xc0, + 0x01, 0x0a, 0x15, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x61, 0x74, + 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, + 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, + 0x72, 0x73, 0x2f, 0x7b, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0xb4, 0x01, 0x0a, 0x14, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, + 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x61, 0x74, 0x6f, + 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, - 0x17, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, - 0x2f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x73, 0x42, 0xa1, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, - 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, - 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, - 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x47, 0x58, 0xaa, 0x02, 0x0e, 0x41, 0x74, 0x6f, - 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x41, 0x74, - 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x41, - 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x41, 0x74, 0x6f, 0x6d, - 0x6f, 0x6e, 0x65, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, + 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xa6, 0x01, 0x0a, 0x11, 0x47, 0x6f, 0x76, + 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x2d, + 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x56, 0x61, 0x6c, + 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, + 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, + 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x2f, 0x7b, + 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x7d, 0x42, 0xa1, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, + 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, + 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x41, 0x47, 0x58, 0xaa, 0x02, 0x0e, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, + 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, + 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, + 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x10, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x3a, 0x3a, 0x47, 0x6f, + 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -12589,95 +17986,128 @@ func file_atomone_gov_v1_query_proto_rawDescGZIP() []byte { return file_atomone_gov_v1_query_proto_rawDescData } -var file_atomone_gov_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_atomone_gov_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 34) var file_atomone_gov_v1_query_proto_goTypes = []interface{}{ - (*QueryConstitutionRequest)(nil), // 0: atomone.gov.v1.QueryConstitutionRequest - (*QueryConstitutionResponse)(nil), // 1: atomone.gov.v1.QueryConstitutionResponse - (*QueryProposalRequest)(nil), // 2: atomone.gov.v1.QueryProposalRequest - (*QueryProposalResponse)(nil), // 3: atomone.gov.v1.QueryProposalResponse - (*QueryProposalsRequest)(nil), // 4: atomone.gov.v1.QueryProposalsRequest - (*QueryProposalsResponse)(nil), // 5: atomone.gov.v1.QueryProposalsResponse - (*QueryVoteRequest)(nil), // 6: atomone.gov.v1.QueryVoteRequest - (*QueryVoteResponse)(nil), // 7: atomone.gov.v1.QueryVoteResponse - (*QueryVotesRequest)(nil), // 8: atomone.gov.v1.QueryVotesRequest - (*QueryVotesResponse)(nil), // 9: atomone.gov.v1.QueryVotesResponse - (*QueryParamsRequest)(nil), // 10: atomone.gov.v1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 11: atomone.gov.v1.QueryParamsResponse - (*QueryDepositRequest)(nil), // 12: atomone.gov.v1.QueryDepositRequest - (*QueryDepositResponse)(nil), // 13: atomone.gov.v1.QueryDepositResponse - (*QueryDepositsRequest)(nil), // 14: atomone.gov.v1.QueryDepositsRequest - (*QueryDepositsResponse)(nil), // 15: atomone.gov.v1.QueryDepositsResponse - (*QueryTallyResultRequest)(nil), // 16: atomone.gov.v1.QueryTallyResultRequest - (*QueryTallyResultResponse)(nil), // 17: atomone.gov.v1.QueryTallyResultResponse - (*QueryMinDepositRequest)(nil), // 18: atomone.gov.v1.QueryMinDepositRequest - (*QueryMinDepositResponse)(nil), // 19: atomone.gov.v1.QueryMinDepositResponse - (*QueryMinInitialDepositRequest)(nil), // 20: atomone.gov.v1.QueryMinInitialDepositRequest - (*QueryMinInitialDepositResponse)(nil), // 21: atomone.gov.v1.QueryMinInitialDepositResponse - (*QueryQuorumsRequest)(nil), // 22: atomone.gov.v1.QueryQuorumsRequest - (*QueryQuorumsResponse)(nil), // 23: atomone.gov.v1.QueryQuorumsResponse - (*Proposal)(nil), // 24: atomone.gov.v1.Proposal - (ProposalStatus)(0), // 25: atomone.gov.v1.ProposalStatus - (*v1beta1.PageRequest)(nil), // 26: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 27: cosmos.base.query.v1beta1.PageResponse - (*Vote)(nil), // 28: atomone.gov.v1.Vote - (*VotingParams)(nil), // 29: atomone.gov.v1.VotingParams - (*DepositParams)(nil), // 30: atomone.gov.v1.DepositParams - (*TallyParams)(nil), // 31: atomone.gov.v1.TallyParams - (*Params)(nil), // 32: atomone.gov.v1.Params - (*Deposit)(nil), // 33: atomone.gov.v1.Deposit - (*TallyResult)(nil), // 34: atomone.gov.v1.TallyResult - (*v1beta11.Coin)(nil), // 35: cosmos.base.v1beta1.Coin + (*QueryConstitutionRequest)(nil), // 0: atomone.gov.v1.QueryConstitutionRequest + (*QueryConstitutionResponse)(nil), // 1: atomone.gov.v1.QueryConstitutionResponse + (*QueryProposalRequest)(nil), // 2: atomone.gov.v1.QueryProposalRequest + (*QueryProposalResponse)(nil), // 3: atomone.gov.v1.QueryProposalResponse + (*QueryProposalsRequest)(nil), // 4: atomone.gov.v1.QueryProposalsRequest + (*QueryProposalsResponse)(nil), // 5: atomone.gov.v1.QueryProposalsResponse + (*QueryVoteRequest)(nil), // 6: atomone.gov.v1.QueryVoteRequest + (*QueryVoteResponse)(nil), // 7: atomone.gov.v1.QueryVoteResponse + (*QueryVotesRequest)(nil), // 8: atomone.gov.v1.QueryVotesRequest + (*QueryVotesResponse)(nil), // 9: atomone.gov.v1.QueryVotesResponse + (*QueryParamsRequest)(nil), // 10: atomone.gov.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 11: atomone.gov.v1.QueryParamsResponse + (*QueryDepositRequest)(nil), // 12: atomone.gov.v1.QueryDepositRequest + (*QueryDepositResponse)(nil), // 13: atomone.gov.v1.QueryDepositResponse + (*QueryDepositsRequest)(nil), // 14: atomone.gov.v1.QueryDepositsRequest + (*QueryDepositsResponse)(nil), // 15: atomone.gov.v1.QueryDepositsResponse + (*QueryTallyResultRequest)(nil), // 16: atomone.gov.v1.QueryTallyResultRequest + (*QueryTallyResultResponse)(nil), // 17: atomone.gov.v1.QueryTallyResultResponse + (*QueryMinDepositRequest)(nil), // 18: atomone.gov.v1.QueryMinDepositRequest + (*QueryMinDepositResponse)(nil), // 19: atomone.gov.v1.QueryMinDepositResponse + (*QueryMinInitialDepositRequest)(nil), // 20: atomone.gov.v1.QueryMinInitialDepositRequest + (*QueryMinInitialDepositResponse)(nil), // 21: atomone.gov.v1.QueryMinInitialDepositResponse + (*QueryQuorumsRequest)(nil), // 22: atomone.gov.v1.QueryQuorumsRequest + (*QueryQuorumsResponse)(nil), // 23: atomone.gov.v1.QueryQuorumsResponse + (*QueryGovernorRequest)(nil), // 24: atomone.gov.v1.QueryGovernorRequest + (*QueryGovernorResponse)(nil), // 25: atomone.gov.v1.QueryGovernorResponse + (*QueryGovernorsRequest)(nil), // 26: atomone.gov.v1.QueryGovernorsRequest + (*QueryGovernorsResponse)(nil), // 27: atomone.gov.v1.QueryGovernorsResponse + (*QueryGovernanceDelegationsRequest)(nil), // 28: atomone.gov.v1.QueryGovernanceDelegationsRequest + (*QueryGovernanceDelegationsResponse)(nil), // 29: atomone.gov.v1.QueryGovernanceDelegationsResponse + (*QueryGovernanceDelegationRequest)(nil), // 30: atomone.gov.v1.QueryGovernanceDelegationRequest + (*QueryGovernanceDelegationResponse)(nil), // 31: atomone.gov.v1.QueryGovernanceDelegationResponse + (*QueryGovernorValSharesRequest)(nil), // 32: atomone.gov.v1.QueryGovernorValSharesRequest + (*QueryGovernorValSharesResponse)(nil), // 33: atomone.gov.v1.QueryGovernorValSharesResponse + (*Proposal)(nil), // 34: atomone.gov.v1.Proposal + (ProposalStatus)(0), // 35: atomone.gov.v1.ProposalStatus + (*v1beta1.PageRequest)(nil), // 36: cosmos.base.query.v1beta1.PageRequest + (*v1beta1.PageResponse)(nil), // 37: cosmos.base.query.v1beta1.PageResponse + (*Vote)(nil), // 38: atomone.gov.v1.Vote + (*VotingParams)(nil), // 39: atomone.gov.v1.VotingParams + (*DepositParams)(nil), // 40: atomone.gov.v1.DepositParams + (*TallyParams)(nil), // 41: atomone.gov.v1.TallyParams + (*Params)(nil), // 42: atomone.gov.v1.Params + (*Deposit)(nil), // 43: atomone.gov.v1.Deposit + (*TallyResult)(nil), // 44: atomone.gov.v1.TallyResult + (*v1beta11.Coin)(nil), // 45: cosmos.base.v1beta1.Coin + (*Governor)(nil), // 46: atomone.gov.v1.Governor + (*GovernanceDelegation)(nil), // 47: atomone.gov.v1.GovernanceDelegation + (*GovernorValShares)(nil), // 48: atomone.gov.v1.GovernorValShares } var file_atomone_gov_v1_query_proto_depIdxs = []int32{ - 24, // 0: atomone.gov.v1.QueryProposalResponse.proposal:type_name -> atomone.gov.v1.Proposal - 25, // 1: atomone.gov.v1.QueryProposalsRequest.proposal_status:type_name -> atomone.gov.v1.ProposalStatus - 26, // 2: atomone.gov.v1.QueryProposalsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 24, // 3: atomone.gov.v1.QueryProposalsResponse.proposals:type_name -> atomone.gov.v1.Proposal - 27, // 4: atomone.gov.v1.QueryProposalsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 28, // 5: atomone.gov.v1.QueryVoteResponse.vote:type_name -> atomone.gov.v1.Vote - 26, // 6: atomone.gov.v1.QueryVotesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 28, // 7: atomone.gov.v1.QueryVotesResponse.votes:type_name -> atomone.gov.v1.Vote - 27, // 8: atomone.gov.v1.QueryVotesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 29, // 9: atomone.gov.v1.QueryParamsResponse.voting_params:type_name -> atomone.gov.v1.VotingParams - 30, // 10: atomone.gov.v1.QueryParamsResponse.deposit_params:type_name -> atomone.gov.v1.DepositParams - 31, // 11: atomone.gov.v1.QueryParamsResponse.tally_params:type_name -> atomone.gov.v1.TallyParams - 32, // 12: atomone.gov.v1.QueryParamsResponse.params:type_name -> atomone.gov.v1.Params - 33, // 13: atomone.gov.v1.QueryDepositResponse.deposit:type_name -> atomone.gov.v1.Deposit - 26, // 14: atomone.gov.v1.QueryDepositsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 33, // 15: atomone.gov.v1.QueryDepositsResponse.deposits:type_name -> atomone.gov.v1.Deposit - 27, // 16: atomone.gov.v1.QueryDepositsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 34, // 17: atomone.gov.v1.QueryTallyResultResponse.tally:type_name -> atomone.gov.v1.TallyResult - 35, // 18: atomone.gov.v1.QueryMinDepositResponse.min_deposit:type_name -> cosmos.base.v1beta1.Coin - 35, // 19: atomone.gov.v1.QueryMinInitialDepositResponse.min_initial_deposit:type_name -> cosmos.base.v1beta1.Coin - 0, // 20: atomone.gov.v1.Query.Constitution:input_type -> atomone.gov.v1.QueryConstitutionRequest - 2, // 21: atomone.gov.v1.Query.Proposal:input_type -> atomone.gov.v1.QueryProposalRequest - 4, // 22: atomone.gov.v1.Query.Proposals:input_type -> atomone.gov.v1.QueryProposalsRequest - 6, // 23: atomone.gov.v1.Query.Vote:input_type -> atomone.gov.v1.QueryVoteRequest - 8, // 24: atomone.gov.v1.Query.Votes:input_type -> atomone.gov.v1.QueryVotesRequest - 10, // 25: atomone.gov.v1.Query.Params:input_type -> atomone.gov.v1.QueryParamsRequest - 12, // 26: atomone.gov.v1.Query.Deposit:input_type -> atomone.gov.v1.QueryDepositRequest - 14, // 27: atomone.gov.v1.Query.Deposits:input_type -> atomone.gov.v1.QueryDepositsRequest - 16, // 28: atomone.gov.v1.Query.TallyResult:input_type -> atomone.gov.v1.QueryTallyResultRequest - 18, // 29: atomone.gov.v1.Query.MinDeposit:input_type -> atomone.gov.v1.QueryMinDepositRequest - 20, // 30: atomone.gov.v1.Query.MinInitialDeposit:input_type -> atomone.gov.v1.QueryMinInitialDepositRequest - 22, // 31: atomone.gov.v1.Query.Quorums:input_type -> atomone.gov.v1.QueryQuorumsRequest - 1, // 32: atomone.gov.v1.Query.Constitution:output_type -> atomone.gov.v1.QueryConstitutionResponse - 3, // 33: atomone.gov.v1.Query.Proposal:output_type -> atomone.gov.v1.QueryProposalResponse - 5, // 34: atomone.gov.v1.Query.Proposals:output_type -> atomone.gov.v1.QueryProposalsResponse - 7, // 35: atomone.gov.v1.Query.Vote:output_type -> atomone.gov.v1.QueryVoteResponse - 9, // 36: atomone.gov.v1.Query.Votes:output_type -> atomone.gov.v1.QueryVotesResponse - 11, // 37: atomone.gov.v1.Query.Params:output_type -> atomone.gov.v1.QueryParamsResponse - 13, // 38: atomone.gov.v1.Query.Deposit:output_type -> atomone.gov.v1.QueryDepositResponse - 15, // 39: atomone.gov.v1.Query.Deposits:output_type -> atomone.gov.v1.QueryDepositsResponse - 17, // 40: atomone.gov.v1.Query.TallyResult:output_type -> atomone.gov.v1.QueryTallyResultResponse - 19, // 41: atomone.gov.v1.Query.MinDeposit:output_type -> atomone.gov.v1.QueryMinDepositResponse - 21, // 42: atomone.gov.v1.Query.MinInitialDeposit:output_type -> atomone.gov.v1.QueryMinInitialDepositResponse - 23, // 43: atomone.gov.v1.Query.Quorums:output_type -> atomone.gov.v1.QueryQuorumsResponse - 32, // [32:44] is the sub-list for method output_type - 20, // [20:32] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 34, // 0: atomone.gov.v1.QueryProposalResponse.proposal:type_name -> atomone.gov.v1.Proposal + 35, // 1: atomone.gov.v1.QueryProposalsRequest.proposal_status:type_name -> atomone.gov.v1.ProposalStatus + 36, // 2: atomone.gov.v1.QueryProposalsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 34, // 3: atomone.gov.v1.QueryProposalsResponse.proposals:type_name -> atomone.gov.v1.Proposal + 37, // 4: atomone.gov.v1.QueryProposalsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 38, // 5: atomone.gov.v1.QueryVoteResponse.vote:type_name -> atomone.gov.v1.Vote + 36, // 6: atomone.gov.v1.QueryVotesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 38, // 7: atomone.gov.v1.QueryVotesResponse.votes:type_name -> atomone.gov.v1.Vote + 37, // 8: atomone.gov.v1.QueryVotesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 39, // 9: atomone.gov.v1.QueryParamsResponse.voting_params:type_name -> atomone.gov.v1.VotingParams + 40, // 10: atomone.gov.v1.QueryParamsResponse.deposit_params:type_name -> atomone.gov.v1.DepositParams + 41, // 11: atomone.gov.v1.QueryParamsResponse.tally_params:type_name -> atomone.gov.v1.TallyParams + 42, // 12: atomone.gov.v1.QueryParamsResponse.params:type_name -> atomone.gov.v1.Params + 43, // 13: atomone.gov.v1.QueryDepositResponse.deposit:type_name -> atomone.gov.v1.Deposit + 36, // 14: atomone.gov.v1.QueryDepositsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 43, // 15: atomone.gov.v1.QueryDepositsResponse.deposits:type_name -> atomone.gov.v1.Deposit + 37, // 16: atomone.gov.v1.QueryDepositsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 44, // 17: atomone.gov.v1.QueryTallyResultResponse.tally:type_name -> atomone.gov.v1.TallyResult + 45, // 18: atomone.gov.v1.QueryMinDepositResponse.min_deposit:type_name -> cosmos.base.v1beta1.Coin + 45, // 19: atomone.gov.v1.QueryMinInitialDepositResponse.min_initial_deposit:type_name -> cosmos.base.v1beta1.Coin + 46, // 20: atomone.gov.v1.QueryGovernorResponse.governor:type_name -> atomone.gov.v1.Governor + 36, // 21: atomone.gov.v1.QueryGovernorsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 46, // 22: atomone.gov.v1.QueryGovernorsResponse.governors:type_name -> atomone.gov.v1.Governor + 37, // 23: atomone.gov.v1.QueryGovernorsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 36, // 24: atomone.gov.v1.QueryGovernanceDelegationsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 47, // 25: atomone.gov.v1.QueryGovernanceDelegationsResponse.delegations:type_name -> atomone.gov.v1.GovernanceDelegation + 37, // 26: atomone.gov.v1.QueryGovernanceDelegationsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 36, // 27: atomone.gov.v1.QueryGovernorValSharesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 48, // 28: atomone.gov.v1.QueryGovernorValSharesResponse.val_shares:type_name -> atomone.gov.v1.GovernorValShares + 37, // 29: atomone.gov.v1.QueryGovernorValSharesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 0, // 30: atomone.gov.v1.Query.Constitution:input_type -> atomone.gov.v1.QueryConstitutionRequest + 2, // 31: atomone.gov.v1.Query.Proposal:input_type -> atomone.gov.v1.QueryProposalRequest + 4, // 32: atomone.gov.v1.Query.Proposals:input_type -> atomone.gov.v1.QueryProposalsRequest + 6, // 33: atomone.gov.v1.Query.Vote:input_type -> atomone.gov.v1.QueryVoteRequest + 8, // 34: atomone.gov.v1.Query.Votes:input_type -> atomone.gov.v1.QueryVotesRequest + 10, // 35: atomone.gov.v1.Query.Params:input_type -> atomone.gov.v1.QueryParamsRequest + 12, // 36: atomone.gov.v1.Query.Deposit:input_type -> atomone.gov.v1.QueryDepositRequest + 14, // 37: atomone.gov.v1.Query.Deposits:input_type -> atomone.gov.v1.QueryDepositsRequest + 16, // 38: atomone.gov.v1.Query.TallyResult:input_type -> atomone.gov.v1.QueryTallyResultRequest + 18, // 39: atomone.gov.v1.Query.MinDeposit:input_type -> atomone.gov.v1.QueryMinDepositRequest + 20, // 40: atomone.gov.v1.Query.MinInitialDeposit:input_type -> atomone.gov.v1.QueryMinInitialDepositRequest + 22, // 41: atomone.gov.v1.Query.Quorums:input_type -> atomone.gov.v1.QueryQuorumsRequest + 24, // 42: atomone.gov.v1.Query.Governor:input_type -> atomone.gov.v1.QueryGovernorRequest + 26, // 43: atomone.gov.v1.Query.Governors:input_type -> atomone.gov.v1.QueryGovernorsRequest + 28, // 44: atomone.gov.v1.Query.GovernanceDelegations:input_type -> atomone.gov.v1.QueryGovernanceDelegationsRequest + 30, // 45: atomone.gov.v1.Query.GovernanceDelegation:input_type -> atomone.gov.v1.QueryGovernanceDelegationRequest + 32, // 46: atomone.gov.v1.Query.GovernorValShares:input_type -> atomone.gov.v1.QueryGovernorValSharesRequest + 1, // 47: atomone.gov.v1.Query.Constitution:output_type -> atomone.gov.v1.QueryConstitutionResponse + 3, // 48: atomone.gov.v1.Query.Proposal:output_type -> atomone.gov.v1.QueryProposalResponse + 5, // 49: atomone.gov.v1.Query.Proposals:output_type -> atomone.gov.v1.QueryProposalsResponse + 7, // 50: atomone.gov.v1.Query.Vote:output_type -> atomone.gov.v1.QueryVoteResponse + 9, // 51: atomone.gov.v1.Query.Votes:output_type -> atomone.gov.v1.QueryVotesResponse + 11, // 52: atomone.gov.v1.Query.Params:output_type -> atomone.gov.v1.QueryParamsResponse + 13, // 53: atomone.gov.v1.Query.Deposit:output_type -> atomone.gov.v1.QueryDepositResponse + 15, // 54: atomone.gov.v1.Query.Deposits:output_type -> atomone.gov.v1.QueryDepositsResponse + 17, // 55: atomone.gov.v1.Query.TallyResult:output_type -> atomone.gov.v1.QueryTallyResultResponse + 19, // 56: atomone.gov.v1.Query.MinDeposit:output_type -> atomone.gov.v1.QueryMinDepositResponse + 21, // 57: atomone.gov.v1.Query.MinInitialDeposit:output_type -> atomone.gov.v1.QueryMinInitialDepositResponse + 23, // 58: atomone.gov.v1.Query.Quorums:output_type -> atomone.gov.v1.QueryQuorumsResponse + 25, // 59: atomone.gov.v1.Query.Governor:output_type -> atomone.gov.v1.QueryGovernorResponse + 27, // 60: atomone.gov.v1.Query.Governors:output_type -> atomone.gov.v1.QueryGovernorsResponse + 29, // 61: atomone.gov.v1.Query.GovernanceDelegations:output_type -> atomone.gov.v1.QueryGovernanceDelegationsResponse + 31, // 62: atomone.gov.v1.Query.GovernanceDelegation:output_type -> atomone.gov.v1.QueryGovernanceDelegationResponse + 33, // 63: atomone.gov.v1.Query.GovernorValShares:output_type -> atomone.gov.v1.QueryGovernorValSharesResponse + 47, // [47:64] is the sub-list for method output_type + 30, // [30:47] is the sub-list for method input_type + 30, // [30:30] is the sub-list for extension type_name + 30, // [30:30] is the sub-list for extension extendee + 0, // [0:30] is the sub-list for field type_name } func init() { file_atomone_gov_v1_query_proto_init() } @@ -12975,6 +18405,126 @@ func file_atomone_gov_v1_query_proto_init() { return nil } } + file_atomone_gov_v1_query_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_query_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_query_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernorsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_query_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernorsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_query_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernanceDelegationsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_query_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernanceDelegationsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_query_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernanceDelegationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_query_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernanceDelegationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_query_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernorValSharesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_query_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGovernorValSharesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -12982,7 +18532,7 @@ func file_atomone_gov_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_atomone_gov_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 24, + NumMessages: 34, NumExtensions: 0, NumServices: 1, }, diff --git a/api/atomone/gov/v1/query_grpc.pb.go b/api/atomone/gov/v1/query_grpc.pb.go index 77932c8d..546f9686 100644 --- a/api/atomone/gov/v1/query_grpc.pb.go +++ b/api/atomone/gov/v1/query_grpc.pb.go @@ -21,18 +21,23 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Query_Constitution_FullMethodName = "/atomone.gov.v1.Query/Constitution" - Query_Proposal_FullMethodName = "/atomone.gov.v1.Query/Proposal" - Query_Proposals_FullMethodName = "/atomone.gov.v1.Query/Proposals" - Query_Vote_FullMethodName = "/atomone.gov.v1.Query/Vote" - Query_Votes_FullMethodName = "/atomone.gov.v1.Query/Votes" - Query_Params_FullMethodName = "/atomone.gov.v1.Query/Params" - Query_Deposit_FullMethodName = "/atomone.gov.v1.Query/Deposit" - Query_Deposits_FullMethodName = "/atomone.gov.v1.Query/Deposits" - Query_TallyResult_FullMethodName = "/atomone.gov.v1.Query/TallyResult" - Query_MinDeposit_FullMethodName = "/atomone.gov.v1.Query/MinDeposit" - Query_MinInitialDeposit_FullMethodName = "/atomone.gov.v1.Query/MinInitialDeposit" - Query_Quorums_FullMethodName = "/atomone.gov.v1.Query/Quorums" + Query_Constitution_FullMethodName = "/atomone.gov.v1.Query/Constitution" + Query_Proposal_FullMethodName = "/atomone.gov.v1.Query/Proposal" + Query_Proposals_FullMethodName = "/atomone.gov.v1.Query/Proposals" + Query_Vote_FullMethodName = "/atomone.gov.v1.Query/Vote" + Query_Votes_FullMethodName = "/atomone.gov.v1.Query/Votes" + Query_Params_FullMethodName = "/atomone.gov.v1.Query/Params" + Query_Deposit_FullMethodName = "/atomone.gov.v1.Query/Deposit" + Query_Deposits_FullMethodName = "/atomone.gov.v1.Query/Deposits" + Query_TallyResult_FullMethodName = "/atomone.gov.v1.Query/TallyResult" + Query_MinDeposit_FullMethodName = "/atomone.gov.v1.Query/MinDeposit" + Query_MinInitialDeposit_FullMethodName = "/atomone.gov.v1.Query/MinInitialDeposit" + Query_Quorums_FullMethodName = "/atomone.gov.v1.Query/Quorums" + Query_Governor_FullMethodName = "/atomone.gov.v1.Query/Governor" + Query_Governors_FullMethodName = "/atomone.gov.v1.Query/Governors" + Query_GovernanceDelegations_FullMethodName = "/atomone.gov.v1.Query/GovernanceDelegations" + Query_GovernanceDelegation_FullMethodName = "/atomone.gov.v1.Query/GovernanceDelegation" + Query_GovernorValShares_FullMethodName = "/atomone.gov.v1.Query/GovernorValShares" ) // QueryClient is the client API for Query service. @@ -67,6 +72,16 @@ type QueryClient interface { MinInitialDeposit(ctx context.Context, in *QueryMinInitialDepositRequest, opts ...grpc.CallOption) (*QueryMinInitialDepositResponse, error) // Quorums queries the dynamically set quorums. Quorums(ctx context.Context, in *QueryQuorumsRequest, opts ...grpc.CallOption) (*QueryQuorumsResponse, 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 virtual validator shares resulting from all governance delegations. + GovernorValShares(ctx context.Context, in *QueryGovernorValSharesRequest, opts ...grpc.CallOption) (*QueryGovernorValSharesResponse, error) } type queryClient struct { @@ -197,6 +212,56 @@ func (c *queryClient) Quorums(ctx context.Context, in *QueryQuorumsRequest, opts return out, nil } +func (c *queryClient) Governor(ctx context.Context, in *QueryGovernorRequest, opts ...grpc.CallOption) (*QueryGovernorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGovernorResponse) + err := c.cc.Invoke(ctx, Query_Governor_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Governors(ctx context.Context, in *QueryGovernorsRequest, opts ...grpc.CallOption) (*QueryGovernorsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGovernorsResponse) + err := c.cc.Invoke(ctx, Query_Governors_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GovernanceDelegations(ctx context.Context, in *QueryGovernanceDelegationsRequest, opts ...grpc.CallOption) (*QueryGovernanceDelegationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGovernanceDelegationsResponse) + err := c.cc.Invoke(ctx, Query_GovernanceDelegations_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GovernanceDelegation(ctx context.Context, in *QueryGovernanceDelegationRequest, opts ...grpc.CallOption) (*QueryGovernanceDelegationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGovernanceDelegationResponse) + err := c.cc.Invoke(ctx, Query_GovernanceDelegation_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GovernorValShares(ctx context.Context, in *QueryGovernorValSharesRequest, opts ...grpc.CallOption) (*QueryGovernorValSharesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGovernorValSharesResponse) + err := c.cc.Invoke(ctx, Query_GovernorValShares_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility. @@ -229,6 +294,16 @@ type QueryServer interface { MinInitialDeposit(context.Context, *QueryMinInitialDepositRequest) (*QueryMinInitialDepositResponse, error) // Quorums queries the dynamically set quorums. Quorums(context.Context, *QueryQuorumsRequest) (*QueryQuorumsResponse, 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 virtual validator shares resulting from all governance delegations. + GovernorValShares(context.Context, *QueryGovernorValSharesRequest) (*QueryGovernorValSharesResponse, error) mustEmbedUnimplementedQueryServer() } @@ -275,6 +350,21 @@ func (UnimplementedQueryServer) MinInitialDeposit(context.Context, *QueryMinInit func (UnimplementedQueryServer) Quorums(context.Context, *QueryQuorumsRequest) (*QueryQuorumsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Quorums not implemented") } +func (UnimplementedQueryServer) Governor(context.Context, *QueryGovernorRequest) (*QueryGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Governor not implemented") +} +func (UnimplementedQueryServer) Governors(context.Context, *QueryGovernorsRequest) (*QueryGovernorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Governors not implemented") +} +func (UnimplementedQueryServer) GovernanceDelegations(context.Context, *QueryGovernanceDelegationsRequest) (*QueryGovernanceDelegationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovernanceDelegations not implemented") +} +func (UnimplementedQueryServer) GovernanceDelegation(context.Context, *QueryGovernanceDelegationRequest) (*QueryGovernanceDelegationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovernanceDelegation not implemented") +} +func (UnimplementedQueryServer) GovernorValShares(context.Context, *QueryGovernorValSharesRequest) (*QueryGovernorValSharesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovernorValShares not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} func (UnimplementedQueryServer) testEmbeddedByValue() {} @@ -512,6 +602,96 @@ func _Query_Quorums_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +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 + } + if interceptor == nil { + return srv.(QueryServer).Governor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Governor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Governor(ctx, req.(*QueryGovernorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +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 + } + if interceptor == nil { + return srv.(QueryServer).Governors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Governors_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Governors(ctx, req.(*QueryGovernorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +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 + } + if interceptor == nil { + return srv.(QueryServer).GovernanceDelegations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GovernanceDelegations_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GovernanceDelegations(ctx, req.(*QueryGovernanceDelegationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +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 + } + if interceptor == nil { + return srv.(QueryServer).GovernanceDelegation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GovernanceDelegation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GovernanceDelegation(ctx, req.(*QueryGovernanceDelegationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +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 + } + if interceptor == nil { + return srv.(QueryServer).GovernorValShares(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GovernorValShares_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GovernorValShares(ctx, req.(*QueryGovernorValSharesRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -567,6 +747,26 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Quorums", Handler: _Query_Quorums_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", diff --git a/api/atomone/gov/v1/tx.pulsar.go b/api/atomone/gov/v1/tx.pulsar.go index 6734008d..d69042ef 100644 --- a/api/atomone/gov/v1/tx.pulsar.go +++ b/api/atomone/gov/v1/tx.pulsar.go @@ -7560,704 +7560,5205 @@ func (x *fastReflection_MsgProposeConstitutionAmendmentResponse) ProtoMethods() } } +var ( + md_MsgCreateGovernor protoreflect.MessageDescriptor + fd_MsgCreateGovernor_address protoreflect.FieldDescriptor + fd_MsgCreateGovernor_description protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgCreateGovernor = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgCreateGovernor") + fd_MsgCreateGovernor_address = md_MsgCreateGovernor.Fields().ByName("address") + fd_MsgCreateGovernor_description = md_MsgCreateGovernor.Fields().ByName("description") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateGovernor)(nil) + +type fastReflection_MsgCreateGovernor MsgCreateGovernor + +func (x *MsgCreateGovernor) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateGovernor)(x) +} + +func (x *MsgCreateGovernor) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgCreateGovernor_messageType fastReflection_MsgCreateGovernor_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateGovernor_messageType{} + +type fastReflection_MsgCreateGovernor_messageType struct{} + +func (x fastReflection_MsgCreateGovernor_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateGovernor)(nil) +} +func (x fastReflection_MsgCreateGovernor_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateGovernor) +} +func (x fastReflection_MsgCreateGovernor_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateGovernor +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateGovernor) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateGovernor +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgCreateGovernor) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateGovernor_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateGovernor) New() protoreflect.Message { + return new(fastReflection_MsgCreateGovernor) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateGovernor) Interface() protoreflect.ProtoMessage { + return (*MsgCreateGovernor)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgCreateGovernor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgCreateGovernor_address, value) { + return + } + } + if x.Description != nil { + value := protoreflect.ValueOfMessage(x.Description.ProtoReflect()) + if !f(fd_MsgCreateGovernor_description, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgCreateGovernor) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.MsgCreateGovernor.address": + return x.Address != "" + case "atomone.gov.v1.MsgCreateGovernor.description": + return x.Description != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernor does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCreateGovernor) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.MsgCreateGovernor.address": + x.Address = "" + case "atomone.gov.v1.MsgCreateGovernor.description": + x.Description = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernor does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgCreateGovernor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.MsgCreateGovernor.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.MsgCreateGovernor.description": + value := x.Description + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernor does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCreateGovernor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.MsgCreateGovernor.address": + x.Address = value.Interface().(string) + case "atomone.gov.v1.MsgCreateGovernor.description": + x.Description = value.Message().Interface().(*GovernorDescription) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernor does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCreateGovernor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgCreateGovernor.description": + if x.Description == nil { + x.Description = new(GovernorDescription) + } + return protoreflect.ValueOfMessage(x.Description.ProtoReflect()) + case "atomone.gov.v1.MsgCreateGovernor.address": + panic(fmt.Errorf("field address of message atomone.gov.v1.MsgCreateGovernor is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernor does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgCreateGovernor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgCreateGovernor.address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.MsgCreateGovernor.description": + m := new(GovernorDescription) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernor does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgCreateGovernor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgCreateGovernor", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgCreateGovernor) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCreateGovernor) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgCreateGovernor) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgCreateGovernor) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateGovernor) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Description != nil { + l = options.Size(x.Description) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgCreateGovernor) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Description != nil { + encoded, err := options.Marshal(x.Description) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgCreateGovernor) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateGovernor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateGovernor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Description == nil { + x.Description = &GovernorDescription{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Description); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgCreateGovernorResponse protoreflect.MessageDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgCreateGovernorResponse = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgCreateGovernorResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateGovernorResponse)(nil) + +type fastReflection_MsgCreateGovernorResponse MsgCreateGovernorResponse + +func (x *MsgCreateGovernorResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateGovernorResponse)(x) +} + +func (x *MsgCreateGovernorResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgCreateGovernorResponse_messageType fastReflection_MsgCreateGovernorResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateGovernorResponse_messageType{} + +type fastReflection_MsgCreateGovernorResponse_messageType struct{} + +func (x fastReflection_MsgCreateGovernorResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateGovernorResponse)(nil) +} +func (x fastReflection_MsgCreateGovernorResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateGovernorResponse) +} +func (x fastReflection_MsgCreateGovernorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateGovernorResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateGovernorResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateGovernorResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgCreateGovernorResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateGovernorResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateGovernorResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateGovernorResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateGovernorResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateGovernorResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgCreateGovernorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgCreateGovernorResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCreateGovernorResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgCreateGovernorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernorResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCreateGovernorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCreateGovernorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgCreateGovernorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgCreateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgCreateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgCreateGovernorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgCreateGovernorResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgCreateGovernorResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCreateGovernorResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgCreateGovernorResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgCreateGovernorResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateGovernorResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgCreateGovernorResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgCreateGovernorResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateGovernorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgEditGovernor protoreflect.MessageDescriptor + fd_MsgEditGovernor_address protoreflect.FieldDescriptor + fd_MsgEditGovernor_description protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgEditGovernor = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgEditGovernor") + fd_MsgEditGovernor_address = md_MsgEditGovernor.Fields().ByName("address") + fd_MsgEditGovernor_description = md_MsgEditGovernor.Fields().ByName("description") +} + +var _ protoreflect.Message = (*fastReflection_MsgEditGovernor)(nil) + +type fastReflection_MsgEditGovernor MsgEditGovernor + +func (x *MsgEditGovernor) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgEditGovernor)(x) +} + +func (x *MsgEditGovernor) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgEditGovernor_messageType fastReflection_MsgEditGovernor_messageType +var _ protoreflect.MessageType = fastReflection_MsgEditGovernor_messageType{} + +type fastReflection_MsgEditGovernor_messageType struct{} + +func (x fastReflection_MsgEditGovernor_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgEditGovernor)(nil) +} +func (x fastReflection_MsgEditGovernor_messageType) New() protoreflect.Message { + return new(fastReflection_MsgEditGovernor) +} +func (x fastReflection_MsgEditGovernor_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditGovernor +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgEditGovernor) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditGovernor +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgEditGovernor) Type() protoreflect.MessageType { + return _fastReflection_MsgEditGovernor_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgEditGovernor) New() protoreflect.Message { + return new(fastReflection_MsgEditGovernor) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgEditGovernor) Interface() protoreflect.ProtoMessage { + return (*MsgEditGovernor)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgEditGovernor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgEditGovernor_address, value) { + return + } + } + if x.Description != nil { + value := protoreflect.ValueOfMessage(x.Description.ProtoReflect()) + if !f(fd_MsgEditGovernor_description, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgEditGovernor) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.MsgEditGovernor.address": + return x.Address != "" + case "atomone.gov.v1.MsgEditGovernor.description": + return x.Description != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernor does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEditGovernor) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.MsgEditGovernor.address": + x.Address = "" + case "atomone.gov.v1.MsgEditGovernor.description": + x.Description = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernor does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgEditGovernor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.MsgEditGovernor.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.MsgEditGovernor.description": + value := x.Description + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernor does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEditGovernor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.MsgEditGovernor.address": + x.Address = value.Interface().(string) + case "atomone.gov.v1.MsgEditGovernor.description": + x.Description = value.Message().Interface().(*GovernorDescription) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernor does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEditGovernor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgEditGovernor.description": + if x.Description == nil { + x.Description = new(GovernorDescription) + } + return protoreflect.ValueOfMessage(x.Description.ProtoReflect()) + case "atomone.gov.v1.MsgEditGovernor.address": + panic(fmt.Errorf("field address of message atomone.gov.v1.MsgEditGovernor is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernor does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgEditGovernor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgEditGovernor.address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.MsgEditGovernor.description": + m := new(GovernorDescription) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernor does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgEditGovernor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgEditGovernor", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgEditGovernor) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEditGovernor) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgEditGovernor) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgEditGovernor) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgEditGovernor) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Description != nil { + l = options.Size(x.Description) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgEditGovernor) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Description != nil { + encoded, err := options.Marshal(x.Description) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgEditGovernor) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEditGovernor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEditGovernor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Description == nil { + x.Description = &GovernorDescription{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Description); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgEditGovernorResponse protoreflect.MessageDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgEditGovernorResponse = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgEditGovernorResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgEditGovernorResponse)(nil) + +type fastReflection_MsgEditGovernorResponse MsgEditGovernorResponse + +func (x *MsgEditGovernorResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgEditGovernorResponse)(x) +} + +func (x *MsgEditGovernorResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgEditGovernorResponse_messageType fastReflection_MsgEditGovernorResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgEditGovernorResponse_messageType{} + +type fastReflection_MsgEditGovernorResponse_messageType struct{} + +func (x fastReflection_MsgEditGovernorResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgEditGovernorResponse)(nil) +} +func (x fastReflection_MsgEditGovernorResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgEditGovernorResponse) +} +func (x fastReflection_MsgEditGovernorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditGovernorResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgEditGovernorResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEditGovernorResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgEditGovernorResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgEditGovernorResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgEditGovernorResponse) New() protoreflect.Message { + return new(fastReflection_MsgEditGovernorResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgEditGovernorResponse) Interface() protoreflect.ProtoMessage { + return (*MsgEditGovernorResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgEditGovernorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgEditGovernorResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEditGovernorResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgEditGovernorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernorResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEditGovernorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEditGovernorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgEditGovernorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgEditGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgEditGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgEditGovernorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgEditGovernorResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgEditGovernorResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgEditGovernorResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgEditGovernorResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgEditGovernorResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgEditGovernorResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgEditGovernorResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgEditGovernorResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEditGovernorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEditGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateGovernorStatus protoreflect.MessageDescriptor + fd_MsgUpdateGovernorStatus_address protoreflect.FieldDescriptor + fd_MsgUpdateGovernorStatus_status protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgUpdateGovernorStatus = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgUpdateGovernorStatus") + fd_MsgUpdateGovernorStatus_address = md_MsgUpdateGovernorStatus.Fields().ByName("address") + fd_MsgUpdateGovernorStatus_status = md_MsgUpdateGovernorStatus.Fields().ByName("status") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateGovernorStatus)(nil) + +type fastReflection_MsgUpdateGovernorStatus MsgUpdateGovernorStatus + +func (x *MsgUpdateGovernorStatus) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateGovernorStatus)(x) +} + +func (x *MsgUpdateGovernorStatus) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateGovernorStatus_messageType fastReflection_MsgUpdateGovernorStatus_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateGovernorStatus_messageType{} + +type fastReflection_MsgUpdateGovernorStatus_messageType struct{} + +func (x fastReflection_MsgUpdateGovernorStatus_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateGovernorStatus)(nil) +} +func (x fastReflection_MsgUpdateGovernorStatus_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateGovernorStatus) +} +func (x fastReflection_MsgUpdateGovernorStatus_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateGovernorStatus +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateGovernorStatus) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateGovernorStatus +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateGovernorStatus) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateGovernorStatus_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateGovernorStatus) New() protoreflect.Message { + return new(fastReflection_MsgUpdateGovernorStatus) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateGovernorStatus) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateGovernorStatus)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateGovernorStatus) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgUpdateGovernorStatus_address, value) { + return + } + } + if x.Status != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Status)) + if !f(fd_MsgUpdateGovernorStatus_status, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateGovernorStatus) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.MsgUpdateGovernorStatus.address": + return x.Address != "" + case "atomone.gov.v1.MsgUpdateGovernorStatus.status": + return x.Status != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatus")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatus does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateGovernorStatus) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.MsgUpdateGovernorStatus.address": + x.Address = "" + case "atomone.gov.v1.MsgUpdateGovernorStatus.status": + x.Status = 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatus")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatus does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateGovernorStatus) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.MsgUpdateGovernorStatus.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.MsgUpdateGovernorStatus.status": + value := x.Status + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatus")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatus does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateGovernorStatus) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.MsgUpdateGovernorStatus.address": + x.Address = value.Interface().(string) + case "atomone.gov.v1.MsgUpdateGovernorStatus.status": + x.Status = (GovernorStatus)(value.Enum()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatus")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatus does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateGovernorStatus) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgUpdateGovernorStatus.address": + panic(fmt.Errorf("field address of message atomone.gov.v1.MsgUpdateGovernorStatus is not mutable")) + case "atomone.gov.v1.MsgUpdateGovernorStatus.status": + panic(fmt.Errorf("field status of message atomone.gov.v1.MsgUpdateGovernorStatus is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatus")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatus does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateGovernorStatus) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgUpdateGovernorStatus.address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.MsgUpdateGovernorStatus.status": + return protoreflect.ValueOfEnum(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatus")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatus does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateGovernorStatus) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgUpdateGovernorStatus", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateGovernorStatus) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateGovernorStatus) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateGovernorStatus) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateGovernorStatus) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateGovernorStatus) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateGovernorStatus) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x10 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateGovernorStatus) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateGovernorStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateGovernorStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Status |= GovernorStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateGovernorStatusResponse protoreflect.MessageDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgUpdateGovernorStatusResponse = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgUpdateGovernorStatusResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateGovernorStatusResponse)(nil) + +type fastReflection_MsgUpdateGovernorStatusResponse MsgUpdateGovernorStatusResponse + +func (x *MsgUpdateGovernorStatusResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateGovernorStatusResponse)(x) +} + +func (x *MsgUpdateGovernorStatusResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateGovernorStatusResponse_messageType fastReflection_MsgUpdateGovernorStatusResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateGovernorStatusResponse_messageType{} + +type fastReflection_MsgUpdateGovernorStatusResponse_messageType struct{} + +func (x fastReflection_MsgUpdateGovernorStatusResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateGovernorStatusResponse)(nil) +} +func (x fastReflection_MsgUpdateGovernorStatusResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateGovernorStatusResponse) +} +func (x fastReflection_MsgUpdateGovernorStatusResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateGovernorStatusResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateGovernorStatusResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateGovernorStatusResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateGovernorStatusResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateGovernorStatusResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatusResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatusResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatusResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatusResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatusResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatusResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatusResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatusResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatusResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatusResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUpdateGovernorStatusResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUpdateGovernorStatusResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgUpdateGovernorStatusResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateGovernorStatusResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateGovernorStatusResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateGovernorStatusResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateGovernorStatusResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateGovernorStatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateGovernorStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgDelegateGovernor protoreflect.MessageDescriptor + fd_MsgDelegateGovernor_delegator_address protoreflect.FieldDescriptor + fd_MsgDelegateGovernor_governor_address protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgDelegateGovernor = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgDelegateGovernor") + fd_MsgDelegateGovernor_delegator_address = md_MsgDelegateGovernor.Fields().ByName("delegator_address") + fd_MsgDelegateGovernor_governor_address = md_MsgDelegateGovernor.Fields().ByName("governor_address") +} + +var _ protoreflect.Message = (*fastReflection_MsgDelegateGovernor)(nil) + +type fastReflection_MsgDelegateGovernor MsgDelegateGovernor + +func (x *MsgDelegateGovernor) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgDelegateGovernor)(x) +} + +func (x *MsgDelegateGovernor) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgDelegateGovernor_messageType fastReflection_MsgDelegateGovernor_messageType +var _ protoreflect.MessageType = fastReflection_MsgDelegateGovernor_messageType{} + +type fastReflection_MsgDelegateGovernor_messageType struct{} + +func (x fastReflection_MsgDelegateGovernor_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgDelegateGovernor)(nil) +} +func (x fastReflection_MsgDelegateGovernor_messageType) New() protoreflect.Message { + return new(fastReflection_MsgDelegateGovernor) +} +func (x fastReflection_MsgDelegateGovernor_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDelegateGovernor +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgDelegateGovernor) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDelegateGovernor +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgDelegateGovernor) Type() protoreflect.MessageType { + return _fastReflection_MsgDelegateGovernor_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgDelegateGovernor) New() protoreflect.Message { + return new(fastReflection_MsgDelegateGovernor) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgDelegateGovernor) Interface() protoreflect.ProtoMessage { + return (*MsgDelegateGovernor)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgDelegateGovernor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DelegatorAddress != "" { + value := protoreflect.ValueOfString(x.DelegatorAddress) + if !f(fd_MsgDelegateGovernor_delegator_address, value) { + return + } + } + if x.GovernorAddress != "" { + value := protoreflect.ValueOfString(x.GovernorAddress) + if !f(fd_MsgDelegateGovernor_governor_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgDelegateGovernor) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.MsgDelegateGovernor.delegator_address": + return x.DelegatorAddress != "" + case "atomone.gov.v1.MsgDelegateGovernor.governor_address": + return x.GovernorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgDelegateGovernor) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.MsgDelegateGovernor.delegator_address": + x.DelegatorAddress = "" + case "atomone.gov.v1.MsgDelegateGovernor.governor_address": + x.GovernorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgDelegateGovernor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.MsgDelegateGovernor.delegator_address": + value := x.DelegatorAddress + return protoreflect.ValueOfString(value) + case "atomone.gov.v1.MsgDelegateGovernor.governor_address": + value := x.GovernorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernor does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgDelegateGovernor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.MsgDelegateGovernor.delegator_address": + x.DelegatorAddress = value.Interface().(string) + case "atomone.gov.v1.MsgDelegateGovernor.governor_address": + x.GovernorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgDelegateGovernor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgDelegateGovernor.delegator_address": + panic(fmt.Errorf("field delegator_address of message atomone.gov.v1.MsgDelegateGovernor is not mutable")) + case "atomone.gov.v1.MsgDelegateGovernor.governor_address": + panic(fmt.Errorf("field governor_address of message atomone.gov.v1.MsgDelegateGovernor is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgDelegateGovernor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgDelegateGovernor.delegator_address": + return protoreflect.ValueOfString("") + case "atomone.gov.v1.MsgDelegateGovernor.governor_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgDelegateGovernor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgDelegateGovernor", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgDelegateGovernor) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgDelegateGovernor) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgDelegateGovernor) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgDelegateGovernor) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgDelegateGovernor) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.DelegatorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.GovernorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgDelegateGovernor) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.GovernorAddress) > 0 { + i -= len(x.GovernorAddress) + copy(dAtA[i:], x.GovernorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GovernorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.DelegatorAddress) > 0 { + i -= len(x.DelegatorAddress) + copy(dAtA[i:], x.DelegatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgDelegateGovernor) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgDelegateGovernor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgDelegateGovernor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovernorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.GovernorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgDelegateGovernorResponse protoreflect.MessageDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgDelegateGovernorResponse = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgDelegateGovernorResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgDelegateGovernorResponse)(nil) + +type fastReflection_MsgDelegateGovernorResponse MsgDelegateGovernorResponse + +func (x *MsgDelegateGovernorResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgDelegateGovernorResponse)(x) +} + +func (x *MsgDelegateGovernorResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgDelegateGovernorResponse_messageType fastReflection_MsgDelegateGovernorResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgDelegateGovernorResponse_messageType{} + +type fastReflection_MsgDelegateGovernorResponse_messageType struct{} + +func (x fastReflection_MsgDelegateGovernorResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgDelegateGovernorResponse)(nil) +} +func (x fastReflection_MsgDelegateGovernorResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgDelegateGovernorResponse) +} +func (x fastReflection_MsgDelegateGovernorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDelegateGovernorResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgDelegateGovernorResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgDelegateGovernorResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgDelegateGovernorResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgDelegateGovernorResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgDelegateGovernorResponse) New() protoreflect.Message { + return new(fastReflection_MsgDelegateGovernorResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgDelegateGovernorResponse) Interface() protoreflect.ProtoMessage { + return (*MsgDelegateGovernorResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgDelegateGovernorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgDelegateGovernorResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgDelegateGovernorResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgDelegateGovernorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernorResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgDelegateGovernorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgDelegateGovernorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgDelegateGovernorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgDelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgDelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgDelegateGovernorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgDelegateGovernorResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgDelegateGovernorResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgDelegateGovernorResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgDelegateGovernorResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgDelegateGovernorResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgDelegateGovernorResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgDelegateGovernorResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgDelegateGovernorResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgDelegateGovernorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgDelegateGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUndelegateGovernor protoreflect.MessageDescriptor + fd_MsgUndelegateGovernor_delegator_address protoreflect.FieldDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgUndelegateGovernor = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgUndelegateGovernor") + fd_MsgUndelegateGovernor_delegator_address = md_MsgUndelegateGovernor.Fields().ByName("delegator_address") +} + +var _ protoreflect.Message = (*fastReflection_MsgUndelegateGovernor)(nil) + +type fastReflection_MsgUndelegateGovernor MsgUndelegateGovernor + +func (x *MsgUndelegateGovernor) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUndelegateGovernor)(x) +} + +func (x *MsgUndelegateGovernor) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUndelegateGovernor_messageType fastReflection_MsgUndelegateGovernor_messageType +var _ protoreflect.MessageType = fastReflection_MsgUndelegateGovernor_messageType{} + +type fastReflection_MsgUndelegateGovernor_messageType struct{} + +func (x fastReflection_MsgUndelegateGovernor_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUndelegateGovernor)(nil) +} +func (x fastReflection_MsgUndelegateGovernor_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUndelegateGovernor) +} +func (x fastReflection_MsgUndelegateGovernor_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUndelegateGovernor +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUndelegateGovernor) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUndelegateGovernor +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUndelegateGovernor) Type() protoreflect.MessageType { + return _fastReflection_MsgUndelegateGovernor_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUndelegateGovernor) New() protoreflect.Message { + return new(fastReflection_MsgUndelegateGovernor) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUndelegateGovernor) Interface() protoreflect.ProtoMessage { + return (*MsgUndelegateGovernor)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUndelegateGovernor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DelegatorAddress != "" { + value := protoreflect.ValueOfString(x.DelegatorAddress) + if !f(fd_MsgUndelegateGovernor_delegator_address, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUndelegateGovernor) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "atomone.gov.v1.MsgUndelegateGovernor.delegator_address": + return x.DelegatorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUndelegateGovernor) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "atomone.gov.v1.MsgUndelegateGovernor.delegator_address": + x.DelegatorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUndelegateGovernor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "atomone.gov.v1.MsgUndelegateGovernor.delegator_address": + value := x.DelegatorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernor does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUndelegateGovernor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "atomone.gov.v1.MsgUndelegateGovernor.delegator_address": + x.DelegatorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUndelegateGovernor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgUndelegateGovernor.delegator_address": + panic(fmt.Errorf("field delegator_address of message atomone.gov.v1.MsgUndelegateGovernor is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUndelegateGovernor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "atomone.gov.v1.MsgUndelegateGovernor.delegator_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernor")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernor does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUndelegateGovernor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgUndelegateGovernor", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUndelegateGovernor) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUndelegateGovernor) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUndelegateGovernor) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUndelegateGovernor) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUndelegateGovernor) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.DelegatorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUndelegateGovernor) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.DelegatorAddress) > 0 { + i -= len(x.DelegatorAddress) + copy(dAtA[i:], x.DelegatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUndelegateGovernor) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUndelegateGovernor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUndelegateGovernor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUndelegateGovernorResponse protoreflect.MessageDescriptor +) + +func init() { + file_atomone_gov_v1_tx_proto_init() + md_MsgUndelegateGovernorResponse = File_atomone_gov_v1_tx_proto.Messages().ByName("MsgUndelegateGovernorResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUndelegateGovernorResponse)(nil) + +type fastReflection_MsgUndelegateGovernorResponse MsgUndelegateGovernorResponse + +func (x *MsgUndelegateGovernorResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUndelegateGovernorResponse)(x) +} + +func (x *MsgUndelegateGovernorResponse) slowProtoReflect() protoreflect.Message { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUndelegateGovernorResponse_messageType fastReflection_MsgUndelegateGovernorResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUndelegateGovernorResponse_messageType{} + +type fastReflection_MsgUndelegateGovernorResponse_messageType struct{} + +func (x fastReflection_MsgUndelegateGovernorResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUndelegateGovernorResponse)(nil) +} +func (x fastReflection_MsgUndelegateGovernorResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUndelegateGovernorResponse) +} +func (x fastReflection_MsgUndelegateGovernorResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUndelegateGovernorResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUndelegateGovernorResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUndelegateGovernorResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUndelegateGovernorResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUndelegateGovernorResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUndelegateGovernorResponse) New() protoreflect.Message { + return new(fastReflection_MsgUndelegateGovernorResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUndelegateGovernorResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUndelegateGovernorResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUndelegateGovernorResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUndelegateGovernorResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUndelegateGovernorResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUndelegateGovernorResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernorResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUndelegateGovernorResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUndelegateGovernorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUndelegateGovernorResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: atomone.gov.v1.MsgUndelegateGovernorResponse")) + } + panic(fmt.Errorf("message atomone.gov.v1.MsgUndelegateGovernorResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUndelegateGovernorResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in atomone.gov.v1.MsgUndelegateGovernorResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUndelegateGovernorResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUndelegateGovernorResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUndelegateGovernorResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUndelegateGovernorResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUndelegateGovernorResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUndelegateGovernorResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUndelegateGovernorResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUndelegateGovernorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUndelegateGovernorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Since: cosmos-sdk 0.46 -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: atomone/gov/v1/tx.proto +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: atomone/gov/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +type MsgSubmitProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // messages are the arbitrary messages to be executed if proposal passes. + Messages []*anypb.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + // initial_deposit is the deposit value that must be paid at proposal + // submission. + InitialDeposit []*v1beta1.Coin `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit,omitempty"` + // proposer is the account address of the proposer. + Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` + // metadata is any arbitrary metadata attached to the proposal. + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + // summary is the summary of the proposal + // + // Since: cosmos-sdk 0.47 + Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` +} + +func (x *MsgSubmitProposal) Reset() { + *x = MsgSubmitProposal{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSubmitProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSubmitProposal) ProtoMessage() {} + +// Deprecated: Use MsgSubmitProposal.ProtoReflect.Descriptor instead. +func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgSubmitProposal) GetMessages() []*anypb.Any { + if x != nil { + return x.Messages + } + return nil +} + +func (x *MsgSubmitProposal) GetInitialDeposit() []*v1beta1.Coin { + if x != nil { + return x.InitialDeposit + } + return nil +} + +func (x *MsgSubmitProposal) GetProposer() string { + if x != nil { + return x.Proposer + } + return "" +} + +func (x *MsgSubmitProposal) GetMetadata() string { + if x != nil { + return x.Metadata + } + return "" +} + +func (x *MsgSubmitProposal) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *MsgSubmitProposal) GetSummary() string { + if x != nil { + return x.Summary + } + return "" +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +type MsgSubmitProposalResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (x *MsgSubmitProposalResponse) Reset() { + *x = MsgSubmitProposalResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSubmitProposalResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSubmitProposalResponse) ProtoMessage() {} + +// Deprecated: Use MsgSubmitProposalResponse.ProtoReflect.Descriptor instead. +func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgSubmitProposalResponse) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +// MsgExecLegacyContent is used to wrap the legacy content field into a message. +// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +type MsgExecLegacyContent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // content is the proposal's content. + Content *anypb.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + // authority must be the gov module address. + Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *MsgExecLegacyContent) Reset() { + *x = MsgExecLegacyContent{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecLegacyContent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecLegacyContent) ProtoMessage() {} + +// Deprecated: Use MsgExecLegacyContent.ProtoReflect.Descriptor instead. +func (*MsgExecLegacyContent) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgExecLegacyContent) GetContent() *anypb.Any { + if x != nil { + return x.Content + } + return nil +} + +func (x *MsgExecLegacyContent) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +type MsgExecLegacyContentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgExecLegacyContentResponse) Reset() { + *x = MsgExecLegacyContentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecLegacyContentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecLegacyContentResponse) ProtoMessage() {} + +// Deprecated: Use MsgExecLegacyContentResponse.ProtoReflect.Descriptor instead. +func (*MsgExecLegacyContentResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{3} +} + +// MsgVote defines a message to cast a vote. +type MsgVote struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // voter is the voter address for the proposal. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // option defines the vote option. + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=atomone.gov.v1.VoteOption" json:"option,omitempty"` + // metadata is any arbitrary metadata attached to the Vote. + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *MsgVote) Reset() { + *x = MsgVote{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgVote) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgVote) ProtoMessage() {} + +// Deprecated: Use MsgVote.ProtoReflect.Descriptor instead. +func (*MsgVote) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgVote) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +func (x *MsgVote) GetVoter() string { + if x != nil { + return x.Voter + } + return "" +} + +func (x *MsgVote) GetOption() VoteOption { + if x != nil { + return x.Option + } + return VoteOption_VOTE_OPTION_UNSPECIFIED +} -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +func (x *MsgVote) GetMetadata() string { + if x != nil { + return x.Metadata + } + return "" +} -// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -// proposal Content. -type MsgSubmitProposal struct { +// MsgVoteResponse defines the Msg/Vote response type. +type MsgVoteResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields +} - // messages are the arbitrary messages to be executed if proposal passes. - Messages []*anypb.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` - // initial_deposit is the deposit value that must be paid at proposal - // submission. - InitialDeposit []*v1beta1.Coin `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit,omitempty"` - // proposer is the account address of the proposer. - Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` - // metadata is any arbitrary metadata attached to the proposal. +func (x *MsgVoteResponse) Reset() { + *x = MsgVoteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgVoteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgVoteResponse) ProtoMessage() {} + +// Deprecated: Use MsgVoteResponse.ProtoReflect.Descriptor instead. +func (*MsgVoteResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{5} +} + +// MsgVoteWeighted defines a message to cast a vote. +type MsgVoteWeighted struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // voter is the voter address for the proposal. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // options defines the weighted vote options. + Options []*WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` + // metadata is any arbitrary metadata attached to the VoteWeighted. Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` - // title is the title of the proposal. - // - // Since: cosmos-sdk 0.47 - Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` - // summary is the summary of the proposal - // - // Since: cosmos-sdk 0.47 - Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` } -func (x *MsgSubmitProposal) Reset() { - *x = MsgSubmitProposal{} +func (x *MsgVoteWeighted) Reset() { + *x = MsgVoteWeighted{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgVoteWeighted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgVoteWeighted) ProtoMessage() {} + +// Deprecated: Use MsgVoteWeighted.ProtoReflect.Descriptor instead. +func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgVoteWeighted) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +func (x *MsgVoteWeighted) GetVoter() string { + if x != nil { + return x.Voter + } + return "" +} + +func (x *MsgVoteWeighted) GetOptions() []*WeightedVoteOption { + if x != nil { + return x.Options + } + return nil +} + +func (x *MsgVoteWeighted) GetMetadata() string { + if x != nil { + return x.Metadata + } + return "" +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +type MsgVoteWeightedResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgVoteWeightedResponse) Reset() { + *x = MsgVoteWeightedResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgVoteWeightedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgVoteWeightedResponse) ProtoMessage() {} + +// Deprecated: Use MsgVoteWeightedResponse.ProtoReflect.Descriptor instead. +func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{7} +} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +type MsgDeposit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` + // amount to be deposited by depositor. + Amount []*v1beta1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *MsgDeposit) Reset() { + *x = MsgDeposit{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgDeposit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgDeposit) ProtoMessage() {} + +// Deprecated: Use MsgDeposit.ProtoReflect.Descriptor instead. +func (*MsgDeposit) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgDeposit) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +func (x *MsgDeposit) GetDepositor() string { + if x != nil { + return x.Depositor + } + return "" +} + +func (x *MsgDeposit) GetAmount() []*v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + +// MsgDepositResponse defines the Msg/Deposit response type. +type MsgDepositResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgDepositResponse) Reset() { + *x = MsgDepositResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_atomone_gov_v1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgDepositResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgDepositResponse) ProtoMessage() {} + +// Deprecated: Use MsgDepositResponse.ProtoReflect.Descriptor instead. +func (*MsgDepositResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{9} +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/gov parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[0] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgSubmitProposal) String() string { +func (x *MsgUpdateParams) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgSubmitProposal) ProtoMessage() {} - -// Deprecated: Use MsgSubmitProposal.ProtoReflect.Descriptor instead. -func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{0} -} - -func (x *MsgSubmitProposal) GetMessages() []*anypb.Any { - if x != nil { - return x.Messages - } - return nil -} - -func (x *MsgSubmitProposal) GetInitialDeposit() []*v1beta1.Coin { - if x != nil { - return x.InitialDeposit - } - return nil -} - -func (x *MsgSubmitProposal) GetProposer() string { - if x != nil { - return x.Proposer - } - return "" -} +func (*MsgUpdateParams) ProtoMessage() {} -func (x *MsgSubmitProposal) GetMetadata() string { - if x != nil { - return x.Metadata - } - return "" +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{10} } -func (x *MsgSubmitProposal) GetTitle() string { +func (x *MsgUpdateParams) GetAuthority() string { if x != nil { - return x.Title + return x.Authority } return "" } -func (x *MsgSubmitProposal) GetSummary() string { +func (x *MsgUpdateParams) GetParams() *Params { if x != nil { - return x.Summary + return x.Params } - return "" + return nil } -// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -type MsgSubmitProposalResponse struct { +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` } -func (x *MsgSubmitProposalResponse) Reset() { - *x = MsgSubmitProposalResponse{} +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[1] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgSubmitProposalResponse) String() string { +func (x *MsgUpdateParamsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgSubmitProposalResponse) ProtoMessage() {} - -// Deprecated: Use MsgSubmitProposalResponse.ProtoReflect.Descriptor instead. -func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{1} -} +func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (x *MsgSubmitProposalResponse) GetProposalId() uint64 { - if x != nil { - return x.ProposalId - } - return 0 +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{11} } -// MsgExecLegacyContent is used to wrap the legacy content field into a message. -// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. -type MsgExecLegacyContent struct { +// MsgLaw is the Msg/ProposeLaw request type. +type MsgProposeLaw struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // content is the proposal's content. - Content *anypb.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` - // authority must be the gov module address. - Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` } -func (x *MsgExecLegacyContent) Reset() { - *x = MsgExecLegacyContent{} +func (x *MsgProposeLaw) Reset() { + *x = MsgProposeLaw{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[2] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgExecLegacyContent) String() string { +func (x *MsgProposeLaw) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgExecLegacyContent) ProtoMessage() {} - -// Deprecated: Use MsgExecLegacyContent.ProtoReflect.Descriptor instead. -func (*MsgExecLegacyContent) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{2} -} +func (*MsgProposeLaw) ProtoMessage() {} -func (x *MsgExecLegacyContent) GetContent() *anypb.Any { - if x != nil { - return x.Content - } - return nil +// Deprecated: Use MsgProposeLaw.ProtoReflect.Descriptor instead. +func (*MsgProposeLaw) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{12} } -func (x *MsgExecLegacyContent) GetAuthority() string { +func (x *MsgProposeLaw) GetAuthority() string { if x != nil { return x.Authority } return "" } -// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. -type MsgExecLegacyContentResponse struct { +// MsgProposeLawResponse defines the response structure for executing a +// MsgProposeLaw message. +type MsgProposeLawResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgExecLegacyContentResponse) Reset() { - *x = MsgExecLegacyContentResponse{} +func (x *MsgProposeLawResponse) Reset() { + *x = MsgProposeLawResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[3] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgExecLegacyContentResponse) String() string { +func (x *MsgProposeLawResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgExecLegacyContentResponse) ProtoMessage() {} +func (*MsgProposeLawResponse) ProtoMessage() {} -// Deprecated: Use MsgExecLegacyContentResponse.ProtoReflect.Descriptor instead. -func (*MsgExecLegacyContentResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{3} +// Deprecated: Use MsgProposeLawResponse.ProtoReflect.Descriptor instead. +func (*MsgProposeLawResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{13} } -// MsgVote defines a message to cast a vote. -type MsgVote struct { +// MsgConstitutionAmendment is the Msg/ProposeConstitutionAmendment request type. +type MsgProposeConstitutionAmendment struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // voter is the voter address for the proposal. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // option defines the vote option. - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=atomone.gov.v1.VoteOption" json:"option,omitempty"` - // metadata is any arbitrary metadata attached to the Vote. - Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // amendment is the amendment to the constitution. It must be in valid GNU patch format. + Amendment string `protobuf:"bytes,2,opt,name=amendment,proto3" json:"amendment,omitempty"` } -func (x *MsgVote) Reset() { - *x = MsgVote{} +func (x *MsgProposeConstitutionAmendment) Reset() { + *x = MsgProposeConstitutionAmendment{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[4] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgVote) String() string { +func (x *MsgProposeConstitutionAmendment) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgVote) ProtoMessage() {} - -// Deprecated: Use MsgVote.ProtoReflect.Descriptor instead. -func (*MsgVote) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{4} -} +func (*MsgProposeConstitutionAmendment) ProtoMessage() {} -func (x *MsgVote) GetProposalId() uint64 { - if x != nil { - return x.ProposalId - } - return 0 +// Deprecated: Use MsgProposeConstitutionAmendment.ProtoReflect.Descriptor instead. +func (*MsgProposeConstitutionAmendment) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{14} } -func (x *MsgVote) GetVoter() string { +func (x *MsgProposeConstitutionAmendment) GetAuthority() string { if x != nil { - return x.Voter + return x.Authority } return "" } -func (x *MsgVote) GetOption() VoteOption { - if x != nil { - return x.Option - } - return VoteOption_VOTE_OPTION_UNSPECIFIED -} - -func (x *MsgVote) GetMetadata() string { +func (x *MsgProposeConstitutionAmendment) GetAmendment() string { if x != nil { - return x.Metadata + return x.Amendment } return "" } -// MsgVoteResponse defines the Msg/Vote response type. -type MsgVoteResponse struct { +// MsgProposeConstitutionAmendmentResponse defines the response structure for executing a +// MsgProposeConstitutionAmendment message. +type MsgProposeConstitutionAmendmentResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgVoteResponse) Reset() { - *x = MsgVoteResponse{} +func (x *MsgProposeConstitutionAmendmentResponse) Reset() { + *x = MsgProposeConstitutionAmendmentResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[5] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgVoteResponse) String() string { +func (x *MsgProposeConstitutionAmendmentResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgVoteResponse) ProtoMessage() {} +func (*MsgProposeConstitutionAmendmentResponse) ProtoMessage() {} -// Deprecated: Use MsgVoteResponse.ProtoReflect.Descriptor instead. -func (*MsgVoteResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{5} +// Deprecated: Use MsgProposeConstitutionAmendmentResponse.ProtoReflect.Descriptor instead. +func (*MsgProposeConstitutionAmendmentResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{15} } -// MsgVoteWeighted defines a message to cast a vote. -type MsgVoteWeighted struct { +// MsgCreateGovernor defines a SDK message for creating a new governor. +type MsgCreateGovernor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // voter is the voter address for the proposal. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // options defines the weighted vote options. - Options []*WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` - // metadata is any arbitrary metadata attached to the VoteWeighted. - Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,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,omitempty"` } -func (x *MsgVoteWeighted) Reset() { - *x = MsgVoteWeighted{} +func (x *MsgCreateGovernor) Reset() { + *x = MsgCreateGovernor{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[6] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgVoteWeighted) String() string { +func (x *MsgCreateGovernor) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgVoteWeighted) ProtoMessage() {} - -// Deprecated: Use MsgVoteWeighted.ProtoReflect.Descriptor instead. -func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{6} -} +func (*MsgCreateGovernor) ProtoMessage() {} -func (x *MsgVoteWeighted) GetProposalId() uint64 { - if x != nil { - return x.ProposalId - } - return 0 +// Deprecated: Use MsgCreateGovernor.ProtoReflect.Descriptor instead. +func (*MsgCreateGovernor) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{16} } -func (x *MsgVoteWeighted) GetVoter() string { +func (x *MsgCreateGovernor) GetAddress() string { if x != nil { - return x.Voter + return x.Address } return "" } -func (x *MsgVoteWeighted) GetOptions() []*WeightedVoteOption { - if x != nil { - return x.Options - } - return nil -} - -func (x *MsgVoteWeighted) GetMetadata() string { +func (x *MsgCreateGovernor) GetDescription() *GovernorDescription { if x != nil { - return x.Metadata + return x.Description } - return "" + return nil } -// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -type MsgVoteWeightedResponse struct { +// MsgCreateGovernorrResponse defines the Msg/CreateGovernor response type. +type MsgCreateGovernorResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgVoteWeightedResponse) Reset() { - *x = MsgVoteWeightedResponse{} +func (x *MsgCreateGovernorResponse) Reset() { + *x = MsgCreateGovernorResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[7] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgVoteWeightedResponse) String() string { +func (x *MsgCreateGovernorResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgVoteWeightedResponse) ProtoMessage() {} +func (*MsgCreateGovernorResponse) ProtoMessage() {} -// Deprecated: Use MsgVoteWeightedResponse.ProtoReflect.Descriptor instead. -func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{7} +// Deprecated: Use MsgCreateGovernorResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateGovernorResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{17} } -// MsgDeposit defines a message to submit a deposit to an existing proposal. -type MsgDeposit struct { +// MsgEditGovernor defines a SDK message for editing an existing governor. +type MsgEditGovernor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` - // amount to be deposited by depositor. - Amount []*v1beta1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount,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,omitempty"` } -func (x *MsgDeposit) Reset() { - *x = MsgDeposit{} +func (x *MsgEditGovernor) Reset() { + *x = MsgEditGovernor{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[8] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgDeposit) String() string { +func (x *MsgEditGovernor) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgDeposit) ProtoMessage() {} - -// Deprecated: Use MsgDeposit.ProtoReflect.Descriptor instead. -func (*MsgDeposit) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{8} -} +func (*MsgEditGovernor) ProtoMessage() {} -func (x *MsgDeposit) GetProposalId() uint64 { - if x != nil { - return x.ProposalId - } - return 0 +// Deprecated: Use MsgEditGovernor.ProtoReflect.Descriptor instead. +func (*MsgEditGovernor) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{18} } -func (x *MsgDeposit) GetDepositor() string { +func (x *MsgEditGovernor) GetAddress() string { if x != nil { - return x.Depositor + return x.Address } return "" } -func (x *MsgDeposit) GetAmount() []*v1beta1.Coin { +func (x *MsgEditGovernor) GetDescription() *GovernorDescription { if x != nil { - return x.Amount + return x.Description } return nil } -// MsgDepositResponse defines the Msg/Deposit response type. -type MsgDepositResponse struct { +// MsgEditGovernorResponse defines the Msg/EditGovernor response type. +type MsgEditGovernorResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgDepositResponse) Reset() { - *x = MsgDepositResponse{} +func (x *MsgEditGovernorResponse) Reset() { + *x = MsgEditGovernorResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[9] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgDepositResponse) String() string { +func (x *MsgEditGovernorResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgDepositResponse) ProtoMessage() {} +func (*MsgEditGovernorResponse) ProtoMessage() {} -// Deprecated: Use MsgDepositResponse.ProtoReflect.Descriptor instead. -func (*MsgDepositResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{9} +// Deprecated: Use MsgEditGovernorResponse.ProtoReflect.Descriptor instead. +func (*MsgEditGovernorResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{19} } -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParams struct { +// MsgUpdateGovernorStatus defines a SDK message for updating the status of a governor. +type MsgUpdateGovernorStatus struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // authority is the address that controls the module (defaults to x/gov unless - // overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/gov parameters to update. - // - // NOTE: All parameters must be supplied. - Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,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"` + Status GovernorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=atomone.gov.v1.GovernorStatus" json:"status,omitempty"` } -func (x *MsgUpdateParams) Reset() { - *x = MsgUpdateParams{} +func (x *MsgUpdateGovernorStatus) Reset() { + *x = MsgUpdateGovernorStatus{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[10] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgUpdateParams) String() string { +func (x *MsgUpdateGovernorStatus) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateGovernorStatus) ProtoMessage() {} -// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{10} +// Deprecated: Use MsgUpdateGovernorStatus.ProtoReflect.Descriptor instead. +func (*MsgUpdateGovernorStatus) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{20} } -func (x *MsgUpdateParams) GetAuthority() string { +func (x *MsgUpdateGovernorStatus) GetAddress() string { if x != nil { - return x.Authority + return x.Address } return "" } -func (x *MsgUpdateParams) GetParams() *Params { +func (x *MsgUpdateGovernorStatus) GetStatus() GovernorStatus { if x != nil { - return x.Params + return x.Status } - return nil + return GovernorStatus_GOVERNOR_STATUS_UNSPECIFIED } -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParamsResponse struct { +// MsgUpdateGovernorStatusResponse defines the Msg/UpdateGovernorStatus response type. +type MsgUpdateGovernorStatusResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgUpdateParamsResponse) Reset() { - *x = MsgUpdateParamsResponse{} +func (x *MsgUpdateGovernorStatusResponse) Reset() { + *x = MsgUpdateGovernorStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[11] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgUpdateParamsResponse) String() string { +func (x *MsgUpdateGovernorStatusResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateGovernorStatusResponse) ProtoMessage() {} -// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{11} +// Deprecated: Use MsgUpdateGovernorStatusResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateGovernorStatusResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{21} } -// MsgLaw is the Msg/ProposeLaw request type. -type MsgProposeLaw struct { +// MsgDelegateGovernor defines a SDK message for performing a delegation of governance voting power +// from a delegator to a governor. +type MsgDelegateGovernor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // authority is the address that controls the module (defaults to x/gov unless - // overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + 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"` } -func (x *MsgProposeLaw) Reset() { - *x = MsgProposeLaw{} +func (x *MsgDelegateGovernor) Reset() { + *x = MsgDelegateGovernor{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[12] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgProposeLaw) String() string { +func (x *MsgDelegateGovernor) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgProposeLaw) ProtoMessage() {} +func (*MsgDelegateGovernor) ProtoMessage() {} -// Deprecated: Use MsgProposeLaw.ProtoReflect.Descriptor instead. -func (*MsgProposeLaw) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{12} +// Deprecated: Use MsgDelegateGovernor.ProtoReflect.Descriptor instead. +func (*MsgDelegateGovernor) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{22} } -func (x *MsgProposeLaw) GetAuthority() string { +func (x *MsgDelegateGovernor) GetDelegatorAddress() string { if x != nil { - return x.Authority + return x.DelegatorAddress } return "" } -// MsgProposeLawResponse defines the response structure for executing a -// MsgProposeLaw message. -type MsgProposeLawResponse struct { +func (x *MsgDelegateGovernor) GetGovernorAddress() string { + if x != nil { + return x.GovernorAddress + } + return "" +} + +// MsgDelegateGovernorResponse defines the Msg/Delegate response type. +type MsgDelegateGovernorResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgProposeLawResponse) Reset() { - *x = MsgProposeLawResponse{} +func (x *MsgDelegateGovernorResponse) Reset() { + *x = MsgDelegateGovernorResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[13] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgProposeLawResponse) String() string { +func (x *MsgDelegateGovernorResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgProposeLawResponse) ProtoMessage() {} +func (*MsgDelegateGovernorResponse) ProtoMessage() {} -// Deprecated: Use MsgProposeLawResponse.ProtoReflect.Descriptor instead. -func (*MsgProposeLawResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{13} +// Deprecated: Use MsgDelegateGovernorResponse.ProtoReflect.Descriptor instead. +func (*MsgDelegateGovernorResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{23} } -// MsgConstitutionAmendment is the Msg/ProposeConstitutionAmendment request type. -type MsgProposeConstitutionAmendment struct { +// MsgUndelegateGovernor defines a SDK message for undelegating governance voting power +type MsgUndelegateGovernor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // authority is the address that controls the module (defaults to x/gov unless - // overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // amendment is the amendment to the constitution. It must be in valid GNU patch format. - Amendment string `protobuf:"bytes,2,opt,name=amendment,proto3" json:"amendment,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` } -func (x *MsgProposeConstitutionAmendment) Reset() { - *x = MsgProposeConstitutionAmendment{} +func (x *MsgUndelegateGovernor) Reset() { + *x = MsgUndelegateGovernor{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[14] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgProposeConstitutionAmendment) String() string { +func (x *MsgUndelegateGovernor) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgProposeConstitutionAmendment) ProtoMessage() {} - -// Deprecated: Use MsgProposeConstitutionAmendment.ProtoReflect.Descriptor instead. -func (*MsgProposeConstitutionAmendment) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{14} -} +func (*MsgUndelegateGovernor) ProtoMessage() {} -func (x *MsgProposeConstitutionAmendment) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" +// Deprecated: Use MsgUndelegateGovernor.ProtoReflect.Descriptor instead. +func (*MsgUndelegateGovernor) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{24} } -func (x *MsgProposeConstitutionAmendment) GetAmendment() string { +func (x *MsgUndelegateGovernor) GetDelegatorAddress() string { if x != nil { - return x.Amendment + return x.DelegatorAddress } return "" } -// MsgProposeConstitutionAmendmentResponse defines the response structure for executing a -// MsgProposeConstitutionAmendment message. -type MsgProposeConstitutionAmendmentResponse struct { +// MsgUndelegateGovernorResponse defines the Msg/UndelegateGovernor response type. +type MsgUndelegateGovernorResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgProposeConstitutionAmendmentResponse) Reset() { - *x = MsgProposeConstitutionAmendmentResponse{} +func (x *MsgUndelegateGovernorResponse) Reset() { + *x = MsgUndelegateGovernorResponse{} if protoimpl.UnsafeEnabled { - mi := &file_atomone_gov_v1_tx_proto_msgTypes[15] + mi := &file_atomone_gov_v1_tx_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgProposeConstitutionAmendmentResponse) String() string { +func (x *MsgUndelegateGovernorResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgProposeConstitutionAmendmentResponse) ProtoMessage() {} +func (*MsgUndelegateGovernorResponse) ProtoMessage() {} -// Deprecated: Use MsgProposeConstitutionAmendmentResponse.ProtoReflect.Descriptor instead. -func (*MsgProposeConstitutionAmendmentResponse) Descriptor() ([]byte, []int) { - return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{15} +// Deprecated: Use MsgUndelegateGovernorResponse.ProtoReflect.Descriptor instead. +func (*MsgUndelegateGovernorResponse) Descriptor() ([]byte, []int) { + return file_atomone_gov_v1_tx_proto_rawDescGZIP(), []int{25} } var File_atomone_gov_v1_tx_proto protoreflect.FileDescriptor @@ -8400,65 +12901,168 @@ var file_atomone_gov_v1_tx_proto_rawDesc = []byte{ 0x70, 0x6f, 0x73, 0x65, 0x41, 0x6d, 0x65, 0x6e, 0x64, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x29, 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6d, 0x65, 0x6e, 0x64, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf5, 0x05, 0x0a, 0x03, 0x4d, 0x73, 0x67, - 0x12, 0x5e, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x12, 0x21, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x29, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x67, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x2c, 0x2e, 0x61, 0x74, - 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x04, 0x56, 0x6f, 0x74, - 0x65, 0x12, 0x17, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x1f, 0x2e, 0x61, 0x74, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xcd, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x32, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x50, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, + 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, + 0x72, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x32, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, + 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x19, 0x61, + 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xcc, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, + 0x74, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x50, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3a, + 0x33, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x47, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x6f, 0x72, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x47, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xc2, 0x01, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, + 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1e, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x3b, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, + 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, + 0x2a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x21, 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc7, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, + 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x3a, 0x3e, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x4d, 0x73, + 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, + 0x72, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x3a, 0x43, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x47, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf3, 0x09, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, + 0x5e, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x12, 0x21, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x29, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x67, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x2c, 0x2e, 0x61, 0x74, 0x6f, + 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, + 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, + 0x12, 0x17, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x1f, 0x2e, 0x61, 0x74, 0x6f, 0x6d, + 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0c, 0x56, 0x6f, + 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, - 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0c, 0x56, - 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x2e, 0x61, 0x74, + 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x1a, 0x27, 0x2e, 0x61, 0x74, + 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, + 0x1a, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x1a, 0x27, 0x2e, 0x61, - 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x12, 0x1a, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x22, 0x2e, 0x61, - 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x58, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x1f, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x58, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x1f, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x1a, 0x27, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x1a, 0x27, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0a, 0x50, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x4c, 0x61, 0x77, 0x12, 0x1d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, - 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x4c, 0x61, 0x77, 0x1a, 0x25, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0a, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x4c, 0x61, 0x77, 0x12, 0x1d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x4c, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x88, - 0x01, 0x0a, 0x1c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, - 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6d, 0x65, 0x6e, 0x64, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x2f, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x6f, 0x73, 0x65, 0x4c, 0x61, 0x77, 0x1a, 0x25, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, + 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x4c, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x88, 0x01, + 0x0a, 0x1c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6d, 0x65, 0x6e, 0x64, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2f, + 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, + 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6d, 0x65, 0x6e, 0x64, 0x6d, 0x65, 0x6e, 0x74, 0x1a, + 0x37, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6d, 0x65, 0x6e, 0x64, 0x6d, 0x65, 0x6e, 0x74, - 0x1a, 0x37, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x73, - 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6d, 0x65, 0x6e, 0x64, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, - 0x42, 0x9e, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, - 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, - 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x47, 0x58, 0xaa, - 0x02, 0x0e, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x0e, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x1a, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x10, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x21, 0x2e, 0x61, 0x74, 0x6f, + 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x1a, 0x29, 0x2e, + 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0c, 0x45, 0x64, 0x69, 0x74, + 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x1f, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, + 0x74, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x1a, 0x27, 0x2e, 0x61, 0x74, 0x6f, 0x6d, + 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x64, + 0x69, 0x74, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x70, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x27, 0x2e, 0x61, 0x74, 0x6f, + 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x1a, 0x2f, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x6f, + 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x12, 0x23, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, + 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x1a, 0x2b, 0x2e, + 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x55, 0x6e, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, + 0x12, 0x25, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x47, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x1a, 0x2d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, + 0x65, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6f, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x9e, 0x01, + 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, + 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x47, 0x58, 0xaa, 0x02, 0x0e, 0x41, + 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, + 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1a, 0x41, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x41, 0x74, + 0x6f, 0x6d, 0x6f, 0x6e, 0x65, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -8473,7 +13077,7 @@ func file_atomone_gov_v1_tx_proto_rawDescGZIP() []byte { return file_atomone_gov_v1_tx_proto_rawDescData } -var file_atomone_gov_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_atomone_gov_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_atomone_gov_v1_tx_proto_goTypes = []interface{}{ (*MsgSubmitProposal)(nil), // 0: atomone.gov.v1.MsgSubmitProposal (*MsgSubmitProposalResponse)(nil), // 1: atomone.gov.v1.MsgSubmitProposalResponse @@ -8491,41 +13095,66 @@ var file_atomone_gov_v1_tx_proto_goTypes = []interface{}{ (*MsgProposeLawResponse)(nil), // 13: atomone.gov.v1.MsgProposeLawResponse (*MsgProposeConstitutionAmendment)(nil), // 14: atomone.gov.v1.MsgProposeConstitutionAmendment (*MsgProposeConstitutionAmendmentResponse)(nil), // 15: atomone.gov.v1.MsgProposeConstitutionAmendmentResponse - (*anypb.Any)(nil), // 16: google.protobuf.Any - (*v1beta1.Coin)(nil), // 17: cosmos.base.v1beta1.Coin - (VoteOption)(0), // 18: atomone.gov.v1.VoteOption - (*WeightedVoteOption)(nil), // 19: atomone.gov.v1.WeightedVoteOption - (*Params)(nil), // 20: atomone.gov.v1.Params + (*MsgCreateGovernor)(nil), // 16: atomone.gov.v1.MsgCreateGovernor + (*MsgCreateGovernorResponse)(nil), // 17: atomone.gov.v1.MsgCreateGovernorResponse + (*MsgEditGovernor)(nil), // 18: atomone.gov.v1.MsgEditGovernor + (*MsgEditGovernorResponse)(nil), // 19: atomone.gov.v1.MsgEditGovernorResponse + (*MsgUpdateGovernorStatus)(nil), // 20: atomone.gov.v1.MsgUpdateGovernorStatus + (*MsgUpdateGovernorStatusResponse)(nil), // 21: atomone.gov.v1.MsgUpdateGovernorStatusResponse + (*MsgDelegateGovernor)(nil), // 22: atomone.gov.v1.MsgDelegateGovernor + (*MsgDelegateGovernorResponse)(nil), // 23: atomone.gov.v1.MsgDelegateGovernorResponse + (*MsgUndelegateGovernor)(nil), // 24: atomone.gov.v1.MsgUndelegateGovernor + (*MsgUndelegateGovernorResponse)(nil), // 25: atomone.gov.v1.MsgUndelegateGovernorResponse + (*anypb.Any)(nil), // 26: google.protobuf.Any + (*v1beta1.Coin)(nil), // 27: cosmos.base.v1beta1.Coin + (VoteOption)(0), // 28: atomone.gov.v1.VoteOption + (*WeightedVoteOption)(nil), // 29: atomone.gov.v1.WeightedVoteOption + (*Params)(nil), // 30: atomone.gov.v1.Params + (*GovernorDescription)(nil), // 31: atomone.gov.v1.GovernorDescription + (GovernorStatus)(0), // 32: atomone.gov.v1.GovernorStatus } var file_atomone_gov_v1_tx_proto_depIdxs = []int32{ - 16, // 0: atomone.gov.v1.MsgSubmitProposal.messages:type_name -> google.protobuf.Any - 17, // 1: atomone.gov.v1.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin - 16, // 2: atomone.gov.v1.MsgExecLegacyContent.content:type_name -> google.protobuf.Any - 18, // 3: atomone.gov.v1.MsgVote.option:type_name -> atomone.gov.v1.VoteOption - 19, // 4: atomone.gov.v1.MsgVoteWeighted.options:type_name -> atomone.gov.v1.WeightedVoteOption - 17, // 5: atomone.gov.v1.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin - 20, // 6: atomone.gov.v1.MsgUpdateParams.params:type_name -> atomone.gov.v1.Params - 0, // 7: atomone.gov.v1.Msg.SubmitProposal:input_type -> atomone.gov.v1.MsgSubmitProposal - 2, // 8: atomone.gov.v1.Msg.ExecLegacyContent:input_type -> atomone.gov.v1.MsgExecLegacyContent - 4, // 9: atomone.gov.v1.Msg.Vote:input_type -> atomone.gov.v1.MsgVote - 6, // 10: atomone.gov.v1.Msg.VoteWeighted:input_type -> atomone.gov.v1.MsgVoteWeighted - 8, // 11: atomone.gov.v1.Msg.Deposit:input_type -> atomone.gov.v1.MsgDeposit - 10, // 12: atomone.gov.v1.Msg.UpdateParams:input_type -> atomone.gov.v1.MsgUpdateParams - 12, // 13: atomone.gov.v1.Msg.ProposeLaw:input_type -> atomone.gov.v1.MsgProposeLaw - 14, // 14: atomone.gov.v1.Msg.ProposeConstitutionAmendment:input_type -> atomone.gov.v1.MsgProposeConstitutionAmendment - 1, // 15: atomone.gov.v1.Msg.SubmitProposal:output_type -> atomone.gov.v1.MsgSubmitProposalResponse - 3, // 16: atomone.gov.v1.Msg.ExecLegacyContent:output_type -> atomone.gov.v1.MsgExecLegacyContentResponse - 5, // 17: atomone.gov.v1.Msg.Vote:output_type -> atomone.gov.v1.MsgVoteResponse - 7, // 18: atomone.gov.v1.Msg.VoteWeighted:output_type -> atomone.gov.v1.MsgVoteWeightedResponse - 9, // 19: atomone.gov.v1.Msg.Deposit:output_type -> atomone.gov.v1.MsgDepositResponse - 11, // 20: atomone.gov.v1.Msg.UpdateParams:output_type -> atomone.gov.v1.MsgUpdateParamsResponse - 13, // 21: atomone.gov.v1.Msg.ProposeLaw:output_type -> atomone.gov.v1.MsgProposeLawResponse - 15, // 22: atomone.gov.v1.Msg.ProposeConstitutionAmendment:output_type -> atomone.gov.v1.MsgProposeConstitutionAmendmentResponse - 15, // [15:23] is the sub-list for method output_type - 7, // [7:15] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 26, // 0: atomone.gov.v1.MsgSubmitProposal.messages:type_name -> google.protobuf.Any + 27, // 1: atomone.gov.v1.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin + 26, // 2: atomone.gov.v1.MsgExecLegacyContent.content:type_name -> google.protobuf.Any + 28, // 3: atomone.gov.v1.MsgVote.option:type_name -> atomone.gov.v1.VoteOption + 29, // 4: atomone.gov.v1.MsgVoteWeighted.options:type_name -> atomone.gov.v1.WeightedVoteOption + 27, // 5: atomone.gov.v1.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin + 30, // 6: atomone.gov.v1.MsgUpdateParams.params:type_name -> atomone.gov.v1.Params + 31, // 7: atomone.gov.v1.MsgCreateGovernor.description:type_name -> atomone.gov.v1.GovernorDescription + 31, // 8: atomone.gov.v1.MsgEditGovernor.description:type_name -> atomone.gov.v1.GovernorDescription + 32, // 9: atomone.gov.v1.MsgUpdateGovernorStatus.status:type_name -> atomone.gov.v1.GovernorStatus + 0, // 10: atomone.gov.v1.Msg.SubmitProposal:input_type -> atomone.gov.v1.MsgSubmitProposal + 2, // 11: atomone.gov.v1.Msg.ExecLegacyContent:input_type -> atomone.gov.v1.MsgExecLegacyContent + 4, // 12: atomone.gov.v1.Msg.Vote:input_type -> atomone.gov.v1.MsgVote + 6, // 13: atomone.gov.v1.Msg.VoteWeighted:input_type -> atomone.gov.v1.MsgVoteWeighted + 8, // 14: atomone.gov.v1.Msg.Deposit:input_type -> atomone.gov.v1.MsgDeposit + 10, // 15: atomone.gov.v1.Msg.UpdateParams:input_type -> atomone.gov.v1.MsgUpdateParams + 12, // 16: atomone.gov.v1.Msg.ProposeLaw:input_type -> atomone.gov.v1.MsgProposeLaw + 14, // 17: atomone.gov.v1.Msg.ProposeConstitutionAmendment:input_type -> atomone.gov.v1.MsgProposeConstitutionAmendment + 16, // 18: atomone.gov.v1.Msg.CreateGovernor:input_type -> atomone.gov.v1.MsgCreateGovernor + 18, // 19: atomone.gov.v1.Msg.EditGovernor:input_type -> atomone.gov.v1.MsgEditGovernor + 20, // 20: atomone.gov.v1.Msg.UpdateGovernorStatus:input_type -> atomone.gov.v1.MsgUpdateGovernorStatus + 22, // 21: atomone.gov.v1.Msg.DelegateGovernor:input_type -> atomone.gov.v1.MsgDelegateGovernor + 24, // 22: atomone.gov.v1.Msg.UndelegateGovernor:input_type -> atomone.gov.v1.MsgUndelegateGovernor + 1, // 23: atomone.gov.v1.Msg.SubmitProposal:output_type -> atomone.gov.v1.MsgSubmitProposalResponse + 3, // 24: atomone.gov.v1.Msg.ExecLegacyContent:output_type -> atomone.gov.v1.MsgExecLegacyContentResponse + 5, // 25: atomone.gov.v1.Msg.Vote:output_type -> atomone.gov.v1.MsgVoteResponse + 7, // 26: atomone.gov.v1.Msg.VoteWeighted:output_type -> atomone.gov.v1.MsgVoteWeightedResponse + 9, // 27: atomone.gov.v1.Msg.Deposit:output_type -> atomone.gov.v1.MsgDepositResponse + 11, // 28: atomone.gov.v1.Msg.UpdateParams:output_type -> atomone.gov.v1.MsgUpdateParamsResponse + 13, // 29: atomone.gov.v1.Msg.ProposeLaw:output_type -> atomone.gov.v1.MsgProposeLawResponse + 15, // 30: atomone.gov.v1.Msg.ProposeConstitutionAmendment:output_type -> atomone.gov.v1.MsgProposeConstitutionAmendmentResponse + 17, // 31: atomone.gov.v1.Msg.CreateGovernor:output_type -> atomone.gov.v1.MsgCreateGovernorResponse + 19, // 32: atomone.gov.v1.Msg.EditGovernor:output_type -> atomone.gov.v1.MsgEditGovernorResponse + 21, // 33: atomone.gov.v1.Msg.UpdateGovernorStatus:output_type -> atomone.gov.v1.MsgUpdateGovernorStatusResponse + 23, // 34: atomone.gov.v1.Msg.DelegateGovernor:output_type -> atomone.gov.v1.MsgDelegateGovernorResponse + 25, // 35: atomone.gov.v1.Msg.UndelegateGovernor:output_type -> atomone.gov.v1.MsgUndelegateGovernorResponse + 23, // [23:36] is the sub-list for method output_type + 10, // [10:23] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_atomone_gov_v1_tx_proto_init() } @@ -8727,6 +13356,126 @@ func file_atomone_gov_v1_tx_proto_init() { return nil } } + file_atomone_gov_v1_tx_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateGovernor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_tx_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateGovernorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_tx_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgEditGovernor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_tx_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgEditGovernorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_tx_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateGovernorStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_tx_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateGovernorStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_tx_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgDelegateGovernor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_tx_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgDelegateGovernorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_tx_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUndelegateGovernor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_atomone_gov_v1_tx_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUndelegateGovernorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -8734,7 +13483,7 @@ func file_atomone_gov_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_atomone_gov_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 16, + NumMessages: 26, NumExtensions: 0, NumServices: 1, }, diff --git a/api/atomone/gov/v1/tx_grpc.pb.go b/api/atomone/gov/v1/tx_grpc.pb.go index c0537a74..2db17fe5 100644 --- a/api/atomone/gov/v1/tx_grpc.pb.go +++ b/api/atomone/gov/v1/tx_grpc.pb.go @@ -29,6 +29,11 @@ const ( Msg_UpdateParams_FullMethodName = "/atomone.gov.v1.Msg/UpdateParams" Msg_ProposeLaw_FullMethodName = "/atomone.gov.v1.Msg/ProposeLaw" Msg_ProposeConstitutionAmendment_FullMethodName = "/atomone.gov.v1.Msg/ProposeConstitutionAmendment" + Msg_CreateGovernor_FullMethodName = "/atomone.gov.v1.Msg/CreateGovernor" + Msg_EditGovernor_FullMethodName = "/atomone.gov.v1.Msg/EditGovernor" + Msg_UpdateGovernorStatus_FullMethodName = "/atomone.gov.v1.Msg/UpdateGovernorStatus" + Msg_DelegateGovernor_FullMethodName = "/atomone.gov.v1.Msg/DelegateGovernor" + Msg_UndelegateGovernor_FullMethodName = "/atomone.gov.v1.Msg/UndelegateGovernor" ) // MsgClient is the client API for Msg service. @@ -60,6 +65,18 @@ type MsgClient interface { // ProposeConstitutionAmendment defines a governance operation for proposing a // new constitution amendment. The authority is defined in the keeper. ProposeConstitutionAmendment(ctx context.Context, in *MsgProposeConstitutionAmendment, opts ...grpc.CallOption) (*MsgProposeConstitutionAmendmentResponse, 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) + // 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) + // UndelegateGovernor defines a method to undelegate governance voting power + UndelegateGovernor(ctx context.Context, in *MsgUndelegateGovernor, opts ...grpc.CallOption) (*MsgUndelegateGovernorResponse, error) } type msgClient struct { @@ -150,6 +167,56 @@ func (c *msgClient) ProposeConstitutionAmendment(ctx context.Context, in *MsgPro return out, nil } +func (c *msgClient) CreateGovernor(ctx context.Context, in *MsgCreateGovernor, opts ...grpc.CallOption) (*MsgCreateGovernorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgCreateGovernorResponse) + err := c.cc.Invoke(ctx, Msg_CreateGovernor_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) EditGovernor(ctx context.Context, in *MsgEditGovernor, opts ...grpc.CallOption) (*MsgEditGovernorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgEditGovernorResponse) + err := c.cc.Invoke(ctx, Msg_EditGovernor_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateGovernorStatus(ctx context.Context, in *MsgUpdateGovernorStatus, opts ...grpc.CallOption) (*MsgUpdateGovernorStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateGovernorStatusResponse) + err := c.cc.Invoke(ctx, Msg_UpdateGovernorStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DelegateGovernor(ctx context.Context, in *MsgDelegateGovernor, opts ...grpc.CallOption) (*MsgDelegateGovernorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgDelegateGovernorResponse) + err := c.cc.Invoke(ctx, Msg_DelegateGovernor_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UndelegateGovernor(ctx context.Context, in *MsgUndelegateGovernor, opts ...grpc.CallOption) (*MsgUndelegateGovernorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUndelegateGovernorResponse) + err := c.cc.Invoke(ctx, Msg_UndelegateGovernor_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility. @@ -179,6 +246,18 @@ type MsgServer interface { // ProposeConstitutionAmendment defines a governance operation for proposing a // new constitution amendment. The authority is defined in the keeper. ProposeConstitutionAmendment(context.Context, *MsgProposeConstitutionAmendment) (*MsgProposeConstitutionAmendmentResponse, 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) + // 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) + // UndelegateGovernor defines a method to undelegate governance voting power + UndelegateGovernor(context.Context, *MsgUndelegateGovernor) (*MsgUndelegateGovernorResponse, error) mustEmbedUnimplementedMsgServer() } @@ -213,6 +292,21 @@ func (UnimplementedMsgServer) ProposeLaw(context.Context, *MsgProposeLaw) (*MsgP func (UnimplementedMsgServer) ProposeConstitutionAmendment(context.Context, *MsgProposeConstitutionAmendment) (*MsgProposeConstitutionAmendmentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProposeConstitutionAmendment not implemented") } +func (UnimplementedMsgServer) CreateGovernor(context.Context, *MsgCreateGovernor) (*MsgCreateGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGovernor not implemented") +} +func (UnimplementedMsgServer) EditGovernor(context.Context, *MsgEditGovernor) (*MsgEditGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditGovernor not implemented") +} +func (UnimplementedMsgServer) UpdateGovernorStatus(context.Context, *MsgUpdateGovernorStatus) (*MsgUpdateGovernorStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGovernorStatus not implemented") +} +func (UnimplementedMsgServer) DelegateGovernor(context.Context, *MsgDelegateGovernor) (*MsgDelegateGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegateGovernor not implemented") +} +func (UnimplementedMsgServer) UndelegateGovernor(context.Context, *MsgUndelegateGovernor) (*MsgUndelegateGovernorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UndelegateGovernor not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} func (UnimplementedMsgServer) testEmbeddedByValue() {} @@ -378,6 +472,96 @@ func _Msg_ProposeConstitutionAmendment_Handler(srv interface{}, ctx context.Cont 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: Msg_CreateGovernor_FullMethodName, + } + 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: Msg_EditGovernor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EditGovernor(ctx, req.(*MsgEditGovernor)) + } + 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: Msg_UpdateGovernorStatus_FullMethodName, + } + 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 { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DelegateGovernor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_DelegateGovernor_FullMethodName, + } + 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: Msg_UndelegateGovernor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UndelegateGovernor(ctx, req.(*MsgUndelegateGovernor)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -417,6 +601,26 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "ProposeConstitutionAmendment", Handler: _Msg_ProposeConstitutionAmendment_Handler, }, + { + MethodName: "CreateGovernor", + Handler: _Msg_CreateGovernor_Handler, + }, + { + MethodName: "EditGovernor", + Handler: _Msg_EditGovernor_Handler, + }, + { + MethodName: "UpdateGovernorStatus", + Handler: _Msg_UpdateGovernorStatus_Handler, + }, + { + MethodName: "DelegateGovernor", + Handler: _Msg_DelegateGovernor_Handler, + }, + { + MethodName: "UndelegateGovernor", + Handler: _Msg_UndelegateGovernor_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "atomone/gov/v1/tx.proto", From 47d3ed118506455682dcf0c53cf3f72105ad0532 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 17 Jul 2025 16:16:57 +0200 Subject: [PATCH 59/70] fix tally tests --- x/gov/keeper/tally_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 4a1d13c2..b5de65f4 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -563,6 +563,11 @@ func TestTally(t *testing.T) { params.MinGovernorSelfDelegation = "1" err := govKeeper.SetParams(ctx, params) require.NoError(t, err) + // Set starting participation EMAs to 0.375 so initial quorum is 0.25 using default params + // minQuorum = 0.1, maxQuorum = 0.5, participationEMA = 0.375; 0.1 + (0.5 - 0.1) * 0.375 = 0.25 + govKeeper.SetParticipationEMA(ctx, sdk.MustNewDecFromStr("0.375")) + govKeeper.SetLawParticipationEMA(ctx, sdk.MustNewDecFromStr("0.375")) + govKeeper.SetConstitutionAmendmentParticipationEMA(ctx, sdk.MustNewDecFromStr("0.375")) // Create the test fixture s := newFixture(t, ctx, 10, 6, 3, govKeeper, mocks) // Setup governor self delegation @@ -694,6 +699,11 @@ func TestHasReachedQuorum(t *testing.T) { params.MinGovernorSelfDelegation = "1" err := govKeeper.SetParams(ctx, params) require.NoError(t, err) + // Set starting participation EMAs to 0.375 so initial quorum is 0.25 using default params + // minQuorum = 0.1, maxQuorum = 0.5, participationEMA = 0.375; 0.1 + (0.5 - 0.1) * 0.375 = 0.25 + govKeeper.SetParticipationEMA(ctx, sdk.MustNewDecFromStr("0.375")) + govKeeper.SetLawParticipationEMA(ctx, sdk.MustNewDecFromStr("0.375")) + govKeeper.SetConstitutionAmendmentParticipationEMA(ctx, sdk.MustNewDecFromStr("0.375")) // Submit and activate a proposal s := newFixture(t, ctx, 10, 5, 3, govKeeper, mocks) // Setup governor self delegation From dffe42f48e22e5d9f150608b24c214ebd19d304b Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 17 Jul 2025 19:11:04 +0200 Subject: [PATCH 60/70] fix e2e tests --- .../{adr-004-governors.md => adr-006-governors.md} | 0 tests/e2e/e2e_exec_test.go | 4 +++- tests/e2e/e2e_gov_test.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) rename docs/architecture/{adr-004-governors.md => adr-006-governors.md} (100%) diff --git a/docs/architecture/adr-004-governors.md b/docs/architecture/adr-006-governors.md similarity index 100% rename from docs/architecture/adr-004-governors.md rename to docs/architecture/adr-006-governors.md diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 1bdec195..2097a23e 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -495,6 +495,7 @@ func (s *IntegrationTestSuite) execDelegate(c *chain, valIdx int, amount sdk.Coi amount.String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGas, "210000"), // default 200000 isn't enough fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()), "--keyring-backend=test", "--output=json", @@ -533,6 +534,7 @@ func (s *IntegrationTestSuite) execUnbondDelegation(c *chain, valIdx int, amount amount, fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGas, "210000"), // default 200000 isn't enough fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()), "--keyring-backend=test", fmt.Sprintf("--%s=%s", flags.FlagHome, home), @@ -589,7 +591,7 @@ func (s *IntegrationTestSuite) execRedelegate(c *chain, valIdx int, amount, orig amount, fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagGas, "300000"), // default 200000 isn't enough + fmt.Sprintf("--%s=%s", flags.FlagGas, "310000"), // default 200000 isn't enough fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()), "--keyring-backend=test", fmt.Sprintf("--%s=%s", flags.FlagHome, home), diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index bb93e4f1..11e9720b 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -530,7 +530,7 @@ func (s *IntegrationTestSuite) testGovGovernors() { // Vote with governor voteFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.submitGovCommand(chainAAPIEndpoint, govDelegatorAddr, proposalCounter, "vote", voteFlags, govtypesv1.StatusPassed) + s.submitGovCommand(chainAAPIEndpoint, govDelegatorAddr, proposalCounter, "vote", voteFlags, govtypesv1.StatusRejected) // assert tally result prop, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) From 3d25bc7e92ae8a38459668fa056edb18b7c68cb4 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 17 Jul 2025 19:41:35 +0200 Subject: [PATCH 61/70] minor fixes --- proto/atomone/gov/v1/gov.proto | 2 +- proto/atomone/gov/v1/query.proto | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index b3a537d5..e2388d6f 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -342,7 +342,7 @@ message Params { // Number of times a proposal should be checked for quorum after the quorum timeout // has elapsed. Used to compute the amount of time in between quorum checks. uint64 quorum_check_count = 22; - + MinDepositThrottler min_deposit_throttler = 23; MinInitialDepositThrottler min_initial_deposit_throttler = 24; diff --git a/proto/atomone/gov/v1/query.proto b/proto/atomone/gov/v1/query.proto index a984041f..00103f59 100644 --- a/proto/atomone/gov/v1/query.proto +++ b/proto/atomone/gov/v1/query.proto @@ -81,7 +81,7 @@ service Query { option (google.api.http).get = "/atomone/gov/v1/quorums"; } - // ParticipationEMAs queries the state of the proposal participation exponential moving averages. + // ParticipationEMAs queries the state of the proposal participation exponential moving averages. rpc ParticipationEMAs(QueryParticipationEMAsRequest) returns (QueryParticipationEMAsResponse) { option (google.api.http).get = "/atomone/gov/v1/participationemas"; } From c5226cec0eaa053ce276e983a7d6f1f3c632744a Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 31 Jul 2025 13:31:54 +0200 Subject: [PATCH 62/70] typo fix and fmt --- tests/e2e/e2e_gov_test.go | 1 - x/gov/keeper/hooks.go | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index 11e9720b..df532292 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -455,7 +455,6 @@ func (s *IntegrationTestSuite) testGovDynamicQuorum() { s.Require().Equal(quorumsAfter.Quorum, quorums.Quorum) s.Require().Equal(quorumsAfter.LawQuorum, quorums.LawQuorum) }) - } // testGovGovernors tests passing a text proposal and vote with governors. diff --git a/x/gov/keeper/hooks.go b/x/gov/keeper/hooks.go index d2ef28c4..91593def 100644 --- a/x/gov/keeper/hooks.go +++ b/x/gov/keeper/hooks.go @@ -14,7 +14,7 @@ type Hooks struct { var _ stakingtypes.StakingHooks = Hooks{} -// Return the slashing hooks +// Return the staking hooks func (k Keeper) StakingHooks() Hooks { return Hooks{k} } @@ -65,12 +65,10 @@ func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, return nil } -// BeforeValidatorSlashed is called when a validator is slashed func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error { 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 } From 103eedfb30b73b09c9cfc644d0639fa832df74ac Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 3 Sep 2025 19:06:29 +0200 Subject: [PATCH 63/70] fix post-merge issues --- tests/e2e/e2e_exec_test.go | 10 ++- tests/e2e/e2e_gov_test.go | 43 +++++----- tests/e2e/e2e_staking_test.go | 2 +- tests/e2e/e2e_vesting_test.go | 12 +-- x/gov/keeper/delegation.go | 26 ++++-- x/gov/keeper/delegation_test.go | 19 ++--- x/gov/keeper/fixture_test.go | 12 +-- x/gov/keeper/governor.go | 14 +-- x/gov/keeper/hooks.go | 45 +++++----- x/gov/keeper/invariants.go | 13 +-- x/gov/keeper/tally_test.go | 104 ----------------------- x/gov/simulation/genesis.go | 4 +- x/gov/testutil/expected_keepers_mocks.go | 24 +++--- x/gov/types/expected_keepers.go | 4 +- x/gov/types/v1/delegation.go | 3 +- x/gov/types/v1/params.go | 2 +- 16 files changed, 125 insertions(+), 212 deletions(-) diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 323fab68..f2ebfe76 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -479,8 +479,9 @@ func (s *IntegrationTestSuite) execDelegate(c *chain, valIdx int, amount sdk.Coi ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) existingDelegation := math.LegacyZeroDec() - res, err := s.queryDelegation(valOperAddress, delegatorAddr) + res, err := s.queryDelegation(chainAAPIEndpoint, valOperAddress, delegatorAddr) if err == nil { existingDelegation = res.GetDelegationResponse().GetDelegation().GetShares() } @@ -496,7 +497,7 @@ func (s *IntegrationTestSuite) execDelegate(c *chain, valIdx int, amount sdk.Coi amount.String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagGas, "210000"), // default 200000 isn't enough + fmt.Sprintf("--%s=%s", flags.FlagGas, "250000"), // default 200000 isn't enough fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()), "--keyring-backend=test", "--output=json", @@ -506,9 +507,10 @@ func (s *IntegrationTestSuite) execDelegate(c *chain, valIdx int, amount sdk.Coi s.executeAtomoneTxCommand(ctx, c, atomoneCommand, valIdx, s.defaultExecValidation(c, valIdx, nil)) // Validate delegation successful + chainAAPIEndpoint = fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) s.Require().Eventually( func() bool { - res, err := s.queryDelegation(valOperAddress, delegatorAddr) + res, err := s.queryDelegation(chainAAPIEndpoint, valOperAddress, delegatorAddr) s.Require().NoError(err) amt := res.GetDelegationResponse().GetDelegation().GetShares() @@ -592,7 +594,7 @@ func (s *IntegrationTestSuite) execRedelegate(c *chain, valIdx int, amount, orig amount, fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagGas, "310000"), // default 200000 isn't enough + fmt.Sprintf("--%s=%s", flags.FlagGas, "350000"), // default 200000 isn't enough fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()), "--keyring-backend=test", fmt.Sprintf("--%s=%s", flags.FlagHome, home), diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index 814899ad..8cab52be 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -46,7 +46,7 @@ func (s *IntegrationTestSuite) testGovSoftwareUpgrade() { depositGovFlags := []string{strconv.Itoa(proposalCounter), s.queryGovMinDeposit(chainAAPIEndpoint).String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes=0.8,no=0.1,abstain=0.1"} - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "SoftwareUpgrade", submitGovFlags, depositGovFlags, voteGovFlags, "weighted-vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "SoftwareUpgrade", submitGovFlags, depositGovFlags, voteGovFlags, "weighted-vote", govtypesv1.StatusPassed) res := s.queryUpgradePlan(chainAAPIEndpoint) s.Require().Equal("v2", res.Plan.Name) @@ -94,14 +94,14 @@ func (s *IntegrationTestSuite) testGovCancelSoftwareUpgrade() { submitGovFlags := []string{configFile(proposalSoftwareUpgradeFilename)} depositGovFlags := []string{strconv.Itoa(proposalCounter), s.queryGovMinDeposit(chainAAPIEndpoint).String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "SoftwareUpgrade", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "SoftwareUpgrade", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusPassed) proposalCounter++ s.writeGovCancelUpgradeProposal(s.chainA) submitGovFlags = []string{configFile(proposalCancelUpgradeFilename)} depositGovFlags = []string{strconv.Itoa(proposalCounter), s.queryGovMinDeposit(chainAAPIEndpoint).String()} voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} - s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CancelUpgrade", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CancelUpgrade", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusPassed) s.verifyChainPassesUpgradeHeight(s.chainA, 0, proposalHeight) s.T().Logf("Successfully canceled upgrade at height %d", proposalHeight) @@ -181,7 +181,7 @@ func (s *IntegrationTestSuite) testGovCommunityPoolSpend() { // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query proposalCounter++ submitGovFlags := []string{configFile(proposalCommunitySpendFilename)} - depositGovFlags := []string{strconv.Itoa(proposalCounter), s.queryGovMinDeposit(chainAAPIEndpoint).String()} + depositGovFlags := []string{strconv.Itoa(proposalCounter), deposit.String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "no"} s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusRejected) @@ -361,7 +361,7 @@ func (s *IntegrationTestSuite) testGovDynamicQuorum() { expectedParticipation := endQuorumPEma.Sub(quorumPEma.Mul(math.LegacyMustNewDecFromStr("0.8"))).Quo(math.LegacyMustNewDecFromStr("0.2")) proposal, _ := s.queryGovProposal(chainAAPIEndpoint, proposalCounter) stakingPool := s.queryStakingPool(chainAAPIEndpoint) - yesCount, ok := sdk.NewIntFromString(proposal.Proposal.FinalTallyResult.YesCount) + yesCount, ok := math.NewIntFromString(proposal.Proposal.FinalTallyResult.YesCount) s.Require().True(ok, "Failed to parse yes count from proposal tally result") votes := yesCount.ToLegacyDec() totalVP := stakingPool.Pool.BondedTokens.ToLegacyDec() @@ -401,7 +401,7 @@ func (s *IntegrationTestSuite) testGovDynamicQuorum() { expectedParticipation := endLawQuorumPEma.Sub(lawQuorumPEma.Mul(math.LegacyMustNewDecFromStr("0.8"))).Quo(math.LegacyMustNewDecFromStr("0.2")) proposal, _ := s.queryGovProposal(chainAAPIEndpoint, proposalCounter) stakingPool := s.queryStakingPool(chainAAPIEndpoint) - yesCount, ok := sdk.NewIntFromString(proposal.Proposal.FinalTallyResult.YesCount) + yesCount, ok := math.NewIntFromString(proposal.Proposal.FinalTallyResult.YesCount) s.Require().True(ok, "Failed to parse yes count from proposal tally result") votes := yesCount.ToLegacyDec() totalVP := stakingPool.Pool.BondedTokens.ToLegacyDec() @@ -441,7 +441,7 @@ func (s *IntegrationTestSuite) testGovDynamicQuorum() { expectedParticipation := endConstitutionAmendmentQuorumPEma.Sub(constitutionAmendmentQuorumPEma.Mul(math.LegacyMustNewDecFromStr("0.8"))).Quo(math.LegacyMustNewDecFromStr("0.2")) proposal, _ := s.queryGovProposal(chainAAPIEndpoint, proposalCounter) stakingPool := s.queryStakingPool(chainAAPIEndpoint) - yesCount, ok := sdk.NewIntFromString(proposal.Proposal.FinalTallyResult.YesCount) + yesCount, ok := math.NewIntFromString(proposal.Proposal.FinalTallyResult.YesCount) s.Require().True(ok, "Failed to parse yes count from proposal tally result") votes := yesCount.ToLegacyDec() totalVP := stakingPool.Pool.BondedTokens.ToLegacyDec() @@ -477,7 +477,7 @@ func (s *IntegrationTestSuite) testGovGovernors() { // check governor is created s.Require().Eventually( func() bool { - governor, err := queryGovGovernor(chainAAPIEndpoint, governorAddr) + governor, err := s.queryGovGovernor(chainAAPIEndpoint, governorAddr) s.Require().NoError(err) return governor.Governor != nil }, @@ -498,7 +498,7 @@ func (s *IntegrationTestSuite) testGovGovernors() { // check governor delegation is created s.Require().Eventually( func() bool { - resp, err := queryGovGovernorDelegation(chainAAPIEndpoint, delegatorAddr) + resp, err := s.queryGovGovernorDelegation(chainAAPIEndpoint, delegatorAddr) s.Require().NoError(err) return resp.GovernorAddress == governorAddr }, @@ -506,12 +506,12 @@ func (s *IntegrationTestSuite) testGovGovernors() { time.Second, ) // assert governor valshares - resp, err := queryGovGovernorValShares(chainAAPIEndpoint, governorAddr) + resp, err := s.queryGovGovernorValShares(chainAAPIEndpoint, governorAddr) s.Require().NoError(err) s.Require().Len(resp.ValShares, 1, "expected 1 valshare") s.Require().Equal(governorAddr, resp.ValShares[0].GovernorAddress) s.Require().Equal(validatorAddr, resp.ValShares[0].ValidatorAddress) - validator, err := queryValidator(chainAAPIEndpoint, validatorAddr) + validator, err := s.queryValidator(chainAAPIEndpoint, validatorAddr) s.Require().NoError(err) totalDelegations := delDelegation.Add(govDelegation) expectedShares, err := validator.SharesFromTokens(totalDelegations.Amount) @@ -528,7 +528,7 @@ func (s *IntegrationTestSuite) testGovGovernors() { s.submitGovCommand(chainAAPIEndpoint, govDelegatorAddr, proposalCounter, "vote", voteFlags, govtypesv1.StatusRejected) // assert tally result - prop, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) + prop, err := s.queryGovProposal(chainAAPIEndpoint, proposalCounter) s.Require().NoError(err) expectedTally := &govtypesv1.TallyResult{ YesCount: totalDelegations.Amount.String(), @@ -543,15 +543,12 @@ func (s *IntegrationTestSuite) submitLegacyGovProposal(chainAAPIEndpoint, sender s.T().Logf("Submitting Gov Proposal: %s", proposalType) // min deposit of 1000uatone is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped sflags := submitFlags - initialDepositResp, err := queryGovMinInitialDeposit(chainAAPIEndpoint) - s.Require().NoError(err) - initialDeposit := initialDepositResp.GetMinInitialDeposit() + initialDeposit := s.queryGovMinInitialDeposit(chainAAPIEndpoint) if withDeposit { - sflags = append(sflags, "--deposit="+initialDeposit[0].String()) + sflags = append(sflags, "--deposit="+initialDeposit.String()) } - deposit, err := queryGovMinDeposit(chainAAPIEndpoint) - s.Require().NoError(err) - depositString := deposit.GetMinDeposit()[0].String() + deposit := s.queryGovMinDeposit(chainAAPIEndpoint) + depositString := deposit.String() depositFlags = append(depositFlags, depositString) s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-legacy-proposal", sflags, govtypesv1.StatusDepositPeriod) s.T().Logf("Depositing Gov Proposal: %s", proposalType) @@ -567,10 +564,6 @@ func (s *IntegrationTestSuite) submitLegacyGovProposal(chainAAPIEndpoint, sender func (s *IntegrationTestSuite) submitGovProposal(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, expectedStatusAfterVote govtypesv1.ProposalStatus) { s.T().Logf("Submitting Gov Proposal: %s", proposalType) sflags := submitFlags - deposit, err := queryGovMinDeposit(chainAAPIEndpoint) - s.Require().NoError(err) - depositString := deposit.GetMinDeposit()[0].String() - depositFlags = append(depositFlags, depositString) s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-proposal", sflags, govtypesv1.StatusDepositPeriod) s.T().Logf("Depositing Gov Proposal: %s", proposalType) s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypesv1.StatusVotingPeriod) @@ -739,7 +732,9 @@ func (s *IntegrationTestSuite) writeGovTextProposal(c *chain) { "summary": "The summary" } ` - propMsgBody := fmt.Sprintf(template, depositAmount) + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[c.id][0].GetHostPort("1317/tcp")) + deposit := s.queryGovMinDeposit(chainAAPIEndpoint) + propMsgBody := fmt.Sprintf(template, deposit) err := writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalTextFilename), []byte(propMsgBody)) s.Require().NoError(err) } diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index dcb038ea..116fd6b7 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -35,7 +35,7 @@ func (s *IntegrationTestSuite) testStaking() { delegation := sdk.NewCoin(uatoneDenom, delegationAmount) // 500 atom // Alice delegate uatone to Validator A - s.execDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress.String(), atomoneHomePath) + s.execDelegate(s.chainA, 0, delegation, validatorAddressA, delegatorAddress.String()) // Validate delegation successful s.Require().Eventually( diff --git a/tests/e2e/e2e_vesting_test.go b/tests/e2e/e2e_vesting_test.go index ecd0055e..04dce957 100644 --- a/tests/e2e/e2e_vesting_test.go +++ b/tests/e2e/e2e_vesting_test.go @@ -62,8 +62,8 @@ func (s *IntegrationTestSuite) testDelayedVestingAccount(api string) { s.Require().Equal(vestingBalance.AmountOf(uatoneDenom), balance.Amount) // Delegate coins should succeed - s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, - vestingDelayedAcc.String(), atomoneHomePath) + s.execDelegate(chain, valIdx, vestingDelegationAmount, valOpAddr, + vestingDelayedAcc.String()) // Validate delegation successful s.Require().Eventually( @@ -129,8 +129,8 @@ func (s *IntegrationTestSuite) testContinuousVestingAccount(api string) { s.Require().Equal(vestingBalance.AmountOf(uatoneDenom), balance.Amount) // Delegate coins should succeed - s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), - valOpAddr, continuousVestingAcc.String(), atomoneHomePath) + s.execDelegate(chain, valIdx, vestingDelegationAmount, + valOpAddr, continuousVestingAcc.String()) // Validate delegation successful s.Require().Eventually( @@ -263,8 +263,8 @@ func (s *IntegrationTestSuite) testPeriodicVestingAccount(api string) { //nolint } // Delegate coins should succeed - s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, - periodicVestingAddr, atomoneHomePath) + s.execDelegate(chain, valIdx, vestingDelegationAmount, valOpAddr, + periodicVestingAddr) // Validate delegation successful s.Require().Eventually( diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 2f13b721..32d90f19 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -1,6 +1,8 @@ package keeper import ( + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -76,7 +78,7 @@ func (k Keeper) GetGovernorValShares(ctx sdk.Context, governorAddr types.Governo // 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{})) + iterator := storetypes.KVStorePrefixIterator(store, types.ValidatorSharesByGovernorKey(governorAddr, []byte{})) defer iterator.Close() for i := int64(0); iterator.Valid(); iterator.Next() { @@ -92,7 +94,7 @@ 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{})) + iterator := storetypes.KVStorePrefixIterator(store, types.GovernanceDelegationsByGovernorKey(governorAddr, []byte{})) defer iterator.Close() for i := int64(0); iterator.Valid(); iterator.Next() { @@ -114,7 +116,7 @@ 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) (delegations []*v1.GovernanceDelegation) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.GovernanceDelegationsByGovernorKey(governorAddr, []byte{})) + iterator := storetypes.KVStorePrefixIterator(store, types.GovernanceDelegationsByGovernorKey(governorAddr, []byte{})) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -128,7 +130,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 := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.ValidatorSharesByGovernorKey(governorAddr, []byte{})) + iterator := storetypes.KVStorePrefixIterator(store, types.ValidatorSharesByGovernorKey(governorAddr, []byte{})) defer iterator.Close() var shares []v1.GovernorValShares @@ -141,7 +143,7 @@ func (k Keeper) GetAllGovernorValShares(ctx sdk.Context, governorAddr types.Gove } // 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) { +func (k Keeper) IncreaseGovernorShares(ctx sdk.Context, governorAddr types.GovernorAddress, validatorAddr sdk.ValAddress, shares math.LegacyDec) { valShares, found := k.GetGovernorValShares(ctx, governorAddr, validatorAddr) if !found { valShares = v1.NewGovernorValShares(governorAddr, validatorAddr, shares) @@ -152,7 +154,7 @@ func (k Keeper) IncreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover } // 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) { +func (k Keeper) DecreaseGovernorShares(ctx sdk.Context, governorAddr types.GovernorAddress, validatorAddr sdk.ValAddress, shares math.LegacyDec) { share, found := k.GetGovernorValShares(ctx, governorAddr, validatorAddr) if !found { panic("cannot decrease shares for a non-existent governor delegation") @@ -178,7 +180,11 @@ func (k Keeper) UndelegateFromGovernor(ctx sdk.Context, delegatorAddr sdk.AccAdd 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()) + valAddr, err := sdk.ValAddressFromBech32(delegation.GetValidatorAddr()) + if err != nil { + panic(err) // This should never happen + } + k.DecreaseGovernorShares(ctx, govAddr, valAddr, delegation.GetShares()) return false }) // remove the governor delegation @@ -192,7 +198,11 @@ func (k Keeper) DelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress 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()) + valAddr, err := sdk.ValAddressFromBech32(delegation.GetValidatorAddr()) + if err != nil { + panic(err) // This should never happen + } + k.IncreaseGovernorShares(ctx, governorAddr, valAddr, delegation.GetShares()) return false }) } diff --git a/x/gov/keeper/delegation_test.go b/x/gov/keeper/delegation_test.go index 509039cf..fa36cfba 100644 --- a/x/gov/keeper/delegation_test.go +++ b/x/gov/keeper/delegation_test.go @@ -3,10 +3,9 @@ package keeper_test import ( "testing" + "cosmossdk.io/math" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" "github.com/stretchr/testify/assert" - - sdk "github.com/cosmos/cosmos-sdk/types" ) func TestGovernanceDelegate(t *testing.T) { @@ -70,7 +69,7 @@ func TestGovernanceDelegate(t *testing.T) { assert.Equal(valShare1, v1.GovernorValShares{ GovernorAddress: s.activeGovernors[0].GovernorAddress, ValidatorAddress: s.valAddrs[0].String(), - Shares: sdk.NewDec(1 + 5), + Shares: math.LegacyNewDec(1 + 5), }) } valShare2, found := govKeeper.GetGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), s.valAddrs[1]) @@ -78,7 +77,7 @@ func TestGovernanceDelegate(t *testing.T) { assert.Equal(valShare2, v1.GovernorValShares{ GovernorAddress: s.activeGovernors[0].GovernorAddress, ValidatorAddress: s.valAddrs[1].String(), - Shares: sdk.NewDec(2), + Shares: math.LegacyNewDec(2), }) } _, found = govKeeper.GetGovernorValShares(ctx, s.inactiveGovernor.GetAddress(), s.valAddrs[0]) @@ -88,7 +87,7 @@ func TestGovernanceDelegate(t *testing.T) { assert.Equal(valShare3, v1.GovernorValShares{ GovernorAddress: s.inactiveGovernor.GovernorAddress, ValidatorAddress: s.valAddrs[1].String(), - Shares: sdk.NewDec(8), + Shares: math.LegacyNewDec(8), }) } @@ -124,7 +123,7 @@ func TestGovernanceDelegate(t *testing.T) { assert.Equal(valShare1, v1.GovernorValShares{ GovernorAddress: s.activeGovernors[0].GovernorAddress, ValidatorAddress: s.valAddrs[0].String(), - Shares: sdk.NewDec(5), + Shares: math.LegacyNewDec(5), }) } _, found = govKeeper.GetGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), s.valAddrs[1]) @@ -134,7 +133,7 @@ func TestGovernanceDelegate(t *testing.T) { assert.Equal(valShare2, v1.GovernorValShares{ GovernorAddress: s.inactiveGovernor.GovernorAddress, ValidatorAddress: s.valAddrs[0].String(), - Shares: sdk.NewDec(1), + Shares: math.LegacyNewDec(1), }) } valShare3, found = govKeeper.GetGovernorValShares(ctx, s.inactiveGovernor.GetAddress(), s.valAddrs[1]) @@ -142,7 +141,7 @@ func TestGovernanceDelegate(t *testing.T) { assert.Equal(valShare3, v1.GovernorValShares{ GovernorAddress: s.inactiveGovernor.GovernorAddress, ValidatorAddress: s.valAddrs[1].String(), - Shares: sdk.NewDec(10), + Shares: math.LegacyNewDec(10), }) } @@ -158,7 +157,7 @@ func TestGovernanceDelegate(t *testing.T) { assert.Equal(valShare1, v1.GovernorValShares{ GovernorAddress: s.activeGovernors[0].GovernorAddress, ValidatorAddress: s.valAddrs[0].String(), - Shares: sdk.NewDec(5), + Shares: math.LegacyNewDec(5), }) } _, found = govKeeper.GetGovernorValShares(ctx, s.activeGovernors[0].GetAddress(), s.valAddrs[1]) @@ -170,7 +169,7 @@ func TestGovernanceDelegate(t *testing.T) { assert.Equal(valShare3, v1.GovernorValShares{ GovernorAddress: s.inactiveGovernor.GovernorAddress, ValidatorAddress: s.valAddrs[1].String(), - Shares: sdk.NewDec(8), + Shares: math.LegacyNewDec(8), }) } } diff --git a/x/gov/keeper/fixture_test.go b/x/gov/keeper/fixture_test.go index b145f069..6fc8bf21 100644 --- a/x/gov/keeper/fixture_test.go +++ b/x/gov/keeper/fixture_test.go @@ -8,7 +8,7 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -64,8 +64,8 @@ func newFixture(t *testing.T, ctx sdk.Context, numVals, numDelegators, } ) mocks.stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()). - DoAndReturn(func(_ context.Context) sdkmath.Int { - return sdkmath.NewInt(s.totalBonded) + DoAndReturn(func(_ context.Context) (math.Int, error) { + return math.NewInt(s.totalBonded), nil }).MaxTimes(1) // Mocks a bunch of validators @@ -73,8 +73,8 @@ func newFixture(t *testing.T, ctx sdk.Context, numVals, numDelegators, s.validators = append(s.validators, stakingtypes.Validator{ OperatorAddress: valAddrs[i].String(), Status: stakingtypes.Bonded, - Tokens: sdkmath.ZeroInt(), - DelegatorShares: sdkmath.LegacyZeroDec(), + Tokens: math.ZeroInt(), + DelegatorShares: math.LegacyZeroDec(), }) // validator self delegation s.delegate(sdk.AccAddress(valAddrs[i]), valAddrs[i], 1) @@ -148,7 +148,7 @@ func (s *fixture) delegate(delegator sdk.AccAddress, validator sdk.ValAddress, m // Increase validator shares and tokens, compute delegation.Shares for i := 0; i < len(s.validators); i++ { if s.validators[i].OperatorAddress == validator.String() { - s.validators[i], delegation.Shares = s.validators[i].AddTokensFromDel(sdk.NewInt(m)) + s.validators[i], delegation.Shares = s.validators[i].AddTokensFromDel(math.NewInt(m)) break } } diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index fa41ef98..30488c51 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -3,6 +3,7 @@ package keeper import ( "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -32,7 +33,7 @@ func (k Keeper) SetGovernor(ctx sdk.Context, governor v1.Governor) { func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors []*v1.Governor) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.GovernorKeyPrefix) + iterator := storetypes.KVStorePrefixIterator(store, types.GovernorKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -47,7 +48,7 @@ func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors []*v1.Governor) { func (k Keeper) GetAllActiveGovernors(ctx sdk.Context) (governors []*v1.Governor) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.GovernorKeyPrefix) + iterator := storetypes.KVStorePrefixIterator(store, types.GovernorKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -64,7 +65,7 @@ func (k Keeper) GetAllActiveGovernors(ctx sdk.Context) (governors []*v1.Governor 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) + iterator := storetypes.KVStorePrefixIterator(store, types.GovernorKeyPrefix) defer iterator.Close() for i := int64(0); iterator.Valid(); iterator.Next() { @@ -77,10 +78,13 @@ func (k Keeper) IterateGovernors(ctx sdk.Context, cb func(index int64, governor } func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorAddress) (bondedTokens math.Int) { - bondedTokens = sdk.ZeroInt() + bondedTokens = math.ZeroInt() addr := sdk.AccAddress(govAddr) k.sk.IterateDelegations(ctx, addr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { - validatorAddr := delegation.GetValidatorAddr() + validatorAddr, err := sdk.ValAddressFromBech32(delegation.GetValidatorAddr()) + if err != nil { + panic(err) // This should never happen + } validator, _ := k.sk.GetValidator(ctx, validatorAddr) shares := delegation.GetShares() bt := shares.MulInt(validator.GetBondedTokens()).Quo(validator.GetDelegatorShares()).TruncateInt() diff --git a/x/gov/keeper/hooks.go b/x/gov/keeper/hooks.go index 91593def..29b40215 100644 --- a/x/gov/keeper/hooks.go +++ b/x/gov/keeper/hooks.go @@ -1,6 +1,9 @@ package keeper import ( + context "context" + + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -22,19 +25,20 @@ 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 { +func (h Hooks) BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) // does the delegator have a governance delegation? - govDelegation, found := h.k.GetGovernanceDelegation(ctx, delAddr) + govDelegation, found := h.k.GetGovernanceDelegation(sdkCtx, delAddr) if !found { return nil } govAddr := types.MustGovernorAddressFromBech32(govDelegation.GovernorAddress) // Fetch the delegation - delegation, _ := h.k.sk.GetDelegation(ctx, delAddr, valAddr) + delegation, _ := h.k.sk.GetDelegation(sdkCtx, delAddr, valAddr) // update the Governor's Validator shares - h.k.DecreaseGovernorShares(ctx, govAddr, valAddr, delegation.Shares) + h.k.DecreaseGovernorShares(sdkCtx, govAddr, valAddr, delegation.Shares) return nil } @@ -42,61 +46,62 @@ 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 { +func (h Hooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) // does the delegator have a governance delegation? - govDelegation, found := h.k.GetGovernanceDelegation(ctx, delAddr) + govDelegation, found := h.k.GetGovernanceDelegation(sdkCtx, delAddr) if !found { return nil } // Fetch the delegation - delegation, found := h.k.sk.GetDelegation(ctx, delAddr, valAddr) - if !found { - return nil + delegation, err := h.k.sk.GetDelegation(sdkCtx, delAddr, valAddr) + if err != nil { + return err } - governor, _ := h.k.GetGovernor(ctx, types.MustGovernorAddressFromBech32(govDelegation.GovernorAddress)) + governor, _ := h.k.GetGovernor(sdkCtx, 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) + h.k.IncreaseGovernorShares(sdkCtx, governor.GetAddress(), valAddr, shares) return nil } -func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error { +func (h Hooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error { return nil } -func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h Hooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { +func (h Hooks) AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error { return nil } -func (h Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error { +func (h Hooks) BeforeValidatorModified(ctx context.Context, valAddr sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { +func (h Hooks) AfterValidatorRemoved(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { +func (h Hooks) AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { +func (h Hooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h Hooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { return nil } -func (h Hooks) AfterUnbondingInitiated(ctx sdk.Context, unbondingID uint64) error { +func (h Hooks) AfterUnbondingInitiated(ctx context.Context, unbondingID uint64) error { return nil } diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index c1d3ab31..92f4c691 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -5,6 +5,7 @@ package keeper import ( "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -70,18 +71,18 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I } } - valShares := make(map[string]sdk.Dec) + valShares := make(map[string]math.LegacyDec) 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) { validatorAddr := delegation.GetValidatorAddr() shares := delegation.GetShares() - if _, ok := valShares[validatorAddr.String()]; !ok { - valShares[validatorAddr.String()] = sdk.ZeroDec() - valSharesKeys = append(valSharesKeys, validatorAddr.String()) + if _, ok := valShares[validatorAddr]; !ok { + valShares[validatorAddr] = math.LegacyZeroDec() + valSharesKeys = append(valSharesKeys, validatorAddr) } - valShares[validatorAddr.String()] = valShares[validatorAddr.String()].Add(shares) + valShares[validatorAddr] = valShares[validatorAddr].Add(shares) return false }) return false @@ -106,7 +107,7 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I } keeper.IterateGovernorValShares(ctx, governor.GetAddress(), func(index int64, shares v1.GovernorValShares) bool { - if _, ok := valShares[shares.ValidatorAddress]; !ok && shares.Shares.GT(sdk.ZeroDec()) { + if _, ok := valShares[shares.ValidatorAddress]; !ok && shares.Shares.GT(math.LegacyZeroDec()) { 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 diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 72494153..18c6ffc9 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -1,123 +1,19 @@ package keeper_test import ( - "context" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "cosmossdk.io/math" - sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/atomone-hub/atomone/x/gov/keeper" "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" ) -type tallyFixture struct { - t *testing.T - - proposal v1.Proposal - valAddrs []sdk.ValAddress - delAddrs []sdk.AccAddress - totalBonded int64 - validators []stakingtypes.Validator - delegations []stakingtypes.Delegation - - keeper *keeper.Keeper - ctx sdk.Context - mocks mocks -} - -// newTallyFixture returns a configured fixture for testing the govKeeper.Tally -// method. -// - setup TotalBondedTokens call -// - initiates the validators with a self delegation of 1: -// - setup IterateBondedValidatorsByPower call -// - setup IterateDelegations call for validators -func newTallyFixture(t *testing.T, ctx sdk.Context, proposal v1.Proposal, - valAddrs []sdk.ValAddress, delAddrs []sdk.AccAddress, govKeeper *keeper.Keeper, - mocks mocks, -) *tallyFixture { - s := &tallyFixture{ - t: t, - ctx: ctx, - proposal: proposal, - valAddrs: valAddrs, - delAddrs: delAddrs, - keeper: govKeeper, - mocks: mocks, - } - mocks.stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()). - DoAndReturn(func(_ context.Context) (sdkmath.Int, error) { - return sdkmath.NewInt(s.totalBonded), nil - }).MaxTimes(1) - // Mocks a bunch of validators - for i := 0; i < len(valAddrs); i++ { - s.validators = append(s.validators, stakingtypes.Validator{ - OperatorAddress: valAddrs[i].String(), - Status: stakingtypes.Bonded, - Tokens: sdkmath.ZeroInt(), - DelegatorShares: sdkmath.LegacyZeroDec(), - }) - // validator self delegation - s.delegate(sdk.AccAddress(valAddrs[i]), valAddrs[i], 1) - } - mocks.stakingKeeper.EXPECT(). - IterateBondedValidatorsByPower(ctx, gomock.Any()). - DoAndReturn( - func(ctx context.Context, fn func(index int64, validator stakingtypes.ValidatorI) bool) error { - for i := 0; i < len(valAddrs); i++ { - fn(int64(i), s.validators[i]) - } - return nil - }) - mocks.stakingKeeper.EXPECT(). - IterateDelegations(ctx, gomock.Any(), gomock.Any()). - DoAndReturn( - func(ctx context.Context, voter sdk.AccAddress, fn func(index int64, d stakingtypes.DelegationI) bool) error { - for i, d := range s.delegations { - if d.DelegatorAddress == voter.String() { - fn(int64(i), d) - } - } - return nil - }).AnyTimes() - return s -} - -// delegate updates the tallyFixture delegations and validators fields. -func (s *tallyFixture) delegate(delegator sdk.AccAddress, validator sdk.ValAddress, m int64) { - // Increment total bonded according to each delegations - s.totalBonded += m - delegation := stakingtypes.Delegation{ - DelegatorAddress: delegator.String(), - ValidatorAddress: validator.String(), - } - for i := 0; i < len(s.validators); i++ { - if s.validators[i].OperatorAddress == validator.String() { - s.validators[i], delegation.Shares = s.validators[i].AddTokensFromDel(math.NewInt(m)) - break - } - } - s.delegations = append(s.delegations, delegation) -} - -// vote calls govKeeper.Vote() -func (s *tallyFixture) vote(voter sdk.AccAddress, vote v1.VoteOption) { - err := s.keeper.AddVote(s.ctx, s.proposal.Id, voter, v1.NewNonSplitVoteOption(vote), "") - require.NoError(s.t, err) -} - -func (s *tallyFixture) validatorVote(voter sdk.ValAddress, vote v1.VoteOption) { - s.vote(sdk.AccAddress(voter), vote) -} - func TestTally(t *testing.T) { tests := []struct { name string diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index bed7a7c4..c8269b42 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -353,13 +353,13 @@ func RandomizedGenState(simState *module.SimulationState) { var governorStatusChangePeriod time.Duration simState.AppParams.GetOrGenerate( - simState.Cdc, GovernorStatusChangePeriod, &governorStatusChangePeriod, simState.Rand, + GovernorStatusChangePeriod, &governorStatusChangePeriod, simState.Rand, func(r *rand.Rand) { governorStatusChangePeriod = GenDepositParamsDepositPeriod(r) }, ) var minGovernorSelfDelegation math.Int simState.AppParams.GetOrGenerate( - simState.Cdc, MinGovernorSelfDelegation, &minGovernorSelfDelegation, simState.Rand, + MinGovernorSelfDelegation, &minGovernorSelfDelegation, simState.Rand, func(r *rand.Rand) { minGovernorSelfDelegation = GenMinGovernorSelfDelegation(r) }, ) diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 263859ed..87ddcf06 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -1053,33 +1053,33 @@ func (mr *MockStakingKeeperMockRecorder) BondDenom(ctx interface{}) *gomock.Call } // GetDelegation mocks base method. -func (m *MockStakingKeeper) GetDelegation(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) (types2.Delegation, bool) { +func (m *MockStakingKeeper) GetDelegation(arg0 context.Context, arg1 types.AccAddress, arg2 types.ValAddress) (types1.Delegation, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDelegation", ctx, delAddr, valAddr) - ret0, _ := ret[0].(types2.Delegation) - ret1, _ := ret[1].(bool) + ret := m.ctrl.Call(m, "GetDelegation", arg0, arg1, arg2) + ret0, _ := ret[0].(types1.Delegation) + ret1, _ := ret[1].(error) return ret0, ret1 } // GetDelegation indicates an expected call of GetDelegation. -func (mr *MockStakingKeeperMockRecorder) GetDelegation(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) GetDelegation(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegation", reflect.TypeOf((*MockStakingKeeper)(nil).GetDelegation), ctx, delAddr, valAddr) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegation", reflect.TypeOf((*MockStakingKeeper)(nil).GetDelegation), arg0, arg1, arg2) } // GetValidator mocks base method. -func (m *MockStakingKeeper) GetValidator(ctx types.Context, addr types.ValAddress) (types2.Validator, bool) { +func (m *MockStakingKeeper) GetValidator(arg0 context.Context, arg1 types.ValAddress) (types1.Validator, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidator", ctx, addr) - ret0, _ := ret[0].(types2.Validator) - ret1, _ := ret[1].(bool) + ret := m.ctrl.Call(m, "GetValidator", arg0, arg1) + ret0, _ := ret[0].(types1.Validator) + ret1, _ := ret[1].(error) return ret0, ret1 } // GetValidator indicates an expected call of GetValidator. -func (mr *MockStakingKeeperMockRecorder) GetValidator(ctx, addr interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) GetValidator(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidator", reflect.TypeOf((*MockStakingKeeper)(nil).GetValidator), ctx, addr) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidator", reflect.TypeOf((*MockStakingKeeper)(nil).GetValidator), arg0, arg1) } // IterateBondedValidatorsByPower mocks base method. diff --git a/x/gov/types/expected_keepers.go b/x/gov/types/expected_keepers.go index dee3cc24..cf62373f 100644 --- a/x/gov/types/expected_keepers.go +++ b/x/gov/types/expected_keepers.go @@ -17,8 +17,8 @@ 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) + GetValidator(context.Context, sdk.ValAddress) (stakingtypes.Validator, error) + GetDelegation(context.Context, sdk.AccAddress, sdk.ValAddress) (stakingtypes.Delegation, error) // iterate through bonded validators by operator address, execute func for each validator IterateBondedValidatorsByPower( diff --git a/x/gov/types/v1/delegation.go b/x/gov/types/v1/delegation.go index acefc2d9..0d7d3909 100644 --- a/x/gov/types/v1/delegation.go +++ b/x/gov/types/v1/delegation.go @@ -3,6 +3,7 @@ package v1 import ( "fmt" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/atomone-hub/atomone/x/gov/types" @@ -17,7 +18,7 @@ func NewGovernanceDelegation(delegatorAddr sdk.AccAddress, governorAddr types.Go } // NewGovernorValShares creates a new GovernorValShares instance -func NewGovernorValShares(governorAddr types.GovernorAddress, validatorAddress sdk.ValAddress, shares sdk.Dec) GovernorValShares { +func NewGovernorValShares(governorAddr types.GovernorAddress, validatorAddress sdk.ValAddress, shares math.LegacyDec) GovernorValShares { if shares.IsNegative() { panic(fmt.Sprintf("invalid governor val shares: %s", shares)) } diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index b8ed9d21..90e7aa38 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -73,7 +73,7 @@ var ( DefaultTargetProposalsInDepositPeriod uint64 = 5 DefaultBurnDepositNoThreshold = math.LegacyNewDecWithPrec(80, 2) DefaultMaxGovernors uint64 = 100 - DefaultMinGovernorSelfDelegation = sdk.NewInt(1000_000000) + DefaultMinGovernorSelfDelegation = math.NewInt(1000_000000) ) // Deprecated: NewDepositParams creates a new DepositParams object From 5a3dadc80c8b7d5f1521e9ce83258db7bff09868 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 4 Sep 2025 17:38:12 +0200 Subject: [PATCH 64/70] fix lint issues --- x/gov/genesis.go | 10 ++++-- x/gov/keeper/delegation.go | 29 +++++++++++++----- x/gov/keeper/delegation_test.go | 15 ++++++--- x/gov/keeper/governor.go | 18 ++++++++--- x/gov/keeper/governor_test.go | 9 ++++-- x/gov/keeper/hooks.go | 1 + x/gov/keeper/invariants.go | 9 +++++- x/gov/keeper/msg_server.go | 30 ++++++++++++++---- x/gov/keeper/tally_test.go | 54 ++++++++++++++++++++++----------- x/gov/types/address.go | 15 +++++++-- x/gov/types/errors.go | 20 ++++++------ x/gov/types/v1/delegation.go | 1 + 12 files changed, 150 insertions(+), 61 deletions(-) diff --git a/x/gov/genesis.go b/x/gov/genesis.go index 576bb3f3..6be8fe29 100644 --- a/x/gov/genesis.go +++ b/x/gov/genesis.go @@ -120,7 +120,10 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k k.SetGovernor(ctx, *governor) if governor.IsActive() { - k.DelegateToGovernor(ctx, accAddr, governor.GetAddress()) + err := k.DelegateToGovernor(ctx, accAddr, governor.GetAddress()) + if err != nil { + panic(fmt.Sprintf("failed to delegate to governor %s: %v", governor.GetAddress().String(), err)) + } } } // set governance delegations @@ -144,7 +147,10 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k panic(fmt.Sprintf("account %s is an active governor and cannot delegate", delAddr.String())) } - k.DelegateToGovernor(ctx, delAddr, govAddr) + err := k.DelegateToGovernor(ctx, delAddr, govAddr) + if err != nil { + panic(fmt.Sprintf("failed to delegate to governor %s: %v", govAddr.String(), err)) + } } } diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 32d90f19..3d6116d6 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -1,9 +1,12 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" + 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" @@ -172,14 +175,14 @@ func (k Keeper) DecreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover // UndelegateFromGovernor decreases all governor validator shares in the store // and then removes the governor delegation for the given delegator -func (k Keeper) UndelegateFromGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress) { +func (k Keeper) UndelegateFromGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress) error { delegation, found := k.GetGovernanceDelegation(ctx, delegatorAddr) if !found { - return + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "governance delegation for delegator %s not found", delegatorAddr.String()) } 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) { + err := k.sk.IterateDelegations(ctx, delegatorAddr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { valAddr, err := sdk.ValAddressFromBech32(delegation.GetValidatorAddr()) if err != nil { panic(err) // This should never happen @@ -187,17 +190,21 @@ func (k Keeper) UndelegateFromGovernor(ctx sdk.Context, delegatorAddr sdk.AccAdd k.DecreaseGovernorShares(ctx, govAddr, valAddr, delegation.GetShares()) return false }) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "failed to iterate delegations: %v", err) + } // remove the governor delegation k.RemoveGovernanceDelegation(ctx, delegatorAddr) + return nil } // DelegateGovernor creates a governor delegation for the given delegator // and increases all governor validator shares in the store -func (k Keeper) DelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, governorAddr types.GovernorAddress) { +func (k Keeper) DelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, governorAddr types.GovernorAddress) error { 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) { + err := k.sk.IterateDelegations(ctx, delegatorAddr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { valAddr, err := sdk.ValAddressFromBech32(delegation.GetValidatorAddr()) if err != nil { panic(err) // This should never happen @@ -205,12 +212,18 @@ func (k Keeper) DelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress k.IncreaseGovernorShares(ctx, governorAddr, valAddr, delegation.GetShares()) return false }) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "failed to iterate delegations: %v", err) + } + return nil } // 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) { +func (k Keeper) RedelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress, dstGovernorAddr types.GovernorAddress) error { // undelegate from the source governor - k.UndelegateFromGovernor(ctx, delegatorAddr) + if err := k.UndelegateFromGovernor(ctx, delegatorAddr); err != nil { + return err + } // delegate to the destination governor - k.DelegateToGovernor(ctx, delegatorAddr, dstGovernorAddr) + return k.DelegateToGovernor(ctx, delegatorAddr, dstGovernorAddr) } diff --git a/x/gov/keeper/delegation_test.go b/x/gov/keeper/delegation_test.go index fa36cfba..42269008 100644 --- a/x/gov/keeper/delegation_test.go +++ b/x/gov/keeper/delegation_test.go @@ -19,10 +19,13 @@ func TestGovernanceDelegate(t *testing.T) { s.delegate(s.delAddrs[2], s.valAddrs[1], 8) // Delegate to active governor - govKeeper.DelegateToGovernor(ctx, s.delAddrs[0], s.activeGovernors[0].GetAddress()) - govKeeper.DelegateToGovernor(ctx, s.delAddrs[1], s.activeGovernors[0].GetAddress()) + err := govKeeper.DelegateToGovernor(ctx, s.delAddrs[0], s.activeGovernors[0].GetAddress()) + assert.NoError(err) + err = govKeeper.DelegateToGovernor(ctx, s.delAddrs[1], s.activeGovernors[0].GetAddress()) + assert.NoError(err) // Delegate to inactive governor - govKeeper.DelegateToGovernor(ctx, s.delAddrs[2], s.inactiveGovernor.GetAddress()) + err = govKeeper.DelegateToGovernor(ctx, s.delAddrs[2], s.inactiveGovernor.GetAddress()) + assert.NoError(err) // Assert GetGovernanceDelegation deleg1, found := govKeeper.GetGovernanceDelegation(ctx, s.delAddrs[0]) @@ -112,7 +115,8 @@ func TestGovernanceDelegate(t *testing.T) { assert.ElementsMatch(valShares, inactiveGovValShares) // Assert RedelegateToGovernor - govKeeper.RedelegateToGovernor(ctx, s.delAddrs[0], s.inactiveGovernor.GetAddress()) + err = govKeeper.RedelegateToGovernor(ctx, s.delAddrs[0], s.inactiveGovernor.GetAddress()) + assert.NoError(err) allDelegs = govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.activeGovernors[0].GetAddress()) assert.ElementsMatch(allDelegs, []*v1.GovernanceDelegation{&deleg2}) allDelegs = govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.inactiveGovernor.GetAddress()) @@ -146,7 +150,8 @@ func TestGovernanceDelegate(t *testing.T) { } // Assert UndelegateFromGovernor - govKeeper.UndelegateFromGovernor(ctx, s.delAddrs[0]) + err = govKeeper.UndelegateFromGovernor(ctx, s.delAddrs[0]) + assert.NoError(err) allDelegs = govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.activeGovernors[0].GetAddress()) assert.ElementsMatch(allDelegs, []*v1.GovernanceDelegation{&deleg2}) allDelegs = govKeeper.GetAllGovernanceDelegationsByGovernor(ctx, s.inactiveGovernor.GetAddress()) diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index 30488c51..72b39d16 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -1,10 +1,12 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" - storetypes "cosmossdk.io/store/types" + 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" @@ -77,10 +79,10 @@ func (k Keeper) IterateGovernors(ctx sdk.Context, cb func(index int64, governor } } -func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorAddress) (bondedTokens math.Int) { +func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorAddress) (bondedTokens math.Int, err error) { bondedTokens = math.ZeroInt() addr := sdk.AccAddress(govAddr) - k.sk.IterateDelegations(ctx, addr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { + err = k.sk.IterateDelegations(ctx, addr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { validatorAddr, err := sdk.ValAddressFromBech32(delegation.GetValidatorAddr()) if err != nil { panic(err) // This should never happen @@ -92,8 +94,11 @@ func (k Keeper) getGovernorBondedTokens(ctx sdk.Context, govAddr types.GovernorA return false }) + if err != nil { + return math.ZeroInt(), errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "failed to iterate delegations: %v", err) + } - return bondedTokens + return bondedTokens, nil } func (k Keeper) ValidateGovernorMinSelfDelegation(ctx sdk.Context, governor v1.Governor) bool { @@ -102,7 +107,10 @@ func (k Keeper) ValidateGovernorMinSelfDelegation(ctx sdk.Context, governor v1.G return false } minGovernorSelfDelegation, _ := math.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) - bondedTokens := k.getGovernorBondedTokens(ctx, governor.GetAddress()) + bondedTokens, err := k.getGovernorBondedTokens(ctx, governor.GetAddress()) + if err != nil { + return false + } delAddr := sdk.AccAddress(governor.GetAddress()) if del, found := k.GetGovernanceDelegation(ctx, delAddr); !found || governor.GovernorAddress != del.GovernorAddress { diff --git a/x/gov/keeper/governor_test.go b/x/gov/keeper/governor_test.go index 40fa9693..0fb3af3c 100644 --- a/x/gov/keeper/governor_test.go +++ b/x/gov/keeper/governor_test.go @@ -114,7 +114,8 @@ func TestValidateGovernorMinSelfDelegation(t *testing.T) { setup: func(s *fixture) v1.Governor { govAddr := s.activeGovernors[0].GetAddress() delAddr := sdk.AccAddress(govAddr) - s.keeper.DelegateToGovernor(s.ctx, delAddr, govAddr) + err := s.keeper.DelegateToGovernor(s.ctx, delAddr, govAddr) + require.NoError(s.t, err) return s.activeGovernors[0] }, expectedPanic: false, @@ -125,7 +126,8 @@ func TestValidateGovernorMinSelfDelegation(t *testing.T) { setup: func(s *fixture) v1.Governor { govAddr := s.activeGovernors[0].GetAddress() delAddr := sdk.AccAddress(govAddr) - s.keeper.DelegateToGovernor(s.ctx, delAddr, govAddr) + err := s.keeper.DelegateToGovernor(s.ctx, delAddr, govAddr) + require.NoError(s.t, err) s.delegate(delAddr, s.valAddrs[0], 1) return s.activeGovernors[0] }, @@ -137,7 +139,8 @@ func TestValidateGovernorMinSelfDelegation(t *testing.T) { setup: func(s *fixture) v1.Governor { govAddr := s.activeGovernors[0].GetAddress() delAddr := sdk.AccAddress(govAddr) - s.keeper.DelegateToGovernor(s.ctx, delAddr, govAddr) + err := s.keeper.DelegateToGovernor(s.ctx, delAddr, govAddr) + require.NoError(s.t, err) s.delegate(delAddr, s.valAddrs[0], v1.DefaultMinGovernorSelfDelegation.Int64()) return s.activeGovernors[0] }, diff --git a/x/gov/keeper/hooks.go b/x/gov/keeper/hooks.go index 29b40215..19f0475d 100644 --- a/x/gov/keeper/hooks.go +++ b/x/gov/keeper/hooks.go @@ -4,6 +4,7 @@ import ( context "context" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index 92f4c691..1f91cd41 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -6,6 +6,7 @@ import ( "fmt" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -75,7 +76,7 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I 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) { + err := keeper.sk.IterateDelegations(ctx, delAddr, func(_ int64, delegation stakingtypes.DelegationI) (stop bool) { validatorAddr := delegation.GetValidatorAddr() shares := delegation.GetShares() if _, ok := valShares[validatorAddr]; !ok { @@ -85,6 +86,12 @@ func GovernorsDelegationsInvariant(keeper *Keeper, sk types.StakingKeeper) sdk.I valShares[validatorAddr] = valShares[validatorAddr].Add(shares) return false }) + if err != nil { + invariantStr = sdk.FormatInvariant(types.ModuleName, fmt.Sprintf("governor %s delegations", governor.GetAddress().String()), + fmt.Sprintf("failed to iterate delegations: %v", err)) + broken = true + return true + } return false }) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 5bffb5fc..70ca3c7f 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -241,7 +241,10 @@ func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovern } minSelfDelegation, _ := math.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) - bondedTokens := k.getGovernorBondedTokens(ctx, govAddr) + bondedTokens, err := k.getGovernorBondedTokens(ctx, govAddr) + if err != nil { + return nil, err + } if bondedTokens.LT(minSelfDelegation) { return nil, govtypes.ErrInsufficientGovernorDelegation.Wrapf("minimum self-delegation required: %s, total bonded tokens: %s", minSelfDelegation, bondedTokens) } @@ -254,7 +257,10 @@ 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.DelegateToGovernor(ctx, addr, govAddr) + err = k.DelegateToGovernor(ctx, addr, govAddr) + if err != nil { + return nil, err + } return &v1.MsgCreateGovernorResponse{}, nil } @@ -316,7 +322,10 @@ 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.RedelegateToGovernor(ctx, addr, govAddr) + err := k.RedelegateToGovernor(ctx, addr, govAddr) + if err != nil { + return nil, err + } } return &v1.MsgUpdateGovernorStatusResponse{}, nil } @@ -339,10 +348,16 @@ func (k msgServer) DelegateGovernor(goCtx context.Context, msg *v1.MsgDelegateGo } // redelegate if a delegation to another governor already exists if found { - k.RedelegateToGovernor(ctx, delAddr, govAddr) + err := k.RedelegateToGovernor(ctx, delAddr, govAddr) + if err != nil { + return nil, err + } } else { // Create the delegation - k.DelegateToGovernor(ctx, delAddr, govAddr) + err := k.DelegateToGovernor(ctx, delAddr, govAddr) + if err != nil { + return nil, err + } } return &v1.MsgDelegateGovernorResponse{}, nil @@ -360,7 +375,10 @@ func (k msgServer) UndelegateGovernor(goCtx context.Context, msg *v1.MsgUndelega } // Remove the delegation - k.UndelegateFromGovernor(ctx, delAddr) + err := k.UndelegateFromGovernor(ctx, delAddr) + if err != nil { + return nil, err + } return &v1.MsgUndelegateGovernorResponse{}, nil } diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 18c6ffc9..f6387d0e 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -99,7 +99,8 @@ func TestTally(t *testing.T) { // del0 VP=5 del=gov0 didn't vote s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 3) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + err := s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + require.NoError(s.t, err) // gov0 VP=3 vote=yes s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, @@ -118,7 +119,8 @@ func TestTally(t *testing.T) { // del0 VP=5 del=gov2(inactive) didn't vote s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 3) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[2]) + err := s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[2]) + require.NoError(s.t, err) // gov2(inactive) VP=3 vote=yes s.governorVote(s.govAddrs[2], v1.VoteOption_VOTE_OPTION_YES) }, @@ -138,7 +140,8 @@ func TestTally(t *testing.T) { s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 3) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + err := s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + require.NoError(s.t, err) // gov0 VP=3 vote=yes s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, @@ -158,7 +161,8 @@ func TestTally(t *testing.T) { s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 3) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_NO) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + err := s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + require.NoError(s.t, err) // gov0 VP=3 vote=yes s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, @@ -181,7 +185,8 @@ func TestTally(t *testing.T) { s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.delegate(s.delAddrs[0], s.valAddrs[1], 3) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_NO) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + err := s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + require.NoError(s.t, err) }, proposalMsgs: TestProposal, expectedPass: false, @@ -197,27 +202,33 @@ func TestTally(t *testing.T) { setup: func(s *fixture) { // del0 VP=2 del=gov0 vote=no s.delegate(s.delAddrs[0], s.valAddrs[0], 2) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + err := s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + require.NoError(s.t, err) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_NO) // del1 VP=3 del=gov0 didn't vote (so VP goes to gov0's vote) s.delegate(s.delAddrs[1], s.valAddrs[1], 3) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[1], s.govAddrs[0]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[1], s.govAddrs[0]) + require.NoError(s.t, err) // del2 VP=4 del=gov0 vote=abstain s.delegate(s.delAddrs[2], s.valAddrs[0], 4) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[2], s.govAddrs[0]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[2], s.govAddrs[0]) + require.NoError(s.t, err) s.vote(s.delAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) // del3 VP=5 del=gov0 vote=yes s.delegate(s.delAddrs[3], s.valAddrs[1], 2) s.delegate(s.delAddrs[3], s.valAddrs[2], 3) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[3], s.govAddrs[0]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[3], s.govAddrs[0]) + require.NoError(s.t, err) s.vote(s.delAddrs[3], v1.VoteOption_VOTE_OPTION_YES) // del4 VP=4 del=gov1 vote=no s.delegate(s.delAddrs[4], s.valAddrs[3], 4) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[4], s.govAddrs[1]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[4], s.govAddrs[1]) + require.NoError(s.t, err) s.vote(s.delAddrs[4], v1.VoteOption_VOTE_OPTION_NO) // del5 VP=6 del=gov1 didn't vote (so VP does to gov1's vote) s.delegate(s.delAddrs[5], s.valAddrs[3], 6) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[5], s.govAddrs[1]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[5], s.govAddrs[1]) + require.NoError(s.t, err) // gov0 VP=3 vote=yes s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, @@ -235,27 +246,33 @@ func TestTally(t *testing.T) { setup: func(s *fixture) { // del0 VP=2 del=gov0 vote=no s.delegate(s.delAddrs[0], s.valAddrs[0], 2) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + err := s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[0], s.govAddrs[0]) + require.NoError(s.t, err) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_NO) // del1 VP=3 del=gov0 didn't vote (so VP goes to gov0's vote) s.delegate(s.delAddrs[1], s.valAddrs[1], 3) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[1], s.govAddrs[0]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[1], s.govAddrs[0]) + require.NoError(s.t, err) // del2 VP=4 del=gov0 vote=abstain s.delegate(s.delAddrs[2], s.valAddrs[0], 4) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[2], s.govAddrs[0]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[2], s.govAddrs[0]) + require.NoError(s.t, err) s.vote(s.delAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) // del3 VP=5 del=gov0 vote=yes s.delegate(s.delAddrs[3], s.valAddrs[1], 2) s.delegate(s.delAddrs[3], s.valAddrs[2], 3) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[3], s.govAddrs[0]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[3], s.govAddrs[0]) + require.NoError(s.t, err) s.vote(s.delAddrs[3], v1.VoteOption_VOTE_OPTION_YES) // del4 VP=4 del=gov1 vote=no s.delegate(s.delAddrs[4], s.valAddrs[3], 4) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[4], s.govAddrs[1]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[4], s.govAddrs[1]) + require.NoError(s.t, err) s.vote(s.delAddrs[4], v1.VoteOption_VOTE_OPTION_NO) // del5 VP=6 del=gov1 didn't vote (so VP does to gov1's vote) s.delegate(s.delAddrs[5], s.valAddrs[3], 6) - s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[5], s.govAddrs[1]) + err = s.keeper.DelegateToGovernor(s.ctx, s.delAddrs[5], s.govAddrs[1]) + require.NoError(s.t, err) // gov0 VP=3 vote=yes s.governorVote(s.govAddrs[0], v1.VoteOption_VOTE_OPTION_YES) // gov1 VP=3 vote=abstain @@ -577,7 +594,8 @@ func TestTally(t *testing.T) { accAddr := sdk.AccAddress(govAddr) s.delegate(accAddr, s.valAddrs[0], 1) s.delegate(accAddr, s.valAddrs[1], 2) - govKeeper.DelegateToGovernor(ctx, accAddr, govAddr) + err := govKeeper.DelegateToGovernor(ctx, accAddr, govAddr) + require.NoError(t, err) } // Submit and activate a proposal proposal, err := govKeeper.SubmitProposal(ctx, tt.proposalMsgs, "", "title", "summary", s.delAddrs[0]) diff --git a/x/gov/types/address.go b/x/gov/types/address.go index eec4d670..339f9090 100644 --- a/x/gov/types/address.go +++ b/x/gov/types/address.go @@ -162,11 +162,20 @@ func (ga GovernorAddress) String() string { func (ga GovernorAddress) Format(s fmt.State, verb rune) { switch verb { case 's': - s.Write([]byte(ga.String())) + _, err := s.Write([]byte(ga.String())) + if err != nil { + panic(err) + } case 'p': - s.Write([]byte(fmt.Sprintf("%p", ga))) + _, err := s.Write([]byte(fmt.Sprintf("%p", ga))) + if err != nil { + panic(err) + } default: - s.Write([]byte(fmt.Sprintf("%X", []byte(ga)))) + _, err := s.Write([]byte(fmt.Sprintf("%X", []byte(ga)))) + if err != nil { + panic(err) + } } } diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 850be2cd..086931ba 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -23,14 +23,14 @@ var ( ErrMinDepositTooSmall = errors.Register(ModuleName, 160, "minimum deposit is too small") ErrInvalidConstitutionAmendment = errors.Register(ModuleName, 170, "invalid constitution amendment") ErrUnknownProposal = errors.Register(ModuleName, 180, "unknown proposal") - ErrGovernorExists = errors.Register(ModuleName, 300, "governor already exists") //nolint:staticcheck - ErrUnknownGovernor = errors.Register(ModuleName, 310, "unknown governor") //nolint:staticcheck - ErrInvalidGovernorStatus = errors.Register(ModuleName, 320, "invalid governor status") //nolint:staticcheck - ErrGovernanceDelegationExists = errors.Register(ModuleName, 330, "governance delegation already exists") //nolint:staticcheck - ErrUnknownGovernanceDelegation = errors.Register(ModuleName, 340, "unknown governance delegation") //nolint:staticcheck - ErrInvalidGovernanceDescription = errors.Register(ModuleName, 350, "invalid governance description") //nolint:staticcheck - ErrDelegatorIsGovernor = errors.Register(ModuleName, 360, "cannot delegate, delegator is an active governor") //nolint:staticcheck - ErrGovernorStatusEqual = errors.Register(ModuleName, 370, "cannot change governor status to the same status") //nolint:staticcheck - ErrGovernorStatusChangePeriod = errors.Register(ModuleName, 380, "governor status change period not elapsed") //nolint:staticcheck - ErrInsufficientGovernorDelegation = errors.Register(ModuleName, 390, "insufficient governor self-delegation") //nolint:staticcheck + ErrGovernorExists = errors.Register(ModuleName, 300, "governor already exists") + ErrUnknownGovernor = errors.Register(ModuleName, 310, "unknown governor") + ErrInvalidGovernorStatus = errors.Register(ModuleName, 320, "invalid governor status") + ErrGovernanceDelegationExists = errors.Register(ModuleName, 330, "governance delegation already exists") + ErrUnknownGovernanceDelegation = errors.Register(ModuleName, 340, "unknown governance delegation") + ErrInvalidGovernanceDescription = errors.Register(ModuleName, 350, "invalid governance description") + ErrDelegatorIsGovernor = errors.Register(ModuleName, 360, "cannot delegate, delegator is an active governor") + ErrGovernorStatusEqual = errors.Register(ModuleName, 370, "cannot change governor status to the same status") + ErrGovernorStatusChangePeriod = errors.Register(ModuleName, 380, "governor status change period not elapsed") + ErrInsufficientGovernorDelegation = errors.Register(ModuleName, 390, "insufficient governor self-delegation") ) diff --git a/x/gov/types/v1/delegation.go b/x/gov/types/v1/delegation.go index 0d7d3909..22983bf2 100644 --- a/x/gov/types/v1/delegation.go +++ b/x/gov/types/v1/delegation.go @@ -4,6 +4,7 @@ import ( "fmt" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/atomone-hub/atomone/x/gov/types" From b16a6ffb573d989e7d06688d2d3703bc8ed2fb1b Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Wed, 24 Sep 2025 18:48:33 +0200 Subject: [PATCH 65/70] add events and some safety checks --- x/gov/keeper/delegation.go | 7 +-- x/gov/keeper/governor.go | 6 ++ x/gov/keeper/hooks.go | 50 +++++++++++++-- x/gov/keeper/msg_server.go | 125 +++++++++++++++++++++++++++++++------ x/gov/types/errors.go | 6 +- x/gov/types/events.go | 13 ++++ 6 files changed, 176 insertions(+), 31 deletions(-) diff --git a/x/gov/keeper/delegation.go b/x/gov/keeper/delegation.go index 3d6116d6..3fa6db9b 100644 --- a/x/gov/keeper/delegation.go +++ b/x/gov/keeper/delegation.go @@ -1,7 +1,6 @@ package keeper import ( - errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" @@ -178,7 +177,7 @@ func (k Keeper) DecreaseGovernorShares(ctx sdk.Context, governorAddr types.Gover func (k Keeper) UndelegateFromGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress) error { delegation, found := k.GetGovernanceDelegation(ctx, delegatorAddr) if !found { - return errorsmod.Wrapf(sdkerrors.ErrNotFound, "governance delegation for delegator %s not found", delegatorAddr.String()) + return types.ErrGovernanceDelegationNotFound.Wrapf("governance delegation for delegator %s does not exist", delegatorAddr.String()) } govAddr := types.MustGovernorAddressFromBech32(delegation.GovernorAddress) // iterate all delegations of delegator and decrease shares @@ -191,7 +190,7 @@ func (k Keeper) UndelegateFromGovernor(ctx sdk.Context, delegatorAddr sdk.AccAdd return false }) if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "failed to iterate delegations: %v", err) + return sdkerrors.ErrInvalidRequest.Wrapf("failed to iterate delegations: %v", err) } // remove the governor delegation k.RemoveGovernanceDelegation(ctx, delegatorAddr) @@ -213,7 +212,7 @@ func (k Keeper) DelegateToGovernor(ctx sdk.Context, delegatorAddr sdk.AccAddress return false }) if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "failed to iterate delegations: %v", err) + return sdkerrors.ErrInvalidRequest.Wrapf("failed to iterate delegations: %v", err) } return nil } diff --git a/x/gov/keeper/governor.go b/x/gov/keeper/governor.go index 72b39d16..b06f81f2 100644 --- a/x/gov/keeper/governor.go +++ b/x/gov/keeper/governor.go @@ -31,6 +31,12 @@ func (k Keeper) SetGovernor(ctx sdk.Context, governor v1.Governor) { store.Set(types.GovernorKey(governor.GetAddress()), bz) } +// RemoveGovernor removes the governor from the store +func (k Keeper) RemoveGovernor(ctx sdk.Context, addr types.GovernorAddress) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.GovernorKey(addr)) +} + // GetAllGovernors returns all governors func (k Keeper) GetAllGovernors(ctx sdk.Context) (governors []*v1.Governor) { store := ctx.KVStore(k.storeKey) diff --git a/x/gov/keeper/hooks.go b/x/gov/keeper/hooks.go index 19f0475d..303229d9 100644 --- a/x/gov/keeper/hooks.go +++ b/x/gov/keeper/hooks.go @@ -9,6 +9,7 @@ import ( 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 @@ -61,21 +62,62 @@ func (h Hooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddre return err } - governor, _ := h.k.GetGovernor(sdkCtx, types.MustGovernorAddressFromBech32(govDelegation.GovernorAddress)) + govAddr := types.MustGovernorAddressFromBech32(govDelegation.GovernorAddress) // Calculate the new shares and update the Governor's shares shares := delegation.Shares - h.k.IncreaseGovernorShares(sdkCtx, governor.GetAddress(), valAddr, shares) + h.k.IncreaseGovernorShares(sdkCtx, govAddr, valAddr, shares) + + // if the delegator is also an active governor, ensure min self-delegation requirement is met, + // otherwise set governor to inactive + delGovAddr := types.GovernorAddress(delAddr.Bytes()) + if governor, found := h.k.GetGovernor(sdkCtx, delGovAddr); found && governor.IsActive() { + if governor.GetAddress().String() != govDelegation.GovernorAddress { + panic("active governor delegating to another governor") + } + // if the governor no longer meets the min self-delegation, set to inactive + if !h.k.ValidateGovernorMinSelfDelegation(sdkCtx, governor) { + governor.Status = v1.Inactive + now := sdkCtx.BlockTime() + governor.LastStatusChangeTime = &now + h.k.SetGovernor(sdkCtx, governor) + } + } return nil } -func (h Hooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error { +// BeforeDelegationRemoved is called when a delegation is removed +// We verify if the delegator is also an active governor and if so check +// that the min self-delegation requirement is still met, otherwise set governor +// status to inactive +func (h Hooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + // if the delegator is also an active governor, ensure min self-delegation requirement is met, + // otherwise set governor to inactive + delGovAddr := types.GovernorAddress(delAddr.Bytes()) + if governor, found := h.k.GetGovernor(sdkCtx, delGovAddr); found && governor.IsActive() { + govDelegation, found := h.k.GetGovernanceDelegation(sdkCtx, delAddr) + if !found { + panic("active governor without governance self-delegation") + } + if governor.GetAddress().String() != govDelegation.GovernorAddress { + panic("active governor delegating to another governor") + } + // if the governor no longer meets the min self-delegation, set to inactive + if !h.k.ValidateGovernorMinSelfDelegation(sdkCtx, governor) { + governor.Status = v1.Inactive + now := sdkCtx.BlockTime() + governor.LastStatusChangeTime = &now + h.k.SetGovernor(sdkCtx, governor) + } + } + return nil } -func (h Hooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h Hooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error { return nil } diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 70ca3c7f..acb9e5b4 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -5,10 +5,9 @@ import ( "fmt" "cosmossdk.io/errors" - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors1 "github.com/cosmos/cosmos-sdk/types/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/atomone-hub/atomone/x/gov/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" @@ -172,7 +171,7 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1.MsgDeposit) (*v1.MsgDe // validateDeposit validates the deposit amount, do not use for initial deposit. func validateDeposit(amount sdk.Coins) error { if !amount.IsValid() || !amount.IsAllPositive() { - return sdkerrors1.ErrInvalidCoins.Wrap(amount.String()) + return sdkerrors.ErrInvalidCoins.Wrap(amount.String()) } return nil @@ -202,7 +201,7 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *v1.MsgUpdateParams) // ProposeLaw implements the MsgServer.ProposeLaw method. func (k msgServer) ProposeLaw(goCtx context.Context, msg *v1.MsgProposeLaw) (*v1.MsgProposeLawResponse, error) { if k.authority != msg.Authority { - return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority) + return nil, govtypes.ErrInvalidSigner.Wrapf("invalid authority; expected %s, got %s", k.authority, msg.Authority) } // only a no-op for now return &v1.MsgProposeLawResponse{}, nil @@ -211,7 +210,7 @@ func (k msgServer) ProposeLaw(goCtx context.Context, msg *v1.MsgProposeLaw) (*v1 // ProposeConstitutionAmendment implements the MsgServer.ProposeConstitutionAmendment method. func (k msgServer) ProposeConstitutionAmendment(goCtx context.Context, msg *v1.MsgProposeConstitutionAmendment) (*v1.MsgProposeConstitutionAmendmentResponse, error) { if k.authority != msg.Authority { - return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority) + return nil, govtypes.ErrInvalidSigner.Wrapf("invalid authority; expected %s, got %s", k.authority, msg.Authority) } if msg.Amendment == "" { return nil, govtypes.ErrInvalidProposalMsg.Wrap("amendment cannot be empty") @@ -240,18 +239,15 @@ func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovern return nil, err } - minSelfDelegation, _ := math.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) - bondedTokens, err := k.getGovernorBondedTokens(ctx, govAddr) + // Create the governor + governor, err := v1.NewGovernor(govAddr.String(), msg.Description, ctx.BlockTime()) if err != nil { return nil, err } - if bondedTokens.LT(minSelfDelegation) { - 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()) - if err != nil { - return nil, err + // validate min self-delegation + if k.ValidateGovernorMinSelfDelegation(ctx, governor) { + return nil, govtypes.ErrInsufficientGovernorDelegation.Wrap("minimum self-delegation not met") } k.SetGovernor(ctx, governor) @@ -262,6 +258,13 @@ func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovern return nil, err } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + govtypes.EventTypeCreateGovernor, + sdk.NewAttribute(govtypes.AttributeKeyGovernor, govAddr.String()), + ), + }) + return &v1.MsgCreateGovernorResponse{}, nil } @@ -273,7 +276,7 @@ func (k msgServer) EditGovernor(goCtx context.Context, msg *v1.MsgEditGovernor) govAddr := govtypes.GovernorAddress(addr.Bytes()) governor, found := k.GetGovernor(ctx, govAddr) if !found { - return nil, govtypes.ErrUnknownGovernor + return nil, govtypes.ErrGovernorNotFound } // Ensure the governor has a valid description @@ -285,6 +288,13 @@ func (k msgServer) EditGovernor(goCtx context.Context, msg *v1.MsgEditGovernor) governor.Description = msg.Description k.SetGovernor(ctx, governor) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + govtypes.EventTypeEditGovernor, + sdk.NewAttribute(govtypes.AttributeKeyGovernor, govAddr.String()), + ), + }) + return &v1.MsgEditGovernorResponse{}, nil } @@ -296,7 +306,7 @@ func (k msgServer) UpdateGovernorStatus(goCtx context.Context, msg *v1.MsgUpdate govAddr := govtypes.GovernorAddress(addr.Bytes()) governor, found := k.GetGovernor(ctx, govAddr) if !found { - return nil, govtypes.ErrUnknownGovernor + return nil, govtypes.ErrGovernorNotFound } if !msg.Status.IsValid() { @@ -318,15 +328,42 @@ func (k msgServer) UpdateGovernorStatus(goCtx context.Context, msg *v1.MsgUpdate // Update the governor status governor.Status = msg.Status governor.LastStatusChangeTime = &changeTime + // prevent a change to active if min self-delegation is not met + if governor.IsActive() { + if !k.ValidateGovernorMinSelfDelegation(ctx, governor) { + return nil, govtypes.ErrInsufficientGovernorDelegation.Wrap("cannot set status to active: minimum self-delegation not met") + } + } + k.SetGovernor(ctx, governor) + status := govtypes.AttributeValueStatusInactive // if status changes to active, create governance self-delegation // in case it didn't exist if governor.IsActive() { - err := k.RedelegateToGovernor(ctx, addr, govAddr) - if err != nil { - return nil, err + delegation, found := k.GetGovernanceDelegation(ctx, addr) + if !found { + err := k.DelegateToGovernor(ctx, addr, govAddr) + if err != nil { + return nil, err + } } + if delegation.GovernorAddress != govAddr.String() { + err := k.RedelegateToGovernor(ctx, addr, govAddr) + if err != nil { + return nil, err + } + } + status = govtypes.AttributeValueStatusActive } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + govtypes.EventTypeGovernorChangeStatus, + sdk.NewAttribute(govtypes.AttributeKeyGovernor, govAddr.String()), + sdk.NewAttribute(govtypes.AttributeKeyStatus, status), + ), + }) + return &v1.MsgUpdateGovernorStatusResponse{}, nil } @@ -352,12 +389,29 @@ func (k msgServer) DelegateGovernor(goCtx context.Context, msg *v1.MsgDelegateGo if err != nil { return nil, err } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + govtypes.EventTypeRedelegate, + sdk.NewAttribute(govtypes.AttributeKeySrcGovernor, gd.GovernorAddress), + sdk.NewAttribute(govtypes.AttributeKeyDstGovernor, msg.GovernorAddress), + sdk.NewAttribute(govtypes.AttributeKeyDelegator, msg.DelegatorAddress), + ), + }) } else { // Create the delegation err := k.DelegateToGovernor(ctx, delAddr, govAddr) if err != nil { return nil, err } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + govtypes.EventTypeDelegate, + sdk.NewAttribute(govtypes.AttributeKeyDstGovernor, msg.GovernorAddress), + sdk.NewAttribute(govtypes.AttributeKeyDelegator, msg.DelegatorAddress), + ), + }) } return &v1.MsgDelegateGovernorResponse{}, nil @@ -369,9 +423,21 @@ func (k msgServer) UndelegateGovernor(goCtx context.Context, msg *v1.MsgUndelega delAddr := sdk.MustAccAddressFromBech32(msg.DelegatorAddress) // Ensure the delegation exists - _, found := k.GetGovernanceDelegation(ctx, delAddr) + delegation, found := k.GetGovernanceDelegation(ctx, delAddr) if !found { - return nil, govtypes.ErrUnknownGovernanceDelegation + return nil, govtypes.ErrGovernanceDelegationNotFound + } + + // if the delegator is also a governor, check if governor is active + // if so, undelegation is not allowed. A status change to inactive is required first. + delGovAddr := govtypes.GovernorAddress(delAddr.Bytes()) + delGovernor, found := k.GetGovernor(ctx, delGovAddr) + if found && delGovernor.IsActive() { + // if the delegation is not to self the state is inconsistent + if delegation.GovernorAddress != delGovAddr.String() { + panic("inconsistent state: active governor has a governance delegation to another governor") + } + return nil, govtypes.ErrDelegatorIsGovernor } // Remove the delegation @@ -380,6 +446,25 @@ func (k msgServer) UndelegateGovernor(goCtx context.Context, msg *v1.MsgUndelega return nil, err } + // if governor is inactive and does not have any delegations left, remove governor + governor, found := k.GetGovernor(ctx, govtypes.MustGovernorAddressFromBech32(delegation.GovernorAddress)) + if !found { + panic("inconsistent state: governance delegation to non-existing governor") + } + if !governor.IsActive() { + delegations := k.GetAllGovernanceDelegationsByGovernor(ctx, governor.GetAddress()) + if len(delegations) == 0 { + k.RemoveGovernor(ctx, governor.GetAddress()) + } + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + govtypes.EventTypeUndelegate, + sdk.NewAttribute(govtypes.AttributeKeySrcGovernor, delegation.GovernorAddress), + sdk.NewAttribute(govtypes.AttributeKeyDelegator, msg.DelegatorAddress), + ), + }) return &v1.MsgUndelegateGovernorResponse{}, nil } diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 086931ba..494e1e78 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -24,12 +24,12 @@ var ( ErrInvalidConstitutionAmendment = errors.Register(ModuleName, 170, "invalid constitution amendment") ErrUnknownProposal = errors.Register(ModuleName, 180, "unknown proposal") ErrGovernorExists = errors.Register(ModuleName, 300, "governor already exists") - ErrUnknownGovernor = errors.Register(ModuleName, 310, "unknown governor") + ErrGovernorNotFound = errors.Register(ModuleName, 310, "governor not found") ErrInvalidGovernorStatus = errors.Register(ModuleName, 320, "invalid governor status") ErrGovernanceDelegationExists = errors.Register(ModuleName, 330, "governance delegation already exists") - ErrUnknownGovernanceDelegation = errors.Register(ModuleName, 340, "unknown governance delegation") + ErrGovernanceDelegationNotFound = errors.Register(ModuleName, 340, "governance delegation not found") ErrInvalidGovernanceDescription = errors.Register(ModuleName, 350, "invalid governance description") - ErrDelegatorIsGovernor = errors.Register(ModuleName, 360, "cannot delegate, delegator is an active governor") + ErrDelegatorIsGovernor = errors.Register(ModuleName, 360, "cannot explicitly manage governance delegations, delegator is an active governor") ErrGovernorStatusEqual = errors.Register(ModuleName, 370, "cannot change governor status to the same status") ErrGovernorStatusChangePeriod = errors.Register(ModuleName, 380, "governor status change period not elapsed") ErrInsufficientGovernorDelegation = errors.Register(ModuleName, 390, "insufficient governor self-delegation") diff --git a/x/gov/types/events.go b/x/gov/types/events.go index 99b5305e..dbb1d134 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -11,6 +11,12 @@ const ( EventTypeQuorumCheck = "quorum_check" EventTypeMinDepositChange = "min_deposit_change" EventTypeMinInitialDepositChange = "min_initial_deposit_change" + EventTypeCreateGovernor = "create_governor" + EventTypeEditGovernor = "edit_governor" + EventTypeGovernorChangeStatus = "governor_change_status" + EventTypeDelegate = "delegate_governor" + EventTypeUndelegate = "undelegate_governor" + EventTypeRedelegate = "redelegate_governor" AttributeKeyVoter = "voter" AttributeKeyProposalResult = "proposal_result" @@ -32,4 +38,11 @@ const ( AttributeKeyLastMinDeposit = "last_min_deposit" // last min deposit value AttributeKeyNewMinInitialDeposit = "new_min_initial_deposit" // new min initial deposit value AttributeKeyLastMinInitialDeposit = "last_min_initial_deposit" // last min initial deposit value + AttributeKeySrcGovernor = "source_governor" + AttributeKeyDstGovernor = "destination_governor" + AttributeKeyDelegator = "delegator" + AttributeKeyGovernor = "governor" + AttributeKeyStatus = "status" + AttributeValueStatusInactive = "inactive" + AttributeValueStatusActive = "active" ) From 01504a7b0ec0b16db44d6309e7930f6f00542a95 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Fri, 26 Sep 2025 18:54:24 +0200 Subject: [PATCH 66/70] fix merge issue --- app/keepers/keepers.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index aad7a1d9..29fffef6 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -263,16 +263,6 @@ func NewAppKeeper( appKeepers.StakingKeeper, ) - // 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.CoreDaosKeeper.StakingHooks(), - ), - ) - evidenceKeeper := evidencekeeper.NewKeeper( appCodec, runtime.NewKVStoreService(appKeepers.keys[evidencetypes.StoreKey]), @@ -291,6 +281,7 @@ func NewAppKeeper( appKeepers.DistrKeeper.Hooks(), appKeepers.SlashingKeeper.Hooks(), appKeepers.GovKeeper.StakingHooks(), + appKeepers.CoreDaosKeeper.StakingHooks(), ), ) From fcded6e9278299b602bdff3fd1bb894607fb298d Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Mon, 29 Sep 2025 15:08:45 +0200 Subject: [PATCH 67/70] fix tests --- x/gov/keeper/tally_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 633bf790..5508881c 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -580,6 +580,7 @@ func TestTally(t *testing.T) { s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_NO) + s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_ABSTAIN) }, proposalMsgs: TestLawProposal, expectedPass: false, @@ -587,7 +588,7 @@ func TestTally(t *testing.T) { endorse: false, expectedTally: v1.TallyResult{ YesCount: "3", - AbstainCount: "0", + AbstainCount: "1", NoCount: "1", }, }, @@ -598,6 +599,7 @@ func TestTally(t *testing.T) { s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_NO) + s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_ABSTAIN) }, proposalMsgs: TestLawProposal, expectedPass: true, @@ -605,7 +607,7 @@ func TestTally(t *testing.T) { endorse: true, expectedTally: v1.TallyResult{ YesCount: "3", - AbstainCount: "0", + AbstainCount: "1", NoCount: "1", }, }, From 906a22cb11670d8975fac0d7a7f369069184cc93 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Mon, 29 Sep 2025 19:53:45 +0200 Subject: [PATCH 68/70] fix e2e tests and revert wrong change --- tests/e2e/e2e_coredaos_test.go | 7 +++---- x/gov/keeper/msg_server.go | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/e2e/e2e_coredaos_test.go b/tests/e2e/e2e_coredaos_test.go index 01ec4cc1..ed4ce907 100644 --- a/tests/e2e/e2e_coredaos_test.go +++ b/tests/e2e/e2e_coredaos_test.go @@ -6,7 +6,6 @@ import ( coredaostypes "github.com/atomone-hub/atomone/x/coredaos/types" govtypesv1 "github.com/atomone-hub/atomone/x/gov/types/v1" - govtypesv1beta1 "github.com/atomone-hub/atomone/x/gov/types/v1beta1" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -30,7 +29,7 @@ func (s *IntegrationTestSuite) testCoreDAOs() { submitGovFlags := []string{configFile(proposalParamChangeFilename)} depositGovFlags := []string{strconv.Itoa(proposalCounter), s.queryGovMinDeposit(chainAAPIEndpoint).String()} voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.submitGovProposal(chainAAPIEndpoint, senderAddress.String(), proposalCounter, "atomone.coredaos.v1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1beta1.StatusPassed) + s.submitGovProposal(chainAAPIEndpoint, senderAddress.String(), proposalCounter, "atomone.coredaos.v1.MsgUpdateParams", submitGovFlags, depositGovFlags, voteGovFlags, "vote", govtypesv1.StatusPassed) newParams := s.queryCoreDAOsParams(chainAAPIEndpoint) s.Require().Equal(newParams.Params.SteeringDaoAddress, steeringDAOAddress.String()) @@ -161,7 +160,7 @@ func (s *IntegrationTestSuite) submitVotingPeriodLawProposal(c *chain) int { depositGovFlags = append(depositGovFlags, depositString) senderAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() sender := senderAddress.String() - s.submitGovCommand(chainAAPIEndpoint, sender, proposalCounter, "submit-proposal", submitGovFlags, govtypesv1beta1.StatusDepositPeriod) - s.submitGovCommand(chainAAPIEndpoint, sender, proposalCounter, "deposit", depositGovFlags, govtypesv1beta1.StatusVotingPeriod) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalCounter, "submit-proposal", submitGovFlags, govtypesv1.StatusDepositPeriod) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalCounter, "deposit", depositGovFlags, govtypesv1.StatusVotingPeriod) return proposalCounter } diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index acb9e5b4..2d6586c6 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -5,6 +5,7 @@ import ( "fmt" "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -246,8 +247,10 @@ func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovern } // validate min self-delegation - if k.ValidateGovernorMinSelfDelegation(ctx, governor) { - return nil, govtypes.ErrInsufficientGovernorDelegation.Wrap("minimum self-delegation not met") + minSelfDelegation, _ := math.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) + bondedTokens, err := k.getGovernorBondedTokens(ctx, govAddr) + if bondedTokens.LT(minSelfDelegation) { + return nil, govtypes.ErrInsufficientGovernorDelegation.Wrapf("minimum self-delegation required: %s, total bonded tokens: %s", minSelfDelegation, bondedTokens) } k.SetGovernor(ctx, governor) From 9ab91edbeae1485a82cb8340fbb0a6860351fb06 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Mon, 29 Sep 2025 20:00:58 +0200 Subject: [PATCH 69/70] fix lint error --- x/gov/keeper/msg_server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 2d6586c6..09b2e89d 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -249,6 +249,9 @@ func (k msgServer) CreateGovernor(goCtx context.Context, msg *v1.MsgCreateGovern // validate min self-delegation minSelfDelegation, _ := math.NewIntFromString(k.GetParams(ctx).MinGovernorSelfDelegation) bondedTokens, err := k.getGovernorBondedTokens(ctx, govAddr) + if err != nil { + return nil, err + } if bondedTokens.LT(minSelfDelegation) { return nil, govtypes.ErrInsufficientGovernorDelegation.Wrapf("minimum self-delegation required: %s, total bonded tokens: %s", minSelfDelegation, bondedTokens) } From a31a8a26f17e9b17706a6c3c7cfb665bd1c8ff40 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:18:42 +0100 Subject: [PATCH 70/70] add remove governor test --- x/gov/keeper/governor_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/x/gov/keeper/governor_test.go b/x/gov/keeper/governor_test.go index 0fb3af3c..96125bd2 100644 --- a/x/gov/keeper/governor_test.go +++ b/x/gov/keeper/governor_test.go @@ -82,6 +82,17 @@ func TestGovernor(t *testing.T) { } } } + + // Remove gov2 + govKeeper.RemoveGovernor(ctx, govAddrs[1]) + gov, found = govKeeper.GetGovernor(ctx, govAddrs[1]) + assert.False(found, "expected gov2 to be removed") + + // Get all govs after removal + govs = govKeeper.GetAllGovernors(ctx) + if assert.Len(govs, 1, "expected 1 governor after removal") { + assert.Equal(gov1, *govs[0]) + } } func TestValidateGovernorMinSelfDelegation(t *testing.T) {