diff --git a/.gitignore b/.gitignore index 146e44fc94f..7b61533f6e1 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,5 @@ dependency-graph.png *.synctex.gz /x/genutil/config/priv_validator_key.json /x/genutil/data/priv_validator_state.json + +debug_container.dot diff --git a/CHANGELOG.md b/CHANGELOG.md index 940c70f6376..babbc39d01a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/mint) [#12363](https://github.com/cosmos/cosmos-sdk/pull/12363) Migrate `x/mint` to self-managed parameters and deprecate it's usage of `x/params`. * (x/distribution) [#12434](https://github.com/cosmos/cosmos-sdk/pull/12434) Migrate `x/distribution` to self-managed parameters and deprecate it's usage of `x/params`. * (x/crisis) [#12445](https://github.com/cosmos/cosmos-sdk/pull/12445) Migrate `x/crisis` to self-managed parameters and deprecate it's usage of `x/params`. +* (x/gov) [#12631](https://github.com/cosmos/cosmos-sdk/pull/12631) Migrate `x/gov` to self-managed parameters and deprecate it's usage of `x/params`. * (x/staking) [#12409](https://github.com/cosmos/cosmos-sdk/pull/12409) Migrate `x/staking` to self-managed parameters and deprecate it's usage of `x/params`. * (x/bank) [#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Move the SendEnabled information out of the Params and into the state store directly. @@ -83,6 +84,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/distribution) [#12434](https://github.com/cosmos/cosmos-sdk/pull/12434) `x/distribution` module `SetParams` keeper method definition is now updated to return `error`. * (x/staking) [#12409](https://github.com/cosmos/cosmos-sdk/pull/12409) `x/staking` module `SetParams` keeper method definition is now updated to return `error`. * (x/crisis) [#12445](https://github.com/cosmos/cosmos-sdk/pull/12445) `x/crisis` module `SetConstantFee` keeper method definition is now updated to return `error`. +* (x/gov) [#12631](https://github.com/cosmos/cosmos-sdk/pull/12631) `x/gov` module refactored to use `Params` as single struct instead of `DepositParams`, `TallyParams` & `VotingParams`. +* (x/gov) [#12631](https://github.com/cosmos/cosmos-sdk/pull/12631) Migrate `x/gov` to self-managed parameters and deprecate it's usage of `x/params`. * (x/bank) [#12630](https://github.com/cosmos/cosmos-sdk/pull/12630) `x/bank` module `SetParams` keeper method definition is now updated to return `error`. * (x/bank) [\#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Move the SendEnabled information out of the Params and into the state store directly. The information can now be accessed using the BankKeeper. diff --git a/api/cosmos/gov/v1/genesis.pulsar.go b/api/cosmos/gov/v1/genesis.pulsar.go index 147979b9196..645e02ec192 100644 --- a/api/cosmos/gov/v1/genesis.pulsar.go +++ b/api/cosmos/gov/v1/genesis.pulsar.go @@ -174,6 +174,7 @@ var ( fd_GenesisState_deposit_params protoreflect.FieldDescriptor fd_GenesisState_voting_params protoreflect.FieldDescriptor fd_GenesisState_tally_params protoreflect.FieldDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor ) func init() { @@ -186,6 +187,7 @@ func init() { fd_GenesisState_deposit_params = md_GenesisState.Fields().ByName("deposit_params") fd_GenesisState_voting_params = md_GenesisState.Fields().ByName("voting_params") fd_GenesisState_tally_params = md_GenesisState.Fields().ByName("tally_params") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -295,6 +297,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } } // Has reports whether a field is populated. @@ -324,6 +332,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool return x.VotingParams != nil case "cosmos.gov.v1.GenesisState.tally_params": return x.TallyParams != nil + case "cosmos.gov.v1.GenesisState.params": + return x.Params != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.GenesisState")) @@ -354,6 +364,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { x.VotingParams = nil case "cosmos.gov.v1.GenesisState.tally_params": x.TallyParams = nil + case "cosmos.gov.v1.GenesisState.params": + x.Params = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.GenesisState")) @@ -400,6 +412,9 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "cosmos.gov.v1.GenesisState.tally_params": value := x.TallyParams return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.gov.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.GenesisState")) @@ -440,6 +455,8 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value x.VotingParams = value.Message().Interface().(*VotingParams) case "cosmos.gov.v1.GenesisState.tally_params": x.TallyParams = value.Message().Interface().(*TallyParams) + case "cosmos.gov.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.GenesisState")) @@ -493,6 +510,11 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.TallyParams = new(TallyParams) } return protoreflect.ValueOfMessage(x.TallyParams.ProtoReflect()) + case "cosmos.gov.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) case "cosmos.gov.v1.GenesisState.starting_proposal_id": panic(fmt.Errorf("field starting_proposal_id of message cosmos.gov.v1.GenesisState is not mutable")) default: @@ -528,6 +550,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "cosmos.gov.v1.GenesisState.tally_params": m := new(TallyParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.gov.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.GenesisState")) @@ -630,6 +655,10 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { l = options.Size(x.TallyParams) n += 1 + l + runtime.Sov(uint64(l)) } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -659,6 +688,20 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + 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] = 0x42 + } if x.TallyParams != nil { encoded, err := options.Marshal(x.TallyParams) if err != nil { @@ -1032,6 +1075,42 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1096,12 +1175,25 @@ type GenesisState struct { Votes []*Vote `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` // proposals defines all the proposals present at genesis. Proposals []*Proposal `protobuf:"bytes,4,rep,name=proposals,proto3" json:"proposals,omitempty"` - // params defines all the paramaters of related to deposit. + // Deprecated: Prefer to use `params` instead. + // deposit_params defines all the paramaters of related to deposit. + // + // Deprecated: Do not use. DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` - // params defines all the paramaters of related to voting. + // Deprecated: Prefer to use `params` instead. + // voting_params defines all the paramaters of related to voting. + // + // Deprecated: Do not use. VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` - // params defines all the paramaters of related to tally. + // Deprecated: Prefer to use `params` instead. + // tally_params defines all the paramaters of related to tally. + // + // Deprecated: Do not use. TallyParams *TallyParams `protobuf:"bytes,7,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,8,opt,name=params,proto3" json:"params,omitempty"` } func (x *GenesisState) Reset() { @@ -1152,6 +1244,7 @@ func (x *GenesisState) GetProposals() []*Proposal { return nil } +// Deprecated: Do not use. func (x *GenesisState) GetDepositParams() *DepositParams { if x != nil { return x.DepositParams @@ -1159,6 +1252,7 @@ func (x *GenesisState) GetDepositParams() *DepositParams { return nil } +// Deprecated: Do not use. func (x *GenesisState) GetVotingParams() *VotingParams { if x != nil { return x.VotingParams @@ -1166,6 +1260,7 @@ func (x *GenesisState) GetVotingParams() *VotingParams { return nil } +// Deprecated: Do not use. func (x *GenesisState) GetTallyParams() *TallyParams { if x != nil { return x.TallyParams @@ -1173,6 +1268,13 @@ func (x *GenesisState) GetTallyParams() *TallyParams { return nil } +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + var File_cosmos_gov_v1_genesis_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_genesis_proto_rawDesc = []byte{ @@ -1180,7 +1282,7 @@ var file_cosmos_gov_v1_genesis_proto_rawDesc = []byte{ 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x6f, 0x76, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x03, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd7, 0x03, 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, @@ -1193,30 +1295,34 @@ var file_cosmos_gov_v1_genesis_proto_rawDesc = []byte{ 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x43, + 0x73, 0x61, 0x6c, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x69, 0x6e, - 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3d, 0x0a, 0x0c, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x6c, 0x6c, - 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x42, 0x9d, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, + 0x67, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x56, + 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x02, 0x18, 0x01, 0x52, + 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x41, 0x0a, + 0x0c, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x02, 0x18, 0x01, 0x52, 0x0b, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x2d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x9d, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, + 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, + 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1240,6 +1346,7 @@ var file_cosmos_gov_v1_genesis_proto_goTypes = []interface{}{ (*DepositParams)(nil), // 4: cosmos.gov.v1.DepositParams (*VotingParams)(nil), // 5: cosmos.gov.v1.VotingParams (*TallyParams)(nil), // 6: cosmos.gov.v1.TallyParams + (*Params)(nil), // 7: cosmos.gov.v1.Params } var file_cosmos_gov_v1_genesis_proto_depIdxs = []int32{ 1, // 0: cosmos.gov.v1.GenesisState.deposits:type_name -> cosmos.gov.v1.Deposit @@ -1248,11 +1355,12 @@ var file_cosmos_gov_v1_genesis_proto_depIdxs = []int32{ 4, // 3: cosmos.gov.v1.GenesisState.deposit_params:type_name -> cosmos.gov.v1.DepositParams 5, // 4: cosmos.gov.v1.GenesisState.voting_params:type_name -> cosmos.gov.v1.VotingParams 6, // 5: cosmos.gov.v1.GenesisState.tally_params:type_name -> cosmos.gov.v1.TallyParams - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 7, // 6: cosmos.gov.v1.GenesisState.params:type_name -> cosmos.gov.v1.Params + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] 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 } func init() { file_cosmos_gov_v1_genesis_proto_init() } diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 3506e799b87..b1d9862b420 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -5117,6 +5117,850 @@ func (x *fastReflection_TallyParams) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_Params_1_list)(nil) + +type _Params_1_list struct { + list *[]*v1beta1.Coin +} + +func (x *_Params_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Params_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_Params_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Params_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_min_deposit protoreflect.FieldDescriptor + fd_Params_max_deposit_period protoreflect.FieldDescriptor + fd_Params_voting_period protoreflect.FieldDescriptor + fd_Params_quorum protoreflect.FieldDescriptor + fd_Params_threshold protoreflect.FieldDescriptor + fd_Params_veto_threshold protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_gov_v1_gov_proto_init() + md_Params = File_cosmos_gov_v1_gov_proto.Messages().ByName("Params") + fd_Params_min_deposit = md_Params.Fields().ByName("min_deposit") + fd_Params_max_deposit_period = md_Params.Fields().ByName("max_deposit_period") + fd_Params_voting_period = md_Params.Fields().ByName("voting_period") + fd_Params_quorum = md_Params.Fields().ByName("quorum") + fd_Params_threshold = md_Params.Fields().ByName("threshold") + fd_Params_veto_threshold = md_Params.Fields().ByName("veto_threshold") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[8] + 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_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// 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_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(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_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.MinDeposit) != 0 { + value := protoreflect.ValueOfList(&_Params_1_list{list: &x.MinDeposit}) + if !f(fd_Params_min_deposit, value) { + return + } + } + if x.MaxDepositPeriod != nil { + value := protoreflect.ValueOfMessage(x.MaxDepositPeriod.ProtoReflect()) + if !f(fd_Params_max_deposit_period, value) { + return + } + } + if x.VotingPeriod != nil { + value := protoreflect.ValueOfMessage(x.VotingPeriod.ProtoReflect()) + if !f(fd_Params_voting_period, value) { + return + } + } + if x.Quorum != "" { + value := protoreflect.ValueOfString(x.Quorum) + if !f(fd_Params_quorum, value) { + return + } + } + if x.Threshold != "" { + value := protoreflect.ValueOfString(x.Threshold) + if !f(fd_Params_threshold, value) { + return + } + } + if x.VetoThreshold != "" { + value := protoreflect.ValueOfString(x.VetoThreshold) + if !f(fd_Params_veto_threshold, 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_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.gov.v1.Params.min_deposit": + return len(x.MinDeposit) != 0 + case "cosmos.gov.v1.Params.max_deposit_period": + return x.MaxDepositPeriod != nil + case "cosmos.gov.v1.Params.voting_period": + return x.VotingPeriod != nil + case "cosmos.gov.v1.Params.quorum": + return x.Quorum != "" + case "cosmos.gov.v1.Params.threshold": + return x.Threshold != "" + case "cosmos.gov.v1.Params.veto_threshold": + return x.VetoThreshold != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) + } + panic(fmt.Errorf("message cosmos.gov.v1.Params 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_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.gov.v1.Params.min_deposit": + x.MinDeposit = nil + case "cosmos.gov.v1.Params.max_deposit_period": + x.MaxDepositPeriod = nil + case "cosmos.gov.v1.Params.voting_period": + x.VotingPeriod = nil + case "cosmos.gov.v1.Params.quorum": + x.Quorum = "" + case "cosmos.gov.v1.Params.threshold": + x.Threshold = "" + case "cosmos.gov.v1.Params.veto_threshold": + x.VetoThreshold = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) + } + panic(fmt.Errorf("message cosmos.gov.v1.Params 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_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.gov.v1.Params.min_deposit": + if len(x.MinDeposit) == 0 { + return protoreflect.ValueOfList(&_Params_1_list{}) + } + listValue := &_Params_1_list{list: &x.MinDeposit} + return protoreflect.ValueOfList(listValue) + case "cosmos.gov.v1.Params.max_deposit_period": + value := x.MaxDepositPeriod + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.gov.v1.Params.voting_period": + value := x.VotingPeriod + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.gov.v1.Params.quorum": + value := x.Quorum + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Params.threshold": + value := x.Threshold + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Params.veto_threshold": + value := x.VetoThreshold + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) + } + panic(fmt.Errorf("message cosmos.gov.v1.Params 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_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.gov.v1.Params.min_deposit": + lv := value.List() + clv := lv.(*_Params_1_list) + x.MinDeposit = *clv.list + case "cosmos.gov.v1.Params.max_deposit_period": + x.MaxDepositPeriod = value.Message().Interface().(*durationpb.Duration) + case "cosmos.gov.v1.Params.voting_period": + x.VotingPeriod = value.Message().Interface().(*durationpb.Duration) + case "cosmos.gov.v1.Params.quorum": + x.Quorum = value.Interface().(string) + case "cosmos.gov.v1.Params.threshold": + x.Threshold = value.Interface().(string) + case "cosmos.gov.v1.Params.veto_threshold": + x.VetoThreshold = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) + } + panic(fmt.Errorf("message cosmos.gov.v1.Params 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_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.Params.min_deposit": + if x.MinDeposit == nil { + x.MinDeposit = []*v1beta1.Coin{} + } + value := &_Params_1_list{list: &x.MinDeposit} + return protoreflect.ValueOfList(value) + case "cosmos.gov.v1.Params.max_deposit_period": + if x.MaxDepositPeriod == nil { + x.MaxDepositPeriod = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.MaxDepositPeriod.ProtoReflect()) + case "cosmos.gov.v1.Params.voting_period": + if x.VotingPeriod == nil { + x.VotingPeriod = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.VotingPeriod.ProtoReflect()) + case "cosmos.gov.v1.Params.quorum": + panic(fmt.Errorf("field quorum of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.threshold": + panic(fmt.Errorf("field threshold of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.veto_threshold": + panic(fmt.Errorf("field veto_threshold of message cosmos.gov.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) + } + panic(fmt.Errorf("message cosmos.gov.v1.Params 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_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.Params.min_deposit": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_Params_1_list{list: &list}) + case "cosmos.gov.v1.Params.max_deposit_period": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.gov.v1.Params.voting_period": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.gov.v1.Params.quorum": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Params.threshold": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Params.veto_threshold": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) + } + panic(fmt.Errorf("message cosmos.gov.v1.Params 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_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.Params", 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_Params) 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_Params) 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_Params) 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_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + 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.MinDeposit) > 0 { + for _, e := range x.MinDeposit { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.MaxDepositPeriod != nil { + l = options.Size(x.MaxDepositPeriod) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.VotingPeriod != nil { + l = options.Size(x.VotingPeriod) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Quorum) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Threshold) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.VetoThreshold) + 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().(*Params) + 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.VetoThreshold) > 0 { + i -= len(x.VetoThreshold) + copy(dAtA[i:], x.VetoThreshold) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VetoThreshold))) + i-- + dAtA[i] = 0x32 + } + if len(x.Threshold) > 0 { + i -= len(x.Threshold) + copy(dAtA[i:], x.Threshold) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Threshold))) + i-- + dAtA[i] = 0x2a + } + if len(x.Quorum) > 0 { + i -= len(x.Quorum) + copy(dAtA[i:], x.Quorum) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Quorum))) + i-- + dAtA[i] = 0x22 + } + if x.VotingPeriod != nil { + encoded, err := options.Marshal(x.VotingPeriod) + 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.MaxDepositPeriod != nil { + encoded, err := options.Marshal(x.MaxDepositPeriod) + 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.MinDeposit) > 0 { + for iNdEx := len(x.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.MinDeposit[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().(*Params) + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: 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 MinDeposit", 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.MinDeposit = append(x.MinDeposit, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MinDeposit[len(x.MinDeposit)-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 MaxDepositPeriod", 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.MaxDepositPeriod == nil { + x.MaxDepositPeriod = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MaxDepositPeriod); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", 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.VotingPeriod == nil { + x.VotingPeriod = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VotingPeriod); 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 Quorum", 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.Quorum = 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 Threshold", 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.Threshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", 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.VetoThreshold = 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. @@ -5735,6 +6579,93 @@ func (x *TallyParams) GetVetoThreshold() string { return "" } +// Params defines the parameters for the x/gov module. +// +// Since: cosmos-sdk 0.47 +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Minimum deposit for a proposal to enter voting period. + MinDeposit []*v1beta1.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit,omitempty"` + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + MaxDepositPeriod *durationpb.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3" json:"max_deposit_period,omitempty"` + // Length of the voting period. + VotingPeriod *durationpb.Duration `protobuf:"bytes,3,opt,name=voting_period,json=votingPeriod,proto3" json:"voting_period,omitempty"` + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + Quorum string `protobuf:"bytes,4,opt,name=quorum,proto3" json:"quorum,omitempty"` + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + Threshold string `protobuf:"bytes,5,opt,name=threshold,proto3" json:"threshold,omitempty"` + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{8} +} + +func (x *Params) GetMinDeposit() []*v1beta1.Coin { + if x != nil { + return x.MinDeposit + } + return nil +} + +func (x *Params) GetMaxDepositPeriod() *durationpb.Duration { + if x != nil { + return x.MaxDepositPeriod + } + return nil +} + +func (x *Params) GetVotingPeriod() *durationpb.Duration { + if x != nil { + return x.VotingPeriod + } + return nil +} + +func (x *Params) GetQuorum() string { + if x != nil { + return x.Quorum + } + return "" +} + +func (x *Params) GetThreshold() string { + if x != nil { + return x.Threshold + } + return "" +} + +func (x *Params) GetVetoThreshold() string { + if x != nil { + return x.VetoThreshold + } + return "" +} + var File_cosmos_gov_v1_gov_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ @@ -5864,39 +6795,62 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x18, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2a, 0x89, 0x01, 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, 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, - 0x10, 0x04, 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, 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, - 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, - 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0xec, 0x02, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x40, 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, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 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, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x18, 0x03, 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, 0x0c, 0x76, 0x6f, 0x74, 0x69, + 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, + 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2a, 0x89, 0x01, 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, 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, + 0x04, 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, 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, + 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, + 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5912,7 +6866,7 @@ func file_cosmos_gov_v1_gov_proto_rawDescGZIP() []byte { } var file_cosmos_gov_v1_gov_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_cosmos_gov_v1_gov_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_cosmos_gov_v1_gov_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_cosmos_gov_v1_gov_proto_goTypes = []interface{}{ (VoteOption)(0), // 0: cosmos.gov.v1.VoteOption (ProposalStatus)(0), // 1: cosmos.gov.v1.ProposalStatus @@ -5924,31 +6878,35 @@ var file_cosmos_gov_v1_gov_proto_goTypes = []interface{}{ (*DepositParams)(nil), // 7: cosmos.gov.v1.DepositParams (*VotingParams)(nil), // 8: cosmos.gov.v1.VotingParams (*TallyParams)(nil), // 9: cosmos.gov.v1.TallyParams - (*v1beta1.Coin)(nil), // 10: cosmos.base.v1beta1.Coin - (*anypb.Any)(nil), // 11: google.protobuf.Any - (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 13: google.protobuf.Duration + (*Params)(nil), // 10: cosmos.gov.v1.Params + (*v1beta1.Coin)(nil), // 11: cosmos.base.v1beta1.Coin + (*anypb.Any)(nil), // 12: google.protobuf.Any + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 14: google.protobuf.Duration } var file_cosmos_gov_v1_gov_proto_depIdxs = []int32{ 0, // 0: cosmos.gov.v1.WeightedVoteOption.option:type_name -> cosmos.gov.v1.VoteOption - 10, // 1: cosmos.gov.v1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin - 11, // 2: cosmos.gov.v1.Proposal.messages:type_name -> google.protobuf.Any + 11, // 1: cosmos.gov.v1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin + 12, // 2: cosmos.gov.v1.Proposal.messages:type_name -> google.protobuf.Any 1, // 3: cosmos.gov.v1.Proposal.status:type_name -> cosmos.gov.v1.ProposalStatus 5, // 4: cosmos.gov.v1.Proposal.final_tally_result:type_name -> cosmos.gov.v1.TallyResult - 12, // 5: cosmos.gov.v1.Proposal.submit_time:type_name -> google.protobuf.Timestamp - 12, // 6: cosmos.gov.v1.Proposal.deposit_end_time:type_name -> google.protobuf.Timestamp - 10, // 7: cosmos.gov.v1.Proposal.total_deposit:type_name -> cosmos.base.v1beta1.Coin - 12, // 8: cosmos.gov.v1.Proposal.voting_start_time:type_name -> google.protobuf.Timestamp - 12, // 9: cosmos.gov.v1.Proposal.voting_end_time:type_name -> google.protobuf.Timestamp + 13, // 5: cosmos.gov.v1.Proposal.submit_time:type_name -> google.protobuf.Timestamp + 13, // 6: cosmos.gov.v1.Proposal.deposit_end_time:type_name -> google.protobuf.Timestamp + 11, // 7: cosmos.gov.v1.Proposal.total_deposit:type_name -> cosmos.base.v1beta1.Coin + 13, // 8: cosmos.gov.v1.Proposal.voting_start_time:type_name -> google.protobuf.Timestamp + 13, // 9: cosmos.gov.v1.Proposal.voting_end_time:type_name -> google.protobuf.Timestamp 2, // 10: cosmos.gov.v1.Vote.options:type_name -> cosmos.gov.v1.WeightedVoteOption - 10, // 11: cosmos.gov.v1.DepositParams.min_deposit:type_name -> cosmos.base.v1beta1.Coin - 13, // 12: cosmos.gov.v1.DepositParams.max_deposit_period:type_name -> google.protobuf.Duration - 13, // 13: cosmos.gov.v1.VotingParams.voting_period:type_name -> google.protobuf.Duration - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 11, // 11: cosmos.gov.v1.DepositParams.min_deposit:type_name -> cosmos.base.v1beta1.Coin + 14, // 12: cosmos.gov.v1.DepositParams.max_deposit_period:type_name -> google.protobuf.Duration + 14, // 13: cosmos.gov.v1.VotingParams.voting_period:type_name -> google.protobuf.Duration + 11, // 14: cosmos.gov.v1.Params.min_deposit:type_name -> cosmos.base.v1beta1.Coin + 14, // 15: cosmos.gov.v1.Params.max_deposit_period:type_name -> google.protobuf.Duration + 14, // 16: cosmos.gov.v1.Params.voting_period:type_name -> google.protobuf.Duration + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_cosmos_gov_v1_gov_proto_init() } @@ -6053,6 +7011,18 @@ func file_cosmos_gov_v1_gov_proto_init() { return nil } } + file_cosmos_gov_v1_gov_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); 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{ @@ -6060,7 +7030,7 @@ func file_cosmos_gov_v1_gov_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_gov_v1_gov_proto_rawDesc, NumEnums: 2, - NumMessages: 8, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cosmos/gov/v1/query.pulsar.go b/api/cosmos/gov/v1/query.pulsar.go index 7ec60a60d83..677db1c2019 100644 --- a/api/cosmos/gov/v1/query.pulsar.go +++ b/api/cosmos/gov/v1/query.pulsar.go @@ -4422,6 +4422,7 @@ var ( fd_QueryParamsResponse_voting_params protoreflect.FieldDescriptor fd_QueryParamsResponse_deposit_params protoreflect.FieldDescriptor fd_QueryParamsResponse_tally_params protoreflect.FieldDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor ) func init() { @@ -4430,6 +4431,7 @@ func init() { fd_QueryParamsResponse_voting_params = md_QueryParamsResponse.Fields().ByName("voting_params") fd_QueryParamsResponse_deposit_params = md_QueryParamsResponse.Fields().ByName("deposit_params") fd_QueryParamsResponse_tally_params = md_QueryParamsResponse.Fields().ByName("tally_params") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") } var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) @@ -4515,6 +4517,12 @@ func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDesc return } } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } } // Has reports whether a field is populated. @@ -4536,6 +4544,8 @@ func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor return x.DepositParams != nil case "cosmos.gov.v1.QueryParamsResponse.tally_params": return x.TallyParams != nil + case "cosmos.gov.v1.QueryParamsResponse.params": + return x.Params != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryParamsResponse")) @@ -4558,6 +4568,8 @@ func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescript x.DepositParams = nil case "cosmos.gov.v1.QueryParamsResponse.tally_params": x.TallyParams = nil + case "cosmos.gov.v1.QueryParamsResponse.params": + x.Params = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryParamsResponse")) @@ -4583,6 +4595,9 @@ func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDe case "cosmos.gov.v1.QueryParamsResponse.tally_params": value := x.TallyParams return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.gov.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryParamsResponse")) @@ -4609,6 +4624,8 @@ func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor x.DepositParams = value.Message().Interface().(*DepositParams) case "cosmos.gov.v1.QueryParamsResponse.tally_params": x.TallyParams = value.Message().Interface().(*TallyParams) + case "cosmos.gov.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryParamsResponse")) @@ -4644,6 +4661,11 @@ func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescri x.TallyParams = new(TallyParams) } return protoreflect.ValueOfMessage(x.TallyParams.ProtoReflect()) + case "cosmos.gov.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryParamsResponse")) @@ -4666,6 +4688,9 @@ func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescr case "cosmos.gov.v1.QueryParamsResponse.tally_params": m := new(TallyParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.gov.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryParamsResponse")) @@ -4747,6 +4772,10 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods l = options.Size(x.TallyParams) n += 1 + l + runtime.Sov(uint64(l)) } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -4776,6 +4805,20 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + 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.TallyParams != nil { encoded, err := options.Marshal(x.TallyParams) if err != nil { @@ -4975,6 +5018,42 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -8225,12 +8304,25 @@ type QueryParamsResponse struct { 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"` } func (x *QueryParamsResponse) Reset() { @@ -8253,6 +8345,7 @@ func (*QueryParamsResponse) Descriptor() ([]byte, []int) { return file_cosmos_gov_v1_query_proto_rawDescGZIP(), []int{9} } +// Deprecated: Do not use. func (x *QueryParamsResponse) GetVotingParams() *VotingParams { if x != nil { return x.VotingParams @@ -8260,6 +8353,7 @@ func (x *QueryParamsResponse) GetVotingParams() *VotingParams { return nil } +// Deprecated: Do not use. func (x *QueryParamsResponse) GetDepositParams() *DepositParams { if x != nil { return x.DepositParams @@ -8267,6 +8361,7 @@ func (x *QueryParamsResponse) GetDepositParams() *DepositParams { return nil } +// Deprecated: Do not use. func (x *QueryParamsResponse) GetTallyParams() *TallyParams { if x != nil { return x.TallyParams @@ -8274,6 +8369,13 @@ func (x *QueryParamsResponse) GetTallyParams() *TallyParams { return nil } +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + // QueryDepositRequest is the request type for the Query/Deposit RPC method. type QueryDepositRequest struct { state protoimpl.MessageState @@ -8601,138 +8703,142 @@ var file_cosmos_gov_v1_query_proto_rawDesc = []byte{ 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x54, 0x79, 0x70, 0x65, 0x22, - 0xdb, 0x01, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, + 0x96, 0x02, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x56, - 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0c, 0x76, 0x6f, 0x74, - 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x43, 0x0a, 0x0e, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3d, - 0x0a, 0x0c, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x0b, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x6e, 0x0a, - 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x18, 0x02, 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, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x22, 0x48, 0x0a, - 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x07, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x22, 0x7f, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x02, 0x18, 0x01, 0x52, + 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x47, 0x0a, + 0x0e, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0d, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x41, 0x0a, 0x0c, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x6c, + 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0b, 0x74, 0x61, + 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2d, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x6e, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, - 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, 0x94, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x08, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 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, - 0x3a, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, + 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, 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, 0x09, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x22, 0x48, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x30, 0x0a, 0x07, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x07, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x22, 0x7f, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x4c, 0x0a, 0x18, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x74, 0x61, 0x6c, 0x6c, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x52, 0x05, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x32, 0xda, 0x08, 0x0a, 0x05, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x85, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x7a, 0x0a, 0x09, 0x50, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 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, 0x25, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x87, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, - 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 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, 0x82, 0x01, 0x0a, 0x05, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 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, 0x21, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 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, 0x7c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, - 0x23, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x97, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x3d, 0x12, 0x3b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x8e, - 0x01, 0x0a, 0x08, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x6f, + 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 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, 0x94, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, + 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x08, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 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, 0x3a, 0x0a, 0x17, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x4c, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, + 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x74, + 0x61, 0x6c, 0x6c, 0x79, 0x32, 0xda, 0x08, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x85, + 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, + 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, - 0x94, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, - 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 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, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 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, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x42, 0x9b, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x73, 0x12, 0x87, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 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, 0x20, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x3c, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x82, 0x01, 0x0a, + 0x05, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 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, 0x34, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x7c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 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, 0x22, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 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, + 0x97, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x22, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 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, + 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x8e, 0x01, 0x0a, 0x08, 0x44, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x24, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 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, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 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, 0x94, 0x01, 0x0a, 0x0b, 0x54, + 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 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, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x34, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x42, 0x9b, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, + 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, + 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -8773,8 +8879,9 @@ var file_cosmos_gov_v1_query_proto_goTypes = []interface{}{ (*VotingParams)(nil), // 21: cosmos.gov.v1.VotingParams (*DepositParams)(nil), // 22: cosmos.gov.v1.DepositParams (*TallyParams)(nil), // 23: cosmos.gov.v1.TallyParams - (*Deposit)(nil), // 24: cosmos.gov.v1.Deposit - (*TallyResult)(nil), // 25: cosmos.gov.v1.TallyResult + (*Params)(nil), // 24: cosmos.gov.v1.Params + (*Deposit)(nil), // 25: cosmos.gov.v1.Deposit + (*TallyResult)(nil), // 26: cosmos.gov.v1.TallyResult } var file_cosmos_gov_v1_query_proto_depIdxs = []int32{ 16, // 0: cosmos.gov.v1.QueryProposalResponse.proposal:type_name -> cosmos.gov.v1.Proposal @@ -8789,32 +8896,33 @@ var file_cosmos_gov_v1_query_proto_depIdxs = []int32{ 21, // 9: cosmos.gov.v1.QueryParamsResponse.voting_params:type_name -> cosmos.gov.v1.VotingParams 22, // 10: cosmos.gov.v1.QueryParamsResponse.deposit_params:type_name -> cosmos.gov.v1.DepositParams 23, // 11: cosmos.gov.v1.QueryParamsResponse.tally_params:type_name -> cosmos.gov.v1.TallyParams - 24, // 12: cosmos.gov.v1.QueryDepositResponse.deposit:type_name -> cosmos.gov.v1.Deposit - 18, // 13: cosmos.gov.v1.QueryDepositsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 24, // 14: cosmos.gov.v1.QueryDepositsResponse.deposits:type_name -> cosmos.gov.v1.Deposit - 19, // 15: cosmos.gov.v1.QueryDepositsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 25, // 16: cosmos.gov.v1.QueryTallyResultResponse.tally:type_name -> cosmos.gov.v1.TallyResult - 0, // 17: cosmos.gov.v1.Query.Proposal:input_type -> cosmos.gov.v1.QueryProposalRequest - 2, // 18: cosmos.gov.v1.Query.Proposals:input_type -> cosmos.gov.v1.QueryProposalsRequest - 4, // 19: cosmos.gov.v1.Query.Vote:input_type -> cosmos.gov.v1.QueryVoteRequest - 6, // 20: cosmos.gov.v1.Query.Votes:input_type -> cosmos.gov.v1.QueryVotesRequest - 8, // 21: cosmos.gov.v1.Query.Params:input_type -> cosmos.gov.v1.QueryParamsRequest - 10, // 22: cosmos.gov.v1.Query.Deposit:input_type -> cosmos.gov.v1.QueryDepositRequest - 12, // 23: cosmos.gov.v1.Query.Deposits:input_type -> cosmos.gov.v1.QueryDepositsRequest - 14, // 24: cosmos.gov.v1.Query.TallyResult:input_type -> cosmos.gov.v1.QueryTallyResultRequest - 1, // 25: cosmos.gov.v1.Query.Proposal:output_type -> cosmos.gov.v1.QueryProposalResponse - 3, // 26: cosmos.gov.v1.Query.Proposals:output_type -> cosmos.gov.v1.QueryProposalsResponse - 5, // 27: cosmos.gov.v1.Query.Vote:output_type -> cosmos.gov.v1.QueryVoteResponse - 7, // 28: cosmos.gov.v1.Query.Votes:output_type -> cosmos.gov.v1.QueryVotesResponse - 9, // 29: cosmos.gov.v1.Query.Params:output_type -> cosmos.gov.v1.QueryParamsResponse - 11, // 30: cosmos.gov.v1.Query.Deposit:output_type -> cosmos.gov.v1.QueryDepositResponse - 13, // 31: cosmos.gov.v1.Query.Deposits:output_type -> cosmos.gov.v1.QueryDepositsResponse - 15, // 32: cosmos.gov.v1.Query.TallyResult:output_type -> cosmos.gov.v1.QueryTallyResultResponse - 25, // [25:33] is the sub-list for method output_type - 17, // [17:25] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 24, // 12: cosmos.gov.v1.QueryParamsResponse.params:type_name -> cosmos.gov.v1.Params + 25, // 13: cosmos.gov.v1.QueryDepositResponse.deposit:type_name -> cosmos.gov.v1.Deposit + 18, // 14: cosmos.gov.v1.QueryDepositsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 25, // 15: cosmos.gov.v1.QueryDepositsResponse.deposits:type_name -> cosmos.gov.v1.Deposit + 19, // 16: cosmos.gov.v1.QueryDepositsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 26, // 17: cosmos.gov.v1.QueryTallyResultResponse.tally:type_name -> cosmos.gov.v1.TallyResult + 0, // 18: cosmos.gov.v1.Query.Proposal:input_type -> cosmos.gov.v1.QueryProposalRequest + 2, // 19: cosmos.gov.v1.Query.Proposals:input_type -> cosmos.gov.v1.QueryProposalsRequest + 4, // 20: cosmos.gov.v1.Query.Vote:input_type -> cosmos.gov.v1.QueryVoteRequest + 6, // 21: cosmos.gov.v1.Query.Votes:input_type -> cosmos.gov.v1.QueryVotesRequest + 8, // 22: cosmos.gov.v1.Query.Params:input_type -> cosmos.gov.v1.QueryParamsRequest + 10, // 23: cosmos.gov.v1.Query.Deposit:input_type -> cosmos.gov.v1.QueryDepositRequest + 12, // 24: cosmos.gov.v1.Query.Deposits:input_type -> cosmos.gov.v1.QueryDepositsRequest + 14, // 25: cosmos.gov.v1.Query.TallyResult:input_type -> cosmos.gov.v1.QueryTallyResultRequest + 1, // 26: cosmos.gov.v1.Query.Proposal:output_type -> cosmos.gov.v1.QueryProposalResponse + 3, // 27: cosmos.gov.v1.Query.Proposals:output_type -> cosmos.gov.v1.QueryProposalsResponse + 5, // 28: cosmos.gov.v1.Query.Vote:output_type -> cosmos.gov.v1.QueryVoteResponse + 7, // 29: cosmos.gov.v1.Query.Votes:output_type -> cosmos.gov.v1.QueryVotesResponse + 9, // 30: cosmos.gov.v1.Query.Params:output_type -> cosmos.gov.v1.QueryParamsResponse + 11, // 31: cosmos.gov.v1.Query.Deposit:output_type -> cosmos.gov.v1.QueryDepositResponse + 13, // 32: cosmos.gov.v1.Query.Deposits:output_type -> cosmos.gov.v1.QueryDepositsResponse + 15, // 33: cosmos.gov.v1.Query.TallyResult:output_type -> cosmos.gov.v1.QueryTallyResultResponse + 26, // [26:34] is the sub-list for method output_type + 18, // [18:26] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_cosmos_gov_v1_query_proto_init() } diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index bd8e57422aa..b8593ef271c 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -4960,6 +4960,861 @@ func (x *fastReflection_MsgDepositResponse) ProtoMethods() *protoiface.Methods { } } +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_gov_v1_tx_proto_init() + md_MsgUpdateParams = File_cosmos_gov_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[10] + 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_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// 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_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(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_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, 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_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.gov.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "cosmos.gov.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParams 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_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.gov.v1.MsgUpdateParams.authority": + x.Authority = "" + case "cosmos.gov.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParams 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_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.gov.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParams 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_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.gov.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "cosmos.gov.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParams 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_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "cosmos.gov.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message cosmos.gov.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParams 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_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParams 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_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.MsgUpdateParams", 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + 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.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + 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().(*MsgUpdateParams) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgUpdateParams) + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: 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 Authority", 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.Authority = 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_gov_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_cosmos_gov_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[11] + 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_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// 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_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.MsgUpdateParamsResponse", 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + 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().(*MsgUpdateParamsResponse) + 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().(*MsgUpdateParamsResponse) + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: 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. @@ -5400,6 +6255,86 @@ func (*MsgDepositResponse) Descriptor() ([]byte, []int) { return file_cosmos_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 of the governance account. + 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_cosmos_gov_v1_tx_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_tx_proto_rawDescGZIP(), []int{10} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// 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 +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_tx_proto_rawDescGZIP(), []int{11} +} + var File_cosmos_gov_v1_tx_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ @@ -5487,44 +6422,60 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xab, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0e, - 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 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, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x12, 0x33, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0x83, 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 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, 0x28, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x65, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 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, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x3e, 0x0a, + 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x1e, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, + 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x1a, 0x26, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x47, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x12, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 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, 0x56, + 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x65, 0x0a, 0x11, 0x45, 0x78, - 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, - 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x3e, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, - 0x65, 0x1a, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, - 0x64, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, - 0x64, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x47, 0x0a, 0x07, 0x44, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x12, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, - 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x42, 0x98, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, - 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, - 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x26, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x42, 0x98, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5539,7 +6490,7 @@ func file_cosmos_gov_v1_tx_proto_rawDescGZIP() []byte { return file_cosmos_gov_v1_tx_proto_rawDescData } -var file_cosmos_gov_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_cosmos_gov_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_cosmos_gov_v1_tx_proto_goTypes = []interface{}{ (*MsgSubmitProposal)(nil), // 0: cosmos.gov.v1.MsgSubmitProposal (*MsgSubmitProposalResponse)(nil), // 1: cosmos.gov.v1.MsgSubmitProposalResponse @@ -5551,33 +6502,39 @@ var file_cosmos_gov_v1_tx_proto_goTypes = []interface{}{ (*MsgVoteWeightedResponse)(nil), // 7: cosmos.gov.v1.MsgVoteWeightedResponse (*MsgDeposit)(nil), // 8: cosmos.gov.v1.MsgDeposit (*MsgDepositResponse)(nil), // 9: cosmos.gov.v1.MsgDepositResponse - (*anypb.Any)(nil), // 10: google.protobuf.Any - (*v1beta1.Coin)(nil), // 11: cosmos.base.v1beta1.Coin - (VoteOption)(0), // 12: cosmos.gov.v1.VoteOption - (*WeightedVoteOption)(nil), // 13: cosmos.gov.v1.WeightedVoteOption + (*MsgUpdateParams)(nil), // 10: cosmos.gov.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 11: cosmos.gov.v1.MsgUpdateParamsResponse + (*anypb.Any)(nil), // 12: google.protobuf.Any + (*v1beta1.Coin)(nil), // 13: cosmos.base.v1beta1.Coin + (VoteOption)(0), // 14: cosmos.gov.v1.VoteOption + (*WeightedVoteOption)(nil), // 15: cosmos.gov.v1.WeightedVoteOption + (*Params)(nil), // 16: cosmos.gov.v1.Params } var file_cosmos_gov_v1_tx_proto_depIdxs = []int32{ - 10, // 0: cosmos.gov.v1.MsgSubmitProposal.messages:type_name -> google.protobuf.Any - 11, // 1: cosmos.gov.v1.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin - 10, // 2: cosmos.gov.v1.MsgExecLegacyContent.content:type_name -> google.protobuf.Any - 12, // 3: cosmos.gov.v1.MsgVote.option:type_name -> cosmos.gov.v1.VoteOption - 13, // 4: cosmos.gov.v1.MsgVoteWeighted.options:type_name -> cosmos.gov.v1.WeightedVoteOption - 11, // 5: cosmos.gov.v1.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin - 0, // 6: cosmos.gov.v1.Msg.SubmitProposal:input_type -> cosmos.gov.v1.MsgSubmitProposal - 2, // 7: cosmos.gov.v1.Msg.ExecLegacyContent:input_type -> cosmos.gov.v1.MsgExecLegacyContent - 4, // 8: cosmos.gov.v1.Msg.Vote:input_type -> cosmos.gov.v1.MsgVote - 6, // 9: cosmos.gov.v1.Msg.VoteWeighted:input_type -> cosmos.gov.v1.MsgVoteWeighted - 8, // 10: cosmos.gov.v1.Msg.Deposit:input_type -> cosmos.gov.v1.MsgDeposit - 1, // 11: cosmos.gov.v1.Msg.SubmitProposal:output_type -> cosmos.gov.v1.MsgSubmitProposalResponse - 3, // 12: cosmos.gov.v1.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1.MsgExecLegacyContentResponse - 5, // 13: cosmos.gov.v1.Msg.Vote:output_type -> cosmos.gov.v1.MsgVoteResponse - 7, // 14: cosmos.gov.v1.Msg.VoteWeighted:output_type -> cosmos.gov.v1.MsgVoteWeightedResponse - 9, // 15: cosmos.gov.v1.Msg.Deposit:output_type -> cosmos.gov.v1.MsgDepositResponse - 11, // [11:16] is the sub-list for method output_type - 6, // [6:11] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 12, // 0: cosmos.gov.v1.MsgSubmitProposal.messages:type_name -> google.protobuf.Any + 13, // 1: cosmos.gov.v1.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin + 12, // 2: cosmos.gov.v1.MsgExecLegacyContent.content:type_name -> google.protobuf.Any + 14, // 3: cosmos.gov.v1.MsgVote.option:type_name -> cosmos.gov.v1.VoteOption + 15, // 4: cosmos.gov.v1.MsgVoteWeighted.options:type_name -> cosmos.gov.v1.WeightedVoteOption + 13, // 5: cosmos.gov.v1.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin + 16, // 6: cosmos.gov.v1.MsgUpdateParams.params:type_name -> cosmos.gov.v1.Params + 0, // 7: cosmos.gov.v1.Msg.SubmitProposal:input_type -> cosmos.gov.v1.MsgSubmitProposal + 2, // 8: cosmos.gov.v1.Msg.ExecLegacyContent:input_type -> cosmos.gov.v1.MsgExecLegacyContent + 4, // 9: cosmos.gov.v1.Msg.Vote:input_type -> cosmos.gov.v1.MsgVote + 6, // 10: cosmos.gov.v1.Msg.VoteWeighted:input_type -> cosmos.gov.v1.MsgVoteWeighted + 8, // 11: cosmos.gov.v1.Msg.Deposit:input_type -> cosmos.gov.v1.MsgDeposit + 10, // 12: cosmos.gov.v1.Msg.UpdateParams:input_type -> cosmos.gov.v1.MsgUpdateParams + 1, // 13: cosmos.gov.v1.Msg.SubmitProposal:output_type -> cosmos.gov.v1.MsgSubmitProposalResponse + 3, // 14: cosmos.gov.v1.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1.MsgExecLegacyContentResponse + 5, // 15: cosmos.gov.v1.Msg.Vote:output_type -> cosmos.gov.v1.MsgVoteResponse + 7, // 16: cosmos.gov.v1.Msg.VoteWeighted:output_type -> cosmos.gov.v1.MsgVoteWeightedResponse + 9, // 17: cosmos.gov.v1.Msg.Deposit:output_type -> cosmos.gov.v1.MsgDepositResponse + 11, // 18: cosmos.gov.v1.Msg.UpdateParams:output_type -> cosmos.gov.v1.MsgUpdateParamsResponse + 13, // [13:19] is the sub-list for method output_type + 7, // [7:13] 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 } func init() { file_cosmos_gov_v1_tx_proto_init() } @@ -5707,6 +6664,30 @@ func file_cosmos_gov_v1_tx_proto_init() { return nil } } + file_cosmos_gov_v1_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_gov_v1_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); 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{ @@ -5714,7 +6695,7 @@ func file_cosmos_gov_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_gov_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/gov/v1/tx_grpc.pb.go b/api/cosmos/gov/v1/tx_grpc.pb.go index 9085bf5fa03..05b1f592e04 100644 --- a/api/cosmos/gov/v1/tx_grpc.pb.go +++ b/api/cosmos/gov/v1/tx_grpc.pb.go @@ -33,6 +33,11 @@ type MsgClient interface { VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) // Deposit defines a method to add deposit on a specific proposal. Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -88,6 +93,15 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca return out, nil } +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/UpdateParams", in, out, opts...) + 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 @@ -103,6 +117,11 @@ type MsgServer interface { VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) // Deposit defines a method to add deposit on a specific proposal. Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) mustEmbedUnimplementedMsgServer() } @@ -125,6 +144,9 @@ func (UnimplementedMsgServer) VoteWeighted(context.Context, *MsgVoteWeighted) (* func (UnimplementedMsgServer) Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") } +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -228,6 +250,24 @@ func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + 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) @@ -255,6 +295,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "Deposit", Handler: _Msg_Deposit_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/gov/v1/tx.proto", diff --git a/proto/cosmos/gov/v1/genesis.proto b/proto/cosmos/gov/v1/genesis.proto index cb44a7f34c9..0a87271b2e5 100644 --- a/proto/cosmos/gov/v1/genesis.proto +++ b/proto/cosmos/gov/v1/genesis.proto @@ -17,10 +17,17 @@ message GenesisState { repeated Vote votes = 3; // proposals defines all the proposals present at genesis. repeated Proposal proposals = 4; - // params defines all the paramaters of related to deposit. - DepositParams deposit_params = 5; - // params defines all the paramaters of related to voting. - VotingParams voting_params = 6; - // params defines all the paramaters of related to tally. - TallyParams tally_params = 7; + // Deprecated: Prefer to use `params` instead. + // deposit_params defines all the paramaters of related to deposit. + DepositParams deposit_params = 5 [deprecated=true]; + // Deprecated: Prefer to use `params` instead. + // voting_params defines all the paramaters of related to voting. + VotingParams voting_params = 6 [deprecated=true]; + // Deprecated: Prefer to use `params` instead. + // tally_params defines all the paramaters of related to tally. + TallyParams tally_params = 7 [deprecated=true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 8; } diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 8a8572335d7..8c1e6486002 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -130,3 +130,29 @@ message TallyParams { // vetoed. Default value: 1/3. string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "veto_threshold,omitempty"]; } + +// Params defines the parameters for the x/gov module. +// +// Since: cosmos-sdk 0.47 +message Params { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [(gogoproto.nullable) = false]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [(gogoproto.stdduration) = true]; + + // Length of the voting period. + google.protobuf.Duration voting_period = 3 [(gogoproto.stdduration) = true]; + + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + string quorum = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + string threshold = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + string veto_threshold = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} diff --git a/proto/cosmos/gov/v1/query.proto b/proto/cosmos/gov/v1/query.proto index b9d5914507d..5890bcbea7b 100644 --- a/proto/cosmos/gov/v1/query.proto +++ b/proto/cosmos/gov/v1/query.proto @@ -130,12 +130,19 @@ message QueryParamsRequest { // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { + // Deprecated: Prefer to use `params` instead. // voting_params defines the parameters related to voting. - VotingParams voting_params = 1; + VotingParams voting_params = 1 [deprecated=true]; + // Deprecated: Prefer to use `params` instead. // deposit_params defines the parameters related to deposit. - DepositParams deposit_params = 2; + DepositParams deposit_params = 2 [deprecated=true]; + // Deprecated: Prefer to use `params` instead. // tally_params defines the parameters related to tally. - TallyParams tally_params = 3; + TallyParams tally_params = 3 [deprecated=true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 4; } // QueryDepositRequest is the request type for the Query/Deposit RPC method. diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 9306c51e8c0..df6b15f1763 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -28,6 +28,12 @@ service Msg { // Deposit defines a method to add deposit on a specific proposal. rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -98,3 +104,24 @@ message MsgDeposit { // MsgDepositResponse defines the Msg/Deposit response type. message MsgDepositResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/gov parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/simapp/app_legacy.go b/simapp/app_legacy.go index 7a41c6812cf..0ec50e6468f 100644 --- a/simapp/app_legacy.go +++ b/simapp/app_legacy.go @@ -317,8 +317,8 @@ func NewSimApp( govConfig.MaxMetadataLen = 10000 */ govKeeper := govkeeper.NewKeeper( - appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, app.MsgServiceRouter(), govConfig, + appCodec, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper, + app.StakingKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.GovKeeper = *govKeeper.SetHooks( @@ -367,7 +367,7 @@ func NewSimApp( capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper), + gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), @@ -434,7 +434,7 @@ func NewSimApp( bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper), + gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), diff --git a/tests/e2e/gov/client/testutil/cli_test.go b/tests/e2e/gov/client/testutil/cli_test.go index 6941bce3820..c472b0c68cc 100644 --- a/tests/e2e/gov/client/testutil/cli_test.go +++ b/tests/e2e/gov/client/testutil/cli_test.go @@ -9,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -22,11 +21,11 @@ func TestIntegrationTestSuite(t *testing.T) { cfg.NumValidators = 1 suite.Run(t, testutil.NewIntegrationTestSuite(cfg)) - dp := v1.NewDepositParams(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, v1.DefaultMinDepositTokens)), time.Duration(15)*time.Second) - vp := v1.NewVotingParams(time.Duration(5) * time.Second) genesisState := v1.DefaultGenesisState() - genesisState.DepositParams = &dp - genesisState.VotingParams = &vp + maxDepPeriod := time.Duration(15) * time.Second + votingPeriod := time.Duration(5) * time.Second + genesisState.Params.MaxDepositPeriod = &maxDepPeriod + genesisState.Params.VotingPeriod = &votingPeriod bz, err := cfg.Codec.MarshalJSON(genesisState) require.NoError(t, err) cfg.GenesisState["gov"] = bz diff --git a/x/distribution/types/msg.go b/x/distribution/types/msg.go index 36dc021e048..7efd47e72d3 100644 --- a/x/distribution/types/msg.go +++ b/x/distribution/types/msg.go @@ -175,5 +175,9 @@ func (msg MsgUpdateParams) GetSignBytes() []byte { // ValidateBasic performs basic MsgUpdateParams message validation. func (msg MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err) + } + return msg.Params.ValidateBasic() } diff --git a/x/genutil/migrations/v043/migrate.go b/x/genutil/migrations/v043/migrate.go index 16a433c9efb..bbb78e5f076 100644 --- a/x/genutil/migrations/v043/migrate.go +++ b/x/genutil/migrations/v043/migrate.go @@ -6,25 +6,25 @@ import ( v2bank "github.com/cosmos/cosmos-sdk/x/bank/migrations/v2" bank "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil/types" - v042gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v042" - v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" + v1gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v1" + v2gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v2" gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // Migrate migrates exported state from v0.40 to a v0.43 genesis state. func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { // Migrate x/gov. - if appState[v042gov.ModuleName] != nil { + if appState[v1gov.ModuleName] != nil { // unmarshal relative source genesis application state var oldGovState gov.GenesisState - clientCtx.Codec.MustUnmarshalJSON(appState[v042gov.ModuleName], &oldGovState) + clientCtx.Codec.MustUnmarshalJSON(appState[v1gov.ModuleName], &oldGovState) // delete deprecated x/gov genesis state - delete(appState, v042gov.ModuleName) + delete(appState, v1gov.ModuleName) // Migrate relative source genesis application state and marshal it into // the respective key. - appState[v043gov.ModuleName] = clientCtx.Codec.MustMarshalJSON(v043gov.MigrateJSON(&oldGovState)) + appState[v2gov.ModuleName] = clientCtx.Codec.MustMarshalJSON(v2gov.MigrateJSON(&oldGovState)) } if appState[v1bank.ModuleName] != nil { diff --git a/x/genutil/migrations/v046/migrate.go b/x/genutil/migrations/v046/migrate.go index 52a73ec03bc..c13a2474662 100644 --- a/x/genutil/migrations/v046/migrate.go +++ b/x/genutil/migrations/v046/migrate.go @@ -3,8 +3,8 @@ package v046 import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/x/genutil/types" - v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" - v046gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046" + v2gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v2" + v3gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingv2 "github.com/cosmos/cosmos-sdk/x/staking/migrations/v2" stakingv3 "github.com/cosmos/cosmos-sdk/x/staking/migrations/v3" @@ -14,21 +14,21 @@ import ( // Migrate migrates exported state from v0.43 to a v0.46 genesis state. func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { // Migrate x/gov. - if appState[v043gov.ModuleName] != nil { + if appState[v2gov.ModuleName] != nil { // unmarshal relative source genesis application state var old govv1beta1.GenesisState - clientCtx.Codec.MustUnmarshalJSON(appState[v043gov.ModuleName], &old) + clientCtx.Codec.MustUnmarshalJSON(appState[v2gov.ModuleName], &old) // delete deprecated x/gov genesis state - delete(appState, v043gov.ModuleName) + delete(appState, v2gov.ModuleName) // Migrate relative source genesis application state and marshal it into // the respective key. - new, err := v046gov.MigrateJSON(&old) + new, err := v3gov.MigrateJSON(&old) if err != nil { panic(err) } - appState[v046gov.ModuleName] = clientCtx.Codec.MustMarshalJSON(new) + appState[v3gov.ModuleName] = clientCtx.Codec.MustMarshalJSON(new) } // Migrate x/staking. diff --git a/x/gov/abci.go b/x/gov/abci.go index 3019404c752..a4edadc6888 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -37,7 +37,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { logger.Info( "proposal did not meet minimum deposit; deleted", "proposal", proposal.Id, - "min_deposit", sdk.NewCoins(keeper.GetDepositParams(ctx).MinDeposit...).String(), + "min_deposit", sdk.NewCoins(keeper.GetParams(ctx).MinDeposit...).String(), "total_deposit", sdk.NewCoins(proposal.TotalDeposit...).String(), ) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 63eab4b4b43..248c82a94ad 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -59,7 +59,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { inactiveQueue.Close() newHeader = ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetParams(ctx).MaxDepositPeriod) ctx = ctx.WithBlockHeader(newHeader) inactiveQueue = app.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) @@ -124,7 +124,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.NotNil(t, res) newHeader = ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(time.Duration(-1) * time.Second) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetParams(ctx).MaxDepositPeriod).Add(time.Duration(-1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) inactiveQueue = app.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) @@ -248,7 +248,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { require.NotNil(t, res1) newHeader = ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(*app.GovKeeper.GetVotingParams(ctx).VotingPeriod) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetParams(ctx).MaxDepositPeriod).Add(*app.GovKeeper.GetParams(ctx).VotingPeriod) ctx = ctx.WithBlockHeader(newHeader) inactiveQueue = app.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) @@ -315,7 +315,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NoError(t, err) newHeader := ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(*app.GovKeeper.GetVotingParams(ctx).VotingPeriod) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetParams(ctx).MaxDepositPeriod).Add(*app.GovKeeper.GetParams(ctx).VotingPeriod) ctx = ctx.WithBlockHeader(newHeader) gov.EndBlocker(ctx, app.GovKeeper) @@ -359,7 +359,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { require.NoError(t, err) newHeader := ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(*app.GovKeeper.GetVotingParams(ctx).VotingPeriod) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetParams(ctx).MaxDepositPeriod).Add(*app.GovKeeper.GetParams(ctx).VotingPeriod) ctx = ctx.WithBlockHeader(newHeader) // Set the contextKeyBadProposal value to false so that the handler will fail diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index 4700f8e753f..fc7f73c1a54 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -32,8 +32,8 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryProposals(), GetCmdQueryVote(), GetCmdQueryVotes(), - GetCmdQueryParam(), GetCmdQueryParams(), + GetCmdQueryParam(), GetCmdQueryProposer(), GetCmdQueryDeposit(), GetCmdQueryDeposits(), @@ -532,23 +532,8 @@ $ %s query gov params // Query store for all 3 params ctx := cmd.Context() - votingRes, err := queryClient.Params( - ctx, - &v1.QueryParamsRequest{ParamsType: "voting"}, - ) - if err != nil { - return err - } - - tallyRes, err := queryClient.Params( - ctx, - &v1.QueryParamsRequest{ParamsType: "tallying"}, - ) - if err != nil { - return err - } - depositRes, err := queryClient.Params( + res, err := queryClient.Params( ctx, &v1.QueryParamsRequest{ParamsType: "deposit"}, ) @@ -556,13 +541,13 @@ $ %s query gov params return err } - params := v1.NewParams( - *votingRes.GetVotingParams(), - *tallyRes.GetTallyParams(), - *depositRes.GetDepositParams(), - ) + vp := v1.NewVotingParams(res.Params.VotingPeriod) + res.VotingParams = &vp + + tp := v1.NewTallyParams(res.Params.Quorum, res.Params.Threshold, res.Params.VetoThreshold) + res.TallyParams = &tp - return clientCtx.PrintObjectLegacy(params) + return clientCtx.PrintProto(res) }, } @@ -579,7 +564,6 @@ func GetCmdQueryParam() *cobra.Command { Short: "Query the parameters (voting|tallying|deposit) of the governance process", Long: strings.TrimSpace( fmt.Sprintf(`Query the all the parameters for the governance process. - Example: $ %s query gov param voting $ %s query gov param tallying diff --git a/x/gov/client/testutil/grpc.go b/x/gov/client/testutil/grpc.go index 67ebba6aa9d..dbcca6ad118 100644 --- a/x/gov/client/testutil/grpc.go +++ b/x/gov/client/testutil/grpc.go @@ -3,13 +3,12 @@ package testutil import ( "fmt" - "github.com/gogo/protobuf/proto" - "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/rest" sdk "github.com/cosmos/cosmos-sdk/types" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + "github.com/gogo/protobuf/proto" ) func (s *IntegrationTestSuite) TestGetProposalGRPC() { @@ -357,9 +356,10 @@ func (s *IntegrationTestSuite) TestGetTallyGRPC() { func (s *IntegrationTestSuite) TestGetParamsGRPC() { val := s.network.Validators[0] - dp := v1.DefaultDepositParams() - vp := v1.DefaultVotingParams() - tp := v1.DefaultTallyParams() + params := v1.DefaultParams() + dp := v1.NewDepositParams(params.MinDeposit, params.MaxDepositPeriod) + vp := v1.NewVotingParams(params.VotingPeriod) + tp := v1.NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold) testCases := []struct { name string @@ -378,21 +378,21 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, v1.ParamDeposit), false, &v1.QueryParamsResponse{}, - &v1.QueryParamsResponse{DepositParams: &dp}, + &v1.QueryParamsResponse{DepositParams: &dp, Params: ¶ms}, }, { "get vote params", fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, v1.ParamVoting), false, &v1.QueryParamsResponse{}, - &v1.QueryParamsResponse{VotingParams: &vp}, + &v1.QueryParamsResponse{VotingParams: &vp, Params: ¶ms}, }, { "get tally params", fmt.Sprintf("%s/cosmos/gov/v1/params/%s", val.APIAddress, v1.ParamTallying), false, &v1.QueryParamsResponse{}, - &v1.QueryParamsResponse{TallyParams: &tp}, + &v1.QueryParamsResponse{TallyParams: &tp, Params: ¶ms}, }, } diff --git a/x/gov/client/testutil/query.go b/x/gov/client/testutil/query.go index 5f0502a8f03..0db8db3c48e 100644 --- a/x/gov/client/testutil/query.go +++ b/x/gov/client/testutil/query.go @@ -24,23 +24,32 @@ func (s *IntegrationTestSuite) TestCmdParams() { { "json output", []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, - `{"voting_params":{"voting_period":"172800000000000"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800000000000"}}`, + `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"}}`, }, { "text output", []string{}, ` deposit_params: - max_deposit_period: "172800000000000" + max_deposit_period: 172800s min_deposit: - amount: "10000000" denom: stake +params: + max_deposit_period: 172800s + min_deposit: + - amount: "10000000" + denom: stake + quorum: "0.334000000000000000" + threshold: "0.500000000000000000" + veto_threshold: "0.334000000000000000" + voting_period: 172800s tally_params: quorum: "0.334000000000000000" threshold: "0.500000000000000000" veto_threshold: "0.334000000000000000" voting_params: - voting_period: "172800000000000" + voting_period: 172800s `, }, } diff --git a/x/gov/exported/exported.go b/x/gov/exported/exported.go new file mode 100644 index 00000000000..08a5d2594e9 --- /dev/null +++ b/x/gov/exported/exported.go @@ -0,0 +1,18 @@ +package exported + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +type ( + ParamSet = paramtypes.ParamSet + + // Subspace defines an interface that implements the legacy x/params Subspace + // type. + // + // NOTE: This is used solely for migration of x/params managed parameters. + ParamSubspace interface { + Get(ctx sdk.Context, key []byte, ptr interface{}) + } +) diff --git a/x/gov/genesis.go b/x/gov/genesis.go index 53f2a1fa7eb..4a29424c229 100644 --- a/x/gov/genesis.go +++ b/x/gov/genesis.go @@ -12,9 +12,7 @@ import ( // InitGenesis - store genesis parameters func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, data *v1.GenesisState) { k.SetProposalID(ctx, data.StartingProposalId) - k.SetDepositParams(ctx, *data.DepositParams) - k.SetVotingParams(ctx, *data.VotingParams) - k.SetTallyParams(ctx, *data.TallyParams) + k.SetParams(ctx, *data.Params) // check if the deposits pool account exists moduleAcc := k.GetGovernanceAccount(ctx) @@ -57,10 +55,12 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k // ExportGenesis - output genesis parameters func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *v1.GenesisState { startingProposalID, _ := k.GetProposalID(ctx) - depositParams := k.GetDepositParams(ctx) - votingParams := k.GetVotingParams(ctx) - tallyParams := k.GetTallyParams(ctx) proposals := k.GetProposals(ctx) + params := k.GetParams(ctx) + + depositParams := v1.NewDepositParams(params.MinDeposit, params.MaxDepositPeriod) + votingParams := v1.NewVotingParams(params.VotingPeriod) + tallyParams := v1.NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold) var proposalsDeposits v1.Deposits var proposalsVotes v1.Votes @@ -80,5 +80,6 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *v1.GenesisState { DepositParams: &depositParams, VotingParams: &votingParams, TallyParams: &tallyParams, + Params: ¶ms, } } diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index a3a80533320..d7c0c6b677e 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -42,7 +42,7 @@ func TestImportExportQueues(t *testing.T) { require.NoError(t, err) proposalID2 := proposal2.Id - votingStarted, err := app.GovKeeper.AddDeposit(ctx, proposalID2, addrs[0], app.GovKeeper.GetDepositParams(ctx).MinDeposit) + votingStarted, err := app.GovKeeper.AddDeposit(ctx, proposalID2, addrs[0], app.GovKeeper.GetParams(ctx).MinDeposit) require.NoError(t, err) require.True(t, votingStarted) @@ -93,7 +93,7 @@ func TestImportExportQueues(t *testing.T) { ctx2 := app2.BaseApp.NewContext(false, tmproto.Header{}) // Jump the time forward past the DepositPeriod and VotingPeriod - ctx2 = ctx2.WithBlockTime(ctx2.BlockHeader().Time.Add(*app2.GovKeeper.GetDepositParams(ctx2).MaxDepositPeriod).Add(*app2.GovKeeper.GetVotingParams(ctx2).VotingPeriod)) + ctx2 = ctx2.WithBlockTime(ctx2.BlockHeader().Time.Add(*app2.GovKeeper.GetParams(ctx2).MaxDepositPeriod).Add(*app2.GovKeeper.GetParams(ctx2).VotingPeriod)) // Make sure that they are still in the DepositPeriod and VotingPeriod respectively proposal1, ok = app2.GovKeeper.GetProposal(ctx2, proposalID1) @@ -104,7 +104,7 @@ func TestImportExportQueues(t *testing.T) { require.True(t, proposal2.Status == v1.StatusVotingPeriod) macc := app2.GovKeeper.GetGovernanceAccount(ctx2) - require.Equal(t, sdk.Coins(app2.GovKeeper.GetDepositParams(ctx2).MinDeposit), app2.BankKeeper.GetAllBalances(ctx2, macc.GetAddress())) + require.Equal(t, sdk.Coins(app2.GovKeeper.GetParams(ctx2).MinDeposit), app2.BankKeeper.GetAllBalances(ctx2, macc.GetAddress())) // Run the endblocker. Check to make sure that proposal1 is removed from state, and proposal2 is finished VotingPeriod. gov.EndBlocker(ctx2, app2.GovKeeper) diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index ee57d91bf25..8ae94ead674 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -131,7 +131,7 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd // Check if deposit has provided sufficient total funds to transition the proposal into the voting period activatedVotingPeriod := false - if proposal.Status == v1.StatusDepositPeriod && sdk.NewCoins(proposal.TotalDeposit...).IsAllGTE(keeper.GetDepositParams(ctx).MinDeposit) { + if proposal.Status == v1.StatusDepositPeriod && sdk.NewCoins(proposal.TotalDeposit...).IsAllGTE(keeper.GetParams(ctx).MinDeposit) { keeper.ActivateVotingPeriod(ctx, proposal) activatedVotingPeriod = true diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index afdfc53652b..a8e859798ed 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - v046 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046" + v3 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -158,24 +158,31 @@ func (q Keeper) Params(c context.Context, req *v1.QueryParamsRequest) (*v1.Query } ctx := sdk.UnwrapSDKContext(c) + params := q.GetParams(ctx) + + response := &v1.QueryParamsResponse{} switch req.ParamsType { case v1.ParamDeposit: - depositParmas := q.GetDepositParams(ctx) - return &v1.QueryParamsResponse{DepositParams: &depositParmas}, nil + depositParams := v1.NewDepositParams(params.MinDeposit, params.MaxDepositPeriod) + response.DepositParams = &depositParams case v1.ParamVoting: - votingParmas := q.GetVotingParams(ctx) - return &v1.QueryParamsResponse{VotingParams: &votingParmas}, nil + votingParams := v1.NewVotingParams(params.VotingPeriod) + response.VotingParams = &votingParams case v1.ParamTallying: - tallyParams := q.GetTallyParams(ctx) - return &v1.QueryParamsResponse{TallyParams: &tallyParams}, nil + tallyParams := v1.NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold) + response.TallyParams = &tallyParams default: return nil, status.Errorf(codes.InvalidArgument, "%s is not a valid parameter type", req.ParamsType) + } + response.Params = ¶ms + + return response, nil } // Deposit queries single deposit information based on proposalID, depositAddr. @@ -291,7 +298,7 @@ func (q legacyQueryServer) Proposal(c context.Context, req *v1beta1.QueryProposa return nil, err } - proposal, err := v046.ConvertToLegacyProposal(*resp.Proposal) + proposal, err := v3.ConvertToLegacyProposal(*resp.Proposal) if err != nil { return nil, err } @@ -312,7 +319,7 @@ func (q legacyQueryServer) Proposals(c context.Context, req *v1beta1.QueryPropos legacyProposals := make([]v1beta1.Proposal, len(resp.Proposals)) for idx, proposal := range resp.Proposals { - legacyProposals[idx], err = v046.ConvertToLegacyProposal(*proposal) + legacyProposals[idx], err = v3.ConvertToLegacyProposal(*proposal) if err != nil { return nil, err } @@ -333,7 +340,7 @@ func (q legacyQueryServer) Vote(c context.Context, req *v1beta1.QueryVoteRequest return nil, err } - vote, err := v046.ConvertToLegacyVote(*resp.Vote) + vote, err := v3.ConvertToLegacyVote(*resp.Vote) if err != nil { return nil, err } @@ -352,7 +359,7 @@ func (q legacyQueryServer) Votes(c context.Context, req *v1beta1.QueryVotesReque votes := make([]v1beta1.Vote, len(resp.Votes)) for i, v := range resp.Votes { - votes[i], err = v046.ConvertToLegacyVote(*v) + votes[i], err = v3.ConvertToLegacyVote(*v) if err != nil { return nil, err } @@ -368,6 +375,7 @@ func (q legacyQueryServer) Params(c context.Context, req *v1beta1.QueryParamsReq resp, err := q.keeper.Params(c, &v1.QueryParamsRequest{ ParamsType: req.ParamsType, }) + if err != nil { return nil, err } @@ -412,7 +420,7 @@ func (q legacyQueryServer) Deposit(c context.Context, req *v1beta1.QueryDepositR return nil, err } - deposit := v046.ConvertToLegacyDeposit(resp.Deposit) + deposit := v3.ConvertToLegacyDeposit(resp.Deposit) return &v1beta1.QueryDepositResponse{Deposit: deposit}, nil } @@ -426,7 +434,7 @@ func (q legacyQueryServer) Deposits(c context.Context, req *v1beta1.QueryDeposit } deposits := make([]v1beta1.Deposit, len(resp.Deposits)) for idx, deposit := range resp.Deposits { - deposits[idx] = v046.ConvertToLegacyDeposit(deposit) + deposits[idx] = v3.ConvertToLegacyDeposit(deposit) } return &v1beta1.QueryDepositsResponse{Deposits: deposits, Pagination: resp.Pagination}, nil @@ -440,7 +448,7 @@ func (q legacyQueryServer) TallyResult(c context.Context, req *v1beta1.QueryTall return nil, err } - tally, err := v046.ConvertToLegacyTallyResult(resp.Tally) + tally, err := v3.ConvertToLegacyTallyResult(resp.Tally) if err != nil { return nil, err } diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 03d93544a62..81017d0b10b 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - v046 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046" + v3 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -131,7 +131,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) - expProposal, err = v046.ConvertToLegacyProposal(submittedProposal) + expProposal, err = v3.ConvertToLegacyProposal(submittedProposal) suite.Require().NoError(err) }, true, @@ -788,6 +788,8 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { func (suite *KeeperTestSuite) TestGRPCQueryParams() { queryClient := suite.queryClient + params := v1.DefaultParams() + var ( req *v1.QueryParamsRequest expRes *v1.QueryParamsResponse @@ -809,7 +811,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { "deposit params request", func() { req = &v1.QueryParamsRequest{ParamsType: v1.ParamDeposit} - depositParams := v1.DefaultDepositParams() + depositParams := v1.NewDepositParams(params.MinDeposit, params.MaxDepositPeriod) expRes = &v1.QueryParamsResponse{ DepositParams: &depositParams, } @@ -820,7 +822,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { "voting params request", func() { req = &v1.QueryParamsRequest{ParamsType: v1.ParamVoting} - votingParams := v1.DefaultVotingParams() + votingParams := v1.NewVotingParams(params.VotingPeriod) expRes = &v1.QueryParamsResponse{ VotingParams: &votingParams, } @@ -831,7 +833,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { "tally params request", func() { req = &v1.QueryParamsRequest{ParamsType: v1.ParamTallying} - tallyParams := v1.DefaultTallyParams() + tallyParams := v1.NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold) expRes = &v1.QueryParamsResponse{ TallyParams: &tallyParams, } diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index 81ac2bbaf6e..7773337cdbc 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -50,7 +50,7 @@ func TestHooks(t *testing.T) { app := simapp.Setup(t, false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - minDeposit := app.GovKeeper.GetDepositParams(ctx).MinDeposit + minDeposit := app.GovKeeper.GetParams(ctx).MinDeposit addrs := simapp.AddTestAddrs(app, ctx, 1, minDeposit[0].Amount) govHooksReceiver := MockGovHooksReceiver{} @@ -71,7 +71,7 @@ func TestHooks(t *testing.T) { require.True(t, govHooksReceiver.AfterProposalSubmissionValid) newHeader := ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(time.Duration(1) * time.Second) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetParams(ctx).MaxDepositPeriod).Add(time.Duration(1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) gov.EndBlocker(ctx, app.GovKeeper) @@ -90,7 +90,7 @@ func TestHooks(t *testing.T) { require.True(t, govHooksReceiver.AfterProposalVoteValid) newHeader = ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetVotingParams(ctx).VotingPeriod).Add(time.Duration(1) * time.Second) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetParams(ctx).VotingPeriod).Add(time.Duration(1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) gov.EndBlocker(ctx, app.GovKeeper) require.True(t, govHooksReceiver.AfterProposalVotingPeriodEndedValid) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 514ec2b9693..5cbb3e78ed1 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -43,6 +43,15 @@ type Keeper struct { router *baseapp.MsgServiceRouter config types.Config + + // the address capable of executing a MsgUpdateParams message. Typically, this + // should be the x/gov module account. + authority string +} + +// GetAuthority returns the x/distribution module's authority. +func (k Keeper) GetAuthority() string { + return k.authority } // NewKeeper returns a governance keeper. It handles: @@ -53,15 +62,19 @@ type Keeper struct { // // CONTRACT: the parameter Subspace must have the param key table already initialized func NewKeeper( - cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace types.ParamSubspace, - authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, - router *baseapp.MsgServiceRouter, config types.Config, + cdc codec.BinaryCodec, key storetypes.StoreKey, authKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, sk types.StakingKeeper, + router *baseapp.MsgServiceRouter, config types.Config, authority string, ) *Keeper { // ensure governance module account is set if addr := authKeeper.GetModuleAddress(types.ModuleName); addr == nil { panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) } + if _, err := sdk.AccAddressFromBech32(authority); err != nil { + panic(fmt.Sprintf("invalid authority address: %s", authority)) + } + // If MaxMetadataLen not set by app developer, set to default value. if config.MaxMetadataLen == 0 { config.MaxMetadataLen = types.DefaultConfig().MaxMetadataLen @@ -69,13 +82,13 @@ func NewKeeper( return &Keeper{ storeKey: key, - paramSpace: paramSpace, authKeeper: authKeeper, bankKeeper: bankKeeper, sk: sk, cdc: cdc, router: router, config: config, + authority: authority, } } diff --git a/x/gov/keeper/migrations.go b/x/gov/keeper/migrations.go index 6131d5601f4..f17088eaaeb 100644 --- a/x/gov/keeper/migrations.go +++ b/x/gov/keeper/migrations.go @@ -2,26 +2,37 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - v043 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" - v046 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046" + "github.com/cosmos/cosmos-sdk/x/gov/exported" + v2 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v2" + v3 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" + v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" ) // Migrator is a struct for handling in-place store migrations. type Migrator struct { - keeper *Keeper + keeper *Keeper + legacySubspace exported.ParamSubspace } // NewMigrator returns a new Migrator. -func NewMigrator(keeper *Keeper) Migrator { - return Migrator{keeper: keeper} +func NewMigrator(keeper *Keeper, legacySubspace exported.ParamSubspace) Migrator { + return Migrator{ + keeper: keeper, + legacySubspace: legacySubspace, + } } // Migrate1to2 migrates from version 1 to 2. func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return v043.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) + return v2.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) } // Migrate2to3 migrates from version 2 to 3. func (m Migrator) Migrate2to3(ctx sdk.Context) error { - return v046.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) + return v3.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) +} + +// Migrate2to3 migrates from version 2 to 3. +func (m Migrator) Migrate3to4(ctx sdk.Context) error { + return v4.MigrateStore(ctx, m.keeper.storeKey, m.legacySubspace, m.keeper.cdc) } diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 3982451dd0f..54773ff7bda 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -10,8 +10,10 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -206,6 +208,19 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1.MsgDeposit) (*v1.MsgDe return &v1.MsgDepositResponse{}, nil } +func (k msgServer) UpdateParams(goCtx context.Context, msg *v1.MsgUpdateParams) (*v1.MsgUpdateParamsResponse, error) { + if k.authority != msg.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := k.SetParams(ctx, msg.Params); err != nil { + return nil, err + } + + return &v1.MsgUpdateParamsResponse{}, nil +} + type legacyMsgServer struct { govAcct string server v1.MsgServer diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 5bdd9951089..894e8f05e9f 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "strings" + "time" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,7 +18,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) initialDeposit := coins - minDeposit := suite.app.GovKeeper.GetDepositParams(suite.ctx).MinDeposit + minDeposit := suite.app.GovKeeper.GetParams(suite.ctx).MinDeposit bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -123,7 +124,7 @@ func (suite *KeeperTestSuite) TestVoteReq() { proposer := addrs[0] coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) - minDeposit := suite.app.GovKeeper.GetDepositParams(suite.ctx).MinDeposit + minDeposit := suite.app.GovKeeper.GetParams(suite.ctx).MinDeposit bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -235,7 +236,7 @@ func (suite *KeeperTestSuite) TestVoteWeightedReq() { proposer := addrs[0] coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) - minDeposit := suite.app.GovKeeper.GetDepositParams(suite.ctx).MinDeposit + minDeposit := suite.app.GovKeeper.GetParams(suite.ctx).MinDeposit bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -348,7 +349,7 @@ func (suite *KeeperTestSuite) TestDepositReq() { proposer := addrs[0] coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) - minDeposit := suite.app.GovKeeper.GetDepositParams(suite.ctx).MinDeposit + minDeposit := suite.app.GovKeeper.GetParams(suite.ctx).MinDeposit bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -417,7 +418,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgSubmitProposal() { coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) initialDeposit := coins - minDeposit := suite.app.GovKeeper.GetDepositParams(suite.ctx).MinDeposit + minDeposit := suite.app.GovKeeper.GetParams(suite.ctx).MinDeposit cases := map[string]struct { preRun func() (*v1beta1.MsgSubmitProposal, error) @@ -466,7 +467,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { proposer := addrs[0] coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) - minDeposit := suite.app.GovKeeper.GetDepositParams(suite.ctx).MinDeposit + minDeposit := suite.app.GovKeeper.GetParams(suite.ctx).MinDeposit bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -568,7 +569,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { proposer := addrs[0] coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) - minDeposit := suite.app.GovKeeper.GetDepositParams(suite.ctx).MinDeposit + minDeposit := suite.app.GovKeeper.GetParams(suite.ctx).MinDeposit bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -671,7 +672,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgDeposit() { proposer := addrs[0] coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) - minDeposit := suite.app.GovKeeper.GetDepositParams(suite.ctx).MinDeposit + minDeposit := suite.app.GovKeeper.GetParams(suite.ctx).MinDeposit bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -732,3 +733,277 @@ func (suite *KeeperTestSuite) TestLegacyMsgDeposit() { }) } } + +func (suite *KeeperTestSuite) TestMsgUpdateParams() { + + authority := suite.app.GovKeeper.GetAuthority() + params := v1.DefaultParams() + testCases := []struct { + name string + input func() *v1.MsgUpdateParams + expErr bool + expErrMsg string + }{ + { + name: "valid", + input: func() *v1.MsgUpdateParams { + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params, + } + }, + expErr: false, + }, + { + name: "invalid authority", + input: func() *v1.MsgUpdateParams { + return &v1.MsgUpdateParams{ + Authority: "authority", + Params: params, + } + }, + expErr: true, + expErrMsg: "invalid authority address", + }, + { + name: "invalid min deposit", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.MinDeposit = nil + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "invalid minimum deposit", + }, + { + name: "negative deposit", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.MinDeposit = sdk.Coins{{ + Denom: sdk.DefaultBondDenom, + Amount: sdk.NewInt(-100), + }} + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "invalid minimum deposit", + }, + { + name: "invalid max deposit period", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.MaxDepositPeriod = nil + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "maximum deposit period must not be nil", + }, + { + name: "zero max deposit period", + input: func() *v1.MsgUpdateParams { + params1 := params + duration := time.Duration(0) + params1.MaxDepositPeriod = &duration + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "maximum deposit period must be positive", + }, + { + name: "invalid quorum", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.Quorum = "abc" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "invalid quorum string", + }, + { + name: "negative quorum", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.Quorum = "-0.1" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "quorom cannot be negative", + }, + { + name: "quorum > 1", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.Quorum = "2" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "quorom too large", + }, + { + name: "invalid threshold", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.Threshold = "abc" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "invalid threshold string", + }, + { + name: "negative threshold", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.Threshold = "-0.1" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "vote threshold must be positive", + }, + { + name: "threshold > 1", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.Threshold = "2" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "vote threshold too large", + }, + { + name: "invalid veto threshold", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.VetoThreshold = "abc" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "invalid vetoThreshold string", + }, + { + name: "negative veto threshold", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.VetoThreshold = "-0.1" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "veto threshold must be positive", + }, + { + name: "veto threshold > 1", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.VetoThreshold = "2" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "veto threshold too large", + }, + { + name: "invalid voting period", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.VotingPeriod = nil + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "voting period must not be nil", + }, + { + name: "zero voting period", + input: func() *v1.MsgUpdateParams { + params1 := params + duration := time.Duration(0) + params1.VotingPeriod = &duration + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "voting period must be positive", + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + msg := tc.input() + exec := func(updateParams *v1.MsgUpdateParams) error { + if err := msg.ValidateBasic(); err != nil { + return err + } + + if _, err := suite.msgSrvr.UpdateParams(suite.ctx, updateParams); err != nil { + return err + } + return nil + } + + err := exec(msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + } + }) + } +} diff --git a/x/gov/keeper/params.go b/x/gov/keeper/params.go index 942f2e3b0b0..64d98a92ef4 100644 --- a/x/gov/keeper/params.go +++ b/x/gov/keeper/params.go @@ -2,41 +2,28 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) -// GetDepositParams returns the current DepositParams from the global param store -func (keeper Keeper) GetDepositParams(ctx sdk.Context) v1.DepositParams { - var depositParams v1.DepositParams - keeper.paramSpace.Get(ctx, v1.ParamStoreKeyDepositParams, &depositParams) - return depositParams -} - -// GetVotingParams returns the current VotingParams from the global param store -func (keeper Keeper) GetVotingParams(ctx sdk.Context) v1.VotingParams { - var votingParams v1.VotingParams - keeper.paramSpace.Get(ctx, v1.ParamStoreKeyVotingParams, &votingParams) - return votingParams -} +func (k Keeper) SetParams(ctx sdk.Context, params v1.Params) error { + store := ctx.KVStore(k.storeKey) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + store.Set(types.ParamsKey, bz) -// GetTallyParams returns the current TallyParam from the global param store -func (keeper Keeper) GetTallyParams(ctx sdk.Context) v1.TallyParams { - var tallyParams v1.TallyParams - keeper.paramSpace.Get(ctx, v1.ParamStoreKeyTallyParams, &tallyParams) - return tallyParams + return nil } -// SetDepositParams sets DepositParams to the global param store -func (keeper Keeper) SetDepositParams(ctx sdk.Context, depositParams v1.DepositParams) { - keeper.paramSpace.Set(ctx, v1.ParamStoreKeyDepositParams, &depositParams) -} - -// SetVotingParams sets VotingParams to the global param store -func (keeper Keeper) SetVotingParams(ctx sdk.Context, votingParams v1.VotingParams) { - keeper.paramSpace.Set(ctx, v1.ParamStoreKeyVotingParams, &votingParams) -} +func (k Keeper) GetParams(clientCtx sdk.Context) (params v1.Params) { + store := clientCtx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return params + } -// SetTallyParams sets TallyParams to the global param store -func (keeper Keeper) SetTallyParams(ctx sdk.Context, tallyParams v1.TallyParams) { - keeper.paramSpace.Set(ctx, v1.ParamStoreKeyTallyParams, &tallyParams) + k.cdc.MustUnmarshal(bz, ¶ms) + return params } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 64088859c68..59d7bd65392 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -66,7 +66,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadat } submitTime := ctx.BlockHeader().Time - depositPeriod := keeper.GetDepositParams(ctx).MaxDepositPeriod + depositPeriod := keeper.GetParams(ctx).MaxDepositPeriod proposal, err := v1.NewProposal(messages, proposalID, metadata, submitTime, submitTime.Add(*depositPeriod)) if err != nil { @@ -237,7 +237,7 @@ func (keeper Keeper) SetProposalID(ctx sdk.Context, proposalID uint64) { func (keeper Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal v1.Proposal) { startTime := ctx.BlockHeader().Time proposal.VotingStartTime = &startTime - votingPeriod := keeper.GetVotingParams(ctx).VotingPeriod + votingPeriod := keeper.GetParams(ctx).VotingPeriod endTime := proposal.VotingStartTime.Add(*votingPeriod) proposal.VotingEndTime = &endTime proposal.Status = v1.StatusVotingPeriod diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 5959989b249..2da6cc48442 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -88,7 +88,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, totalVotingPower = totalVotingPower.Add(votingPower) } - tallyParams := keeper.GetTallyParams(ctx) + tallyParams := keeper.GetParams(ctx) tallyResults = v1.NewTallyResultFromMap(results) // TODO: Upgrade the spec to cover all of these cases & remove pseudocode. diff --git a/x/gov/migrations/v042/types.go b/x/gov/migrations/v1/types.go similarity index 99% rename from x/gov/migrations/v042/types.go rename to x/gov/migrations/v1/types.go index 417b2401fac..48c5a75bf06 100644 --- a/x/gov/migrations/v042/types.go +++ b/x/gov/migrations/v1/types.go @@ -1,4 +1,4 @@ -package v042 +package v1 // Package v040 is copy-pasted from: // https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/x/gov/types/keys.go diff --git a/x/gov/migrations/v043/json.go b/x/gov/migrations/v2/json.go similarity index 98% rename from x/gov/migrations/v043/json.go rename to x/gov/migrations/v2/json.go index f5eca24d9a3..8eab93981b1 100644 --- a/x/gov/migrations/v043/json.go +++ b/x/gov/migrations/v2/json.go @@ -1,4 +1,4 @@ -package v043 +package v2 import ( "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" diff --git a/x/gov/migrations/v043/json_test.go b/x/gov/migrations/v2/json_test.go similarity index 96% rename from x/gov/migrations/v043/json_test.go rename to x/gov/migrations/v2/json_test.go index acde3a1b643..9203bf01494 100644 --- a/x/gov/migrations/v043/json_test.go +++ b/x/gov/migrations/v2/json_test.go @@ -1,4 +1,4 @@ -package v043_test +package v2_test import ( "encoding/json" @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" + v2 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v2" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -32,7 +32,7 @@ func TestMigrateJSON(t *testing.T) { }, } - migrated := v043gov.MigrateJSON(govGenState) + migrated := v2.MigrateJSON(govGenState) bz, err := clientCtx.Codec.MarshalJSON(migrated) require.NoError(t, err) diff --git a/x/gov/migrations/v046/keys.go b/x/gov/migrations/v2/keys.go similarity index 84% rename from x/gov/migrations/v046/keys.go rename to x/gov/migrations/v2/keys.go index aaf810f3b00..fcedde0a5f4 100644 --- a/x/gov/migrations/v046/keys.go +++ b/x/gov/migrations/v2/keys.go @@ -1,4 +1,4 @@ -package v046 +package v2 const ( // ModuleName is the name of the module diff --git a/x/gov/migrations/v043/store.go b/x/gov/migrations/v2/store.go similarity index 99% rename from x/gov/migrations/v043/store.go rename to x/gov/migrations/v2/store.go index 72658f39c26..916f4dc3cef 100644 --- a/x/gov/migrations/v043/store.go +++ b/x/gov/migrations/v2/store.go @@ -1,4 +1,4 @@ -package v043 +package v2 import ( "fmt" diff --git a/x/gov/migrations/v043/store_test.go b/x/gov/migrations/v2/store_test.go similarity index 80% rename from x/gov/migrations/v043/store_test.go rename to x/gov/migrations/v2/store_test.go index 104e6046f21..cedc94d84d7 100644 --- a/x/gov/migrations/v043/store_test.go +++ b/x/gov/migrations/v2/store_test.go @@ -1,4 +1,4 @@ -package v043_test +package v2_test import ( "bytes" @@ -11,8 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - v042gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v042" - v043gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v043" + v1 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v1" + v2 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v2" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -40,32 +40,32 @@ func TestMigrateStore(t *testing.T) { }{ { "ProposalKey", - v042gov.ProposalKey(proposalID), dummyValue, + v1.ProposalKey(proposalID), dummyValue, types.ProposalKey(proposalID), dummyValue, }, { "ActiveProposalQueue", - v042gov.ActiveProposalQueueKey(proposalID, now), dummyValue, + v1.ActiveProposalQueueKey(proposalID, now), dummyValue, types.ActiveProposalQueueKey(proposalID, now), dummyValue, }, { "InactiveProposalQueue", - v042gov.InactiveProposalQueueKey(proposalID, now), dummyValue, + v1.InactiveProposalQueueKey(proposalID, now), dummyValue, types.InactiveProposalQueueKey(proposalID, now), dummyValue, }, { "ProposalIDKey", - v042gov.ProposalIDKey, dummyValue, + v1.ProposalIDKey, dummyValue, types.ProposalIDKey, dummyValue, }, { "DepositKey", - v042gov.DepositKey(proposalID, addr1), dummyValue, + v1.DepositKey(proposalID, addr1), dummyValue, types.DepositKey(proposalID, addr1), dummyValue, }, { "VotesKeyPrefix", - v042gov.VoteKey(proposalID, addr1), oldVoteValue, + v1.VoteKey(proposalID, addr1), oldVoteValue, types.VoteKey(proposalID, addr1), newVoteValue, }, } @@ -75,8 +75,8 @@ func TestMigrateStore(t *testing.T) { store.Set(tc.oldKey, tc.oldValue) } - // Run migrations. - err := v043gov.MigrateStore(ctx, govKey, cdc) + // Run migratio + err := v2.MigrateStore(ctx, govKey, cdc) require.NoError(t, err) // Make sure the new keys are set and old keys are deleted. diff --git a/x/gov/migrations/v046/convert.go b/x/gov/migrations/v3/convert.go similarity index 99% rename from x/gov/migrations/v046/convert.go rename to x/gov/migrations/v3/convert.go index 5cc159e6a37..0e7ae37359d 100644 --- a/x/gov/migrations/v046/convert.go +++ b/x/gov/migrations/v3/convert.go @@ -1,4 +1,4 @@ -package v046 +package v3 import ( "fmt" diff --git a/x/gov/migrations/v046/convert_test.go b/x/gov/migrations/v3/convert_test.go similarity index 93% rename from x/gov/migrations/v046/convert_test.go rename to x/gov/migrations/v3/convert_test.go index 64375e796ae..c50d1191fb8 100644 --- a/x/gov/migrations/v046/convert_test.go +++ b/x/gov/migrations/v3/convert_test.go @@ -1,4 +1,4 @@ -package v046_test +package v3_test import ( "testing" @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" - v046 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046" + v3 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/stretchr/testify/require" @@ -46,7 +46,7 @@ func TestConvertToLegacyProposal(t *testing.T) { for name, tc := range testCases { t.Run(name, func(t *testing.T) { proposal.FinalTallyResult = &tc.tallyResult - v1beta1Proposal, err := v046.ConvertToLegacyProposal(proposal) + v1beta1Proposal, err := v3.ConvertToLegacyProposal(proposal) if tc.expErr { require.Error(t, err) } else { @@ -113,7 +113,7 @@ func TestConvertToLegacyTallyResult(t *testing.T) { } for name, tc := range testCases { t.Run(name, func(t *testing.T) { - _, err := v046.ConvertToLegacyTallyResult(&tc.tallyResult) + _, err := v3.ConvertToLegacyTallyResult(&tc.tallyResult) if tc.expErr { require.Error(t, err) } else { @@ -146,7 +146,7 @@ func TestConvertToLegacyVote(t *testing.T) { for name, tc := range testCases { t.Run(name, func(t *testing.T) { vote.Options = tc.options - v1beta1Vote, err := v046.ConvertToLegacyVote(vote) + v1beta1Vote, err := v3.ConvertToLegacyVote(vote) if tc.expErr { require.Error(t, err) } else { @@ -167,7 +167,7 @@ func TestConvertToLegacyDeposit(t *testing.T) { Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1))), } - v1beta1Deposit := v046.ConvertToLegacyDeposit(&deposit) + v1beta1Deposit := v3.ConvertToLegacyDeposit(&deposit) require.Equal(t, v1beta1Deposit.ProposalId, deposit.ProposalId) require.Equal(t, v1beta1Deposit.Depositor, deposit.Depositor) require.Equal(t, v1beta1Deposit.Amount[0], deposit.Amount[0]) diff --git a/x/gov/migrations/v046/json.go b/x/gov/migrations/v3/json.go similarity index 76% rename from x/gov/migrations/v046/json.go rename to x/gov/migrations/v3/json.go index ec10fcf1288..94116b77656 100644 --- a/x/gov/migrations/v046/json.go +++ b/x/gov/migrations/v3/json.go @@ -1,4 +1,4 @@ -package v046 +package v3 import ( v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -27,8 +27,13 @@ func MigrateJSON(oldState *v1beta1.GenesisState) (*v1.GenesisState, error) { Deposits: convertToNewDeposits(oldState.Deposits), Votes: newVotes, Proposals: newProps, - DepositParams: &depParams, - VotingParams: &votingParms, - TallyParams: &tallyParams, + Params: &v1.Params{ + MinDeposit: depParams.MinDeposit, + MaxDepositPeriod: depParams.MaxDepositPeriod, + VotingPeriod: votingParms.VotingPeriod, + Quorum: tallyParams.Quorum, + Threshold: tallyParams.Threshold, + VetoThreshold: tallyParams.VetoThreshold, + }, }, nil } diff --git a/x/gov/migrations/v046/json_test.go b/x/gov/migrations/v3/json_test.go similarity index 94% rename from x/gov/migrations/v046/json_test.go rename to x/gov/migrations/v3/json_test.go index 109af562dde..fa54dc2a02c 100644 --- a/x/gov/migrations/v046/json_test.go +++ b/x/gov/migrations/v3/json_test.go @@ -1,4 +1,4 @@ -package v046_test +package v3_test import ( "encoding/json" @@ -14,7 +14,7 @@ import ( moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/gov" - v046 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046" + v3 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -52,7 +52,7 @@ func TestMigrateJSON(t *testing.T) { v1beta1.Vote{ProposalId: 2, Voter: voter.String(), Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo)}, } - migrated, err := v046.MigrateJSON(govGenState) + migrated, err := v3.MigrateJSON(govGenState) require.NoError(t, err) // Make sure the migrated proposal's Msg signer is the gov acct. @@ -74,16 +74,21 @@ func TestMigrateJSON(t *testing.T) { // Make sure about: // - Proposals use MsgExecLegacyContent expected := `{ - "deposit_params": { + "deposit_params": null, + "deposits": [], + "params": { "max_deposit_period": "172800s", "min_deposit": [ { "amount": "10000000", "denom": "stake" } - ] + ], + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000", + "voting_period": "172800s" }, - "deposits": [], "proposals": [ { "deposit_end_time": "2001-09-09T01:46:40Z", @@ -119,11 +124,7 @@ func TestMigrateJSON(t *testing.T) { } ], "starting_proposal_id": "1", - "tally_params": { - "quorum": "0.334000000000000000", - "threshold": "0.500000000000000000", - "veto_threshold": "0.334000000000000000" - }, + "tally_params": null, "votes": [ { "metadata": "", @@ -148,9 +149,7 @@ func TestMigrateJSON(t *testing.T) { "voter": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh" } ], - "voting_params": { - "voting_period": "172800s" - } + "voting_params": null }` require.Equal(t, expected, string(indentedBz)) diff --git a/x/gov/migrations/v043/keys.go b/x/gov/migrations/v3/keys.go similarity index 84% rename from x/gov/migrations/v043/keys.go rename to x/gov/migrations/v3/keys.go index 8a2528ce5cd..a4aa0fe28a7 100644 --- a/x/gov/migrations/v043/keys.go +++ b/x/gov/migrations/v3/keys.go @@ -1,4 +1,4 @@ -package v043 +package v3 const ( // ModuleName is the name of the module diff --git a/x/gov/migrations/v046/store.go b/x/gov/migrations/v3/store.go similarity index 89% rename from x/gov/migrations/v046/store.go rename to x/gov/migrations/v3/store.go index c0ad36dfb4b..2fbecac5363 100644 --- a/x/gov/migrations/v046/store.go +++ b/x/gov/migrations/v3/store.go @@ -1,18 +1,18 @@ -package v046 +package v3 import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - v042 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v042" + v1 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // migrateProposals migrates all legacy proposals into MsgExecLegacyContent // proposals. func migrateProposals(store sdk.KVStore, cdc codec.BinaryCodec) error { - propStore := prefix.NewStore(store, v042.ProposalsKeyPrefix) + propStore := prefix.NewStore(store, v1.ProposalsKeyPrefix) iter := propStore.Iterator(nil, nil) defer iter.Close() diff --git a/x/gov/migrations/v046/store_test.go b/x/gov/migrations/v3/store_test.go similarity index 85% rename from x/gov/migrations/v046/store_test.go rename to x/gov/migrations/v3/store_test.go index 7241815a6ff..ce5448cbca0 100644 --- a/x/gov/migrations/v046/store_test.go +++ b/x/gov/migrations/v3/store_test.go @@ -1,4 +1,4 @@ -package v046_test +package v3_test import ( "testing" @@ -10,8 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/gov" - v042gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v042" - v046gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046" + v1gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v1" + v3gov "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/upgrade" @@ -38,20 +38,20 @@ func TestMigrateStore(t *testing.T) { prop2Bz, err := cdc.Marshal(&prop2) require.NoError(t, err) - store.Set(v042gov.ProposalKey(prop1.ProposalId), prop1Bz) - store.Set(v042gov.ProposalKey(prop2.ProposalId), prop2Bz) + store.Set(v1gov.ProposalKey(prop1.ProposalId), prop1Bz) + store.Set(v1gov.ProposalKey(prop2.ProposalId), prop2Bz) // Run migrations. - err = v046gov.MigrateStore(ctx, govKey, cdc) + err = v3gov.MigrateStore(ctx, govKey, cdc) require.NoError(t, err) var newProp1 v1.Proposal - err = cdc.Unmarshal(store.Get(v042gov.ProposalKey(prop1.ProposalId)), &newProp1) + err = cdc.Unmarshal(store.Get(v1gov.ProposalKey(prop1.ProposalId)), &newProp1) require.NoError(t, err) compareProps(t, prop1, newProp1) var newProp2 v1.Proposal - err = cdc.Unmarshal(store.Get(v042gov.ProposalKey(prop2.ProposalId)), &newProp2) + err = cdc.Unmarshal(store.Get(v1gov.ProposalKey(prop2.ProposalId)), &newProp2) require.NoError(t, err) compareProps(t, prop2, newProp2) } diff --git a/x/gov/migrations/v4/keys.go b/x/gov/migrations/v4/keys.go new file mode 100644 index 00000000000..1c5163a82c4 --- /dev/null +++ b/x/gov/migrations/v4/keys.go @@ -0,0 +1,9 @@ +package v4 + +const ( + // ModuleName is the name of the module + ModuleName = "gov" +) + +// ParamsKey is the key of x/gov params +var ParamsKey = []byte{0x30} diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go new file mode 100644 index 00000000000..07e524b2d17 --- /dev/null +++ b/x/gov/migrations/v4/store.go @@ -0,0 +1,46 @@ +package v4 + +import ( + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/exported" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" +) + +func migrateParams(ctx sdk.Context, storeKey storetypes.StoreKey, legacySubspace exported.ParamSubspace, cdc codec.BinaryCodec) error { + store := ctx.KVStore(storeKey) + + dp := govv1.DepositParams{} + vp := govv1.VotingParams{} + tp := govv1.TallyParams{} + legacySubspace.Get(ctx, govv1.ParamStoreKeyDepositParams, &dp) + legacySubspace.Get(ctx, govv1.ParamStoreKeyVotingParams, &vp) + legacySubspace.Get(ctx, govv1.ParamStoreKeyTallyParams, &tp) + + params := govv1.NewParams( + dp.MinDeposit, + *dp.MaxDepositPeriod, + *vp.VotingPeriod, + tp.Quorum, + tp.Threshold, + tp.VetoThreshold, + ) + + bz, err := cdc.Marshal(¶ms) + if err != nil { + return err + } + + store.Set(ParamsKey, bz) + + return nil +} + +// MigrateStore performs in-place store migrations from v3 (v0.46) to v4 (v0.47). The +// migration includes: +// +// Params migrations from x/params to gov +func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, legacySubspace exported.ParamSubspace, cdc codec.BinaryCodec) error { + return migrateParams(ctx, storeKey, legacySubspace, cdc) +} diff --git a/x/gov/migrations/v4/store_test.go b/x/gov/migrations/v4/store_test.go new file mode 100644 index 00000000000..28076792715 --- /dev/null +++ b/x/gov/migrations/v4/store_test.go @@ -0,0 +1,72 @@ +package v4_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/gov" + v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + "github.com/cosmos/cosmos-sdk/x/upgrade" +) + +type mockSubspace struct { + dp v1.DepositParams + vp v1.VotingParams + tp v1.TallyParams +} + +func newMockSubspace(p v1.Params) mockSubspace { + return mockSubspace{ + dp: v1.DepositParams{ + MinDeposit: p.MinDeposit, + MaxDepositPeriod: p.MaxDepositPeriod, + }, + vp: v1.VotingParams{ + VotingPeriod: p.VotingPeriod, + }, + tp: v1.TallyParams{ + Quorum: p.Quorum, + Threshold: p.Threshold, + VetoThreshold: p.VetoThreshold, + }, + } +} + +func (ms mockSubspace) Get(ctx sdk.Context, key []byte, ptr interface{}) { + switch string(key) { + case string(v1.ParamStoreKeyDepositParams): + *ptr.(*v1.DepositParams) = ms.dp + case string(v1.ParamStoreKeyVotingParams): + *ptr.(*v1.VotingParams) = ms.vp + case string(v1.ParamStoreKeyTallyParams): + *ptr.(*v1.TallyParams) = ms.tp + } +} + +func TestMigrateStore(t *testing.T) { + cdc := moduletestutil.MakeTestEncodingConfig(upgrade.AppModuleBasic{}, gov.AppModuleBasic{}).Codec + govKey := sdk.NewKVStoreKey("gov") + ctx := testutil.DefaultContext(govKey, sdk.NewTransientStoreKey("transient_test")) + store := ctx.KVStore(govKey) + + legacySubspace := newMockSubspace(v1.DefaultParams()) + // Run migrations. + err := v4.MigrateStore(ctx, govKey, legacySubspace, cdc) + require.NoError(t, err) + + var params v1.Params + bz := store.Get(v4.ParamsKey) + require.NoError(t, cdc.Unmarshal(bz, ¶ms)) + require.NotNil(t, params) + require.Equal(t, legacySubspace.dp.MinDeposit, params.MinDeposit) + require.Equal(t, legacySubspace.dp.MaxDepositPeriod, params.MaxDepositPeriod) + require.Equal(t, legacySubspace.vp.VotingPeriod, params.VotingPeriod) + require.Equal(t, legacySubspace.tp.Quorum, params.Quorum) + require.Equal(t, legacySubspace.tp.Threshold, params.Threshold) + require.Equal(t, legacySubspace.tp.VetoThreshold, params.VetoThreshold) +} diff --git a/x/gov/module.go b/x/gov/module.go index c5d1e563e45..2b799b49371 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -27,16 +27,20 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) +const ConsensusVersion = 4 + var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} @@ -126,15 +130,23 @@ type AppModule struct { keeper *keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper + + // legacySubspace is used solely for migration of x/params managed parameters + legacySubspace types.ParamSubspace } // NewAppModule creates a new AppModule object -func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) AppModule { +func NewAppModule( + cdc codec.Codec, keeper *keeper.Keeper, + ak types.AccountKeeper, bk types.BankKeeper, ss types.ParamSubspace, +) AppModule { + return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, keeper: keeper, accountKeeper: ak, bankKeeper: bk, + legacySubspace: ss, } } @@ -155,11 +167,16 @@ type govInputs struct { Config *modulev1.Module Cdc codec.Codec Key *store.KVStoreKey - Subspace types.ParamSubspace + ModuleKey depinject.OwnModuleKey MsgServiceRouter *baseapp.MsgServiceRouter - AccountKeeper types.AccountKeeper - BankKeeper types.BankKeeper - StakingKeeper types.StakingKeeper + Authority map[string]sdk.AccAddress `optional:"true"` + + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper + StakingKeeper types.StakingKeeper + + // LegacySubspace is used solely for migration of x/params managed parameters + LegacySubspace types.ParamSubspace } type govOutputs struct { @@ -176,8 +193,22 @@ func provideModule(in govInputs) govOutputs { kConfig.MaxMetadataLen = in.Config.MaxMetadataLen } - k := keeper.NewKeeper(in.Cdc, in.Key, in.Subspace, in.AccountKeeper, in.BankKeeper, in.StakingKeeper, in.MsgServiceRouter, kConfig) - m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper) + authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] + if !ok { + authority = authtypes.NewModuleAddress(govtypes.ModuleName) + } + + k := keeper.NewKeeper( + in.Cdc, + in.Key, + in.AccountKeeper, + in.BankKeeper, + in.StakingKeeper, + in.MsgServiceRouter, + kConfig, + authority.String(), + ) + m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.LegacySubspace) hr := v1beta1.HandlerRoute{Handler: v1beta1.ProposalHandler, RouteKey: types.RouterKey} return govOutputs{Module: runtime.WrapAppModule(m), Keeper: k, HandlerRoute: hr} @@ -249,7 +280,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { v1beta1.RegisterQueryServer(cfg.QueryServer(), legacyQueryServer) v1.RegisterQueryServer(cfg.QueryServer(), am.keeper) - m := keeper.NewMigrator(am.keeper) + m := keeper.NewMigrator(am.keeper, am.legacySubspace) err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2) if err != nil { panic(err) @@ -258,6 +289,11 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err != nil { panic(err) } + + err = cfg.RegisterMigration(types.ModuleName, 3, m.Migrate3to4) + if err != nil { + panic(err) + } } // InitGenesis performs genesis initialization for the gov module. It returns @@ -277,7 +313,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 3 } +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // EndBlock returns the end blocker for the gov module. It returns no validator // updates. @@ -299,9 +335,11 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We return simulation.ProposalContents() } -// RandomizedParams creates randomized gov param changes for the simulator. -func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { - return simulation.ParamChanges(r) +// TODO: Returns an empty slice which will make parameter changes a no-op during +// simulations. Once all modules are migrated, remove RandomizedParams from +// the simulation interface. +func (AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + return []simtypes.ParamChange{} } // RegisterStoreDecoder registers a decoder for gov module's types diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 9c83be198dc..56bee918d8e 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -97,9 +97,7 @@ func RandomizedGenState(simState *module.SimulationState) { govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewDepositParams(minDeposit, depositPeriod), - v1.NewVotingParams(votingPeriod), - v1.NewTallyParams(quorum, threshold, veto), + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String()), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index 281487751e3..37868dd942f 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -46,12 +46,12 @@ func TestRandomizedGenState(t *testing.T) { dec2, _ := sdk.NewDecFromStr("0.512000000000000000") dec3, _ := sdk.NewDecFromStr("0.267000000000000000") - require.Equal(t, "905stake", govGenesis.DepositParams.MinDeposit[0].String()) - require.Equal(t, "77h26m10s", govGenesis.DepositParams.MaxDepositPeriod.String()) - require.Equal(t, float64(148296), govGenesis.VotingParams.VotingPeriod.Seconds()) - require.Equal(t, dec1.String(), govGenesis.TallyParams.Quorum) - require.Equal(t, dec2.String(), govGenesis.TallyParams.Threshold) - require.Equal(t, dec3.String(), govGenesis.TallyParams.VetoThreshold) + require.Equal(t, "905stake", govGenesis.Params.MinDeposit[0].String()) + require.Equal(t, "77h26m10s", govGenesis.Params.MaxDepositPeriod.String()) + require.Equal(t, float64(148296), govGenesis.Params.VotingPeriod.Seconds()) + require.Equal(t, dec1.String(), govGenesis.Params.Quorum) + require.Equal(t, dec2.String(), govGenesis.Params.Threshold) + require.Equal(t, dec3.String(), govGenesis.Params.VetoThreshold) require.Equal(t, uint64(0x28), govGenesis.StartingProposalId) require.Equal(t, []*v1.Deposit{}, govGenesis.Deposits) require.Equal(t, []*v1.Vote{}, govGenesis.Votes) diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index edcc4a35d74..7f6b913645f 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -203,7 +203,7 @@ func SimulateMsgSubmitProposal(ak types.AccountKeeper, bk types.BankKeeper, k *k // didntVote := whoVotes[numVotes:] whoVotes = whoVotes[:numVotes] - votingPeriod := k.GetVotingParams(ctx).VotingPeriod + votingPeriod := k.GetParams(ctx).VotingPeriod fops := make([]simtypes.FutureOperation, numVotes+1) for i := 0; i < numVotes; i++ { @@ -385,7 +385,7 @@ func randomDeposit(r *rand.Rand, ctx sdk.Context, ak types.AccountKeeper, bk typ return nil, true, nil // skip } - minDeposit := k.GetDepositParams(ctx).MinDeposit + minDeposit := k.GetParams(ctx).MinDeposit denomIndex := r.Intn(len(minDeposit)) denom := minDeposit[denomIndex].Denom diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 685c5596d9b..4f1a6e331f1 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -147,7 +147,7 @@ func TestSimulateMsgDeposit(t *testing.T) { require.NoError(t, err) submitTime := ctx.BlockHeader().Time - depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod + depositPeriod := app.GovKeeper.GetParams(ctx).MaxDepositPeriod proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) @@ -193,7 +193,7 @@ func TestSimulateMsgVote(t *testing.T) { require.NoError(t, err) submitTime := ctx.BlockHeader().Time - depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod + depositPeriod := app.GovKeeper.GetParams(ctx).MaxDepositPeriod proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) @@ -236,7 +236,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { contentMsg, err := v1.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), govAcc) require.NoError(t, err) submitTime := ctx.BlockHeader().Time - depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod + depositPeriod := app.GovKeeper.GetParams(ctx).MaxDepositPeriod proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) diff --git a/x/gov/spec/02_state.md b/x/gov/spec/02_state.md index 66514ec2c54..a61e1f9ed6b 100644 --- a/x/gov/spec/02_state.md +++ b/x/gov/spec/02_state.md @@ -127,7 +127,9 @@ We will use one KVStore `Governance` to store two mappings: * A mapping from `proposalID|'addresses'|address` to `Vote`. This mapping allows us to query all addresses that voted on the proposal along with their vote by doing a range query on `proposalID:addresses`. - +* A mapping from `ParamsKey|'Params'` to `Params`. This map allows to query all + x/gov params. + For pseudocode purposes, here are the two function we will use to read or write in stores: * `load(StoreKey, Key)`: Retrieve item stored at key `Key` in store found at key `StoreKey` in the multistore diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index bbb964c674c..dd1fb906335 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -34,6 +34,8 @@ const ( // - 0x10: Deposit // // - 0x20: Voter +// +// - 0x30: Params var ( ProposalsKeyPrefix = []byte{0x00} ActiveProposalQueuePrefix = []byte{0x01} @@ -43,6 +45,9 @@ var ( DepositsKeyPrefix = []byte{0x10} VotesKeyPrefix = []byte{0x20} + + // ParamsKey is the key to query all gov params + ParamsKey = []byte{0x30} ) var lenTime = len(sdk.FormatTimeBytes(time.Now())) diff --git a/x/gov/types/v1/codec.go b/x/gov/types/v1/codec.go index 327094960d7..8b45b209834 100644 --- a/x/gov/types/v1/codec.go +++ b/x/gov/types/v1/codec.go @@ -19,6 +19,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { legacy.RegisterAminoMsg(cdc, &MsgVote{}, "cosmos-sdk/v1/MsgVote") legacy.RegisterAminoMsg(cdc, &MsgVoteWeighted{}, "cosmos-sdk/v1/MsgVoteWeighted") legacy.RegisterAminoMsg(cdc, &MsgExecLegacyContent{}, "cosmos-sdk/v1/MsgExecLegacyContent") + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/gov/v1/MsgUpdateParams") } func RegisterInterfaces(registry codectypes.InterfaceRegistry) { @@ -28,6 +29,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgVoteWeighted{}, &MsgDeposit{}, &MsgExecLegacyContent{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/gov/types/v1/genesis.go b/x/gov/types/v1/genesis.go index 0e661b4a201..cc407309fbf 100644 --- a/x/gov/types/v1/genesis.go +++ b/x/gov/types/v1/genesis.go @@ -8,12 +8,17 @@ import ( ) // NewGenesisState creates a new genesis state for the governance module -func NewGenesisState(startingProposalID uint64, dp DepositParams, vp VotingParams, tp TallyParams) *GenesisState { +func NewGenesisState(startingProposalID uint64, params Params) *GenesisState { + dp := NewDepositParams(params.MinDeposit, params.MaxDepositPeriod) + vp := NewVotingParams(params.VotingPeriod) + tp := NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold) + return &GenesisState{ StartingProposalId: startingProposalID, DepositParams: &dp, VotingParams: &vp, TallyParams: &tp, + Params: ¶ms, } } @@ -21,18 +26,13 @@ func NewGenesisState(startingProposalID uint64, dp DepositParams, vp VotingParam func DefaultGenesisState() *GenesisState { return NewGenesisState( DefaultStartingProposalID, - DefaultDepositParams(), - DefaultVotingParams(), - DefaultTallyParams(), + DefaultParams(), ) } // Empty returns true if a GenesisState is empty func (data GenesisState) Empty() bool { - return data.StartingProposalId == 0 || - data.DepositParams == nil || - data.VotingParams == nil || - data.TallyParams == nil + return data.StartingProposalId == 0 || data.Params == nil } // ValidateGenesis checks if parameters are within valid ranges @@ -53,7 +53,7 @@ func ValidateGenesis(data *GenesisState) error { return fmt.Errorf("invalid deposit params: %w", err) } - return nil + return data.Params.ValidateBasic() } var _ types.UnpackInterfacesMessage = GenesisState{} diff --git a/x/gov/types/v1/genesis.pb.go b/x/gov/types/v1/genesis.pb.go index 2d4773082e5..5d0d3dea13e 100644 --- a/x/gov/types/v1/genesis.pb.go +++ b/x/gov/types/v1/genesis.pb.go @@ -32,12 +32,19 @@ type GenesisState struct { Votes []*Vote `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` // proposals defines all the proposals present at genesis. Proposals []*Proposal `protobuf:"bytes,4,rep,name=proposals,proto3" json:"proposals,omitempty"` - // params defines all the paramaters of related to deposit. - DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` - // params defines all the paramaters of related to voting. - VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` - // params defines all the paramaters of related to tally. - TallyParams *TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` + // Deprecated: Prefer to use `params` instead. + // deposit_params defines all the paramaters of related to deposit. + DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` // Deprecated: Do not use. + // Deprecated: Prefer to use `params` instead. + // voting_params defines all the paramaters of related to voting. + VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` // Deprecated: Do not use. + // Deprecated: Prefer to use `params` instead. + // tally_params defines all the paramaters of related to tally. + TallyParams *TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` // Deprecated: Do not use. + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params *Params `protobuf:"bytes,8,opt,name=params,proto3" json:"params,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -101,6 +108,7 @@ func (m *GenesisState) GetProposals() []*Proposal { return nil } +// Deprecated: Do not use. func (m *GenesisState) GetDepositParams() *DepositParams { if m != nil { return m.DepositParams @@ -108,6 +116,7 @@ func (m *GenesisState) GetDepositParams() *DepositParams { return nil } +// Deprecated: Do not use. func (m *GenesisState) GetVotingParams() *VotingParams { if m != nil { return m.VotingParams @@ -115,6 +124,7 @@ func (m *GenesisState) GetVotingParams() *VotingParams { return nil } +// Deprecated: Do not use. func (m *GenesisState) GetTallyParams() *TallyParams { if m != nil { return m.TallyParams @@ -122,6 +132,13 @@ func (m *GenesisState) GetTallyParams() *TallyParams { return nil } +func (m *GenesisState) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1.GenesisState") } @@ -129,29 +146,30 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/genesis.proto", fileDescriptor_ef7cfd15e3ded621) } var fileDescriptor_ef7cfd15e3ded621 = []byte{ - // 341 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcd, 0x4e, 0xc2, 0x40, - 0x14, 0x85, 0xa9, 0xfc, 0xa8, 0x03, 0xb8, 0x18, 0x8d, 0x34, 0x60, 0x1a, 0xe2, 0x0a, 0x63, 0x6c, - 0x05, 0xe3, 0xd2, 0xc4, 0xf8, 0x13, 0xe3, 0x8e, 0x54, 0xe3, 0xc2, 0x0d, 0x29, 0x74, 0x52, 0x1b, - 0x81, 0xdb, 0xf4, 0x5e, 0x27, 0xf2, 0x16, 0x3e, 0x80, 0x0f, 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- 0x2a, 0xa3, 0xf1, 0xb7, 0xee, 0x62, 0x25, 0x3a, 0xa2, 0x22, 0x57, 0x26, 0x7e, 0xc6, 0x2a, 0xe4, - 0x0d, 0x87, 0x93, 0x34, 0x60, 0x5d, 0x05, 0xd4, 0x33, 0x01, 0xf7, 0x0b, 0x24, 0xf1, 0x97, 0x69, - 0x39, 0x5c, 0x5c, 0x7f, 0xcc, 0x2c, 0x63, 0x3a, 0xb3, 0x8c, 0xaf, 0x99, 0x65, 0xbc, 0xcd, 0xad, - 0xdc, 0x74, 0x6e, 0xe5, 0x3e, 0xe7, 0x56, 0xee, 0xf1, 0x30, 0x08, 0xe9, 0xe9, 0xa5, 0x6f, 0x0f, - 0x60, 0xe4, 0x24, 0xc7, 0xd5, 0xcf, 0x11, 0xfa, 0xcf, 0xce, 0xab, 0xba, 0x34, 0x4d, 0x22, 0x81, - 0x8e, 0x6c, 0xf7, 0x4b, 0xea, 0xd8, 0x27, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf3, 0xec, 0x74, - 0x03, 0x33, 0x02, 0x00, 0x00, + // 358 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x4e, 0xfa, 0x40, + 0x14, 0xc5, 0x19, 0xbe, 0xfe, 0xfc, 0x07, 0x70, 0x31, 0x7e, 0xd0, 0x80, 0x69, 0x88, 0x2b, 0x8c, + 0xa1, 0x15, 0x8c, 0x0f, 0x20, 0xc1, 0x10, 0x77, 0xa4, 0x1a, 0x17, 0x6e, 0x48, 0xa1, 0x93, 0xda, + 0x08, 0xdc, 0xa6, 0x77, 0x9c, 0xc8, 0x5b, 0xf8, 0x58, 0x2e, 0xd9, 0xe9, 0xd2, 0xc0, 0x8b, 0x18, + 0x66, 0x5a, 0xc1, 0xea, 0x6a, 0x92, 0x7b, 0x7e, 0xe7, 0xcc, 0xc9, 0xcd, 0xa5, 0x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 0x4e, 0xa7, 0x8b, 0x24, 0xe4, 0x9f, 0x0a, 0xa9, 0xa7, 0x42, 0xee, 0x36, 0xc8, + 0x4e, 0x46, 0x59, 0x6c, 0x07, 0xac, 0x4d, 0x8b, 0xb1, 0xb9, 0xa4, 0xcc, 0x87, 0xe9, 0x2d, 0x28, + 0xd1, 0x89, 0xa1, 0xde, 0xf5, 0xdb, 0xca, 0x24, 0xcb, 0x95, 0x49, 0x3e, 0x57, 0x26, 0x79, 0x5d, + 0x9b, 0x99, 0xe5, 0xda, 0xcc, 0x7c, 0xac, 0xcd, 0xcc, 0xc3, 0x99, 0x1f, 0x88, 0xc7, 0xe7, 0xb1, + 0x35, 0x81, 0x99, 0x1d, 0xdf, 0x85, 0x7e, 0xda, 0xe8, 0x3d, 0xd9, 0x2f, 0xea, 0x48, 0xc4, 0x22, + 0xe4, 0x68, 0xcb, 0xce, 0xb8, 0xa8, 0xee, 0xe4, 0xe2, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xb2, + 0x17, 0xb2, 0x6e, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -174,6 +192,18 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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 = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } if m.TallyParams != nil { { size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) @@ -310,6 +340,10 @@ func (m *GenesisState) Size() (n int) { l = m.TallyParams.Size() n += 1 + l + sovGenesis(uint64(l)) } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + } return n } @@ -577,6 +611,42 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + 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 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 + } + 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 := skipGenesis(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/genesis_test.go b/x/gov/types/v1/genesis_test.go index 16b90087833..1d74e2ded39 100644 --- a/x/gov/types/v1/genesis_test.go +++ b/x/gov/types/v1/genesis_test.go @@ -3,6 +3,7 @@ package v1_test import ( "testing" + sdk "github.com/cosmos/cosmos-sdk/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/stretchr/testify/require" ) @@ -16,56 +17,76 @@ func TestEmptyGenesis(t *testing.T) { } func TestValidateGenesis(t *testing.T) { - depositParams := v1.DefaultDepositParams() - votingParams := v1.DefaultVotingParams() - tallyParams := v1.DefaultTallyParams() + params := v1.DefaultParams() testCases := []struct { name string - genesisState *v1.GenesisState + genesisState func() *v1.GenesisState expErr bool }{ { - name: "valid", - genesisState: v1.DefaultGenesisState(), + name: "valid", + genesisState: func() *v1.GenesisState { + return v1.NewGenesisState(v1.DefaultStartingProposalID, params) + }, }, { name: "invalid StartingProposalId", - genesisState: &v1.GenesisState{ - StartingProposalId: 0, - DepositParams: &depositParams, - VotingParams: &votingParams, - TallyParams: &tallyParams, + genesisState: func() *v1.GenesisState { + return v1.NewGenesisState(0, params) + }, + expErr: true, + }, + { + name: "invalid min deposit", + genesisState: func() *v1.GenesisState { + params1 := params + params1.MinDeposit = sdk.Coins{{ + Denom: sdk.DefaultBondDenom, + Amount: sdk.NewInt(-100), + }} + + return v1.NewGenesisState(0, params1) + }, + expErr: true, + }, + { + name: "invalid max deposit period", + genesisState: func() *v1.GenesisState { + params1 := params + params1.MaxDepositPeriod = nil + + return v1.NewGenesisState(0, params1) }, expErr: true, }, { - name: "invalid TallyParams", - genesisState: &v1.GenesisState{ - StartingProposalId: v1.DefaultStartingProposalID, - DepositParams: &depositParams, - VotingParams: &votingParams, - TallyParams: &v1.TallyParams{}, + name: "invalid quorum", + genesisState: func() *v1.GenesisState { + params1 := params + params1.Quorum = "2" + + return v1.NewGenesisState(0, params1) }, expErr: true, }, { - name: "invalid VotingParams", - genesisState: &v1.GenesisState{ - StartingProposalId: v1.DefaultStartingProposalID, - DepositParams: &depositParams, - VotingParams: &v1.VotingParams{}, - TallyParams: &tallyParams, + name: "invalid threshold", + genesisState: func() *v1.GenesisState { + params1 := params + params1.Threshold = "2" + + return v1.NewGenesisState(0, params1) }, expErr: true, }, { - name: "invalid DepositParams", - genesisState: &v1.GenesisState{ - StartingProposalId: v1.DefaultStartingProposalID, - DepositParams: &v1.DepositParams{}, - VotingParams: &votingParams, - TallyParams: &tallyParams, + name: "invalid veto threshold", + genesisState: func() *v1.GenesisState { + params1 := params + params1.VetoThreshold = "2" + + return v1.NewGenesisState(0, params1) }, expErr: true, }, @@ -74,7 +95,7 @@ func TestValidateGenesis(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - err := v1.ValidateGenesis(tc.genesisState) + err := v1.ValidateGenesis(tc.genesisState()) if tc.expErr { require.Error(t, err) } else { diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 36b207454ff..8cbdf616f9f 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -664,6 +664,102 @@ func (m *TallyParams) GetVetoThreshold() string { return "" } +// Params defines the parameters for the x/gov module. +// +// Since: cosmos-sdk 0.47 +type Params struct { + // Minimum deposit for a proposal to enter voting period. + MinDeposit []types.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit"` + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + MaxDepositPeriod *time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` + // Length of the voting period. + VotingPeriod *time.Duration `protobuf:"bytes,3,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + Quorum string `protobuf:"bytes,4,opt,name=quorum,proto3" json:"quorum,omitempty"` + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + Threshold string `protobuf:"bytes,5,opt,name=threshold,proto3" json:"threshold,omitempty"` + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{8} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetMinDeposit() []types.Coin { + if m != nil { + return m.MinDeposit + } + return nil +} + +func (m *Params) GetMaxDepositPeriod() *time.Duration { + if m != nil { + return m.MaxDepositPeriod + } + return nil +} + +func (m *Params) GetVotingPeriod() *time.Duration { + if m != nil { + return m.VotingPeriod + } + return nil +} + +func (m *Params) GetQuorum() string { + if m != nil { + return m.Quorum + } + return "" +} + +func (m *Params) GetThreshold() string { + if m != nil { + return m.Threshold + } + return "" +} + +func (m *Params) GetVetoThreshold() string { + if m != nil { + return m.VetoThreshold + } + return "" +} + func init() { proto.RegisterEnum("cosmos.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -675,81 +771,86 @@ func init() { proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1.DepositParams") proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1.VotingParams") proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1.TallyParams") + proto.RegisterType((*Params)(nil), "cosmos.gov.v1.Params") } func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1104 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x4f, 0x53, 0xdb, 0x46, - 0x14, 0x47, 0xb6, 0x30, 0xe6, 0x19, 0x1b, 0x75, 0xa1, 0x45, 0x90, 0x60, 0x13, 0x4f, 0xdb, 0xa1, - 0xa4, 0xd8, 0x25, 0x99, 0xb6, 0x33, 0xcd, 0xc9, 0xc6, 0x4a, 0x31, 0xc3, 0x60, 0x57, 0x52, 0xcc, - 0xa4, 0x17, 0x8d, 0x8c, 0x14, 0x5b, 0x53, 0x4b, 0xeb, 0x6a, 0xd7, 0x0e, 0xfe, 0x08, 0xbd, 0xe5, - 0xd8, 0x99, 0x7e, 0x8d, 0x4c, 0x3f, 0x43, 0x4e, 0x9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 0xf5, 0x46, 0x4d, 0x12, 0xd0, 0x03, 0xd8, 0x8c, 0x63, - 0x5a, 0x0d, 0xbd, 0x7e, 0xfc, 0x7d, 0x04, 0x49, 0xa0, 0x0d, 0xf8, 0x24, 0x0e, 0x69, 0x56, 0x34, - 0x4d, 0xa9, 0x85, 0x4d, 0xc7, 0x73, 0xaa, 0x72, 0xa8, 0xec, 0xeb, 0x4a, 0x4d, 0x12, 0x6f, 0x62, - 0x3e, 0xad, 0xd4, 0x8f, 0x94, 0x9a, 0x34, 0x5f, 0x55, 0xde, 0x9c, 0xe7, 0x85, 0xb7, 0xe7, 0x79, - 0xe1, 0xbf, 0xf3, 0xbc, 0xf0, 0xea, 0x22, 0x3f, 0xf7, 0xf6, 0x22, 0x3f, 0xf7, 0xf7, 0x45, 0x7e, - 0xee, 0xc7, 0x87, 0x1d, 0x87, 0x76, 0x07, 0xed, 0xd2, 0x29, 0x76, 0xf9, 0x0f, 0x0a, 0xbf, 0xec, - 0x12, 0xeb, 0xa7, 0xf2, 0x19, 0xfb, 0xe9, 0xa2, 0xa3, 0xbe, 0x4d, 0x82, 0x3f, 0xaa, 0x14, 0xb3, - 0xeb, 0xe3, 0xf7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x73, 0xa8, 0x09, 0x8c, 0x92, 0x09, 0x00, 0x00, + // 1166 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xdb, 0x46, + 0x17, 0x35, 0x25, 0x5a, 0x96, 0xaf, 0x2c, 0x85, 0xdf, 0x24, 0x5f, 0xc3, 0x38, 0xb1, 0xe4, 0x08, + 0x6d, 0xe1, 0x3a, 0xb1, 0x54, 0x27, 0x48, 0x0b, 0x34, 0x9b, 0x4a, 0x16, 0x53, 0xcb, 0x70, 0x2d, + 0x95, 0x64, 0x64, 0xa4, 0x1b, 0x82, 0x32, 0x19, 0x89, 0xa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 0xf9, 0xea, 0xe1, + 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x25, 0x68, 0xda, 0x01, 0x0b, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1187,6 +1288,84 @@ func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VetoThreshold) > 0 { + i -= len(m.VetoThreshold) + copy(dAtA[i:], m.VetoThreshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.VetoThreshold))) + i-- + dAtA[i] = 0x32 + } + if len(m.Threshold) > 0 { + i -= len(m.Threshold) + copy(dAtA[i:], m.Threshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.Threshold))) + i-- + dAtA[i] = 0x2a + } + if len(m.Quorum) > 0 { + i -= len(m.Quorum) + copy(dAtA[i:], m.Quorum) + i = encodeVarintGov(dAtA, i, uint64(len(m.Quorum))) + i-- + dAtA[i] = 0x22 + } + if m.VotingPeriod != nil { + n8, err8 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.VotingPeriod):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintGov(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x1a + } + if m.MaxDepositPeriod != nil { + n9, err9 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintGov(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0x12 + } + if len(m.MinDeposit) > 0 { + for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintGov(dAtA []byte, offset int, v uint64) int { offset -= sovGov(v) base := offset @@ -1391,6 +1570,41 @@ func (m *TallyParams) Size() (n int) { return n } +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MinDeposit) > 0 { + for _, e := range m.MinDeposit { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + if m.MaxDepositPeriod != nil { + l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.MaxDepositPeriod) + n += 1 + l + sovGov(uint64(l)) + } + if m.VotingPeriod != nil { + l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.VotingPeriod) + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Quorum) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Threshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.VetoThreshold) + 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 } @@ -2698,6 +2912,258 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *Params) 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinDeposit", 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.MinDeposit = append(m.MinDeposit, types.Coin{}) + if err := m.MinDeposit[len(m.MinDeposit)-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 MaxDepositPeriod", 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.MaxDepositPeriod == nil { + m.MaxDepositPeriod = new(time.Duration) + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", 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.VotingPeriod == nil { + m.VotingPeriod = new(time.Duration) + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quorum", 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.Quorum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", 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.Threshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", 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.VetoThreshold = 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/msgs.go b/x/gov/types/v1/msgs.go index 84b845c5573..1c46906293e 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -12,8 +12,8 @@ import ( ) var ( - _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{} - _, _ codectypes.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} + _, _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{}, &MsgUpdateParams{} + _, _ codectypes.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. @@ -260,3 +260,30 @@ func (c MsgExecLegacyContent) UnpackInterfaces(unpacker codectypes.AnyUnpacker) var content v1beta1.Content return unpacker.UnpackAny(c.Content, &content) } + +// Route implements Msg +func (msg MsgUpdateParams) Route() string { return types.RouterKey } + +// Type implements Msg +func (msg MsgUpdateParams) Type() string { return sdk.MsgTypeURL(&msg) } + +// ValidateBasic implements Msg +func (msg MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err) + } + + return msg.Params.ValidateBasic() +} + +// GetSignBytes implements Msg +func (msg MsgUpdateParams) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements Msg +func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { + authority, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{authority} +} diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index b2321be75d5..a41799f05cb 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -1,12 +1,10 @@ package v1 import ( - "errors" "fmt" "time" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) // Default period for deposits & voting @@ -22,85 +20,71 @@ var ( DefaultVetoThreshold = sdk.NewDecWithPrec(334, 3) ) -// Parameter store key -var ( - ParamStoreKeyDepositParams = []byte("depositparams") - ParamStoreKeyVotingParams = []byte("votingparams") - ParamStoreKeyTallyParams = []byte("tallyparams") -) +// Deprecated: NewDepositParams creates a new DepositParams object +func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod *time.Duration) DepositParams { + return DepositParams{ + MinDeposit: minDeposit, + MaxDepositPeriod: maxDepositPeriod, + } +} -// ParamKeyTable - Key declaration for parameters -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable( - paramtypes.NewParamSetPair(ParamStoreKeyDepositParams, DepositParams{}, validateDepositParams), - paramtypes.NewParamSetPair(ParamStoreKeyVotingParams, VotingParams{}, validateVotingParams), - paramtypes.NewParamSetPair(ParamStoreKeyTallyParams, TallyParams{}, validateTallyParams), - ) +// Deprecated: NewTallyParams creates a new TallyParams object +func NewTallyParams(quorum, threshold, vetoThreshold string) TallyParams { + return TallyParams{ + Quorum: quorum, + Threshold: threshold, + VetoThreshold: vetoThreshold, + } } -// NewDepositParams creates a new DepositParams object -func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) DepositParams { - return DepositParams{ +// Deprecated: NewVotingParams creates a new VotingParams object +func NewVotingParams(votingPeriod *time.Duration) VotingParams { + return VotingParams{ + VotingPeriod: votingPeriod, + } +} + +func NewParams( + minDeposit sdk.Coins, maxDepositPeriod time.Duration, votingPeriod time.Duration, + quorum string, threshold string, vetoThreshold string, +) Params { + return Params{ MinDeposit: minDeposit, MaxDepositPeriod: &maxDepositPeriod, + VotingPeriod: &votingPeriod, + Quorum: quorum, + Threshold: threshold, + VetoThreshold: vetoThreshold, } } -// DefaultDepositParams default parameters for deposits -func DefaultDepositParams() DepositParams { - return NewDepositParams( +// DefaultParams default governance params +func DefaultParams() Params { + return NewParams( sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinDepositTokens)), DefaultPeriod, + DefaultPeriod, + DefaultQuorum.String(), + DefaultThreshold.String(), + DefaultVetoThreshold.String(), ) } -// Equal checks equality of DepositParams -func (dp DepositParams) Equal(dp2 DepositParams) bool { - return sdk.Coins(dp.MinDeposit).IsEqual(dp2.MinDeposit) && dp.MaxDepositPeriod == dp2.MaxDepositPeriod -} - -func validateDepositParams(i interface{}) error { - v, ok := i.(DepositParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } +func (p Params) ValidateBasic() error { - if !sdk.Coins(v.MinDeposit).IsValid() { - return fmt.Errorf("invalid minimum deposit: %s", v.MinDeposit) + if minDeposit := sdk.Coins(p.MinDeposit); minDeposit.Empty() || !minDeposit.IsValid() { + return fmt.Errorf("invalid minimum deposit: %s", minDeposit) } - if v.MaxDepositPeriod == nil || v.MaxDepositPeriod.Seconds() <= 0 { - return fmt.Errorf("maximum deposit period must be positive: %d", v.MaxDepositPeriod) - } - - return nil -} -// NewTallyParams creates a new TallyParams object -func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) TallyParams { - return TallyParams{ - Quorum: quorum.String(), - Threshold: threshold.String(), - VetoThreshold: vetoThreshold.String(), + if p.MaxDepositPeriod == nil { + return fmt.Errorf("maximum deposit period must not be nil: %d", p.MaxDepositPeriod) } -} - -// DefaultTallyParams default parameters for tallying -func DefaultTallyParams() TallyParams { - return NewTallyParams(DefaultQuorum, DefaultThreshold, DefaultVetoThreshold) -} - -// Equal checks equality of TallyParams -func (tp TallyParams) Equal(other TallyParams) bool { - return tp.Quorum == other.Quorum && tp.Threshold == other.Threshold && tp.VetoThreshold == other.VetoThreshold -} -func validateTallyParams(i interface{}) error { - v, ok := i.(TallyParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) + if p.MaxDepositPeriod.Seconds() <= 0 { + return fmt.Errorf("maximum deposit period must be positive: %d", p.MaxDepositPeriod) } - quorum, err := sdk.NewDecFromStr(v.Quorum) + quorum, err := sdk.NewDecFromStr(p.Quorum) if err != nil { return fmt.Errorf("invalid quorum string: %w", err) } @@ -108,10 +92,10 @@ func validateTallyParams(i interface{}) error { return fmt.Errorf("quorom cannot be negative: %s", quorum) } if quorum.GT(sdk.OneDec()) { - return fmt.Errorf("quorom too large: %s", v) + return fmt.Errorf("quorom too large: %s", p.Quorum) } - threshold, err := sdk.NewDecFromStr(v.Threshold) + threshold, err := sdk.NewDecFromStr(p.Threshold) if err != nil { return fmt.Errorf("invalid threshold string: %w", err) } @@ -119,10 +103,10 @@ func validateTallyParams(i interface{}) error { return fmt.Errorf("vote threshold must be positive: %s", threshold) } if threshold.GT(sdk.OneDec()) { - return fmt.Errorf("vote threshold too large: %s", v) + return fmt.Errorf("vote threshold too large: %s", threshold) } - vetoThreshold, err := sdk.NewDecFromStr(v.VetoThreshold) + vetoThreshold, err := sdk.NewDecFromStr(p.VetoThreshold) if err != nil { return fmt.Errorf("invalid vetoThreshold string: %w", err) } @@ -130,68 +114,16 @@ func validateTallyParams(i interface{}) error { return fmt.Errorf("veto threshold must be positive: %s", vetoThreshold) } if vetoThreshold.GT(sdk.OneDec()) { - return fmt.Errorf("veto threshold too large: %s", v) - } - - return nil -} - -// NewVotingParams creates a new VotingParams object -func NewVotingParams(votingPeriod time.Duration) VotingParams { - return VotingParams{ - VotingPeriod: &votingPeriod, - } -} - -// DefaultVotingParams default parameters for voting -func DefaultVotingParams() VotingParams { - return NewVotingParams(DefaultPeriod) -} - -// Equal checks equality of TallyParams -func (vp VotingParams) Equal(other VotingParams) bool { - return vp.VotingPeriod == other.VotingPeriod -} - -func validateVotingParams(i interface{}) error { - v, ok := i.(VotingParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) + return fmt.Errorf("veto threshold too large: %s", vetoThreshold) } - if v.VotingPeriod == nil { - return errors.New("voting period must not be nil") + if p.VotingPeriod == nil { + return fmt.Errorf("voting period must not be nil: %d", p.VotingPeriod) } - if v.VotingPeriod.Seconds() <= 0 { - return fmt.Errorf("voting period must be positive: %s", v.VotingPeriod) + if p.VotingPeriod.Seconds() <= 0 { + return fmt.Errorf("voting period must be positive: %s", p.VotingPeriod) } return nil } - -// Params returns all of the governance params -type Params struct { - VotingParams VotingParams `json:"voting_params" yaml:"voting_params"` - TallyParams TallyParams `json:"tally_params" yaml:"tally_params"` - DepositParams DepositParams `json:"deposit_params" yaml:"deposit_params"` -} - -func (gp Params) String() string { - return gp.VotingParams.String() + "\n" + - gp.TallyParams.String() + "\n" + gp.DepositParams.String() -} - -// NewParams creates a new gov Params instance -func NewParams(vp VotingParams, tp TallyParams, dp DepositParams) Params { - return Params{ - VotingParams: vp, - DepositParams: dp, - TallyParams: tp, - } -} - -// DefaultParams default governance params -func DefaultParams() Params { - return NewParams(DefaultVotingParams(), DefaultTallyParams(), DefaultDepositParams()) -} diff --git a/x/gov/types/v1/params_legacy.go b/x/gov/types/v1/params_legacy.go new file mode 100644 index 00000000000..04069128409 --- /dev/null +++ b/x/gov/types/v1/params_legacy.go @@ -0,0 +1,100 @@ +package v1 + +import ( + "errors" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +// Parameter store key +var ( + ParamStoreKeyDepositParams = []byte("depositparams") + ParamStoreKeyVotingParams = []byte("votingparams") + ParamStoreKeyTallyParams = []byte("tallyparams") +) + +// ParamKeyTable - Key declaration for parameters +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable( + paramtypes.NewParamSetPair(ParamStoreKeyDepositParams, DepositParams{}, validateDepositParams), + paramtypes.NewParamSetPair(ParamStoreKeyVotingParams, VotingParams{}, validateVotingParams), + paramtypes.NewParamSetPair(ParamStoreKeyTallyParams, TallyParams{}, validateTallyParams), + ) +} + +func validateDepositParams(i interface{}) error { + v, ok := i.(DepositParams) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if !sdk.Coins(v.MinDeposit).IsValid() { + return fmt.Errorf("invalid minimum deposit: %s", v.MinDeposit) + } + if v.MaxDepositPeriod == nil || v.MaxDepositPeriod.Seconds() <= 0 { + return fmt.Errorf("maximum deposit period must be positive: %d", v.MaxDepositPeriod) + } + + return nil +} + +func validateTallyParams(i interface{}) error { + v, ok := i.(TallyParams) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + quorum, err := sdk.NewDecFromStr(v.Quorum) + if err != nil { + return fmt.Errorf("invalid quorum string: %w", err) + } + if quorum.IsNegative() { + return fmt.Errorf("quorom cannot be negative: %s", quorum) + } + if quorum.GT(sdk.OneDec()) { + return fmt.Errorf("quorom too large: %s", v) + } + + threshold, err := sdk.NewDecFromStr(v.Threshold) + if err != nil { + return fmt.Errorf("invalid threshold string: %w", err) + } + if !threshold.IsPositive() { + return fmt.Errorf("vote threshold must be positive: %s", threshold) + } + if threshold.GT(sdk.OneDec()) { + return fmt.Errorf("vote threshold too large: %s", v) + } + + vetoThreshold, err := sdk.NewDecFromStr(v.VetoThreshold) + if err != nil { + return fmt.Errorf("invalid vetoThreshold string: %w", err) + } + if !vetoThreshold.IsPositive() { + return fmt.Errorf("veto threshold must be positive: %s", vetoThreshold) + } + if vetoThreshold.GT(sdk.OneDec()) { + return fmt.Errorf("veto threshold too large: %s", v) + } + + return nil +} + +func validateVotingParams(i interface{}) error { + v, ok := i.(VotingParams) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.VotingPeriod == nil { + return errors.New("voting period must not be nil") + } + + if v.VotingPeriod.Seconds() <= 0 { + return fmt.Errorf("voting period must be positive: %s", v.VotingPeriod) + } + + return nil +} diff --git a/x/gov/types/v1/query.pb.go b/x/gov/types/v1/query.pb.go index 2a7bbcc2fdf..948563680c7 100644 --- a/x/gov/types/v1/query.pb.go +++ b/x/gov/types/v1/query.pb.go @@ -509,12 +509,19 @@ func (m *QueryParamsRequest) GetParamsType() string { // QueryParamsResponse is the response type for the Query/Params RPC method. type QueryParamsResponse struct { + // Deprecated: Prefer to use `params` instead. // voting_params defines the parameters related to voting. - VotingParams *VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` + VotingParams *VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` // Deprecated: Do not use. + // Deprecated: Prefer to use `params` instead. // deposit_params defines the parameters related to deposit. - DepositParams *DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` + DepositParams *DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` // Deprecated: Do not use. + // Deprecated: Prefer to use `params` instead. // tally_params defines the parameters related to tally. - TallyParams *TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` + TallyParams *TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` // Deprecated: Do not use. + // 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 (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -550,6 +557,7 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo +// Deprecated: Do not use. func (m *QueryParamsResponse) GetVotingParams() *VotingParams { if m != nil { return m.VotingParams @@ -557,6 +565,7 @@ func (m *QueryParamsResponse) GetVotingParams() *VotingParams { return nil } +// Deprecated: Do not use. func (m *QueryParamsResponse) GetDepositParams() *DepositParams { if m != nil { return m.DepositParams @@ -564,6 +573,7 @@ func (m *QueryParamsResponse) GetDepositParams() *DepositParams { return nil } +// Deprecated: Do not use. func (m *QueryParamsResponse) GetTallyParams() *TallyParams { if m != nil { return m.TallyParams @@ -571,6 +581,13 @@ func (m *QueryParamsResponse) GetTallyParams() *TallyParams { return nil } +func (m *QueryParamsResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + // QueryDepositRequest is the request type for the Query/Deposit RPC method. type QueryDepositRequest struct { // proposal_id defines the unique id of the proposal. @@ -895,67 +912,68 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/query.proto", fileDescriptor_46a436d1109b50d0) } var fileDescriptor_46a436d1109b50d0 = []byte{ - // 945 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x5d, 0x6f, 0xdc, 0x44, - 0x14, 0xcd, 0x6c, 0x92, 0x76, 0xf7, 0xa6, 0x09, 0x70, 0x5b, 0x9a, 0xc5, 0x94, 0x6d, 0x70, 0x68, - 0x12, 0x28, 0xf5, 0xb0, 0xe9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d5, 0x82, 0xe4, 0xd1, 0xc7, - 0x6d, 0xfb, 0x13, 0x78, 0xb1, 0x10, 0x28, 0x23, 0x11, 0x4a, 0x0f, 0xaf, 0x42, 0x35, 0x81, 0xe9, - 0xb0, 0x99, 0xd5, 0x79, 0x27, 0x57, 0xb1, 0x93, 0x86, 0xa4, 0x40, 0xfb, 0xc7, 0x4a, 0x81, 0x4e, - 0x26, 0x42, 0xd6, 0xe0, 0xb9, 0x54, 0x88, 0x54, 0xae, 0xea, 0x49, 0xcd, 0x3a, 0xb7, 0xfa, 0xca, - 0x10, 0xd6, 0x7b, 0x1a, 0xd4, 0x9a, 0x8b, 0x72, 0x67, 0x74, 0x60, 0xba, 0x2f, 0x94, 0xd7, 0xad, - 0x57, 0x16, 0xd8, 0x4a, 0xed, 0x4e, 0xfd, 0x8f, 0xdf, 0xae, 0x9c, 0x23, 0x82, 0xf7, 0xda, 0xed, - 0xae, 0x27, 0xe5, 0x3d, 0xd5, 0x0d, 0x42, 0xbf, 0x65, 0x60, 0x78, 0x03, 0x6a, 0x6d, 0x2f, 0x12, - 0x32, 0x50, 0xa2, 0x5b, 0x9f, 0x3c, 0x22, 0x66, 0x00, 0xc5, 0x35, 0x80, 0xc1, 0xd8, 0xea, 0x53, - 0xba, 0x01, 0x4b, 0x89, 0xd4, 0x78, 0xc6, 0x8e, 0xd9, 0x05, 0x9a, 0xb1, 0xb3, 0xee, 0xfa, 0x1e, - 0xd5, 0xda, 0xca, 0x44, 0xda, 0xbf, 0x32, 0x38, 0x5f, 0xec, 0x08, 0x75, 0xf8, 0x3a, 0xd4, 0x92, - 0xe2, 0xe2, 0x66, 0x4c, 0x8e, 0x6a, 0xf1, 0x00, 0x89, 0x1f, 0xe6, 0x94, 0x55, 0xb4, 0xb2, 0xe5, - 0x23, 0x95, 0x99, 0x9c, 0x39, 0x69, 0x5b, 0xf0, 0xbc, 0x56, 0xf6, 0x99, 0x50, 0xde, 0xb8, 0xfb, - 0x72, 0xdc, 0xfe, 0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es of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4b, 0x6f, 0xdc, 0x54, + 0x14, 0x8e, 0x27, 0x8f, 0xce, 0x9c, 0x34, 0x01, 0x4e, 0x1f, 0x19, 0x4c, 0x99, 0x06, 0x87, 0x26, + 0x81, 0x12, 0x5f, 0x26, 0x7d, 0x49, 0x50, 0x16, 0x0d, 0x25, 0x05, 0x89, 0x45, 0x98, 0x56, 0x2c, + 0xd8, 0x44, 0x4e, 0xc6, 0x32, 0x16, 0x13, 0x5f, 0x77, 0xee, 0x9d, 0x11, 0x21, 0x8d, 0x90, 0x2a, + 0x21, 0x58, 0x01, 0x12, 0x15, 0xf0, 0x43, 0xf8, 0x11, 0x2c, 0x2b, 0xd8, 0x20, 0x56, 0x28, 0xe1, + 0x87, 0x20, 0xdf, 0x7b, 0xec, 0xb1, 0x1d, 0x8f, 0x33, 0x53, 0x55, 0xac, 0x22, 0xdf, 0xfb, 0x9d, + 0xef, 0x7c, 0xe7, 0x79, 0x33, 0xf0, 0xf2, 0x2e, 0x17, 0x7b, 0x5c, 0x30, 0x8f, 0xf7, 0x59, 0xbf, + 0xc9, 0x1e, 0xf6, 0xdc, 0xee, 0xbe, 0x1d, 0x76, 0xb9, 0xe4, 0x38, 0xa7, 0xaf, 0x6c, 0x8f, 0xf7, + 0xed, 0x7e, 0xd3, 0x7c, 0x93, 0x90, 0x3b, 0x8e, 0x70, 0x35, 0x8e, 0xf5, 0x9b, 0x3b, 0xae, 0x74, + 0x9a, 0x2c, 0x74, 0x3c, 0x3f, 0x70, 0xa4, 0xcf, 0x03, 0x6d, 0x6a, 0x5e, 0xf2, 0x38, 0xf7, 0x3a, + 0x2e, 0x73, 0x42, 0x9f, 0x39, 0x41, 0xc0, 0xa5, 0xba, 0x14, 0x74, 0xbb, 0x90, 0xf5, 0x19, 0xf1, + 0xeb, 0x0b, 0x12, 0xb3, 0xad,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 0xa3, 0x79, 0x10, 0x41, 0x52, 0x24, 0xb3, 0x72, 0x70, 0x80, 0x6b, 0x30, 0x43, 0xc6, 0x7a, + 0x56, 0x2f, 0xe4, 0x27, 0x49, 0x27, 0x80, 0x40, 0x56, 0x40, 0x79, 0x21, 0x69, 0x23, 0xb7, 0x56, + 0x66, 0x9d, 0x54, 0x46, 0x5e, 0x27, 0xd6, 0x87, 0xb4, 0x9f, 0x13, 0x7f, 0x54, 0x88, 0xb7, 0xe1, + 0x0c, 0x81, 0xa8, 0x04, 0x17, 0x8b, 0x73, 0xd7, 0x8a, 0x61, 0xd6, 0xd7, 0x59, 0xa6, 0xff, 0x7f, + 0x2a, 0x9e, 0x18, 0xb4, 0xe3, 0x07, 0x0a, 0x28, 0x98, 0x75, 0xa8, 0x92, 0xca, 0x78, 0x36, 0x86, + 0x45, 0x93, 0xe0, 0x9e, 0xdf, 0x84, 0xbc, 0x03, 0x0b, 0x4a, 0x95, 0xea, 0x92, 0x96, 0x2b, 0x7a, + 0x1d, 0x39, 0xc6, 0x23, 0x58, 0x3f, 0x69, 0x9b, 0x54, 0x68, 0x5a, 0xf5, 0x19, 0xd5, 0xa7, 0xb0, + 0x29, 0xc9, 0x44, 0x03, 0xd7, 0xff, 0xae, 0xc2, 0xb4, 0xa2, 0xc3, 0x6f, 0x0c, 0xa8, 0xc6, 0x2b, + 0x1c, 0x97, 0x72, 0x96, 0x45, 0xef, 0xb5, 0xf9, 0x7a, 0x39, 0x48, 0x6b, 0xb2, 0xec, 0xc7, 0x7f, + 0xfe, 0xfb, 0x53, 0x65, 0x15, 0x97, 0x59, 0xf6, 0x5f, 0x85, 0xe4, 0x91, 0x60, 0x07, 0xa9, 0x80, + 0x0f, 0xf1, 0x2b, 0xa8, 0x25, 0xcf, 0x0f, 0x96, 0xba, 0x88, 0xdb, 0xc9, 0xbc, 0x72, 0x0a, 0x8a, + 0x94, 0x2c, 0x2a, 0x25, 0x26, 0xd6, 0x87, 0x29, 0xc1, 0x6f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, + 0x4c, 0xfc, 0x75, 0xdc, 0x98, 0xf8, 0xec, 0xaa, 0xe7, 0xcb, 0xcf, 0x7b, 0x3b, 0xf6, 0x2e, 0xdf, + 0x8b, 0x19, 0xf5, 0x9f, 0x35, 0xd1, 0xfe, 0x82, 0x7d, 0xa9, 0xe8, 0xa3, 0x2e, 0x10, 0xd1, 0xef, + 0x92, 0x19, 0xf5, 0xb3, 0xe1, 0xda, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xe4, 0xf6, 0xe9, + 0xe0, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1681,6 +1699,18 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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]) @@ -2116,6 +2146,10 @@ func (m *QueryParamsResponse) Size() (n int) { 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 } @@ -3289,6 +3323,42 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { 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:]) diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 25696059d98..42864efee94 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -551,6 +551,105 @@ func (m *MsgDepositResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + // authority is the address of the governance account. + 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"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{10} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{11} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1.MsgSubmitProposal") proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitProposalResponse") @@ -562,58 +661,64 @@ func init() { proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1.MsgVoteWeightedResponse") proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1.MsgDeposit") proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1.MsgDepositResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.gov.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.gov.v1.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 734 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0xcf, 0x6a, 0xdb, 0x4a, - 0x14, 0xc6, 0xad, 0xd8, 0x37, 0x4e, 0x4e, 0x6e, 0x1c, 0x32, 0x98, 0x44, 0x16, 0x41, 0x71, 0x7c, - 0xe1, 0x62, 0x6e, 0x88, 0x14, 0xe7, 0x96, 0x16, 0x92, 0x52, 0x88, 0xd3, 0xd0, 0x16, 0x6a, 0x5a, - 0x14, 0x48, 0xa1, 0x14, 0x82, 0x6c, 0x4d, 0x27, 0xa2, 0x91, 0x46, 0x68, 0xc6, 0x26, 0x5e, 0xb6, - 0x4f, 0xd0, 0xf7, 0xe8, 0xa6, 0x8b, 0xec, 0xbb, 0x2b, 0xa1, 0xab, 0xd0, 0x55, 0x56, 0xa1, 0x24, - 0x8b, 0x42, 0x57, 0x7d, 0x84, 0x22, 0xcd, 0x48, 0x4e, 0xac, 0xfc, 0xeb, 0xa6, 0x2b, 0x4b, 0xe7, - 0x7c, 0xdf, 0x99, 0xf3, 0xd3, 0xcc, 0xf1, 0xc0, 0x4c, 0x87, 0x32, 0x8f, 0x32, 0x93, 0xd0, 0x9e, - 0xd9, 0x6b, 0x98, 0x7c, 0xdf, 0x08, 0x42, 0xca, 0x29, 0x9a, 0x14, 0x71, 0x83, 0xd0, 0x9e, 0xd1, - 0x6b, 0x68, 0xba, 0x94, 0xb5, 0x6d, 0x86, 0xcd, 0x5e, 0xa3, 0x8d, 0xb9, 0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x99, 0x9e, 0x7b, - 0xb9, 0x48, 0x5c, 0xbe, 0xdb, 0x6d, 0x1b, 0x1d, 0xea, 0xc9, 0x3b, 0x49, 0xfe, 0x2c, 0x31, 0xe7, - 0x8d, 0xb9, 0x1f, 0x5f, 0x6e, 0xbc, 0x1f, 0x60, 0x16, 0xdd, 0x80, 0xa3, 0xf1, 0x1f, 0xe2, 0xff, - 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb7, 0xdb, 0x52, 0x42, 0x41, 0x07, 0x00, 0x00, + // 797 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x4f, 0xe3, 0x46, + 0x14, 0x8e, 0x49, 0x9a, 0xc0, 0x4b, 0x09, 0xc2, 0x4a, 0xc1, 0xb1, 0x90, 0x09, 0xa9, 0x54, 0x45, + 0x45, 0xd8, 0x04, 0xaa, 0x56, 0x82, 0xaa, 0x12, 0xa1, 0xa8, 0xad, 0xd4, 0xa8, 0xc8, 0xa8, 0x54, + 0xaa, 0x56, 0x42, 0x4e, 0x3c, 0x3b, 0x58, 0x8b, 0x3d, 0x96, 0x67, 0x12, 0x91, 0xe3, 0xee, 0xde, + 0x57, 0xfb, 0x53, 0xf6, 0xc0, 0x7d, 0x6f, 0x2b, 0xb4, 0x27, 0xb4, 0x27, 0x4e, 0x68, 0x05, 0x87, + 0x95, 0xf6, 0xb4, 0x3f, 0x61, 0x65, 0xcf, 0xd8, 0x09, 0x71, 0x20, 0xec, 0x65, 0x4f, 0xb1, 0xdf, + 0xfb, 0xbe, 0x37, 0xdf, 0xe7, 0x37, 0x6f, 0x26, 0xb0, 0xd0, 0x21, 0xd4, 0x25, 0xd4, 0xc0, 0xa4, + 0x67, 0xf4, 0x1a, 0x06, 0x3b, 0xd5, 0xfd, 0x80, 0x30, 0x22, 0xcf, 0xf2, 0xb8, 0x8e, 0x49, 0x4f, + 0xef, 0x35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85, 0x34, 0x29, 0x8c, 0xab, 0xda, 0xf8, 0x78, 0xc2, 0x3f, 0x84, 0x6f, + 0x6f, 0x8d, 0xe0, 0x1d, 0xf8, 0x38, 0xaf, 0xfe, 0x70, 0x7f, 0x3e, 0xa9, 0xfb, 0x07, 0x14, 0xe2, + 0x4d, 0x5e, 0x49, 0x53, 0x44, 0x4a, 0x5d, 0xb9, 0x33, 0x35, 0x2c, 0xf0, 0xd6, 0xae, 0x1a, 0x23, + 0x70, 0x38, 0x3f, 0x4e, 0xe0, 0xb8, 0x5d, 0xd0, 0xdc, 0x3b, 0xbf, 0xd6, 0xa4, 0x8b, 0x6b, 0x4d, + 0x7a, 0x7f, 0xad, 0x49, 0x2f, 0x6f, 0xb4, 0xcc, 0xc5, 0x8d, 0x96, 0xb9, 0xbc, 0xd1, 0x32, 0xff, + 0xaf, 0x62, 0x87, 0x1d, 0x77, 0xdb, 0x7a, 0x87, 0xb8, 0xe2, 0x5e, 0x16, 0x3f, 0x6b, 0xd4, 0x7e, + 0x62, 0x9c, 0x46, 0x17, 0x3c, 0xeb, 0xfb, 0x88, 0x86, 0xff, 0x02, 0xf2, 0xd1, 0xa5, 0xb0, 0xf9, + 0x39, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x33, 0x01, 0xac, 0x45, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -639,6 +744,11 @@ type MsgClient interface { VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) // Deposit defines a method to add deposit on a specific proposal. Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } type msgClient struct { @@ -694,6 +804,15 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca return out, nil } +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/UpdateParams", 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 a content. @@ -707,6 +826,11 @@ type MsgServer interface { VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) // Deposit defines a method to add deposit on a specific proposal. Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -728,6 +852,9 @@ func (*UnimplementedMsgServer) VoteWeighted(ctx context.Context, req *MsgVoteWei func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") } +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -823,6 +950,24 @@ func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.gov.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -847,6 +992,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "Deposit", Handler: _Msg_Deposit_Handler, }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/gov/v1/tx.proto", @@ -1231,6 +1380,69 @@ func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) 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 @@ -1407,6 +1619,30 @@ func (m *MsgDepositResponse) Size() (n int) { return n } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + 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 sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2436,6 +2672,171 @@ func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateParams) 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + 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 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 + 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 + } + 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 *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/params/module.go b/x/params/module.go index d3385f50011..82ccd75c48a 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -26,7 +26,6 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/params/client/cli" "github.com/cosmos/cosmos-sdk/x/params/keeper" - "github.com/cosmos/cosmos-sdk/x/params/simulation" "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" ) @@ -112,7 +111,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // ProposalContents returns all the params content functions used to // simulate governance proposals. func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return simulation.ProposalContents(simState.ParamChanges) + return nil } // RandomizedParams creates randomized distribution param changes for the simulator.