From 2528498f1a760c28614e7218d3fa050914837a56 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 8 Aug 2022 21:35:25 +0200 Subject: [PATCH 01/60] add consensus-param module --- .../module/v1/module.pulsar.go | 507 ++++++++ api/cosmos/consensus_param/v1/query.pulsar.go | 1016 +++++++++++++++ .../consensus_param/v1/query_grpc.pb.go | 107 ++ api/cosmos/consensus_param/v1/tx.pulsar.go | 1098 +++++++++++++++++ api/cosmos/consensus_param/v1/tx_grpc.pb.go | 113 ++ baseapp/baseapp.go | 6 +- baseapp/params.go | 64 +- baseapp/params_test.go | 65 - client/grpc/reflection/reflection.pb.go | 7 +- client/grpc/tmservice/query.pb.go | 7 +- .../consensus_param/module/v1/module.proto | 12 + proto/cosmos/consensus_param/v1/query.proto | 25 + proto/cosmos/consensus_param/v1/tx.proto | 39 + x/consensus_param/README.md | 7 + x/consensus_param/client/cli/query.go | 280 +++++ x/consensus_param/client/cli/query_test.go | 362 ++++++ x/consensus_param/client/cli/suite_test.go | 96 ++ x/consensus_param/client/cli/tx.go | 144 +++ x/consensus_param/client/cli/tx_test.go | 211 ++++ x/consensus_param/exported/exported.go | 13 + x/consensus_param/keeper/keeper.go | 64 + x/consensus_param/keeper/msg_server.go | 41 + x/consensus_param/module.go | 273 ++++ x/consensus_param/simulation/genesis.go | 99 ++ x/consensus_param/simulation/genesis_test.go | 81 ++ x/consensus_param/simulation/operations.go | 414 +++++++ .../simulation/operations_test.go | 207 ++++ x/consensus_param/simulation/params.go | 25 + x/consensus_param/simulation/params_test.go | 35 + .../testutil/expected_keepers_mocks.go | 228 ++++ x/consensus_param/testutil/test_helpers.go | 35 + x/consensus_param/types/codec.go | 15 + x/consensus_param/types/msgs.go | 34 + x/consensus_param/types/params.go | 30 + x/consensus_param/types/query.pb.go | 540 ++++++++ x/consensus_param/types/query.pb.gw.go | 153 +++ x/consensus_param/types/tx.pb.go | 607 +++++++++ x/consensus_param/types/util.go | 27 + x/upgrade/keeper/keeper.go | 3 +- 39 files changed, 6949 insertions(+), 141 deletions(-) create mode 100644 api/cosmos/consensus_param/module/v1/module.pulsar.go create mode 100644 api/cosmos/consensus_param/v1/query.pulsar.go create mode 100644 api/cosmos/consensus_param/v1/query_grpc.pb.go create mode 100644 api/cosmos/consensus_param/v1/tx.pulsar.go create mode 100644 api/cosmos/consensus_param/v1/tx_grpc.pb.go delete mode 100644 baseapp/params_test.go create mode 100644 proto/cosmos/consensus_param/module/v1/module.proto create mode 100644 proto/cosmos/consensus_param/v1/query.proto create mode 100644 proto/cosmos/consensus_param/v1/tx.proto create mode 100644 x/consensus_param/README.md create mode 100644 x/consensus_param/client/cli/query.go create mode 100644 x/consensus_param/client/cli/query_test.go create mode 100644 x/consensus_param/client/cli/suite_test.go create mode 100644 x/consensus_param/client/cli/tx.go create mode 100644 x/consensus_param/client/cli/tx_test.go create mode 100644 x/consensus_param/exported/exported.go create mode 100644 x/consensus_param/keeper/keeper.go create mode 100644 x/consensus_param/keeper/msg_server.go create mode 100644 x/consensus_param/module.go create mode 100644 x/consensus_param/simulation/genesis.go create mode 100644 x/consensus_param/simulation/genesis_test.go create mode 100644 x/consensus_param/simulation/operations.go create mode 100644 x/consensus_param/simulation/operations_test.go create mode 100644 x/consensus_param/simulation/params.go create mode 100644 x/consensus_param/simulation/params_test.go create mode 100644 x/consensus_param/testutil/expected_keepers_mocks.go create mode 100644 x/consensus_param/testutil/test_helpers.go create mode 100644 x/consensus_param/types/codec.go create mode 100644 x/consensus_param/types/msgs.go create mode 100644 x/consensus_param/types/params.go create mode 100644 x/consensus_param/types/query.pb.go create mode 100644 x/consensus_param/types/query.pb.gw.go create mode 100644 x/consensus_param/types/tx.pb.go create mode 100644 x/consensus_param/types/util.go diff --git a/api/cosmos/consensus_param/module/v1/module.pulsar.go b/api/cosmos/consensus_param/module/v1/module.pulsar.go new file mode 100644 index 000000000000..f418c5e8e34b --- /dev/null +++ b/api/cosmos/consensus_param/module/v1/module.pulsar.go @@ -0,0 +1,507 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_consensus_param_module_v1_module_proto_init() + md_Module = File_cosmos_consensus_param_module_v1_module_proto.Messages().ByName("Module") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_param_module_v1_module_proto_msgTypes[0] + 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_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(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_Module) 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module 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_Module) 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.consensus_param.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + 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().(*Module) + 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/consensus_param/module/v1/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the config object of the bank module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_param_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_param_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +var File_cosmos_consensus_param_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_consensus_param_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, + 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x40, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x36, 0xba, + 0xc0, 0x96, 0xda, 0x01, 0x30, 0x0a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x42, 0x8e, 0x02, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x4d, 0xaa, + 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_consensus_param_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_consensus_param_module_v1_module_proto_rawDescData = file_cosmos_consensus_param_module_v1_module_proto_rawDesc +) + +func file_cosmos_consensus_param_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_consensus_param_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_consensus_param_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_param_module_v1_module_proto_rawDescData) + }) + return file_cosmos_consensus_param_module_v1_module_proto_rawDescData +} + +var file_cosmos_consensus_param_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_consensus_param_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.consensus_param.module.v1.Module +} +var file_cosmos_consensus_param_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_consensus_param_module_v1_module_proto_init() } +func file_cosmos_consensus_param_module_v1_module_proto_init() { + if File_cosmos_consensus_param_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_consensus_param_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_consensus_param_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_consensus_param_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_consensus_param_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_consensus_param_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_consensus_param_module_v1_module_proto = out.File + file_cosmos_consensus_param_module_v1_module_proto_rawDesc = nil + file_cosmos_consensus_param_module_v1_module_proto_goTypes = nil + file_cosmos_consensus_param_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/consensus_param/v1/query.pulsar.go b/api/cosmos/consensus_param/v1/query.pulsar.go new file mode 100644 index 000000000000..301a0f756bf3 --- /dev/null +++ b/api/cosmos/consensus_param/v1/query.pulsar.go @@ -0,0 +1,1016 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package consensus_paramv1beta1 + +import ( + _ "cosmossdk.io/api/cosmos/base/query/v1beta1" + types "cosmossdk.io/api/tendermint/types" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/gogo/protobuf/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_consensus_param_v1_query_proto_init() + md_QueryParamsRequest = File_cosmos_consensus_param_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_param_v1_query_proto_msgTypes[0] + 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_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// 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_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(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_QueryParamsRequest) 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_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest 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_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest 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_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest 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_QueryParamsRequest) 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.consensus_param.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest 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_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest 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_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest 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_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1beta1.QueryParamsRequest", 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + 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().(*QueryParamsRequest) + 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().(*QueryParamsRequest) + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_param_v1_query_proto_init() + md_QueryParamsResponse = File_cosmos_consensus_param_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_param_v1_query_proto_msgTypes[1] + 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_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// 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_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(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_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_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_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse 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_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse 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_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse 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_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*types.ConsensusParams) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse 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_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(types.ConsensusParams) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse 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_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + m := new(types.ConsensusParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse 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_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1beta1.QueryParamsResponse", 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + 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.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().(*QueryParamsResponse) + 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] = 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().(*QueryParamsResponse) + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: 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 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 = &types.ConsensusParams{} + } + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/consensus_param/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest defines the request type for querying x/bank parameters. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_param_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_param_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse defines the response type for querying x/bank parameters. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Params *types.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_param_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_param_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *types.ConsensusParams { + if x != nil { + return x.Params + } + return nil +} + +var File_cosmos_consensus_param_v1_query_proto protoreflect.FileDescriptor + +var file_cosmos_consensus_param_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x56, 0x0a, 0x13, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x32, 0xa0, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x96, + 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x89, 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, + 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x29, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_consensus_param_v1_query_proto_rawDescOnce sync.Once + file_cosmos_consensus_param_v1_query_proto_rawDescData = file_cosmos_consensus_param_v1_query_proto_rawDesc +) + +func file_cosmos_consensus_param_v1_query_proto_rawDescGZIP() []byte { + file_cosmos_consensus_param_v1_query_proto_rawDescOnce.Do(func() { + file_cosmos_consensus_param_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_param_v1_query_proto_rawDescData) + }) + return file_cosmos_consensus_param_v1_query_proto_rawDescData +} + +var file_cosmos_consensus_param_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_consensus_param_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: cosmos.consensus_param.v1beta1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: cosmos.consensus_param.v1beta1.QueryParamsResponse + (*types.ConsensusParams)(nil), // 2: tendermint.types.ConsensusParams +} +var file_cosmos_consensus_param_v1_query_proto_depIdxs = []int32{ + 2, // 0: cosmos.consensus_param.v1beta1.QueryParamsResponse.params:type_name -> tendermint.types.ConsensusParams + 0, // 1: cosmos.consensus_param.v1beta1.Query.Params:input_type -> cosmos.consensus_param.v1beta1.QueryParamsRequest + 1, // 2: cosmos.consensus_param.v1beta1.Query.Params:output_type -> cosmos.consensus_param.v1beta1.QueryParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_cosmos_consensus_param_v1_query_proto_init() } +func file_cosmos_consensus_param_v1_query_proto_init() { + if File_cosmos_consensus_param_v1_query_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_consensus_param_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_consensus_param_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_consensus_param_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_consensus_param_v1_query_proto_goTypes, + DependencyIndexes: file_cosmos_consensus_param_v1_query_proto_depIdxs, + MessageInfos: file_cosmos_consensus_param_v1_query_proto_msgTypes, + }.Build() + File_cosmos_consensus_param_v1_query_proto = out.File + file_cosmos_consensus_param_v1_query_proto_rawDesc = nil + file_cosmos_consensus_param_v1_query_proto_goTypes = nil + file_cosmos_consensus_param_v1_query_proto_depIdxs = nil +} diff --git a/api/cosmos/consensus_param/v1/query_grpc.pb.go b/api/cosmos/consensus_param/v1/query_grpc.pb.go new file mode 100644 index 000000000000..08e754a19331 --- /dev/null +++ b/api/cosmos/consensus_param/v1/query_grpc.pb.go @@ -0,0 +1,107 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: cosmos/consensus_param/v1/query.proto + +package consensus_paramv1beta1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // Params queries the parameters of x/bank module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Params queries the parameters of x/bank module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.consensus_param.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.consensus_param.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/consensus_param/v1/query.proto", +} diff --git a/api/cosmos/consensus_param/v1/tx.pulsar.go b/api/cosmos/consensus_param/v1/tx.pulsar.go new file mode 100644 index 000000000000..d89d8683e803 --- /dev/null +++ b/api/cosmos/consensus_param/v1/tx.pulsar.go @@ -0,0 +1,1098 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package consensus_paramv1beta1 + +import ( + _ "cosmossdk.io/api/cosmos/msg/v1" + types "cosmossdk.io/api/tendermint/types" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/gogo/protobuf/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_param_v1_tx_proto_init() + md_MsgUpdateParams = File_cosmos_consensus_param_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_consensus_param_v1_tx_proto_msgTypes[0] + 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.consensus_param.v1beta1.MsgUpdateParams.authority": + return x.Authority != "" + case "cosmos.consensus_param.v1beta1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParams.authority": + x.Authority = "" + case "cosmos.consensus_param.v1beta1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "cosmos.consensus_param.v1beta1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*types.ConsensusParams) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(types.ConsensusParams) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "cosmos.consensus_param.v1beta1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message cosmos.consensus_param.v1beta1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "cosmos.consensus_param.v1beta1.MsgUpdateParams.params": + m := new(types.ConsensusParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.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 = &types.ConsensusParams{} + } + 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_consensus_param_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_cosmos_consensus_param_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_consensus_param_v1_tx_proto_msgTypes[1] + 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.consensus_param.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.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.consensus_param.v1beta1.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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/consensus_param/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 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/bank parameters to update. + // + // NOTE: All parameters must be supplied. + Params *types.ConsensusParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_param_v1_tx_proto_msgTypes[0] + 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_consensus_param_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *types.ConsensusParams { + 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_consensus_param_v1_tx_proto_msgTypes[1] + 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_consensus_param_v1_tx_proto_rawDescGZIP(), []int{1} +} + +var File_cosmos_consensus_param_v1_tx_proto protoreflect.FileDescriptor + +var file_cosmos_consensus_param_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, + 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, + 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 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, 0x3f, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 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, 0x7f, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x78, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2f, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x37, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 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, 0x86, 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, + 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, + 0x58, 0xaa, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xca, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xe2, 0x02, 0x29, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1f, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_consensus_param_v1_tx_proto_rawDescOnce sync.Once + file_cosmos_consensus_param_v1_tx_proto_rawDescData = file_cosmos_consensus_param_v1_tx_proto_rawDesc +) + +func file_cosmos_consensus_param_v1_tx_proto_rawDescGZIP() []byte { + file_cosmos_consensus_param_v1_tx_proto_rawDescOnce.Do(func() { + file_cosmos_consensus_param_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_param_v1_tx_proto_rawDescData) + }) + return file_cosmos_consensus_param_v1_tx_proto_rawDescData +} + +var file_cosmos_consensus_param_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_consensus_param_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: cosmos.consensus_param.v1beta1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse + (*types.ConsensusParams)(nil), // 2: tendermint.types.ConsensusParams +} +var file_cosmos_consensus_param_v1_tx_proto_depIdxs = []int32{ + 2, // 0: cosmos.consensus_param.v1beta1.MsgUpdateParams.params:type_name -> tendermint.types.ConsensusParams + 0, // 1: cosmos.consensus_param.v1beta1.Msg.UpdateParams:input_type -> cosmos.consensus_param.v1beta1.MsgUpdateParams + 1, // 2: cosmos.consensus_param.v1beta1.Msg.UpdateParams:output_type -> cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_cosmos_consensus_param_v1_tx_proto_init() } +func file_cosmos_consensus_param_v1_tx_proto_init() { + if File_cosmos_consensus_param_v1_tx_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_consensus_param_v1_tx_proto_msgTypes[0].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_consensus_param_v1_tx_proto_msgTypes[1].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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_consensus_param_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_consensus_param_v1_tx_proto_goTypes, + DependencyIndexes: file_cosmos_consensus_param_v1_tx_proto_depIdxs, + MessageInfos: file_cosmos_consensus_param_v1_tx_proto_msgTypes, + }.Build() + File_cosmos_consensus_param_v1_tx_proto = out.File + file_cosmos_consensus_param_v1_tx_proto_rawDesc = nil + file_cosmos_consensus_param_v1_tx_proto_goTypes = nil + file_cosmos_consensus_param_v1_tx_proto_depIdxs = nil +} diff --git a/api/cosmos/consensus_param/v1/tx_grpc.pb.go b/api/cosmos/consensus_param/v1/tx_grpc.pb.go new file mode 100644 index 000000000000..6a39f24b6b77 --- /dev/null +++ b/api/cosmos/consensus_param/v1/tx_grpc.pb.go @@ -0,0 +1,113 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: cosmos/consensus_param/v1/tx.proto + +package consensus_paramv1beta1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a governance operation for updating the x/bank 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 { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1beta1.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 +type MsgServer interface { + // UpdateParams defines a governance operation for updating the x/bank module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +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. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +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.consensus_param.v1beta1.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) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.consensus_param.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/consensus_param/v1/tx.proto", +} diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 096228614922..398ddd20b5fe 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -426,7 +426,7 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams if app.paramStore.Has(ctx, ParamStoreKeyBlockParams) { var bp tmproto.BlockParams - app.paramStore.Get(ctx, ParamStoreKeyBlockParams, &bp) + app.paramStore.Get(ctx, &cp) cp.Block = &bp } @@ -464,9 +464,7 @@ func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusP return } - app.paramStore.Set(ctx, ParamStoreKeyBlockParams, cp.Block) - app.paramStore.Set(ctx, ParamStoreKeyEvidenceParams, cp.Evidence) - app.paramStore.Set(ctx, ParamStoreKeyValidatorParams, cp.Validator) + app.paramStore.Set(ctx, *cp) // We're explicitly not storing the Tendermint app_version in the param store. It's // stored instead in the x/upgrade store, with its own bump logic. } diff --git a/baseapp/params.go b/baseapp/params.go index 5cf31125b027..fbf16daff0fa 100644 --- a/baseapp/params.go +++ b/baseapp/params.go @@ -1,9 +1,6 @@ package baseapp import ( - "errors" - "fmt" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -22,64 +19,7 @@ var ( // ParamStore defines the interface the parameter store used by the BaseApp must // fulfill. type ParamStore interface { - Get(ctx sdk.Context, key []byte, ptr interface{}) + Get(ctx sdk.Context, key []byte) (tmproto.ConsensusParams, error) Has(ctx sdk.Context, key []byte) bool - Set(ctx sdk.Context, key []byte, param interface{}) -} - -// ValidateBlockParams defines a stateless validation on BlockParams. This function -// is called whenever the parameters are updated or stored. -func ValidateBlockParams(i interface{}) error { - v, ok := i.(tmproto.BlockParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v.MaxBytes <= 0 { - return fmt.Errorf("block maximum bytes must be positive: %d", v.MaxBytes) - } - - if v.MaxGas < -1 { - return fmt.Errorf("block maximum gas must be greater than or equal to -1: %d", v.MaxGas) - } - - return nil -} - -// ValidateEvidenceParams defines a stateless validation on EvidenceParams. This -// function is called whenever the parameters are updated or stored. -func ValidateEvidenceParams(i interface{}) error { - v, ok := i.(tmproto.EvidenceParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v.MaxAgeNumBlocks <= 0 { - return fmt.Errorf("evidence maximum age in blocks must be positive: %d", v.MaxAgeNumBlocks) - } - - if v.MaxAgeDuration <= 0 { - return fmt.Errorf("evidence maximum age time duration must be positive: %v", v.MaxAgeDuration) - } - - if v.MaxBytes < 0 { - return fmt.Errorf("maximum evidence bytes must be non-negative: %v", v.MaxBytes) - } - - return nil -} - -// ValidateValidatorParams defines a stateless validation on ValidatorParams. This -// function is called whenever the parameters are updated or stored. -func ValidateValidatorParams(i interface{}) error { - v, ok := i.(tmproto.ValidatorParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if len(v.PubKeyTypes) == 0 { - return errors.New("validator allowed pubkey types must not be empty") - } - - return nil + Set(ctx sdk.Context, cp tmproto.ConsensusParams) } diff --git a/baseapp/params_test.go b/baseapp/params_test.go deleted file mode 100644 index 3f9d26a56f2f..000000000000 --- a/baseapp/params_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package baseapp_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - "github.com/cosmos/cosmos-sdk/baseapp" -) - -func TestValidateBlockParams(t *testing.T) { - testCases := []struct { - arg interface{} - expectErr bool - }{ - {nil, true}, - {&tmproto.BlockParams{}, true}, - {tmproto.BlockParams{}, true}, - {tmproto.BlockParams{MaxBytes: -1, MaxGas: -1}, true}, - {tmproto.BlockParams{MaxBytes: 2000000, MaxGas: -5}, true}, - {tmproto.BlockParams{MaxBytes: 2000000, MaxGas: 300000}, false}, - } - - for _, tc := range testCases { - require.Equal(t, tc.expectErr, baseapp.ValidateBlockParams(tc.arg) != nil) - } -} - -func TestValidateEvidenceParams(t *testing.T) { - testCases := []struct { - arg interface{} - expectErr bool - }{ - {nil, true}, - {&tmproto.EvidenceParams{}, true}, - {tmproto.EvidenceParams{}, true}, - {tmproto.EvidenceParams{MaxAgeNumBlocks: -1, MaxAgeDuration: 18004000, MaxBytes: 5000000}, true}, - {tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: -1, MaxBytes: 5000000}, true}, - {tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxBytes: -1}, true}, - {tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxBytes: 5000000}, false}, - {tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxBytes: 0}, false}, - } - - for _, tc := range testCases { - require.Equal(t, tc.expectErr, baseapp.ValidateEvidenceParams(tc.arg) != nil) - } -} - -func TestValidateValidatorParams(t *testing.T) { - testCases := []struct { - arg interface{} - expectErr bool - }{ - {nil, true}, - {&tmproto.ValidatorParams{}, true}, - {tmproto.ValidatorParams{}, true}, - {tmproto.ValidatorParams{PubKeyTypes: []string{}}, true}, - {tmproto.ValidatorParams{PubKeyTypes: []string{"secp256k1"}}, false}, - } - - for _, tc := range testCases { - require.Equal(t, tc.expectErr, baseapp.ValidateValidatorParams(tc.arg) != nil) - } -} diff --git a/client/grpc/reflection/reflection.pb.go b/client/grpc/reflection/reflection.pb.go index 66dbef0c7105..271b71fe9295 100644 --- a/client/grpc/reflection/reflection.pb.go +++ b/client/grpc/reflection/reflection.pb.go @@ -6,7 +6,6 @@ package reflection import ( context "context" fmt "fmt" - grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" @@ -265,10 +264,10 @@ type ReflectionServiceClient interface { } type reflectionServiceClient struct { - cc grpc1.ClientConn + cc *grpc.ClientConn } -func NewReflectionServiceClient(cc grpc1.ClientConn) ReflectionServiceClient { +func NewReflectionServiceClient(cc *grpc.ClientConn) ReflectionServiceClient { return &reflectionServiceClient{cc} } @@ -311,7 +310,7 @@ func (*UnimplementedReflectionServiceServer) ListImplementations(ctx context.Con return nil, status.Errorf(codes.Unimplemented, "method ListImplementations not implemented") } -func RegisterReflectionServiceServer(s grpc1.Server, srv ReflectionServiceServer) { +func RegisterReflectionServiceServer(s *grpc.Server, srv ReflectionServiceServer) { s.RegisterService(&_ReflectionService_serviceDesc, srv) } diff --git a/client/grpc/tmservice/query.pb.go b/client/grpc/tmservice/query.pb.go index 1ce38e1c5430..15c3cd42f39f 100644 --- a/client/grpc/tmservice/query.pb.go +++ b/client/grpc/tmservice/query.pb.go @@ -10,7 +10,6 @@ import ( types "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" p2p "github.com/tendermint/tendermint/proto/tendermint/p2p" types1 "github.com/tendermint/tendermint/proto/tendermint/types" @@ -1315,10 +1314,10 @@ type ServiceClient interface { } type serviceClient struct { - cc grpc1.ClientConn + cc *grpc.ClientConn } -func NewServiceClient(cc grpc1.ClientConn) ServiceClient { +func NewServiceClient(cc *grpc.ClientConn) ServiceClient { return &serviceClient{cc} } @@ -1433,7 +1432,7 @@ func (*UnimplementedServiceServer) ABCIQuery(ctx context.Context, req *ABCIQuery return nil, status.Errorf(codes.Unimplemented, "method ABCIQuery not implemented") } -func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { +func RegisterServiceServer(s *grpc.Server, srv ServiceServer) { s.RegisterService(&_Service_serviceDesc, srv) } diff --git a/proto/cosmos/consensus_param/module/v1/module.proto b/proto/cosmos/consensus_param/module/v1/module.proto new file mode 100644 index 000000000000..c11656d7a3aa --- /dev/null +++ b/proto/cosmos/consensus_param/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.consensus_param.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the bank module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/consensus_param" + }; +} diff --git a/proto/cosmos/consensus_param/v1/query.proto b/proto/cosmos/consensus_param/v1/query.proto new file mode 100644 index 000000000000..bdb27b36af4b --- /dev/null +++ b/proto/cosmos/consensus_param/v1/query.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package cosmos.consensus_param.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus_param/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the parameters of x/bank module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/params"; + } +} + +// QueryParamsRequest defines the request type for querying x/bank parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/bank parameters. +message QueryParamsResponse { + tendermint.types.ConsensusParams params = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/consensus_param/v1/tx.proto b/proto/cosmos/consensus_param/v1/tx.proto new file mode 100644 index 000000000000..d983c7419f22 --- /dev/null +++ b/proto/cosmos/consensus_param/v1/tx.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package cosmos.consensus_param.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus_param/types"; + +// Msg defines the bank Msg service. +service Msg { + // UpdateParams defines a governance operation for updating the x/bank module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// 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/bank parameters to update. + // + // NOTE: All parameters must be supplied. + tendermint.types.ConsensusParams 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/x/consensus_param/README.md b/x/consensus_param/README.md new file mode 100644 index 000000000000..b9b428e19af3 --- /dev/null +++ b/x/consensus_param/README.md @@ -0,0 +1,7 @@ + + +# Consensus Parameters + +* [ConsensusParams](spec/README.md) - Functionality to modify consensus params. diff --git a/x/consensus_param/client/cli/query.go b/x/consensus_param/client/cli/query.go new file mode 100644 index 000000000000..df544fd315d6 --- /dev/null +++ b/x/consensus_param/client/cli/query.go @@ -0,0 +1,280 @@ +package cli + +import ( + "fmt" + "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +const ( + FlagDenom = "denom" +) + +// GetQueryCmd returns the parent command for all x/bank CLi query commands. The +// provided clientCtx should have, at a minimum, a verifier, Tendermint RPC client, +// and marshaler set. +func GetQueryCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for the bank module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + GetBalancesCmd(), + GetCmdQueryTotalSupply(), + GetCmdDenomsMetadata(), + GetCmdQuerySendEnabled(), + ) + + return cmd +} + +func GetBalancesCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "balances [address]", + Short: "Query for account balances by address", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the total balance of an account or of a specific denomination. + +Example: + $ %s query %s balances [address] + $ %s query %s balances [address] --denom=[denom] +`, + version.AppName, types.ModuleName, version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + denom, err := cmd.Flags().GetString(FlagDenom) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + addr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + ctx := cmd.Context() + + if denom == "" { + params := types.NewQueryAllBalancesRequest(addr, pageReq) + + res, err := queryClient.AllBalances(ctx, params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + } + + params := types.NewQueryBalanceRequest(addr, denom) + + res, err := queryClient.Balance(ctx, params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res.Balance) + }, + } + + cmd.Flags().String(FlagDenom, "", "The specific balance denomination to query for") + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "all balances") + + return cmd +} + +// GetCmdDenomsMetadata defines the cobra command to query client denomination metadata. +func GetCmdDenomsMetadata() *cobra.Command { + cmd := &cobra.Command{ + Use: "denom-metadata", + Short: "Query the client metadata for coin denominations", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the client metadata for all the registered coin denominations + +Example: + To query for the client metadata of all coin denominations use: + $ %s query %s denom-metadata + +To query for the client metadata of a specific coin denomination use: + $ %s query %s denom-metadata --denom=[denom] +`, + version.AppName, types.ModuleName, version.AppName, types.ModuleName, + ), + ), + RunE: func(cmd *cobra.Command, _ []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + denom, err := cmd.Flags().GetString(FlagDenom) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + if denom == "" { + res, err := queryClient.DenomsMetadata(cmd.Context(), &types.QueryDenomsMetadataRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + } + + res, err := queryClient.DenomMetadata(cmd.Context(), &types.QueryDenomMetadataRequest{Denom: denom}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + cmd.Flags().String(FlagDenom, "", "The specific denomination to query client metadata for") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func GetCmdQueryTotalSupply() *cobra.Command { + cmd := &cobra.Command{ + Use: "total", + Short: "Query the total supply of coins of the chain", + Args: cobra.NoArgs, + Long: strings.TrimSpace( + fmt.Sprintf(`Query total supply of coins that are held by accounts in the chain. + +Example: + $ %s query %s total + +To query for the total supply of a specific coin denomination use: + $ %s query %s total --denom=[denom] +`, + version.AppName, types.ModuleName, version.AppName, types.ModuleName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + denom, err := cmd.Flags().GetString(FlagDenom) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + ctx := cmd.Context() + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + if denom == "" { + res, err := queryClient.TotalSupply(ctx, &types.QueryTotalSupplyRequest{Pagination: pageReq}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + } + + res, err := queryClient.SupplyOf(ctx, &types.QuerySupplyOfRequest{Denom: denom}) + if err != nil { + return err + } + + return clientCtx.PrintProto(&res.Amount) + }, + } + + cmd.Flags().String(FlagDenom, "", "The specific balance denomination to query for") + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "all supply totals") + + return cmd +} + +func GetCmdQuerySendEnabled() *cobra.Command { + cmd := &cobra.Command{ + Use: "send-enabled [denom1 ...]", + Short: "Query for send enabled entries", + Long: strings.TrimSpace(`Query for send enabled entries that have been specifically set. + +To look up one or more specific denoms, supply them as arguments to this command. +To look up all denoms, do not provide any arguments. +`, + ), + Example: strings.TrimSpace( + fmt.Sprintf(`Getting one specific entry: + $ %[1]s query %[2]s send-enabled foocoin + +Getting two specific entries: + $ %[1]s query %[2]s send-enabled foocoin barcoin + +Getting all entries: + $ %[1]s query %[2]s send-enabled +`, + version.AppName, types.ModuleName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + reqPag, err := client.ReadPageRequest(client.MustFlagSetWithPageKeyDecoded(cmd.Flags())) + if err != nil { + return err + } + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + req := &types.QuerySendEnabledRequest{ + Denoms: args, + Pagination: reqPag, + } + + res, err := queryClient.SendEnabled(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "send enabled entries") + + return cmd +} diff --git a/x/consensus_param/client/cli/query_test.go b/x/consensus_param/client/cli/query_test.go new file mode 100644 index 000000000000..b782f0799ce8 --- /dev/null +++ b/x/consensus_param/client/cli/query_test.go @@ -0,0 +1,362 @@ +package cli_test + +import ( + "bytes" + "context" + "fmt" + "io" + + "github.com/gogo/protobuf/proto" + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/client/cli" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +func (s *CLITestSuite) TestGetBalancesCmd() { + accounts := s.createKeyringAccounts(1) + + cmd := cli.GetBalancesCmd() + cmd.SetOutput(io.Discard) + + testCases := []struct { + name string + ctxGen func() client.Context + args []string + expectResult proto.Message + expectErr bool + }{ + { + "valid query", + func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&types.QueryAllBalancesResponse{}) + c := newMockTendermintRPC(abci.ResponseQuery{ + Value: bz, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + accounts[0].address.String(), + fmt.Sprintf("--%s=json", flags.FlagOutput), + }, + &types.QueryAllBalancesResponse{}, + false, + }, + { + "valid query with denom", + func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&types.QueryBalanceResponse{ + Balance: &sdk.Coin{}, + }) + c := newMockTendermintRPC(abci.ResponseQuery{ + Value: bz, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + accounts[0].address.String(), + fmt.Sprintf("--%s=photon", cli.FlagDenom), + fmt.Sprintf("--%s=json", flags.FlagOutput), + }, + &sdk.Coin{}, + false, + }, + { + "invalid address", + func() client.Context { + return s.baseCtx + }, + []string{ + "foo", + }, + nil, + true, + }, + { + "invalid denom", + func() client.Context { + c := newMockTendermintRPC(abci.ResponseQuery{ + Code: 1, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + accounts[0].address.String(), + fmt.Sprintf("--%s=foo", cli.FlagDenom), + }, + nil, + true, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + var outBuf bytes.Buffer + + clientCtx := tc.ctxGen().WithOutput(&outBuf) + ctx := svrcmd.CreateExecuteContext(context.Background()) + + cmd.SetContext(ctx) + cmd.SetArgs(tc.args) + + s.Require().NoError(client.SetCmdClientContextHandler(clientCtx, cmd)) + + err := cmd.Execute() + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(outBuf.Bytes(), tc.expectResult)) + s.Require().NoError(err) + } + }) + } +} + +func (s *CLITestSuite) TestGetCmdDenomsMetadata() { + cmd := cli.GetCmdDenomsMetadata() + cmd.SetOutput(io.Discard) + + testCases := []struct { + name string + ctxGen func() client.Context + args []string + expectResult proto.Message + expectErr bool + }{ + { + "valid query", + func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&types.QueryDenomsMetadataResponse{}) + c := newMockTendermintRPC(abci.ResponseQuery{ + Value: bz, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + fmt.Sprintf("--%s=json", flags.FlagOutput), + }, + &types.QueryDenomsMetadataResponse{}, + false, + }, + { + "valid query with denom", + func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&types.QueryDenomMetadataResponse{}) + c := newMockTendermintRPC(abci.ResponseQuery{ + Value: bz, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + fmt.Sprintf("--%s=photon", cli.FlagDenom), + fmt.Sprintf("--%s=json", flags.FlagOutput), + }, + &types.QueryDenomMetadataResponse{}, + false, + }, + { + "invalid query with denom", + func() client.Context { + c := newMockTendermintRPC(abci.ResponseQuery{ + Code: 1, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + fmt.Sprintf("--%s=foo", cli.FlagDenom), + }, + nil, + true, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + var outBuf bytes.Buffer + + clientCtx := tc.ctxGen().WithOutput(&outBuf) + ctx := svrcmd.CreateExecuteContext(context.Background()) + + cmd.SetContext(ctx) + cmd.SetArgs(tc.args) + + s.Require().NoError(client.SetCmdClientContextHandler(clientCtx, cmd)) + + err := cmd.Execute() + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(outBuf.Bytes(), tc.expectResult)) + s.Require().NoError(err) + } + }) + } +} + +func (s *CLITestSuite) TestGetCmdQueryTotalSupply() { + cmd := cli.GetCmdQueryTotalSupply() + cmd.SetOutput(io.Discard) + + testCases := []struct { + name string + ctxGen func() client.Context + args []string + expectResult proto.Message + expectErr bool + }{ + { + "valid query", + func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&types.QueryTotalSupplyResponse{}) + c := newMockTendermintRPC(abci.ResponseQuery{ + Value: bz, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + fmt.Sprintf("--%s=json", flags.FlagOutput), + }, + &types.QueryTotalSupplyResponse{}, + false, + }, + { + "valid query with denom", + func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&types.QuerySupplyOfResponse{ + Amount: sdk.Coin{}, + }) + c := newMockTendermintRPC(abci.ResponseQuery{ + Value: bz, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + fmt.Sprintf("--%s=photon", cli.FlagDenom), + fmt.Sprintf("--%s=json", flags.FlagOutput), + }, + &sdk.Coin{}, + false, + }, + { + "invalid query with denom", + func() client.Context { + c := newMockTendermintRPC(abci.ResponseQuery{ + Code: 1, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + fmt.Sprintf("--%s=foo", cli.FlagDenom), + fmt.Sprintf("--%s=json", flags.FlagOutput), + }, + nil, + true, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + var outBuf bytes.Buffer + + clientCtx := tc.ctxGen().WithOutput(&outBuf) + ctx := svrcmd.CreateExecuteContext(context.Background()) + + cmd.SetContext(ctx) + cmd.SetArgs(tc.args) + + s.Require().NoError(client.SetCmdClientContextHandler(clientCtx, cmd)) + + err := cmd.Execute() + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(outBuf.Bytes(), tc.expectResult)) + s.Require().NoError(err) + } + }) + } +} + +func (s *CLITestSuite) TestGetCmdQuerySendEnabled() { + cmd := cli.GetCmdQuerySendEnabled() + cmd.SetOutput(io.Discard) + + testCases := []struct { + name string + ctxGen func() client.Context + args []string + expectResult proto.Message + expectErr bool + }{ + { + "valid query", + func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&types.QuerySendEnabledResponse{ + SendEnabled: []*types.SendEnabled{}, + }) + c := newMockTendermintRPC(abci.ResponseQuery{ + Value: bz, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + fmt.Sprintf("--%s=json", flags.FlagOutput), + }, + &types.QuerySendEnabledResponse{}, + false, + }, + { + "valid query with denoms", + func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&types.QuerySendEnabledResponse{ + SendEnabled: []*types.SendEnabled{}, + }) + c := newMockTendermintRPC(abci.ResponseQuery{ + Value: bz, + }) + return s.baseCtx.WithClient(c) + }, + []string{ + "photon", + "stake", + fmt.Sprintf("--%s=json", flags.FlagOutput), + }, + &types.QuerySendEnabledResponse{}, + false, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + var outBuf bytes.Buffer + + clientCtx := tc.ctxGen().WithOutput(&outBuf) + ctx := svrcmd.CreateExecuteContext(context.Background()) + + cmd.SetContext(ctx) + cmd.SetArgs(tc.args) + + s.Require().NoError(client.SetCmdClientContextHandler(clientCtx, cmd)) + + err := cmd.Execute() + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(outBuf.Bytes(), tc.expectResult)) + s.Require().NoError(err) + } + }) + } +} diff --git a/x/consensus_param/client/cli/suite_test.go b/x/consensus_param/client/cli/suite_test.go new file mode 100644 index 000000000000..82fcd699befc --- /dev/null +++ b/x/consensus_param/client/cli/suite_test.go @@ -0,0 +1,96 @@ +package cli_test + +import ( + "context" + "fmt" + "io" + "testing" + + "github.com/stretchr/testify/suite" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/bytes" + rpcclient "github.com/tendermint/tendermint/rpc/client" + rpcclientmock "github.com/tendermint/tendermint/rpc/client/mock" + "github.com/tendermint/tendermint/rpc/coretypes" + tmtypes "github.com/tendermint/tendermint/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdk "github.com/cosmos/cosmos-sdk/types" + testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/bank" +) + +var _ client.TendermintRPC = (*mockTendermintRPC)(nil) + +type mockTendermintRPC struct { + rpcclientmock.Client + + responseQuery abci.ResponseQuery +} + +func newMockTendermintRPC(respQuery abci.ResponseQuery) mockTendermintRPC { + return mockTendermintRPC{responseQuery: respQuery} +} + +func (_ mockTendermintRPC) BroadcastTxSync(context.Context, tmtypes.Tx) (*coretypes.ResultBroadcastTx, error) { + return &coretypes.ResultBroadcastTx{Code: 0}, nil +} + +func (m mockTendermintRPC) ABCIQueryWithOptions( + _ context.Context, + _ string, _ bytes.HexBytes, + _ rpcclient.ABCIQueryOptions, +) (*coretypes.ResultABCIQuery, error) { + return &coretypes.ResultABCIQuery{Response: m.responseQuery}, nil +} + +type account struct { + name string + address sdk.AccAddress +} + +type CLITestSuite struct { + suite.Suite + + kr keyring.Keyring + encCfg testutilmod.TestEncodingConfig + baseCtx client.Context +} + +func TestMigrateTestSuite(t *testing.T) { + suite.Run(t, new(CLITestSuite)) +} + +func (s *CLITestSuite) SetupSuite() { + s.encCfg = testutilmod.MakeTestEncodingConfig(bank.AppModuleBasic{}) + s.kr = keyring.NewInMemory(s.encCfg.Codec) + s.baseCtx = client.Context{}. + WithKeyring(s.kr). + WithTxConfig(s.encCfg.TxConfig). + WithCodec(s.encCfg.Codec). + WithClient(mockTendermintRPC{Client: rpcclientmock.New()}). + WithAccountRetriever(client.MockAccountRetriever{}). + WithOutput(io.Discard) +} + +func (s *CLITestSuite) createKeyringAccounts(num int) []account { + accounts := make([]account, num) + for i := range accounts { + record, _, err := s.kr.NewMnemonic( + fmt.Sprintf("key-%d", i), + keyring.English, + sdk.FullFundraiserPath, + keyring.DefaultBIP39Passphrase, + hd.Secp256k1) + s.Require().NoError(err) + + addr, err := record.GetAddress() + s.Require().NoError(err) + + accounts[i] = account{name: record.Name, address: addr} + } + + return accounts +} diff --git a/x/consensus_param/client/cli/tx.go b/x/consensus_param/client/cli/tx.go new file mode 100644 index 000000000000..b0bac9b8282d --- /dev/null +++ b/x/consensus_param/client/cli/tx.go @@ -0,0 +1,144 @@ +package cli + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +var FlagSplit = "split" + +// NewTxCmd returns a root CLI command handler for all x/bank transaction commands. +func NewTxCmd() *cobra.Command { + txCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Bank transaction subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + txCmd.AddCommand( + NewSendTxCmd(), + NewMultiSendTxCmd(), + ) + + return txCmd +} + +// NewSendTxCmd returns a CLI command handler for creating a MsgSend transaction. +func NewSendTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "send [from_key_or_address] [to_address] [amount]", + Short: "Send funds from one account to another.", + Long: `Send funds from one account to another. +Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. +When using '--dry-run' a key name cannot be used, only a bech32 address. +`, + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + cmd.Flags().Set(flags.FlagFrom, args[0]) + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + toAddr, err := sdk.AccAddressFromBech32(args[1]) + if err != nil { + return err + } + + coins, err := sdk.ParseCoinsNormalized(args[2]) + if err != nil { + return err + } + + msg := types.NewMsgSend(clientCtx.GetFromAddress(), toAddr, coins) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewMultiSendTxCmd returns a CLI command handler for creating a MsgMultiSend transaction. +// For a better UX this command is limited to send funds from one account to two or more accounts. +func NewMultiSendTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "multi-send [from_key_or_address] [to_address_1, to_address_2, ...] [amount]", + Short: "Send funds from one account to two or more accounts.", + Long: `Send funds from one account to two or more accounts. +By default, sends the [amount] to each address of the list. +Using the '--split' flag, the [amount] is split equally between the addresses. +Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. +When using '--dry-run' a key name cannot be used, only a bech32 address. +`, + Args: cobra.MinimumNArgs(4), + RunE: func(cmd *cobra.Command, args []string) error { + cmd.Flags().Set(flags.FlagFrom, args[0]) + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + coins, err := sdk.ParseCoinsNormalized(args[len(args)-1]) + if err != nil { + return err + } + + if coins.IsZero() { + return fmt.Errorf("must send positive amount") + } + + split, err := cmd.Flags().GetBool(FlagSplit) + if err != nil { + return err + } + + totalAddrs := sdk.NewInt(int64(len(args) - 2)) + // coins to be received by the addresses + sendCoins := coins + if split { + sendCoins = coins.QuoInt(totalAddrs) + } + + var output []types.Output + for _, arg := range args[1 : len(args)-1] { + toAddr, err := sdk.AccAddressFromBech32(arg) + if err != nil { + return err + } + + output = append(output, types.NewOutput(toAddr, sendCoins)) + } + + // amount to be send from the from address + var amount sdk.Coins + if split { + // user input: 1000stake to send to 3 addresses + // actual: 333stake to each address (=> 999stake actually sent) + amount = sendCoins.MulInt(totalAddrs) + } else { + amount = coins.MulInt(totalAddrs) + } + + msg := types.NewMsgMultiSend([]types.Input{types.NewInput(clientCtx.FromAddress, amount)}, output) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().Bool(FlagSplit, false, "Send the equally split token amount to each address") + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/consensus_param/client/cli/tx_test.go b/x/consensus_param/client/cli/tx_test.go new file mode 100644 index 000000000000..ba0904f14f8e --- /dev/null +++ b/x/consensus_param/client/cli/tx_test.go @@ -0,0 +1,211 @@ +package cli_test + +import ( + "context" + "fmt" + "io" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/client/cli" +) + +func (s *CLITestSuite) TestSendTxCmd() { + accounts := s.createKeyringAccounts(1) + cmd := cli.NewSendTxCmd() + cmd.SetOutput(io.Discard) + + extraArgs := []string{ + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("photon", sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=test-chain", flags.FlagChainID), + } + + testCases := []struct { + name string + ctxGen func() client.Context + from, to sdk.AccAddress + amount sdk.Coins + extraArgs []string + expectErr bool + }{ + { + "valid transaction", + func() client.Context { + return s.baseCtx + }, + accounts[0].address, + accounts[0].address, + sdk.NewCoins( + sdk.NewCoin("stake", sdk.NewInt(10)), + sdk.NewCoin("photon", sdk.NewInt(40)), + ), + extraArgs, + false, + }, + { + "invalid to address", + func() client.Context { + return s.baseCtx + }, + accounts[0].address, + sdk.AccAddress{}, + sdk.NewCoins( + sdk.NewCoin("stake", sdk.NewInt(10)), + sdk.NewCoin("photon", sdk.NewInt(40)), + ), + extraArgs, + true, + }, + { + "invalid coins", + func() client.Context { + return s.baseCtx + }, + accounts[0].address, + accounts[0].address, + nil, + extraArgs, + true, + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.name, func() { + ctx := svrcmd.CreateExecuteContext(context.Background()) + + cmd.SetContext(ctx) + cmd.SetArgs(append([]string{tc.from.String(), tc.to.String(), tc.amount.String()}, tc.extraArgs...)) + + s.Require().NoError(client.SetCmdClientContextHandler(tc.ctxGen(), cmd)) + + err := cmd.Execute() + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + } + }) + } +} + +func (s *CLITestSuite) TestMultiSendTxCmd() { + accounts := s.createKeyringAccounts(3) + + cmd := cli.NewMultiSendTxCmd() + cmd.SetOutput(io.Discard) + + extraArgs := []string{ + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("photon", sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=test-chain", flags.FlagChainID), + } + + testCases := []struct { + name string + ctxGen func() client.Context + from string + to []string + amount sdk.Coins + extraArgs []string + expectErr bool + }{ + { + "valid transaction", + func() client.Context { + return s.baseCtx + }, + accounts[0].address.String(), + []string{ + accounts[1].address.String(), + accounts[2].address.String(), + }, + sdk.NewCoins( + sdk.NewCoin("stake", sdk.NewInt(10)), + sdk.NewCoin("photon", sdk.NewInt(40)), + ), + extraArgs, + false, + }, + { + "invalid from address", + func() client.Context { + return s.baseCtx + }, + "foo", + []string{ + accounts[1].address.String(), + accounts[2].address.String(), + }, + sdk.NewCoins( + sdk.NewCoin("stake", sdk.NewInt(10)), + sdk.NewCoin("photon", sdk.NewInt(40)), + ), + extraArgs, + true, + }, + { + "invalid recipients", + func() client.Context { + return s.baseCtx + }, + accounts[0].address.String(), + []string{ + accounts[1].address.String(), + "bar", + }, + sdk.NewCoins( + sdk.NewCoin("stake", sdk.NewInt(10)), + sdk.NewCoin("photon", sdk.NewInt(40)), + ), + extraArgs, + true, + }, + { + "invalid amount", + func() client.Context { + return s.baseCtx + }, + accounts[0].address.String(), + []string{ + accounts[1].address.String(), + accounts[2].address.String(), + }, + nil, + extraArgs, + true, + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.name, func() { + ctx := svrcmd.CreateExecuteContext(context.Background()) + + var args []string + args = append(args, tc.from) + args = append(args, tc.to...) + args = append(args, tc.amount.String()) + args = append(args, tc.extraArgs...) + + cmd.SetContext(ctx) + cmd.SetArgs(args) + + s.Require().NoError(client.SetCmdClientContextHandler(tc.ctxGen(), cmd)) + + err := cmd.Execute() + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + } + }) + } +} diff --git a/x/consensus_param/exported/exported.go b/x/consensus_param/exported/exported.go new file mode 100644 index 000000000000..258c111686a6 --- /dev/null +++ b/x/consensus_param/exported/exported.go @@ -0,0 +1,13 @@ +package exported + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +) + +// ProtocolVersionSetter defines the interface fulfilled by BaseApp +// which allows setting it's appVersion field. +type ConsensusParamSetter interface { + StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusParams) + GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams +} diff --git a/x/consensus_param/keeper/keeper.go b/x/consensus_param/keeper/keeper.go new file mode 100644 index 000000000000..85171643ab64 --- /dev/null +++ b/x/consensus_param/keeper/keeper.go @@ -0,0 +1,64 @@ +package keeper + +import ( + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "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/consensus_param/exported" + "github.com/cosmos/cosmos-sdk/x/consensus_param/types" +) + +type Keeper struct { + storeKey storetypes.StoreKey + cdc codec.BinaryCodec + paramSetter exported.ConsensusParamSetter + authority string +} + +func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSetter exported.ConsensusParamSetter, authority string) Keeper { + return Keeper{ + storeKey: storeKey, + cdc: cdc, + paramSetter: paramSetter, + authority: authority, + } +} + +func (k *Keeper) SetParamSetter(paramSetter exported.ConsensusParamSetter) { + k.paramSetter = paramSetter +} + +func (k *Keeper) GetParamSetter() exported.ConsensusParamSetter { + return k.paramSetter +} + +func (k *Keeper) GetAuthority() string { + return k.authority +} + +func (k *Keeper) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { + store := ctx.KVStore(k.storeKey) + + cp := &tmproto.ConsensusParams{} + bz := store.Get(types.ParamStoreKeyConsensusParams) + + if err := k.cdc.Unmarshal(bz, cp); err != nil { + return nil, err + } + + return cp, nil +} + +func (k *Keeper) Has(ctx sdk.Context) bool { + store := ctx.KVStore(k.storeKey) + + return store.Has(types.ParamStoreKeyConsensusParams) +} + +func (k *Keeper) Set(ctx sdk.Context, cp *tmproto.ConsensusParams) { + store := ctx.KVStore(k.storeKey) + + store.Set(types.ParamStoreKeyConsensusParams, k.cdc.MustMarshal(cp)) +} diff --git a/x/consensus_param/keeper/msg_server.go b/x/consensus_param/keeper/msg_server.go new file mode 100644 index 000000000000..2b79ba225222 --- /dev/null +++ b/x/consensus_param/keeper/msg_server.go @@ -0,0 +1,41 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +type msgServer struct { + Keeper +} + +var _ types.MsgServer = msgServer{} + +// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if k.GetAuthority() != req.Authority { + return nil, sdkerrors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + k.Set(ctx, &req.Params) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, req.Authority), + ), + ) + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/consensus_param/module.go b/x/consensus_param/module.go new file mode 100644 index 000000000000..0ca4e015ebb7 --- /dev/null +++ b/x/consensus_param/module.go @@ -0,0 +1,273 @@ +package bank + +import ( + "context" + "encoding/json" + "fmt" + "math/rand" + "time" + + modulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + "cosmossdk.io/depinject" + store "github.com/cosmos/cosmos-sdk/store/types" + "github.com/tendermint/tendermint/crypto" + + "cosmossdk.io/core/appmodule" + gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/telemetry" + 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" + "github.com/cosmos/cosmos-sdk/x/bank/client/cli" + "github.com/cosmos/cosmos-sdk/x/bank/exported" + "github.com/cosmos/cosmos-sdk/x/bank/keeper" + v1bank "github.com/cosmos/cosmos-sdk/x/bank/migrations/v1" + "github.com/cosmos/cosmos-sdk/x/bank/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +// ConsensusVersion defines the current x/bank module consensus version. +const ConsensusVersion = 4 + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleSimulation = AppModule{} +) + +// AppModuleBasic defines the basic application module used by the bank module. +type AppModuleBasic struct { + cdc codec.Codec +} + +// Name returns the bank module's name. +func (AppModuleBasic) Name() string { return types.ModuleName } + +// RegisterLegacyAminoCodec registers the bank module's types on the LegacyAmino codec. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} + +// DefaultGenesis returns default genesis state as raw bytes for the bank +// module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the bank module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var data types.GenesisState + if err := cdc.UnmarshalJSON(bz, &data); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return data.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the bank module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// GetTxCmd returns the root tx command for the bank module. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.NewTxCmd() +} + +// GetQueryCmd returns no root query command for the bank module. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +// RegisterInterfaces registers interfaces and implementations of the bank module. +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) + + // Register legacy interfaces for migration scripts. + v1bank.RegisterInterfaces(registry) +} + +// AppModule implements an application module for the bank module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + + // legacySubspace is used solely for migration of x/params managed parameters + legacySubspace exported.Subspace +} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + + m := keeper.NewMigrator(am.keeper.(keeper.BaseKeeper), am.legacySubspace) + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate x/bank from version 1 to 2: %v", err)) + } + + if err := cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3); err != nil { + panic(fmt.Sprintf("failed to migrate x/bank from version 2 to 3: %v", err)) + } + + if err := cfg.RegisterMigration(types.ModuleName, 3, m.Migrate3to4); err != nil { + panic(fmt.Sprintf("failed to migrate x/bank from version 3 to 4: %v", err)) + } +} + +// NewAppModule creates a new AppModule object +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, accountKeeper types.AccountKeeper, ss exported.Subspace) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{cdc: cdc}, + keeper: keeper, + accountKeeper: accountKeeper, + legacySubspace: ss, + } +} + +// Name returns the bank module's name. +func (AppModule) Name() string { return types.ModuleName } + +// RegisterInvariants registers the bank module invariants. +func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { + keeper.RegisterInvariants(ir, am.keeper) +} + +// QuerierRoute returns the bank module's querier route name. +func (AppModule) QuerierRoute() string { return types.RouterKey } + +// InitGenesis performs genesis initialization for the bank module. It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { + start := time.Now() + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") + + am.keeper.InitGenesis(ctx, &genesisState) + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the exported genesis state as raw bytes for the bank +// module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := am.keeper.ExportGenesis(ctx) + return cdc.MustMarshalJSON(gs) +} + +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the bank module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// ProposalContents doesn't return any content functions for governance proposals. +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized distribution param changes for the simulator. + +// 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 supply module's types +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + return simulation.WeightedOperations( + simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper, + ) +} + +// New App Wiring Setup + +func init() { + appmodule.Register(&modulev1.Module{}, + appmodule.Provide( + provideModuleBasic, + provideModule)) +} + +func provideModuleBasic() runtime.AppModuleBasicWrapper { + return runtime.WrapAppModuleBasic(AppModuleBasic{}) +} + +type bankInputs struct { + depinject.In + + ModuleKey depinject.OwnModuleKey + Config *modulev1.Module + Cdc codec.Codec + Key *store.KVStoreKey + + AccountKeeper types.AccountKeeper + Authority map[string]sdk.AccAddress `optional:"true"` + + // LegacySubspace is used solely for migration of x/params managed parameters + LegacySubspace exported.Subspace +} + +type bankOutputs struct { + depinject.Out + + BankKeeper keeper.BaseKeeper + Module runtime.AppModuleWrapper +} + +func provideModule(in bankInputs) bankOutputs { + // configure blocked module accounts. + // + // default behavior for blockedAddresses is to regard any module mentioned in AccountKeeper's module account + // permissions as blocked. + blockedAddresses := make(map[string]bool) + if len(in.Config.BlockedModuleAccountsOverride) != 0 { + for _, moduleName := range in.Config.BlockedModuleAccountsOverride { + addr := sdk.AccAddress(crypto.AddressHash([]byte(moduleName))) + blockedAddresses[addr.String()] = true + } + } else { + for _, permission := range in.AccountKeeper.GetModulePermissions() { + blockedAddresses[permission.GetAddress().String()] = true + } + } + + authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] + if !ok { + // default to governance authority if not provided + authority = authtypes.NewModuleAddress(govtypes.ModuleName) + } + + bankKeeper := keeper.NewBaseKeeper( + in.Cdc, + in.Key, + in.AccountKeeper, + blockedAddresses, + authority.String(), + ) + m := NewAppModule(in.Cdc, bankKeeper, in.AccountKeeper, in.LegacySubspace) + + return bankOutputs{BankKeeper: bankKeeper, Module: runtime.WrapAppModule(m)} +} diff --git a/x/consensus_param/simulation/genesis.go b/x/consensus_param/simulation/genesis.go new file mode 100644 index 000000000000..8592b08a318d --- /dev/null +++ b/x/consensus_param/simulation/genesis.go @@ -0,0 +1,99 @@ +package simulation + +// DONTCOVER + +import ( + "encoding/json" + "fmt" + "math/rand" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// RandomGenesisDefaultSendEnabledParam computes randomized allow all send transfers param for the bank module +func RandomGenesisDefaultSendEnabledParam(r *rand.Rand) bool { + // 90% chance of transfers being enabled or P(a) = 0.9 for success + return r.Int63n(100) < 90 +} + +// RandomGenesisSendEnabled creates randomized values for the SendEnabled slice. +func RandomGenesisSendEnabled(r *rand.Rand) []types.SendEnabled { + rv := make([]types.SendEnabled, 0, 2) + // 60% of the time, add a denom specific record. + if r.Int63n(100) < 60 { + // 75% of the those times, set send enabled to true. + bondEnabled := r.Int63n(100) < 75 + rv = append(rv, types.SendEnabled{Denom: sdk.DefaultBondDenom, Enabled: bondEnabled}) + } + // Probabilities: + // P(a) = 60.0% = There's SendEnable entry for the bond denom = .600 + // P(a)' = 40.0% = There is NOT a SendEnable entry for the bond denom = 1 - P(a) = 1 - .600 = .400 + // P(b) = 75.0% = The SendEnable entry is true (if there is such an entry) = .750 + // P(b)' = 25.0% = The SendEnable entry is false (if there is such an entry) = 1 - P(b) = 1 - .750 = .250 + // P(c) = 90.0% = The default send enabled is true (defined in RandomGenesisDefaultSendEnabledParam) = .900 + // P(c)' = 10.0% = The default send enabled is false = 1 - P(c) = 1 - .900 = .100 + // + // P(st) = 45.0% = There's a SendEnable entry that's true = P(a)*P(b) = .600*.750 = .450 + // P(sf) = 15.0% = There's a SendEnable entry that's false = P(a)*P(b)' = .600*.250 = .150 + // + // P(a'c) = 36.0% = No SendEnabled entry AND default is true = P(a)'*P(c) = .400*.900 = .360 + // P(a'c') = 4.0% = No SendEnabled entry AND default is false = P(a)'*P(c)' = .400*.100 = .040 + // P(stc) = 40.5% = SendEnabled entry is true AND default is true = P(st)*P(c) = .450*.900 = .405 + // P(stc') = 4.5% = SendEnabled entry is true AND default is false = P(st)*P(c)' = .450*.100 = .045 + // P(sfc) = 13.5% = SendEnabled entry is false AND default is true = P(sf)*P(c) = .150*.900 = .135 + // P(sfc') = 1.5% = SendEnabled entry is false AND default is false = P(sf)*P(c)' = .150*.100 = .015 + // + // P(set) = 42.0% = SendEnabled entry that equals the default = P(stc) + P(sfc') = .405 + .015 = .420 + // P(sef) = 18.0% = SendEnabled entry that does not equal the default = P(stc') + P(sfc) = .045 + .135 = .180 + // + // P(t) = 81.0% = Bond denom is sendable = P(a'c) + P(st) = .360 + .450 = .810 + // P(f) = 19.0% = Bond demon is NOT sendable = P(a'c') + P(sf) = .040 + .150 = .190 + + return rv +} + +// RandomGenesisBalances returns a slice of account balances. Each account has +// a balance of simState.InitialStake for sdk.DefaultBondDenom. +func RandomGenesisBalances(simState *module.SimulationState) []types.Balance { + genesisBalances := []types.Balance{} + + for _, acc := range simState.Accounts { + genesisBalances = append(genesisBalances, types.Balance{ + Address: acc.Address.String(), + Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, simState.InitialStake)), + }) + } + + return genesisBalances +} + +// RandomizedGenState generates a random GenesisState for bank +func RandomizedGenState(simState *module.SimulationState) { + var defaultSendEnabledParam bool + simState.AppParams.GetOrGenerate( + simState.Cdc, string(types.KeyDefaultSendEnabled), &defaultSendEnabledParam, simState.Rand, + func(r *rand.Rand) { defaultSendEnabledParam = RandomGenesisDefaultSendEnabledParam(r) }, + ) + + sendEnabled := RandomGenesisSendEnabled(simState.Rand) + + numAccs := int64(len(simState.Accounts)) + totalSupply := simState.InitialStake.Mul(sdk.NewInt((numAccs + simState.NumBonded))) + supply := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, totalSupply)) + + bankGenesis := types.GenesisState{ + Params: types.NewParams(defaultSendEnabledParam), + Balances: RandomGenesisBalances(simState), + Supply: supply, + SendEnabled: sendEnabled, + } + + paramsBytes, err := json.MarshalIndent(&bankGenesis.Params, "", " ") + if err != nil { + panic(err) + } + fmt.Printf("Selected randomly generated bank parameters:\n%s\n", paramsBytes) + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&bankGenesis) +} diff --git a/x/consensus_param/simulation/genesis_test.go b/x/consensus_param/simulation/genesis_test.go new file mode 100644 index 000000000000..7782b6cd794f --- /dev/null +++ b/x/consensus_param/simulation/genesis_test.go @@ -0,0 +1,81 @@ +package simulation_test + +import ( + "encoding/json" + "math/rand" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. +// Abonormal scenarios are not tested here. +func TestRandomizedGenState(t *testing.T) { + interfaceRegistry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(interfaceRegistry) + s := rand.NewSource(1) + r := rand.New(s) + + simState := module.SimulationState{ + AppParams: make(simtypes.AppParams), + Cdc: cdc, + Rand: r, + NumBonded: 3, + Accounts: simtypes.RandomAccounts(r, 3), + InitialStake: sdkmath.NewInt(1000), + GenState: make(map[string]json.RawMessage), + } + + simulation.RandomizedGenState(&simState) + + var bankGenesis types.GenesisState + simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &bankGenesis) + + assert.Equal(t, true, bankGenesis.Params.GetDefaultSendEnabled(), "Params.GetDefaultSendEnabled") + assert.Len(t, bankGenesis.Params.GetSendEnabled(), 0, "Params.GetSendEnabled") + if assert.Len(t, bankGenesis.Balances, 3) { + assert.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", bankGenesis.Balances[2].GetAddress().String(), "Balances[2] address") + assert.Equal(t, "1000stake", bankGenesis.Balances[2].GetCoins().String(), "Balances[2] coins") + } + assert.Equal(t, "6000stake", bankGenesis.Supply.String(), "Supply") + if assert.Len(t, bankGenesis.SendEnabled, 1, "SendEnabled") { + assert.Equal(t, true, bankGenesis.SendEnabled[0].Enabled, "SendEnabled[0] value") + } +} + +// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. +func TestRandomizedGenState1(t *testing.T) { + interfaceRegistry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(interfaceRegistry) + + s := rand.NewSource(1) + r := rand.New(s) + + // all these tests will panic + tests := []struct { + simState module.SimulationState + panicMsg string + }{ + { // panic => reason: incomplete initialization of the simState + module.SimulationState{}, "invalid memory address or nil pointer dereference"}, + { // panic => reason: incomplete initialization of the simState + module.SimulationState{ + AppParams: make(simtypes.AppParams), + Cdc: cdc, + Rand: r, + }, "assignment to entry in nil map"}, + } + + for _, tt := range tests { + require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) + } +} diff --git a/x/consensus_param/simulation/operations.go b/x/consensus_param/simulation/operations.go new file mode 100644 index 000000000000..86ef2d496a46 --- /dev/null +++ b/x/consensus_param/simulation/operations.go @@ -0,0 +1,414 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/keeper" + "github.com/cosmos/cosmos-sdk/x/bank/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +// Simulation operation weights constants +//nolint:gosec // these are not hardcoded credentials. +const ( + OpWeightMsgSend = "op_weight_msg_send" + OpWeightMsgMultiSend = "op_weight_msg_multisend" +) + +// WeightedOperations returns all the operations from the module with their respective weights +func WeightedOperations( + appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, bk keeper.Keeper, +) simulation.WeightedOperations { + var weightMsgSend, weightMsgMultiSend int + appParams.GetOrGenerate(cdc, OpWeightMsgSend, &weightMsgSend, nil, + func(_ *rand.Rand) { + weightMsgSend = simappparams.DefaultWeightMsgSend + }, + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgMultiSend, &weightMsgMultiSend, nil, + func(_ *rand.Rand) { + weightMsgMultiSend = simappparams.DefaultWeightMsgMultiSend + }, + ) + + return simulation.WeightedOperations{ + simulation.NewWeightedOperation( + weightMsgSend, + SimulateMsgSend(ak, bk), + ), + simulation.NewWeightedOperation( + weightMsgMultiSend, + SimulateMsgMultiSend(ak, bk), + ), + } +} + +// SimulateMsgSend tests and runs a single msg send where both +// accounts already exist. +func SimulateMsgSend(ak types.AccountKeeper, bk keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, + accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + from, to, coins, skip := randomSendFields(r, ctx, accs, bk, ak) + + // if coins slice is empty, we can not create valid types.MsgSend + if len(coins) == 0 { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, "empty coins slice"), nil, nil + } + + // Check send_enabled status of each coin denom + if err := bk.IsSendEnabledCoins(ctx, coins...); err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, err.Error()), nil, nil + } + + if skip { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, "skip all transfers"), nil, nil + } + + msg := types.NewMsgSend(from.Address, to.Address, coins) + + err := sendMsgSend(r, app, bk, ak, msg, ctx, chainID, []cryptotypes.PrivKey{from.PrivKey}) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "invalid transfers"), nil, err + } + + return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + } +} + +// SimulateMsgSendToModuleAccount tests and runs a single msg send where both +// accounts already exist. +func SimulateMsgSendToModuleAccount(ak types.AccountKeeper, bk keeper.Keeper, moduleAccCount int) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, + accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + from := accs[0] + + to := getModuleAccounts(ak, ctx, moduleAccCount)[0] + + spendable := bk.SpendableCoins(ctx, from.Address) + coins := simtypes.RandSubsetCoins(r, spendable) + // if coins slice is empty, we can not create valid types.MsgSend + if len(coins) == 0 { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, "empty coins slice"), nil, nil + } + + // Check send_enabled status of each coin denom + if err := bk.IsSendEnabledCoins(ctx, coins...); err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, err.Error()), nil, nil + } + + msg := types.NewMsgSend(from.Address, to.Address, coins) + + err := sendMsgSend(r, app, bk, ak, msg, ctx, chainID, []cryptotypes.PrivKey{from.PrivKey}) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "invalid transfers"), nil, err + } + + return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + } +} + +// sendMsgSend sends a transaction with a MsgSend from a provided random account. +func sendMsgSend( + r *rand.Rand, app *baseapp.BaseApp, bk keeper.Keeper, ak types.AccountKeeper, + msg *types.MsgSend, ctx sdk.Context, chainID string, privkeys []cryptotypes.PrivKey, +) error { + var ( + fees sdk.Coins + err error + ) + + from, err := sdk.AccAddressFromBech32(msg.FromAddress) + if err != nil { + return err + } + + account := ak.GetAccount(ctx, from) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + coins, hasNeg := spendable.SafeSub(msg.Amount...) + if !hasNeg { + fees, err = simtypes.RandomFees(r, ctx, coins) + if err != nil { + return err + } + } + txGen := simappparams.MakeTestEncodingConfig().TxConfig + tx, err := simtestutil.GenSignedMockTx( + r, + txGen, + []sdk.Msg{msg}, + fees, + simtestutil.DefaultGenTxGas, + chainID, + []uint64{account.GetAccountNumber()}, + []uint64{account.GetSequence()}, + privkeys..., + ) + if err != nil { + return err + } + + _, _, err = app.SimDeliver(txGen.TxEncoder(), tx) + if err != nil { + return err + } + + return nil +} + +// SimulateMsgMultiSend tests and runs a single msg multisend, with randomized, capped number of inputs/outputs. +// all accounts in msg fields exist in state +func SimulateMsgMultiSend(ak types.AccountKeeper, bk keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, + accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + // random number of inputs/outputs between [1, 3] + inputs := make([]types.Input, r.Intn(1)+1) //nolint:staticcheck // SA4030: (*math/rand.Rand).Intn(n) generates a random value 0 <= x < n; that is, the generated values don't include n; r.Intn(1) therefore always returns 0 + outputs := make([]types.Output, r.Intn(3)+1) + + // collect signer privKeys + privs := make([]cryptotypes.PrivKey, len(inputs)) + + // use map to check if address already exists as input + usedAddrs := make(map[string]bool) + + var totalSentCoins sdk.Coins + for i := range inputs { + // generate random input fields, ignore to address + from, _, coins, skip := randomSendFields(r, ctx, accs, bk, ak) + + // make sure account is fresh and not used in previous input + for usedAddrs[from.Address.String()] { + from, _, coins, skip = randomSendFields(r, ctx, accs, bk, ak) + } + + if skip { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgMultiSend, "skip all transfers"), nil, nil + } + + // set input address in used address map + usedAddrs[from.Address.String()] = true + + // set signer privkey + privs[i] = from.PrivKey + + // set next input and accumulate total sent coins + inputs[i] = types.NewInput(from.Address, coins) + totalSentCoins = totalSentCoins.Add(coins...) + } + + // Check send_enabled status of each sent coin denom + if err := bk.IsSendEnabledCoins(ctx, totalSentCoins...); err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgMultiSend, err.Error()), nil, nil + } + + for o := range outputs { + outAddr, _ := simtypes.RandomAcc(r, accs) + + var outCoins sdk.Coins + // split total sent coins into random subsets for output + if o == len(outputs)-1 { + outCoins = totalSentCoins + } else { + // take random subset of remaining coins for output + // and update remaining coins + outCoins = simtypes.RandSubsetCoins(r, totalSentCoins) + totalSentCoins = totalSentCoins.Sub(outCoins...) + } + + outputs[o] = types.NewOutput(outAddr.Address, outCoins) + } + + // remove any output that has no coins + + for i := 0; i < len(outputs); { + if outputs[i].Coins.Empty() { + outputs[i] = outputs[len(outputs)-1] + outputs = outputs[:len(outputs)-1] + } else { + // continue onto next coin + i++ + } + } + + msg := &types.MsgMultiSend{ + Inputs: inputs, + Outputs: outputs, + } + err := sendMsgMultiSend(r, app, bk, ak, msg, ctx, chainID, privs) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "invalid transfers"), nil, err + } + + return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + } +} + +// SimulateMsgMultiSendToModuleAccount sends coins to Module Accounts +func SimulateMsgMultiSendToModuleAccount(ak types.AccountKeeper, bk keeper.Keeper, moduleAccCount int) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, + accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + inputs := make([]types.Input, 2) + outputs := make([]types.Output, moduleAccCount) + // collect signer privKeys + privs := make([]cryptotypes.PrivKey, len(inputs)) + var totalSentCoins sdk.Coins + for i := range inputs { + sender := accs[i] + privs[i] = sender.PrivKey + spendable := bk.SpendableCoins(ctx, sender.Address) + coins := simtypes.RandSubsetCoins(r, spendable) + inputs[i] = types.NewInput(sender.Address, coins) + totalSentCoins = totalSentCoins.Add(coins...) + } + if err := bk.IsSendEnabledCoins(ctx, totalSentCoins...); err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgMultiSend, err.Error()), nil, nil + } + moduleAccounts := getModuleAccounts(ak, ctx, moduleAccCount) + for i := range outputs { + var outCoins sdk.Coins + // split total sent coins into random subsets for output + if i == len(outputs)-1 { + outCoins = totalSentCoins + } else { + // take random subset of remaining coins for output + // and update remaining coins + outCoins = simtypes.RandSubsetCoins(r, totalSentCoins) + totalSentCoins = totalSentCoins.Sub(outCoins...) + } + outputs[i] = types.NewOutput(moduleAccounts[i].Address, outCoins) + } + // remove any output that has no coins + for i := 0; i < len(outputs); { + if outputs[i].Coins.Empty() { + outputs[i] = outputs[len(outputs)-1] + outputs = outputs[:len(outputs)-1] + } else { + // continue onto next coin + i++ + } + } + msg := &types.MsgMultiSend{ + Inputs: inputs, + Outputs: outputs, + } + err := sendMsgMultiSend(r, app, bk, ak, msg, ctx, chainID, privs) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "invalid transfers"), nil, err + } + return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + } +} + +// sendMsgMultiSend sends a transaction with a MsgMultiSend from a provided random +// account. +func sendMsgMultiSend( + r *rand.Rand, app *baseapp.BaseApp, bk keeper.Keeper, ak types.AccountKeeper, + msg *types.MsgMultiSend, ctx sdk.Context, chainID string, privkeys []cryptotypes.PrivKey, +) error { + accountNumbers := make([]uint64, len(msg.Inputs)) + sequenceNumbers := make([]uint64, len(msg.Inputs)) + for i := 0; i < len(msg.Inputs); i++ { + addr := sdk.MustAccAddressFromBech32(msg.Inputs[i].Address) + acc := ak.GetAccount(ctx, addr) + accountNumbers[i] = acc.GetAccountNumber() + sequenceNumbers[i] = acc.GetSequence() + } + var ( + fees sdk.Coins + err error + ) + addr := sdk.MustAccAddressFromBech32(msg.Inputs[0].Address) + // feePayer is the first signer, i.e. first input address + feePayer := ak.GetAccount(ctx, addr) + spendable := bk.SpendableCoins(ctx, feePayer.GetAddress()) + coins, hasNeg := spendable.SafeSub(msg.Inputs[0].Coins...) + if !hasNeg { + fees, err = simtypes.RandomFees(r, ctx, coins) + if err != nil { + return err + } + } + txGen := simappparams.MakeTestEncodingConfig().TxConfig + tx, err := simtestutil.GenSignedMockTx( + r, + txGen, + []sdk.Msg{msg}, + fees, + simtestutil.DefaultGenTxGas, + chainID, + accountNumbers, + sequenceNumbers, + privkeys..., + ) + if err != nil { + return err + } + _, _, err = app.SimDeliver(txGen.TxEncoder(), tx) + if err != nil { + return err + } + return nil +} + +// randomSendFields returns the sender and recipient simulation accounts as well +// as the transferred amount. +func randomSendFields( + r *rand.Rand, ctx sdk.Context, accs []simtypes.Account, bk keeper.Keeper, ak types.AccountKeeper, +) (simtypes.Account, simtypes.Account, sdk.Coins, bool) { + from, _ := simtypes.RandomAcc(r, accs) + to, _ := simtypes.RandomAcc(r, accs) + + // disallow sending money to yourself + for from.PubKey.Equals(to.PubKey) { + to, _ = simtypes.RandomAcc(r, accs) + } + + acc := ak.GetAccount(ctx, from.Address) + if acc == nil { + return from, to, nil, true + } + + spendable := bk.SpendableCoins(ctx, acc.GetAddress()) + + sendCoins := simtypes.RandSubsetCoins(r, spendable) + if sendCoins.Empty() { + return from, to, nil, true + } + + return from, to, sendCoins, false +} + +func getModuleAccounts(ak types.AccountKeeper, ctx sdk.Context, moduleAccCount int) []simtypes.Account { + moduleAccounts := make([]simtypes.Account, moduleAccCount) + + for i := 0; i < moduleAccCount; i++ { + addr := ak.GetModuleAddress(distributiontypes.ModuleName) + acc := ak.GetAccount(ctx, addr) + mAcc := simtypes.Account{ + Address: acc.GetAddress(), + PrivKey: nil, + ConsKey: nil, + PubKey: acc.GetPubKey(), + } + moduleAccounts[i] = mAcc + } + + return moduleAccounts +} diff --git a/x/consensus_param/simulation/operations_test.go b/x/consensus_param/simulation/operations_test.go new file mode 100644 index 000000000000..6a0b8c34ac67 --- /dev/null +++ b/x/consensus_param/simulation/operations_test.go @@ -0,0 +1,207 @@ +package simulation_test + +import ( + "math/rand" + "testing" + + "github.com/stretchr/testify/suite" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +type SimTestSuite struct { + suite.Suite + + ctx sdk.Context + app *simapp.SimApp +} + +func (suite *SimTestSuite) SetupTest() { + checkTx := false + app := simapp.Setup(suite.T(), checkTx) + suite.app = app + suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{}) +} + +// TestWeightedOperations tests the weights of the operations. +func (suite *SimTestSuite) TestWeightedOperations() { + cdc := suite.app.AppCodec() + appParams := make(simtypes.AppParams) + + weightesOps := simulation.WeightedOperations(appParams, cdc, suite.app.AccountKeeper, suite.app.BankKeeper) + + // setup 3 accounts + s := rand.NewSource(1) + r := rand.New(s) + accs := suite.getTestingAccounts(r, 3) + + expected := []struct { + weight int + opMsgRoute string + opMsgName string + }{ + {simappparams.DefaultWeightMsgSend, types.ModuleName, types.TypeMsgSend}, + {simappparams.DefaultWeightMsgMultiSend, types.ModuleName, types.TypeMsgMultiSend}, + } + + for i, w := range weightesOps { + operationMsg, _, err := w.Op()(r, suite.app.BaseApp, suite.ctx, accs, "") + suite.Require().NoError(err) + + // the following checks are very much dependent from the ordering of the output given + // by WeightedOperations. if the ordering in WeightedOperations changes some tests + // will fail + suite.Require().Equal(expected[i].weight, w.Weight(), "weight should be the same") + suite.Require().Equal(expected[i].opMsgRoute, operationMsg.Route, "route should be the same") + suite.Require().Equal(expected[i].opMsgName, operationMsg.Name, "operation Msg name should be the same") + } +} + +// TestSimulateMsgSend tests the normal scenario of a valid message of type TypeMsgSend. +// Abonormal scenarios, where the message is created by an errors, are not tested here. +func (suite *SimTestSuite) TestSimulateMsgSend() { + // setup 3 accounts + s := rand.NewSource(1) + r := rand.New(s) + accounts := suite.getTestingAccounts(r, 3) + + // begin a new block + suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + + // execute operation + op := simulation.SimulateMsgSend(suite.app.AccountKeeper, suite.app.BankKeeper) + operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "") + suite.Require().NoError(err) + + var msg types.MsgSend + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + + suite.Require().True(operationMsg.OK) + suite.Require().Equal("65337742stake", msg.Amount.String()) + suite.Require().Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.FromAddress) + suite.Require().Equal("cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.ToAddress) + suite.Require().Equal(types.TypeMsgSend, msg.Type()) + suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Len(futureOperations, 0) +} + +// TestSimulateMsgSend tests the normal scenario of a valid message of type TypeMsgMultiSend. +// Abonormal scenarios, where the message is created by an errors, are not tested here. +func (suite *SimTestSuite) TestSimulateMsgMultiSend() { + // setup 3 accounts + s := rand.NewSource(1) + r := rand.New(s) + accounts := suite.getTestingAccounts(r, 3) + + // begin a new block + suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + + // execute operation + op := simulation.SimulateMsgMultiSend(suite.app.AccountKeeper, suite.app.BankKeeper) + operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "") + require := suite.Require() + require.NoError(err) + + var msg types.MsgMultiSend + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + + require.True(operationMsg.OK) + require.Len(msg.Inputs, 1) + require.Equal("cosmos1tnh2q55v8wyygtt9srz5safamzdengsnqeycj3", msg.Inputs[0].Address) + require.Equal("114949958stake", msg.Inputs[0].Coins.String()) + require.Len(msg.Outputs, 2) + require.Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Outputs[1].Address) + require.Equal("107287087stake", msg.Outputs[1].Coins.String()) + require.Equal(types.TypeMsgMultiSend, msg.Type()) + require.Equal(types.ModuleName, msg.Route()) + require.Len(futureOperations, 0) +} + +func (suite *SimTestSuite) TestSimulateModuleAccountMsgSend() { + const ( + accCount = 1 + moduleAccCount = 1 + ) + + s := rand.NewSource(1) + r := rand.New(s) + accounts := suite.getTestingAccounts(r, accCount) + + // begin a new block + suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + + // execute operation + op := simulation.SimulateMsgSendToModuleAccount(suite.app.AccountKeeper, suite.app.BankKeeper, moduleAccCount) + + s = rand.NewSource(1) + r = rand.New(s) + + operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "") + suite.Require().Error(err) + + var msg types.MsgSend + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + + suite.Require().False(operationMsg.OK) + suite.Require().Equal(operationMsg.Comment, "invalid transfers") + suite.Require().Equal(types.TypeMsgSend, msg.Type()) + suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Len(futureOperations, 0) +} + +func (suite *SimTestSuite) TestSimulateMsgMultiSendToModuleAccount() { + const ( + accCount = 2 + mAccCount = 2 + ) + + s := rand.NewSource(1) + r := rand.New(s) + accounts := suite.getTestingAccounts(r, accCount) + + // begin a new block + suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + + // execute operation + op := simulation.SimulateMsgMultiSendToModuleAccount(suite.app.AccountKeeper, suite.app.BankKeeper, mAccCount) + + operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "") + suite.Require().Error(err) + + var msg types.MsgMultiSend + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + + suite.Require().False(operationMsg.OK) // sending tokens to a module account should fail + suite.Require().Equal(operationMsg.Comment, "invalid transfers") + suite.Require().Equal(types.TypeMsgMultiSend, msg.Type()) + suite.Require().Equal(types.ModuleName, msg.Route()) + suite.Require().Len(futureOperations, 0) +} + +func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Account { + accounts := simtypes.RandomAccounts(r, n) + + initAmt := suite.app.StakingKeeper.TokensFromConsensusPower(suite.ctx, 200) + initCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initAmt)) + + // add coins to the accounts + for _, account := range accounts { + acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, account.Address) + suite.app.AccountKeeper.SetAccount(suite.ctx, acc) + suite.Require().NoError(testutil.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins)) + } + + return accounts +} + +func TestSimTestSuite(t *testing.T) { + suite.Run(t, new(SimTestSuite)) +} diff --git a/x/consensus_param/simulation/params.go b/x/consensus_param/simulation/params.go new file mode 100644 index 000000000000..08decd4e1e63 --- /dev/null +++ b/x/consensus_param/simulation/params.go @@ -0,0 +1,25 @@ +package simulation + +// DONTCOVER + +import ( + "fmt" + "math/rand" + + "github.com/cosmos/cosmos-sdk/x/simulation" + + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// ParamChanges defines the parameters that can be modified by param change proposals +// on the simulation +func ParamChanges(r *rand.Rand) []simtypes.ParamChange { + return []simtypes.ParamChange{ + simulation.NewSimParamChange(types.ModuleName, string(types.KeyDefaultSendEnabled), + func(r *rand.Rand) string { + return fmt.Sprintf("%v", RandomGenesisDefaultSendEnabledParam(r)) + }, + ), + } +} diff --git a/x/consensus_param/simulation/params_test.go b/x/consensus_param/simulation/params_test.go new file mode 100644 index 000000000000..df6604367a1d --- /dev/null +++ b/x/consensus_param/simulation/params_test.go @@ -0,0 +1,35 @@ +package simulation_test + +import ( + "math/rand" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/x/bank/simulation" +) + +func TestParamChanges(t *testing.T) { + s := rand.NewSource(1) + r := rand.New(s) + + expected := []struct { + composedKey string + key string + simValue string + subspace string + }{ + {"bank/DefaultSendEnabled", "DefaultSendEnabled", "true", "bank"}, + } + + paramChanges := simulation.ParamChanges(r) + + require.Len(t, paramChanges, len(expected)) + + for i, p := range paramChanges { + require.Equal(t, expected[i].composedKey, p.ComposedKey()) + require.Equal(t, expected[i].key, p.Key()) + require.Equal(t, expected[i].simValue, p.SimValue()(r)) + require.Equal(t, expected[i].subspace, p.Subspace()) + } +} diff --git a/x/consensus_param/testutil/expected_keepers_mocks.go b/x/consensus_param/testutil/expected_keepers_mocks.go new file mode 100644 index 000000000000..c27addd028fd --- /dev/null +++ b/x/consensus_param/testutil/expected_keepers_mocks.go @@ -0,0 +1,228 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/bank/types/expected_keepers.go + +// Package testutil is a generated GoMock package. +package testutil + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/x/auth/types" + gomock "github.com/golang/mock/gomock" +) + +// MockAccountKeeper is a mock of AccountKeeper interface. +type MockAccountKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountKeeperMockRecorder +} + +// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. +type MockAccountKeeperMockRecorder struct { + mock *MockAccountKeeper +} + +// NewMockAccountKeeper creates a new mock instance. +func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper { + mock := &MockAccountKeeper{ctrl: ctrl} + mock.recorder = &MockAccountKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { + return m.recorder +} + +// GetAccount mocks base method. +func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", ctx, addr) + ret0, _ := ret[0].(types0.AccountI) + return ret0 +} + +// GetAccount indicates an expected call of GetAccount. +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) +} + +// GetAllAccounts mocks base method. +func (m *MockAccountKeeper) GetAllAccounts(ctx types.Context) []types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllAccounts", ctx) + ret0, _ := ret[0].([]types0.AccountI) + return ret0 +} + +// GetAllAccounts indicates an expected call of GetAllAccounts. +func (mr *MockAccountKeeperMockRecorder) GetAllAccounts(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).GetAllAccounts), ctx) +} + +// GetModuleAccount mocks base method. +func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types0.ModuleAccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName) + ret0, _ := ret[0].(types0.ModuleAccountI) + return ret0 +} + +// GetModuleAccount indicates an expected call of GetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) +} + +// GetModuleAccountAndPermissions mocks base method. +func (m *MockAccountKeeper) GetModuleAccountAndPermissions(ctx types.Context, moduleName string) (types0.ModuleAccountI, []string) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAccountAndPermissions", ctx, moduleName) + ret0, _ := ret[0].(types0.ModuleAccountI) + ret1, _ := ret[1].([]string) + return ret0, ret1 +} + +// GetModuleAccountAndPermissions indicates an expected call of GetModuleAccountAndPermissions. +func (mr *MockAccountKeeperMockRecorder) GetModuleAccountAndPermissions(ctx, moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccountAndPermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccountAndPermissions), ctx, moduleName) +} + +// GetModuleAddress mocks base method. +func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddress", moduleName) + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetModuleAddress indicates an expected call of GetModuleAddress. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName) +} + +// GetModuleAddressAndPermissions mocks base method. +func (m *MockAccountKeeper) GetModuleAddressAndPermissions(moduleName string) (types.AccAddress, []string) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddressAndPermissions", moduleName) + ret0, _ := ret[0].(types.AccAddress) + ret1, _ := ret[1].([]string) + return ret0, ret1 +} + +// GetModuleAddressAndPermissions indicates an expected call of GetModuleAddressAndPermissions. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddressAndPermissions(moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddressAndPermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddressAndPermissions), moduleName) +} + +// GetModulePermissions mocks base method. +func (m *MockAccountKeeper) GetModulePermissions() map[string]types0.PermissionsForAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModulePermissions") + ret0, _ := ret[0].(map[string]types0.PermissionsForAddress) + return ret0 +} + +// GetModulePermissions indicates an expected call of GetModulePermissions. +func (mr *MockAccountKeeperMockRecorder) GetModulePermissions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModulePermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModulePermissions)) +} + +// HasAccount mocks base method. +func (m *MockAccountKeeper) HasAccount(ctx types.Context, addr types.AccAddress) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasAccount", ctx, addr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// HasAccount indicates an expected call of HasAccount. +func (mr *MockAccountKeeperMockRecorder) HasAccount(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasAccount", reflect.TypeOf((*MockAccountKeeper)(nil).HasAccount), ctx, addr) +} + +// IterateAccounts mocks base method. +func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types0.AccountI) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateAccounts", ctx, process) +} + +// IterateAccounts indicates an expected call of IterateAccounts. +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process) +} + +// NewAccount mocks base method. +func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types0.AccountI) types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewAccount", arg0, arg1) + ret0, _ := ret[0].(types0.AccountI) + return ret0 +} + +// NewAccount indicates an expected call of NewAccount. +func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccount", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccount), arg0, arg1) +} + +// NewAccountWithAddress mocks base method. +func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewAccountWithAddress", ctx, addr) + ret0, _ := ret[0].(types0.AccountI) + return ret0 +} + +// NewAccountWithAddress indicates an expected call of NewAccountWithAddress. +func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccountWithAddress", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccountWithAddress), ctx, addr) +} + +// SetAccount mocks base method. +func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types0.AccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetAccount", ctx, acc) +} + +// SetAccount indicates an expected call of SetAccount. +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) +} + +// SetModuleAccount mocks base method. +func (m *MockAccountKeeper) SetModuleAccount(ctx types.Context, macc types0.ModuleAccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetModuleAccount", ctx, macc) +} + +// SetModuleAccount indicates an expected call of SetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(ctx, macc interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), ctx, macc) +} + +// ValidatePermissions mocks base method. +func (m *MockAccountKeeper) ValidatePermissions(macc types0.ModuleAccountI) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatePermissions", macc) + ret0, _ := ret[0].(error) + return ret0 +} + +// ValidatePermissions indicates an expected call of ValidatePermissions. +func (mr *MockAccountKeeperMockRecorder) ValidatePermissions(macc interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePermissions", reflect.TypeOf((*MockAccountKeeper)(nil).ValidatePermissions), macc) +} diff --git a/x/consensus_param/testutil/test_helpers.go b/x/consensus_param/testutil/test_helpers.go new file mode 100644 index 000000000000..e8805ed7b348 --- /dev/null +++ b/x/consensus_param/testutil/test_helpers.go @@ -0,0 +1,35 @@ +package testutil + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" +) + +// FundAccount is a utility function that funds an account by minting and +// sending the coins to the address. This should be used for testing purposes +// only! +// +// TODO: Instead of using the mint module account, which has the +// permission of minting, create a "faucet" account. (@fdymylja) +func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error { + if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { + return err + } + + return bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, amounts) +} + +// FundModuleAccount is a utility function that funds a module account by +// minting and sending the coins to the address. This should be used for testing +// purposes only! +// +// TODO: Instead of using the mint module account, which has the +// permission of minting, create a "faucet" account. (@fdymylja) +func FundModuleAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, recipientMod string, amounts sdk.Coins) error { + if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { + return err + } + + return bankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, recipientMod, amounts) +} diff --git a/x/consensus_param/types/codec.go b/x/consensus_param/types/codec.go new file mode 100644 index 000000000000..3ecdcf3e09e3 --- /dev/null +++ b/x/consensus_param/types/codec.go @@ -0,0 +1,15 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/consensus_param/types/msgs.go b/x/consensus_param/types/msgs.go new file mode 100644 index 000000000000..c9f3e5622f37 --- /dev/null +++ b/x/consensus_param/types/msgs.go @@ -0,0 +1,34 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + tmtypes "github.com/tendermint/tendermint/types" +) + +// bank message types +const ( + TypeMsgUpdateParams = "update_params" +) + +var ( + _ sdk.Msg = &MsgUpdateParams{} +) + +// GetSigners returns the signer addresses that are expected to sign the result +// of GetSignBytes. +func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { + authority, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{authority} +} + +// GetSignBytes returns the raw bytes for a MsgUpdateParams message that +// the expected signer needs to sign. +func (msg MsgUpdateParams) GetSignBytes() []byte { + return []byte{} +} + +// ValidateBasic performs basic MsgUpdateParams message validation. +func (msg MsgUpdateParams) ValidateBasic() error { + params := tmtypes.ConsensusParamsFromProto(msg.Params) + return Validate(params) +} diff --git a/x/consensus_param/types/params.go b/x/consensus_param/types/params.go new file mode 100644 index 000000000000..7f96bb630fa8 --- /dev/null +++ b/x/consensus_param/types/params.go @@ -0,0 +1,30 @@ +package types + +import ( + tmtypes "github.com/tendermint/tendermint/types" +) + +// DefaultDefaultSendEnabled is the value that DefaultSendEnabled will have from DefaultParams(). +var DefaultDefaultSendEnabled = true + +// NewParams creates a new parameter configuration for the bank module +func NewParams(defaultSendEnabled bool) tmtypes.ConsensusParams { + return tmtypes.ConsensusParams{} +} + +// DefaultParams is the default parameter configuration for the bank module +func DefaultParams() tmtypes.ConsensusParams { + return tmtypes.ConsensusParams{} +} + +// Validate all bank module parameters +func Validate(p tmtypes.ConsensusParams) error { + return p.ValidateConsensusParams() + +} + +// String implements the Stringer interface. +func String(p tmtypes.ConsensusParams) string { + cp := p.ToProto() + return cp.String() +} diff --git a/x/consensus_param/types/query.pb.go b/x/consensus_param/types/query.pb.go new file mode 100644 index 000000000000..4708226e0a1e --- /dev/null +++ b/x/consensus_param/types/query.pb.go @@ -0,0 +1,540 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/consensus_param/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/tendermint/tendermint/proto/tendermint/types" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest defines the request type for querying x/bank parameters. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3d2ae9668ec06671, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse defines the response type for querying x/bank parameters. +type QueryParamsResponse struct { + Params types.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3d2ae9668ec06671, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() types.ConsensusParams { + if m != nil { + return m.Params + } + return types.ConsensusParams{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.consensus_param.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.consensus_param.v1beta1.QueryParamsResponse") +} + +func init() { + proto.RegisterFile("cosmos/consensus_param/v1/query.proto", fileDescriptor_3d2ae9668ec06671) +} + +var fileDescriptor_3d2ae9668ec06671 = []byte{ + // 332 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x4f, 0x4b, 0x3b, 0x31, + 0x10, 0xdd, 0xfc, 0xf8, 0xd9, 0xc3, 0x7a, 0x5b, 0x7b, 0x90, 0x6a, 0xa3, 0x56, 0x04, 0x11, 0xcc, + 0xd0, 0xd6, 0xbb, 0xa0, 0x77, 0xd1, 0x1e, 0x3c, 0x78, 0x91, 0x6c, 0x1b, 0xd6, 0xa5, 0x6e, 0x26, + 0xdd, 0x64, 0x8b, 0xbd, 0xfa, 0x09, 0x04, 0xc1, 0xb3, 0x1f, 0xa7, 0xc7, 0x82, 0x17, 0x4f, 0x22, + 0xad, 0x1f, 0x44, 0x36, 0x89, 0xf5, 0x4f, 0x41, 0xf0, 0x94, 0x61, 0xe6, 0xbd, 0x37, 0x2f, 0x2f, + 0x09, 0x77, 0xba, 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6, 0xbf, 0xa4, 0x6d, 0x0d, 0x9f, + 0x8c, 0xa7, 0x94, 0x4c, 0xa6, 0x94, 0xbc, 0x4e, 0x29, 0xb9, 0x9b, 0xd1, 0x60, 0x32, 0xa3, 0xc1, + 0xf3, 0x8c, 0x06, 0x17, 0x07, 0x49, 0x6a, 0xae, 0x8a, 0x98, 0x75, 0x31, 0x83, 0xf9, 0xdb, 0x97, + 0xc7, 0xbe, 0xee, 0xf5, 0xe1, 0x66, 0xe1, 0x23, 0xd8, 0x40, 0xe2, 0x8a, 0xcd, 0xb9, 0xfd, 0x1e, + 0x00, 0x00, 0xff, 0xff, 0xe7, 0xfa, 0xba, 0x98, 0x2f, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Params queries the parameters of x/bank module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc *grpc.ClientConn +} + +func NewQueryClient(cc *grpc.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params queries the parameters of x/bank module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s *grpc.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.consensus_param.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.consensus_param.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/consensus_param/v1/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/consensus_param/types/query.pb.gw.go b/x/consensus_param/types/query.pb.gw.go new file mode 100644 index 000000000000..03edaa120b8c --- /dev/null +++ b/x/consensus_param/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/consensus_param/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/consensus_param/types/tx.pb.go b/x/consensus_param/types/tx.pb.go new file mode 100644 index 000000000000..c9ff74108425 --- /dev/null +++ b/x/consensus_param/types/tx.pb.go @@ -0,0 +1,607 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/consensus_param/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/tendermint/tendermint/proto/tendermint/types" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// 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/bank parameters to update. + // + // NOTE: All parameters must be supplied. + Params types.ConsensusParams `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_512bd98009ecbd38, []int{0} +} +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() types.ConsensusParams { + if m != nil { + return m.Params + } + return types.ConsensusParams{} +} + +// 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_512bd98009ecbd38, []int{1} +} +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((*MsgUpdateParams)(nil), "cosmos.consensus_param.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse") +} + +func init() { + proto.RegisterFile("cosmos/consensus_param/v1/tx.proto", fileDescriptor_512bd98009ecbd38) +} + +var fileDescriptor_512bd98009ecbd38 = []byte{ + // 340 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0x8e, 0x2f, 0x48, 0x2c, + 0x4a, 0xcc, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, + 0x83, 0xa8, 0xd1, 0x43, 0x53, 0xa3, 0x57, 0x66, 0x98, 0x94, 0x5a, 0x92, 0x68, 0x28, 0x25, 0x92, + 0x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b, 0x07, 0xc5, 0xe9, 0xfa, 0x7a, 0xf8, 0x03, 0x56, + 0x0f, 0xcd, 0x3c, 0x29, 0x73, 0x12, 0x35, 0xc0, 0x1c, 0xe0, 0xe4, 0x77, 0xe2, 0x91, 0x1c, 0xe3, + 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, + 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x26, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, + 0xb9, 0xfa, 0xf0, 0xa4, 0x00, 0xa2, 0x74, 0x8b, 0x53, 0xb2, 0xf5, 0x2b, 0x30, 0xd2, 0x05, 0x38, + 0x64, 0x92, 0xd8, 0xc0, 0xf1, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x24, 0x41, 0xec, 0x6a, + 0x3e, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a governance operation for updating the x/bank 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 { + cc *grpc.ClientConn +} + +func NewMsgClient(cc *grpc.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1beta1.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 { + // UpdateParams defines a governance operation for updating the x/bank 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. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s *grpc.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +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.consensus_param.v1beta1.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.consensus_param.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/consensus_param/v1/tx.proto", +} + +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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +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 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/consensus_param/types/util.go b/x/consensus_param/types/util.go new file mode 100644 index 000000000000..c99f45269389 --- /dev/null +++ b/x/consensus_param/types/util.go @@ -0,0 +1,27 @@ +package types + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const ( + ModuleName = "consensus_param" + + StoreKey = ModuleName +) + +var ParamStoreKeyConsensusParams = []byte("ConsensusParams") + +// x/consensus_param module sentinel errors +var ( + ErrUnauthorized = sdkerrors.Register(ModuleName, 2, "unauthorized action") +) + +// Events +const ( + AttributeValueCategory = ModuleName + + EventTypeUpdateParam = "update_param" + + AttributeKeyParamUpdater = "param_updaterssh ubuntu@54.38.45.152 " +) diff --git a/x/upgrade/keeper/keeper.go b/x/upgrade/keeper/keeper.go index 21e3ee70fb4a..1df6b39194ac 100644 --- a/x/upgrade/keeper/keeper.go +++ b/x/upgrade/keeper/keeper.go @@ -11,10 +11,9 @@ import ( "github.com/tendermint/tendermint/libs/log" tmos "github.com/tendermint/tendermint/libs/os" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "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" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/kv" From 75fd065eee1fee1d3b2f8c27c940a19b2dcbf830 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 9 Aug 2022 17:07:24 +0200 Subject: [PATCH 02/60] remove exrtas --- api/cosmos/consensus_param/v1/query.pulsar.go | 159 ++++--- .../consensus_param/v1/query_grpc.pb.go | 8 +- api/cosmos/consensus_param/v1/tx.pulsar.go | 179 ++++---- api/cosmos/consensus_param/v1/tx_grpc.pb.go | 8 +- baseapp/baseapp.go | 26 +- baseapp/params.go | 12 +- proto/cosmos/consensus_param/v1/query.proto | 4 +- proto/cosmos/consensus_param/v1/tx.proto | 4 +- x/consensus_param/client/cli/query.go | 280 ------------ x/consensus_param/client/cli/query_test.go | 362 --------------- x/consensus_param/client/cli/suite_test.go | 96 ---- x/consensus_param/client/cli/tx.go | 144 ------ x/consensus_param/client/cli/tx_test.go | 211 --------- x/consensus_param/exported/exported.go | 5 +- x/consensus_param/keeper/grpc_query.go | 37 ++ x/consensus_param/module.go | 106 +---- x/consensus_param/simulation/genesis.go | 99 ----- x/consensus_param/simulation/genesis_test.go | 81 ---- x/consensus_param/simulation/operations.go | 414 ------------------ .../simulation/operations_test.go | 207 --------- x/consensus_param/simulation/params.go | 25 -- x/consensus_param/simulation/params_test.go | 35 -- x/consensus_param/types/query.pb.go | 87 ++-- x/consensus_param/types/tx.pb.go | 51 ++- 24 files changed, 300 insertions(+), 2340 deletions(-) delete mode 100644 x/consensus_param/client/cli/query.go delete mode 100644 x/consensus_param/client/cli/query_test.go delete mode 100644 x/consensus_param/client/cli/suite_test.go delete mode 100644 x/consensus_param/client/cli/tx.go delete mode 100644 x/consensus_param/client/cli/tx_test.go create mode 100644 x/consensus_param/keeper/grpc_query.go delete mode 100644 x/consensus_param/simulation/genesis.go delete mode 100644 x/consensus_param/simulation/genesis_test.go delete mode 100644 x/consensus_param/simulation/operations.go delete mode 100644 x/consensus_param/simulation/operations_test.go delete mode 100644 x/consensus_param/simulation/params.go delete mode 100644 x/consensus_param/simulation/params_test.go diff --git a/api/cosmos/consensus_param/v1/query.pulsar.go b/api/cosmos/consensus_param/v1/query.pulsar.go index 301a0f756bf3..a3025a6b2bb1 100644 --- a/api/cosmos/consensus_param/v1/query.pulsar.go +++ b/api/cosmos/consensus_param/v1/query.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package consensus_paramv1beta1 +package consensus_paramv1 import ( _ "cosmossdk.io/api/cosmos/base/query/v1beta1" @@ -107,9 +107,9 @@ func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -123,9 +123,9 @@ func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescripto switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -139,9 +139,9 @@ func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDes switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) } } @@ -159,9 +159,9 @@ func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -179,9 +179,9 @@ func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescrip switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -192,9 +192,9 @@ func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescri switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -204,7 +204,7 @@ func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescri func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1beta1.QueryParamsRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1.QueryParamsRequest", d.FullName())) } panic("unreachable") } @@ -469,13 +469,13 @@ func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDesc // a repeated field is populated if it is non-empty. func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + case "cosmos.consensus_param.v1.QueryParamsResponse.params": return x.Params != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -487,13 +487,13 @@ func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + case "cosmos.consensus_param.v1.QueryParamsResponse.params": x.Params = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -505,14 +505,14 @@ func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescript // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + case "cosmos.consensus_param.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.consensus_param.v1beta1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) } } @@ -528,13 +528,13 @@ func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDe // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + case "cosmos.consensus_param.v1.QueryParamsResponse.params": x.Params = value.Message().Interface().(*types.ConsensusParams) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -550,16 +550,16 @@ func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + case "cosmos.consensus_param.v1.QueryParamsResponse.params": if x.Params == nil { x.Params = new(types.ConsensusParams) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -568,14 +568,14 @@ func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescri // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.consensus_param.v1beta1.QueryParamsResponse.params": + case "cosmos.consensus_param.v1.QueryParamsResponse.params": m := new(types.ConsensusParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -585,7 +585,7 @@ func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescr func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1beta1.QueryParamsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1.QueryParamsResponse", d.FullName())) } panic("unreachable") } @@ -888,51 +888,48 @@ var File_cosmos_consensus_param_v1_query_proto protoreflect.FileDescriptor var file_cosmos_consensus_param_v1_query_proto_rawDesc = []byte{ 0x0a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x56, 0x0a, 0x13, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x32, 0xa0, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x96, - 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, + 0x76, 0x31, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, + 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x96, 0x01, 0x0a, 0x05, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x12, 0x8c, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x89, 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, - 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x29, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0xeb, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -949,14 +946,14 @@ func file_cosmos_consensus_param_v1_query_proto_rawDescGZIP() []byte { var file_cosmos_consensus_param_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_cosmos_consensus_param_v1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: cosmos.consensus_param.v1beta1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: cosmos.consensus_param.v1beta1.QueryParamsResponse + (*QueryParamsRequest)(nil), // 0: cosmos.consensus_param.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: cosmos.consensus_param.v1.QueryParamsResponse (*types.ConsensusParams)(nil), // 2: tendermint.types.ConsensusParams } var file_cosmos_consensus_param_v1_query_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus_param.v1beta1.QueryParamsResponse.params:type_name -> tendermint.types.ConsensusParams - 0, // 1: cosmos.consensus_param.v1beta1.Query.Params:input_type -> cosmos.consensus_param.v1beta1.QueryParamsRequest - 1, // 2: cosmos.consensus_param.v1beta1.Query.Params:output_type -> cosmos.consensus_param.v1beta1.QueryParamsResponse + 2, // 0: cosmos.consensus_param.v1.QueryParamsResponse.params:type_name -> tendermint.types.ConsensusParams + 0, // 1: cosmos.consensus_param.v1.Query.Params:input_type -> cosmos.consensus_param.v1.QueryParamsRequest + 1, // 2: cosmos.consensus_param.v1.Query.Params:output_type -> cosmos.consensus_param.v1.QueryParamsResponse 2, // [2:3] is the sub-list for method output_type 1, // [1:2] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name diff --git a/api/cosmos/consensus_param/v1/query_grpc.pb.go b/api/cosmos/consensus_param/v1/query_grpc.pb.go index 08e754a19331..00ed21d9126d 100644 --- a/api/cosmos/consensus_param/v1/query_grpc.pb.go +++ b/api/cosmos/consensus_param/v1/query_grpc.pb.go @@ -4,7 +4,7 @@ // - protoc (unknown) // source: cosmos/consensus_param/v1/query.proto -package consensus_paramv1beta1 +package consensus_paramv1 import ( context "context" @@ -36,7 +36,7 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1beta1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -82,7 +82,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.consensus_param.v1beta1.Query/Params", + FullMethod: "/cosmos.consensus_param.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -94,7 +94,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.consensus_param.v1beta1.Query", + ServiceName: "cosmos.consensus_param.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/api/cosmos/consensus_param/v1/tx.pulsar.go b/api/cosmos/consensus_param/v1/tx.pulsar.go index d89d8683e803..fedb608cb92b 100644 --- a/api/cosmos/consensus_param/v1/tx.pulsar.go +++ b/api/cosmos/consensus_param/v1/tx.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package consensus_paramv1beta1 +package consensus_paramv1 import ( _ "cosmossdk.io/api/cosmos/msg/v1" @@ -121,15 +121,15 @@ func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescript // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.consensus_param.v1beta1.MsgUpdateParams.authority": + case "cosmos.consensus_param.v1.MsgUpdateParams.authority": return x.Authority != "" - case "cosmos.consensus_param.v1beta1.MsgUpdateParams.params": + case "cosmos.consensus_param.v1.MsgUpdateParams.params": return x.Params != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -141,15 +141,15 @@ func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bo // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.consensus_param.v1beta1.MsgUpdateParams.authority": + case "cosmos.consensus_param.v1.MsgUpdateParams.authority": x.Authority = "" - case "cosmos.consensus_param.v1beta1.MsgUpdateParams.params": + case "cosmos.consensus_param.v1.MsgUpdateParams.params": x.Params = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -161,17 +161,17 @@ func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) // 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.consensus_param.v1beta1.MsgUpdateParams.authority": + case "cosmos.consensus_param.v1.MsgUpdateParams.authority": value := x.Authority return protoreflect.ValueOfString(value) - case "cosmos.consensus_param.v1beta1.MsgUpdateParams.params": + case "cosmos.consensus_param.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.consensus_param.v1beta1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) } } @@ -187,15 +187,15 @@ func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescri // 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.consensus_param.v1beta1.MsgUpdateParams.authority": + case "cosmos.consensus_param.v1.MsgUpdateParams.authority": x.Authority = value.Interface().(string) - case "cosmos.consensus_param.v1beta1.MsgUpdateParams.params": + case "cosmos.consensus_param.v1.MsgUpdateParams.params": x.Params = value.Message().Interface().(*types.ConsensusParams) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -211,18 +211,18 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va // 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.consensus_param.v1beta1.MsgUpdateParams.params": + case "cosmos.consensus_param.v1.MsgUpdateParams.params": if x.Params == nil { x.Params = new(types.ConsensusParams) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "cosmos.consensus_param.v1beta1.MsgUpdateParams.authority": - panic(fmt.Errorf("field authority of message cosmos.consensus_param.v1beta1.MsgUpdateParams is not mutable")) + case "cosmos.consensus_param.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message cosmos.consensus_param.v1.MsgUpdateParams is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -231,16 +231,16 @@ func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor // 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.consensus_param.v1beta1.MsgUpdateParams.authority": + case "cosmos.consensus_param.v1.MsgUpdateParams.authority": return protoreflect.ValueOfString("") - case "cosmos.consensus_param.v1beta1.MsgUpdateParams.params": + case "cosmos.consensus_param.v1.MsgUpdateParams.params": m := new(types.ConsensusParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -250,7 +250,7 @@ func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescripto 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.consensus_param.v1beta1.MsgUpdateParams", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1.MsgUpdateParams", d.FullName())) } panic("unreachable") } @@ -606,9 +606,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescri switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -622,9 +622,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDesc switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -638,9 +638,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.Fie switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) } } @@ -658,9 +658,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescri switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -678,9 +678,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDe switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -691,9 +691,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldD switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -703,7 +703,7 @@ func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldD 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.consensus_param.v1beta1.MsgUpdateParamsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1.MsgUpdateParamsResponse", d.FullName())) } panic("unreachable") } @@ -894,7 +894,7 @@ 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/bank parameters to update. + // params defines the x/consensus_params parameters to update. // // NOTE: All parameters must be supplied. Params *types.ConsensusParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` @@ -969,52 +969,49 @@ var File_cosmos_consensus_param_v1_tx_proto protoreflect.FileDescriptor var file_cosmos_consensus_param_v1_tx_proto_rawDesc = []byte{ 0x0a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, - 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 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, 0x3f, 0x0a, 0x06, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 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, 0x7f, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x78, 0x0a, 0x0c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2f, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x37, 0x2e, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x1a, + 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 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, 0x3f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 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, 0x75, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x6e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 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, 0xe8, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 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, 0x86, 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, - 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, - 0x58, 0xaa, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xca, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xe2, 0x02, 0x29, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1f, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, + 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1031,14 +1028,14 @@ func file_cosmos_consensus_param_v1_tx_proto_rawDescGZIP() []byte { var file_cosmos_consensus_param_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_cosmos_consensus_param_v1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: cosmos.consensus_param.v1beta1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse + (*MsgUpdateParams)(nil), // 0: cosmos.consensus_param.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: cosmos.consensus_param.v1.MsgUpdateParamsResponse (*types.ConsensusParams)(nil), // 2: tendermint.types.ConsensusParams } var file_cosmos_consensus_param_v1_tx_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus_param.v1beta1.MsgUpdateParams.params:type_name -> tendermint.types.ConsensusParams - 0, // 1: cosmos.consensus_param.v1beta1.Msg.UpdateParams:input_type -> cosmos.consensus_param.v1beta1.MsgUpdateParams - 1, // 2: cosmos.consensus_param.v1beta1.Msg.UpdateParams:output_type -> cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse + 2, // 0: cosmos.consensus_param.v1.MsgUpdateParams.params:type_name -> tendermint.types.ConsensusParams + 0, // 1: cosmos.consensus_param.v1.Msg.UpdateParams:input_type -> cosmos.consensus_param.v1.MsgUpdateParams + 1, // 2: cosmos.consensus_param.v1.Msg.UpdateParams:output_type -> cosmos.consensus_param.v1.MsgUpdateParamsResponse 2, // [2:3] is the sub-list for method output_type 1, // [1:2] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name diff --git a/api/cosmos/consensus_param/v1/tx_grpc.pb.go b/api/cosmos/consensus_param/v1/tx_grpc.pb.go index 6a39f24b6b77..ead8b7c6d37a 100644 --- a/api/cosmos/consensus_param/v1/tx_grpc.pb.go +++ b/api/cosmos/consensus_param/v1/tx_grpc.pb.go @@ -4,7 +4,7 @@ // - protoc (unknown) // source: cosmos/consensus_param/v1/tx.proto -package consensus_paramv1beta1 +package consensus_paramv1 import ( context "context" @@ -39,7 +39,7 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1beta1.Msg/UpdateParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1.Msg/UpdateParams", in, out, opts...) if err != nil { return nil, err } @@ -88,7 +88,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.consensus_param.v1beta1.Msg/UpdateParams", + FullMethod: "/cosmos.consensus_param.v1.Msg/UpdateParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) @@ -100,7 +100,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.consensus_param.v1beta1.Msg", + ServiceName: "cosmos.consensus_param.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 398ddd20b5fe..d831541a003c 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -421,30 +421,12 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams return nil } - cp := new(tmproto.ConsensusParams) - - if app.paramStore.Has(ctx, ParamStoreKeyBlockParams) { - var bp tmproto.BlockParams - - app.paramStore.Get(ctx, &cp) - cp.Block = &bp - } - - if app.paramStore.Has(ctx, ParamStoreKeyEvidenceParams) { - var ep tmproto.EvidenceParams - - app.paramStore.Get(ctx, ParamStoreKeyEvidenceParams, &ep) - cp.Evidence = &ep - } - - if app.paramStore.Has(ctx, ParamStoreKeyValidatorParams) { - var vp tmproto.ValidatorParams - - app.paramStore.Get(ctx, ParamStoreKeyValidatorParams, &vp) - cp.Validator = &vp + cp, err := app.paramStore.Get(ctx) + if err != nil { + panic(err) } - return cp + return &cp } // AddRunTxRecoveryHandler adds custom app.runTx method panic handlers. diff --git a/baseapp/params.go b/baseapp/params.go index fbf16daff0fa..021ba6bed900 100644 --- a/baseapp/params.go +++ b/baseapp/params.go @@ -6,20 +6,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// Paramspace defines the parameter subspace to be used for the paramstore. -const Paramspace = "baseapp" - -// Parameter store keys for all the consensus parameter types. -var ( - ParamStoreKeyBlockParams = []byte("BlockParams") - ParamStoreKeyEvidenceParams = []byte("EvidenceParams") - ParamStoreKeyValidatorParams = []byte("ValidatorParams") -) - // ParamStore defines the interface the parameter store used by the BaseApp must // fulfill. type ParamStore interface { - Get(ctx sdk.Context, key []byte) (tmproto.ConsensusParams, error) + Get(ctx sdk.Context) (tmproto.ConsensusParams, error) Has(ctx sdk.Context, key []byte) bool Set(ctx sdk.Context, cp tmproto.ConsensusParams) } diff --git a/proto/cosmos/consensus_param/v1/query.proto b/proto/cosmos/consensus_param/v1/query.proto index bdb27b36af4b..83f16631fae7 100644 --- a/proto/cosmos/consensus_param/v1/query.proto +++ b/proto/cosmos/consensus_param/v1/query.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package cosmos.consensus_param.v1beta1; +package cosmos.consensus_param.v1; import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; @@ -21,5 +21,5 @@ message QueryParamsRequest {} // QueryParamsResponse defines the response type for querying x/bank parameters. message QueryParamsResponse { - tendermint.types.ConsensusParams params = 1 [(gogoproto.nullable) = false]; + tendermint.types.ConsensusParams params = 1; } diff --git a/proto/cosmos/consensus_param/v1/tx.proto b/proto/cosmos/consensus_param/v1/tx.proto index d983c7419f22..4f17de5556f6 100644 --- a/proto/cosmos/consensus_param/v1/tx.proto +++ b/proto/cosmos/consensus_param/v1/tx.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package cosmos.consensus_param.v1beta1; +package cosmos.consensus_param.v1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; @@ -26,7 +26,7 @@ message MsgUpdateParams { // authority is the address of the governance account. string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // params defines the x/bank parameters to update. + // params defines the x/consensus_params parameters to update. // // NOTE: All parameters must be supplied. tendermint.types.ConsensusParams params = 2 [(gogoproto.nullable) = false]; diff --git a/x/consensus_param/client/cli/query.go b/x/consensus_param/client/cli/query.go deleted file mode 100644 index df544fd315d6..000000000000 --- a/x/consensus_param/client/cli/query.go +++ /dev/null @@ -1,280 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -const ( - FlagDenom = "denom" -) - -// GetQueryCmd returns the parent command for all x/bank CLi query commands. The -// provided clientCtx should have, at a minimum, a verifier, Tendermint RPC client, -// and marshaler set. -func GetQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the bank module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - GetBalancesCmd(), - GetCmdQueryTotalSupply(), - GetCmdDenomsMetadata(), - GetCmdQuerySendEnabled(), - ) - - return cmd -} - -func GetBalancesCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "balances [address]", - Short: "Query for account balances by address", - Long: strings.TrimSpace( - fmt.Sprintf(`Query the total balance of an account or of a specific denomination. - -Example: - $ %s query %s balances [address] - $ %s query %s balances [address] --denom=[denom] -`, - version.AppName, types.ModuleName, version.AppName, types.ModuleName, - ), - ), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - denom, err := cmd.Flags().GetString(FlagDenom) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - addr, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - ctx := cmd.Context() - - if denom == "" { - params := types.NewQueryAllBalancesRequest(addr, pageReq) - - res, err := queryClient.AllBalances(ctx, params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - } - - params := types.NewQueryBalanceRequest(addr, denom) - - res, err := queryClient.Balance(ctx, params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Balance) - }, - } - - cmd.Flags().String(FlagDenom, "", "The specific balance denomination to query for") - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "all balances") - - return cmd -} - -// GetCmdDenomsMetadata defines the cobra command to query client denomination metadata. -func GetCmdDenomsMetadata() *cobra.Command { - cmd := &cobra.Command{ - Use: "denom-metadata", - Short: "Query the client metadata for coin denominations", - Long: strings.TrimSpace( - fmt.Sprintf(`Query the client metadata for all the registered coin denominations - -Example: - To query for the client metadata of all coin denominations use: - $ %s query %s denom-metadata - -To query for the client metadata of a specific coin denomination use: - $ %s query %s denom-metadata --denom=[denom] -`, - version.AppName, types.ModuleName, version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, _ []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - denom, err := cmd.Flags().GetString(FlagDenom) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - if denom == "" { - res, err := queryClient.DenomsMetadata(cmd.Context(), &types.QueryDenomsMetadataRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - } - - res, err := queryClient.DenomMetadata(cmd.Context(), &types.QueryDenomMetadataRequest{Denom: denom}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - cmd.Flags().String(FlagDenom, "", "The specific denomination to query client metadata for") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetCmdQueryTotalSupply() *cobra.Command { - cmd := &cobra.Command{ - Use: "total", - Short: "Query the total supply of coins of the chain", - Args: cobra.NoArgs, - Long: strings.TrimSpace( - fmt.Sprintf(`Query total supply of coins that are held by accounts in the chain. - -Example: - $ %s query %s total - -To query for the total supply of a specific coin denomination use: - $ %s query %s total --denom=[denom] -`, - version.AppName, types.ModuleName, version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - denom, err := cmd.Flags().GetString(FlagDenom) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - ctx := cmd.Context() - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - if denom == "" { - res, err := queryClient.TotalSupply(ctx, &types.QueryTotalSupplyRequest{Pagination: pageReq}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - } - - res, err := queryClient.SupplyOf(ctx, &types.QuerySupplyOfRequest{Denom: denom}) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Amount) - }, - } - - cmd.Flags().String(FlagDenom, "", "The specific balance denomination to query for") - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "all supply totals") - - return cmd -} - -func GetCmdQuerySendEnabled() *cobra.Command { - cmd := &cobra.Command{ - Use: "send-enabled [denom1 ...]", - Short: "Query for send enabled entries", - Long: strings.TrimSpace(`Query for send enabled entries that have been specifically set. - -To look up one or more specific denoms, supply them as arguments to this command. -To look up all denoms, do not provide any arguments. -`, - ), - Example: strings.TrimSpace( - fmt.Sprintf(`Getting one specific entry: - $ %[1]s query %[2]s send-enabled foocoin - -Getting two specific entries: - $ %[1]s query %[2]s send-enabled foocoin barcoin - -Getting all entries: - $ %[1]s query %[2]s send-enabled -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - reqPag, err := client.ReadPageRequest(client.MustFlagSetWithPageKeyDecoded(cmd.Flags())) - if err != nil { - return err - } - - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - req := &types.QuerySendEnabledRequest{ - Denoms: args, - Pagination: reqPag, - } - - res, err := queryClient.SendEnabled(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "send enabled entries") - - return cmd -} diff --git a/x/consensus_param/client/cli/query_test.go b/x/consensus_param/client/cli/query_test.go deleted file mode 100644 index b782f0799ce8..000000000000 --- a/x/consensus_param/client/cli/query_test.go +++ /dev/null @@ -1,362 +0,0 @@ -package cli_test - -import ( - "bytes" - "context" - "fmt" - "io" - - "github.com/gogo/protobuf/proto" - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/bank/client/cli" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -func (s *CLITestSuite) TestGetBalancesCmd() { - accounts := s.createKeyringAccounts(1) - - cmd := cli.GetBalancesCmd() - cmd.SetOutput(io.Discard) - - testCases := []struct { - name string - ctxGen func() client.Context - args []string - expectResult proto.Message - expectErr bool - }{ - { - "valid query", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryAllBalancesResponse{}) - c := newMockTendermintRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - accounts[0].address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QueryAllBalancesResponse{}, - false, - }, - { - "valid query with denom", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryBalanceResponse{ - Balance: &sdk.Coin{}, - }) - c := newMockTendermintRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - accounts[0].address.String(), - fmt.Sprintf("--%s=photon", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &sdk.Coin{}, - false, - }, - { - "invalid address", - func() client.Context { - return s.baseCtx - }, - []string{ - "foo", - }, - nil, - true, - }, - { - "invalid denom", - func() client.Context { - c := newMockTendermintRPC(abci.ResponseQuery{ - Code: 1, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - accounts[0].address.String(), - fmt.Sprintf("--%s=foo", cli.FlagDenom), - }, - nil, - true, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - var outBuf bytes.Buffer - - clientCtx := tc.ctxGen().WithOutput(&outBuf) - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - s.Require().NoError(client.SetCmdClientContextHandler(clientCtx, cmd)) - - err := cmd.Execute() - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(outBuf.Bytes(), tc.expectResult)) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdDenomsMetadata() { - cmd := cli.GetCmdDenomsMetadata() - cmd.SetOutput(io.Discard) - - testCases := []struct { - name string - ctxGen func() client.Context - args []string - expectResult proto.Message - expectErr bool - }{ - { - "valid query", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryDenomsMetadataResponse{}) - c := newMockTendermintRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QueryDenomsMetadataResponse{}, - false, - }, - { - "valid query with denom", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryDenomMetadataResponse{}) - c := newMockTendermintRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=photon", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QueryDenomMetadataResponse{}, - false, - }, - { - "invalid query with denom", - func() client.Context { - c := newMockTendermintRPC(abci.ResponseQuery{ - Code: 1, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=foo", cli.FlagDenom), - }, - nil, - true, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - var outBuf bytes.Buffer - - clientCtx := tc.ctxGen().WithOutput(&outBuf) - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - s.Require().NoError(client.SetCmdClientContextHandler(clientCtx, cmd)) - - err := cmd.Execute() - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(outBuf.Bytes(), tc.expectResult)) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryTotalSupply() { - cmd := cli.GetCmdQueryTotalSupply() - cmd.SetOutput(io.Discard) - - testCases := []struct { - name string - ctxGen func() client.Context - args []string - expectResult proto.Message - expectErr bool - }{ - { - "valid query", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryTotalSupplyResponse{}) - c := newMockTendermintRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QueryTotalSupplyResponse{}, - false, - }, - { - "valid query with denom", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QuerySupplyOfResponse{ - Amount: sdk.Coin{}, - }) - c := newMockTendermintRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=photon", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &sdk.Coin{}, - false, - }, - { - "invalid query with denom", - func() client.Context { - c := newMockTendermintRPC(abci.ResponseQuery{ - Code: 1, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=foo", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - nil, - true, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - var outBuf bytes.Buffer - - clientCtx := tc.ctxGen().WithOutput(&outBuf) - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - s.Require().NoError(client.SetCmdClientContextHandler(clientCtx, cmd)) - - err := cmd.Execute() - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(outBuf.Bytes(), tc.expectResult)) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQuerySendEnabled() { - cmd := cli.GetCmdQuerySendEnabled() - cmd.SetOutput(io.Discard) - - testCases := []struct { - name string - ctxGen func() client.Context - args []string - expectResult proto.Message - expectErr bool - }{ - { - "valid query", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QuerySendEnabledResponse{ - SendEnabled: []*types.SendEnabled{}, - }) - c := newMockTendermintRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QuerySendEnabledResponse{}, - false, - }, - { - "valid query with denoms", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QuerySendEnabledResponse{ - SendEnabled: []*types.SendEnabled{}, - }) - c := newMockTendermintRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - "photon", - "stake", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QuerySendEnabledResponse{}, - false, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - var outBuf bytes.Buffer - - clientCtx := tc.ctxGen().WithOutput(&outBuf) - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - s.Require().NoError(client.SetCmdClientContextHandler(clientCtx, cmd)) - - err := cmd.Execute() - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(outBuf.Bytes(), tc.expectResult)) - s.Require().NoError(err) - } - }) - } -} diff --git a/x/consensus_param/client/cli/suite_test.go b/x/consensus_param/client/cli/suite_test.go deleted file mode 100644 index 82fcd699befc..000000000000 --- a/x/consensus_param/client/cli/suite_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package cli_test - -import ( - "context" - "fmt" - "io" - "testing" - - "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/bytes" - rpcclient "github.com/tendermint/tendermint/rpc/client" - rpcclientmock "github.com/tendermint/tendermint/rpc/client/mock" - "github.com/tendermint/tendermint/rpc/coretypes" - tmtypes "github.com/tendermint/tendermint/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - sdk "github.com/cosmos/cosmos-sdk/types" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/bank" -) - -var _ client.TendermintRPC = (*mockTendermintRPC)(nil) - -type mockTendermintRPC struct { - rpcclientmock.Client - - responseQuery abci.ResponseQuery -} - -func newMockTendermintRPC(respQuery abci.ResponseQuery) mockTendermintRPC { - return mockTendermintRPC{responseQuery: respQuery} -} - -func (_ mockTendermintRPC) BroadcastTxSync(context.Context, tmtypes.Tx) (*coretypes.ResultBroadcastTx, error) { - return &coretypes.ResultBroadcastTx{Code: 0}, nil -} - -func (m mockTendermintRPC) ABCIQueryWithOptions( - _ context.Context, - _ string, _ bytes.HexBytes, - _ rpcclient.ABCIQueryOptions, -) (*coretypes.ResultABCIQuery, error) { - return &coretypes.ResultABCIQuery{Response: m.responseQuery}, nil -} - -type account struct { - name string - address sdk.AccAddress -} - -type CLITestSuite struct { - suite.Suite - - kr keyring.Keyring - encCfg testutilmod.TestEncodingConfig - baseCtx client.Context -} - -func TestMigrateTestSuite(t *testing.T) { - suite.Run(t, new(CLITestSuite)) -} - -func (s *CLITestSuite) SetupSuite() { - s.encCfg = testutilmod.MakeTestEncodingConfig(bank.AppModuleBasic{}) - s.kr = keyring.NewInMemory(s.encCfg.Codec) - s.baseCtx = client.Context{}. - WithKeyring(s.kr). - WithTxConfig(s.encCfg.TxConfig). - WithCodec(s.encCfg.Codec). - WithClient(mockTendermintRPC{Client: rpcclientmock.New()}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard) -} - -func (s *CLITestSuite) createKeyringAccounts(num int) []account { - accounts := make([]account, num) - for i := range accounts { - record, _, err := s.kr.NewMnemonic( - fmt.Sprintf("key-%d", i), - keyring.English, - sdk.FullFundraiserPath, - keyring.DefaultBIP39Passphrase, - hd.Secp256k1) - s.Require().NoError(err) - - addr, err := record.GetAddress() - s.Require().NoError(err) - - accounts[i] = account{name: record.Name, address: addr} - } - - return accounts -} diff --git a/x/consensus_param/client/cli/tx.go b/x/consensus_param/client/cli/tx.go deleted file mode 100644 index b0bac9b8282d..000000000000 --- a/x/consensus_param/client/cli/tx.go +++ /dev/null @@ -1,144 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -var FlagSplit = "split" - -// NewTxCmd returns a root CLI command handler for all x/bank transaction commands. -func NewTxCmd() *cobra.Command { - txCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Bank transaction subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - txCmd.AddCommand( - NewSendTxCmd(), - NewMultiSendTxCmd(), - ) - - return txCmd -} - -// NewSendTxCmd returns a CLI command handler for creating a MsgSend transaction. -func NewSendTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "send [from_key_or_address] [to_address] [amount]", - Short: "Send funds from one account to another.", - Long: `Send funds from one account to another. -Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. -When using '--dry-run' a key name cannot be used, only a bech32 address. -`, - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) error { - cmd.Flags().Set(flags.FlagFrom, args[0]) - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - toAddr, err := sdk.AccAddressFromBech32(args[1]) - if err != nil { - return err - } - - coins, err := sdk.ParseCoinsNormalized(args[2]) - if err != nil { - return err - } - - msg := types.NewMsgSend(clientCtx.GetFromAddress(), toAddr, coins) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -// NewMultiSendTxCmd returns a CLI command handler for creating a MsgMultiSend transaction. -// For a better UX this command is limited to send funds from one account to two or more accounts. -func NewMultiSendTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "multi-send [from_key_or_address] [to_address_1, to_address_2, ...] [amount]", - Short: "Send funds from one account to two or more accounts.", - Long: `Send funds from one account to two or more accounts. -By default, sends the [amount] to each address of the list. -Using the '--split' flag, the [amount] is split equally between the addresses. -Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. -When using '--dry-run' a key name cannot be used, only a bech32 address. -`, - Args: cobra.MinimumNArgs(4), - RunE: func(cmd *cobra.Command, args []string) error { - cmd.Flags().Set(flags.FlagFrom, args[0]) - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - coins, err := sdk.ParseCoinsNormalized(args[len(args)-1]) - if err != nil { - return err - } - - if coins.IsZero() { - return fmt.Errorf("must send positive amount") - } - - split, err := cmd.Flags().GetBool(FlagSplit) - if err != nil { - return err - } - - totalAddrs := sdk.NewInt(int64(len(args) - 2)) - // coins to be received by the addresses - sendCoins := coins - if split { - sendCoins = coins.QuoInt(totalAddrs) - } - - var output []types.Output - for _, arg := range args[1 : len(args)-1] { - toAddr, err := sdk.AccAddressFromBech32(arg) - if err != nil { - return err - } - - output = append(output, types.NewOutput(toAddr, sendCoins)) - } - - // amount to be send from the from address - var amount sdk.Coins - if split { - // user input: 1000stake to send to 3 addresses - // actual: 333stake to each address (=> 999stake actually sent) - amount = sendCoins.MulInt(totalAddrs) - } else { - amount = coins.MulInt(totalAddrs) - } - - msg := types.NewMsgMultiSend([]types.Input{types.NewInput(clientCtx.FromAddress, amount)}, output) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().Bool(FlagSplit, false, "Send the equally split token amount to each address") - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/consensus_param/client/cli/tx_test.go b/x/consensus_param/client/cli/tx_test.go deleted file mode 100644 index ba0904f14f8e..000000000000 --- a/x/consensus_param/client/cli/tx_test.go +++ /dev/null @@ -1,211 +0,0 @@ -package cli_test - -import ( - "context" - "fmt" - "io" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/bank/client/cli" -) - -func (s *CLITestSuite) TestSendTxCmd() { - accounts := s.createKeyringAccounts(1) - cmd := cli.NewSendTxCmd() - cmd.SetOutput(io.Discard) - - extraArgs := []string{ - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("photon", sdk.NewInt(10))).String()), - fmt.Sprintf("--%s=test-chain", flags.FlagChainID), - } - - testCases := []struct { - name string - ctxGen func() client.Context - from, to sdk.AccAddress - amount sdk.Coins - extraArgs []string - expectErr bool - }{ - { - "valid transaction", - func() client.Context { - return s.baseCtx - }, - accounts[0].address, - accounts[0].address, - sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(10)), - sdk.NewCoin("photon", sdk.NewInt(40)), - ), - extraArgs, - false, - }, - { - "invalid to address", - func() client.Context { - return s.baseCtx - }, - accounts[0].address, - sdk.AccAddress{}, - sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(10)), - sdk.NewCoin("photon", sdk.NewInt(40)), - ), - extraArgs, - true, - }, - { - "invalid coins", - func() client.Context { - return s.baseCtx - }, - accounts[0].address, - accounts[0].address, - nil, - extraArgs, - true, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetContext(ctx) - cmd.SetArgs(append([]string{tc.from.String(), tc.to.String(), tc.amount.String()}, tc.extraArgs...)) - - s.Require().NoError(client.SetCmdClientContextHandler(tc.ctxGen(), cmd)) - - err := cmd.Execute() - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestMultiSendTxCmd() { - accounts := s.createKeyringAccounts(3) - - cmd := cli.NewMultiSendTxCmd() - cmd.SetOutput(io.Discard) - - extraArgs := []string{ - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("photon", sdk.NewInt(10))).String()), - fmt.Sprintf("--%s=test-chain", flags.FlagChainID), - } - - testCases := []struct { - name string - ctxGen func() client.Context - from string - to []string - amount sdk.Coins - extraArgs []string - expectErr bool - }{ - { - "valid transaction", - func() client.Context { - return s.baseCtx - }, - accounts[0].address.String(), - []string{ - accounts[1].address.String(), - accounts[2].address.String(), - }, - sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(10)), - sdk.NewCoin("photon", sdk.NewInt(40)), - ), - extraArgs, - false, - }, - { - "invalid from address", - func() client.Context { - return s.baseCtx - }, - "foo", - []string{ - accounts[1].address.String(), - accounts[2].address.String(), - }, - sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(10)), - sdk.NewCoin("photon", sdk.NewInt(40)), - ), - extraArgs, - true, - }, - { - "invalid recipients", - func() client.Context { - return s.baseCtx - }, - accounts[0].address.String(), - []string{ - accounts[1].address.String(), - "bar", - }, - sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(10)), - sdk.NewCoin("photon", sdk.NewInt(40)), - ), - extraArgs, - true, - }, - { - "invalid amount", - func() client.Context { - return s.baseCtx - }, - accounts[0].address.String(), - []string{ - accounts[1].address.String(), - accounts[2].address.String(), - }, - nil, - extraArgs, - true, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - var args []string - args = append(args, tc.from) - args = append(args, tc.to...) - args = append(args, tc.amount.String()) - args = append(args, tc.extraArgs...) - - cmd.SetContext(ctx) - cmd.SetArgs(args) - - s.Require().NoError(client.SetCmdClientContextHandler(tc.ctxGen(), cmd)) - - err := cmd.Execute() - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - } - }) - } -} diff --git a/x/consensus_param/exported/exported.go b/x/consensus_param/exported/exported.go index 258c111686a6..9a01ea72fb73 100644 --- a/x/consensus_param/exported/exported.go +++ b/x/consensus_param/exported/exported.go @@ -8,6 +8,7 @@ import ( // ProtocolVersionSetter defines the interface fulfilled by BaseApp // which allows setting it's appVersion field. type ConsensusParamSetter interface { - StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusParams) - GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams + Get(ctx sdk.Context, key []byte) (tmproto.ConsensusParams, error) + Has(ctx sdk.Context, key []byte) bool + Set(ctx sdk.Context, cp tmproto.ConsensusParams) } diff --git a/x/consensus_param/keeper/grpc_query.go b/x/consensus_param/keeper/grpc_query.go new file mode 100644 index 000000000000..e90e03c25881 --- /dev/null +++ b/x/consensus_param/keeper/grpc_query.go @@ -0,0 +1,37 @@ +package keeper + +import ( + "context" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/consensus_param/types" +) + +var _ types.QueryServer = Querier{} + +type Querier struct { + Keeper +} + +func NewQuerier(keeper Keeper) Querier { + return Querier{Keeper: keeper} +} + +// Balance implements the Query/Balance gRPC method +func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + + params, err := k.Keeper.Get(sdkCtx) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryParamsResponse{Params: params}, nil +} diff --git a/x/consensus_param/module.go b/x/consensus_param/module.go index 0ca4e015ebb7..6c7c0727383b 100644 --- a/x/consensus_param/module.go +++ b/x/consensus_param/module.go @@ -7,12 +7,6 @@ import ( "math/rand" "time" - modulev1 "cosmossdk.io/api/cosmos/bank/module/v1" - "cosmossdk.io/depinject" - store "github.com/cosmos/cosmos-sdk/store/types" - "github.com/tendermint/tendermint/crypto" - - "cosmossdk.io/core/appmodule" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" @@ -20,19 +14,14 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/telemetry" 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" - "github.com/cosmos/cosmos-sdk/x/bank/client/cli" - "github.com/cosmos/cosmos-sdk/x/bank/exported" - "github.com/cosmos/cosmos-sdk/x/bank/keeper" - v1bank "github.com/cosmos/cosmos-sdk/x/bank/migrations/v1" - "github.com/cosmos/cosmos-sdk/x/bank/simulation" - "github.com/cosmos/cosmos-sdk/x/bank/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/consensus_param/client/cli" + "github.com/cosmos/cosmos-sdk/x/consensus_param/exported" + "github.com/cosmos/cosmos-sdk/x/consensus_param/keeper" + "github.com/cosmos/cosmos-sdk/x/consensus_param/types" ) // ConsensusVersion defines the current x/bank module consensus version. @@ -114,18 +103,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - m := keeper.NewMigrator(am.keeper.(keeper.BaseKeeper), am.legacySubspace) - if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - panic(fmt.Sprintf("failed to migrate x/bank from version 1 to 2: %v", err)) - } - - if err := cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3); err != nil { - panic(fmt.Sprintf("failed to migrate x/bank from version 2 to 3: %v", err)) - } - - if err := cfg.RegisterMigration(types.ModuleName, 3, m.Migrate3to4); err != nil { - panic(fmt.Sprintf("failed to migrate x/bank from version 3 to 4: %v", err)) - } } // NewAppModule creates a new AppModule object @@ -175,7 +152,6 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // GenerateGenesisState creates a randomized GenState of the bank module. func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - simulation.RandomizedGenState(simState) } // ProposalContents doesn't return any content functions for governance proposals. @@ -197,77 +173,5 @@ func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - return simulation.WeightedOperations( - simState.AppParams, simState.Cdc, am.accountKeeper, am.keeper, - ) -} - -// New App Wiring Setup - -func init() { - appmodule.Register(&modulev1.Module{}, - appmodule.Provide( - provideModuleBasic, - provideModule)) -} - -func provideModuleBasic() runtime.AppModuleBasicWrapper { - return runtime.WrapAppModuleBasic(AppModuleBasic{}) -} - -type bankInputs struct { - depinject.In - - ModuleKey depinject.OwnModuleKey - Config *modulev1.Module - Cdc codec.Codec - Key *store.KVStoreKey - - AccountKeeper types.AccountKeeper - Authority map[string]sdk.AccAddress `optional:"true"` - - // LegacySubspace is used solely for migration of x/params managed parameters - LegacySubspace exported.Subspace -} - -type bankOutputs struct { - depinject.Out - - BankKeeper keeper.BaseKeeper - Module runtime.AppModuleWrapper -} - -func provideModule(in bankInputs) bankOutputs { - // configure blocked module accounts. - // - // default behavior for blockedAddresses is to regard any module mentioned in AccountKeeper's module account - // permissions as blocked. - blockedAddresses := make(map[string]bool) - if len(in.Config.BlockedModuleAccountsOverride) != 0 { - for _, moduleName := range in.Config.BlockedModuleAccountsOverride { - addr := sdk.AccAddress(crypto.AddressHash([]byte(moduleName))) - blockedAddresses[addr.String()] = true - } - } else { - for _, permission := range in.AccountKeeper.GetModulePermissions() { - blockedAddresses[permission.GetAddress().String()] = true - } - } - - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) - } - - bankKeeper := keeper.NewBaseKeeper( - in.Cdc, - in.Key, - in.AccountKeeper, - blockedAddresses, - authority.String(), - ) - m := NewAppModule(in.Cdc, bankKeeper, in.AccountKeeper, in.LegacySubspace) - - return bankOutputs{BankKeeper: bankKeeper, Module: runtime.WrapAppModule(m)} + return []simtypes.WeightedOperation{} } diff --git a/x/consensus_param/simulation/genesis.go b/x/consensus_param/simulation/genesis.go deleted file mode 100644 index 8592b08a318d..000000000000 --- a/x/consensus_param/simulation/genesis.go +++ /dev/null @@ -1,99 +0,0 @@ -package simulation - -// DONTCOVER - -import ( - "encoding/json" - "fmt" - "math/rand" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// RandomGenesisDefaultSendEnabledParam computes randomized allow all send transfers param for the bank module -func RandomGenesisDefaultSendEnabledParam(r *rand.Rand) bool { - // 90% chance of transfers being enabled or P(a) = 0.9 for success - return r.Int63n(100) < 90 -} - -// RandomGenesisSendEnabled creates randomized values for the SendEnabled slice. -func RandomGenesisSendEnabled(r *rand.Rand) []types.SendEnabled { - rv := make([]types.SendEnabled, 0, 2) - // 60% of the time, add a denom specific record. - if r.Int63n(100) < 60 { - // 75% of the those times, set send enabled to true. - bondEnabled := r.Int63n(100) < 75 - rv = append(rv, types.SendEnabled{Denom: sdk.DefaultBondDenom, Enabled: bondEnabled}) - } - // Probabilities: - // P(a) = 60.0% = There's SendEnable entry for the bond denom = .600 - // P(a)' = 40.0% = There is NOT a SendEnable entry for the bond denom = 1 - P(a) = 1 - .600 = .400 - // P(b) = 75.0% = The SendEnable entry is true (if there is such an entry) = .750 - // P(b)' = 25.0% = The SendEnable entry is false (if there is such an entry) = 1 - P(b) = 1 - .750 = .250 - // P(c) = 90.0% = The default send enabled is true (defined in RandomGenesisDefaultSendEnabledParam) = .900 - // P(c)' = 10.0% = The default send enabled is false = 1 - P(c) = 1 - .900 = .100 - // - // P(st) = 45.0% = There's a SendEnable entry that's true = P(a)*P(b) = .600*.750 = .450 - // P(sf) = 15.0% = There's a SendEnable entry that's false = P(a)*P(b)' = .600*.250 = .150 - // - // P(a'c) = 36.0% = No SendEnabled entry AND default is true = P(a)'*P(c) = .400*.900 = .360 - // P(a'c') = 4.0% = No SendEnabled entry AND default is false = P(a)'*P(c)' = .400*.100 = .040 - // P(stc) = 40.5% = SendEnabled entry is true AND default is true = P(st)*P(c) = .450*.900 = .405 - // P(stc') = 4.5% = SendEnabled entry is true AND default is false = P(st)*P(c)' = .450*.100 = .045 - // P(sfc) = 13.5% = SendEnabled entry is false AND default is true = P(sf)*P(c) = .150*.900 = .135 - // P(sfc') = 1.5% = SendEnabled entry is false AND default is false = P(sf)*P(c)' = .150*.100 = .015 - // - // P(set) = 42.0% = SendEnabled entry that equals the default = P(stc) + P(sfc') = .405 + .015 = .420 - // P(sef) = 18.0% = SendEnabled entry that does not equal the default = P(stc') + P(sfc) = .045 + .135 = .180 - // - // P(t) = 81.0% = Bond denom is sendable = P(a'c) + P(st) = .360 + .450 = .810 - // P(f) = 19.0% = Bond demon is NOT sendable = P(a'c') + P(sf) = .040 + .150 = .190 - - return rv -} - -// RandomGenesisBalances returns a slice of account balances. Each account has -// a balance of simState.InitialStake for sdk.DefaultBondDenom. -func RandomGenesisBalances(simState *module.SimulationState) []types.Balance { - genesisBalances := []types.Balance{} - - for _, acc := range simState.Accounts { - genesisBalances = append(genesisBalances, types.Balance{ - Address: acc.Address.String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, simState.InitialStake)), - }) - } - - return genesisBalances -} - -// RandomizedGenState generates a random GenesisState for bank -func RandomizedGenState(simState *module.SimulationState) { - var defaultSendEnabledParam bool - simState.AppParams.GetOrGenerate( - simState.Cdc, string(types.KeyDefaultSendEnabled), &defaultSendEnabledParam, simState.Rand, - func(r *rand.Rand) { defaultSendEnabledParam = RandomGenesisDefaultSendEnabledParam(r) }, - ) - - sendEnabled := RandomGenesisSendEnabled(simState.Rand) - - numAccs := int64(len(simState.Accounts)) - totalSupply := simState.InitialStake.Mul(sdk.NewInt((numAccs + simState.NumBonded))) - supply := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, totalSupply)) - - bankGenesis := types.GenesisState{ - Params: types.NewParams(defaultSendEnabledParam), - Balances: RandomGenesisBalances(simState), - Supply: supply, - SendEnabled: sendEnabled, - } - - paramsBytes, err := json.MarshalIndent(&bankGenesis.Params, "", " ") - if err != nil { - panic(err) - } - fmt.Printf("Selected randomly generated bank parameters:\n%s\n", paramsBytes) - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&bankGenesis) -} diff --git a/x/consensus_param/simulation/genesis_test.go b/x/consensus_param/simulation/genesis_test.go deleted file mode 100644 index 7782b6cd794f..000000000000 --- a/x/consensus_param/simulation/genesis_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package simulation_test - -import ( - "encoding/json" - "math/rand" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - sdkmath "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/bank/simulation" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. -// Abonormal scenarios are not tested here. -func TestRandomizedGenState(t *testing.T) { - interfaceRegistry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(interfaceRegistry) - s := rand.NewSource(1) - r := rand.New(s) - - simState := module.SimulationState{ - AppParams: make(simtypes.AppParams), - Cdc: cdc, - Rand: r, - NumBonded: 3, - Accounts: simtypes.RandomAccounts(r, 3), - InitialStake: sdkmath.NewInt(1000), - GenState: make(map[string]json.RawMessage), - } - - simulation.RandomizedGenState(&simState) - - var bankGenesis types.GenesisState - simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &bankGenesis) - - assert.Equal(t, true, bankGenesis.Params.GetDefaultSendEnabled(), "Params.GetDefaultSendEnabled") - assert.Len(t, bankGenesis.Params.GetSendEnabled(), 0, "Params.GetSendEnabled") - if assert.Len(t, bankGenesis.Balances, 3) { - assert.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", bankGenesis.Balances[2].GetAddress().String(), "Balances[2] address") - assert.Equal(t, "1000stake", bankGenesis.Balances[2].GetCoins().String(), "Balances[2] coins") - } - assert.Equal(t, "6000stake", bankGenesis.Supply.String(), "Supply") - if assert.Len(t, bankGenesis.SendEnabled, 1, "SendEnabled") { - assert.Equal(t, true, bankGenesis.SendEnabled[0].Enabled, "SendEnabled[0] value") - } -} - -// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. -func TestRandomizedGenState1(t *testing.T) { - interfaceRegistry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(interfaceRegistry) - - s := rand.NewSource(1) - r := rand.New(s) - - // all these tests will panic - tests := []struct { - simState module.SimulationState - panicMsg string - }{ - { // panic => reason: incomplete initialization of the simState - module.SimulationState{}, "invalid memory address or nil pointer dereference"}, - { // panic => reason: incomplete initialization of the simState - module.SimulationState{ - AppParams: make(simtypes.AppParams), - Cdc: cdc, - Rand: r, - }, "assignment to entry in nil map"}, - } - - for _, tt := range tests { - require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg) - } -} diff --git a/x/consensus_param/simulation/operations.go b/x/consensus_param/simulation/operations.go deleted file mode 100644 index 86ef2d496a46..000000000000 --- a/x/consensus_param/simulation/operations.go +++ /dev/null @@ -1,414 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/cosmos/cosmos-sdk/x/bank/types" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -// Simulation operation weights constants -//nolint:gosec // these are not hardcoded credentials. -const ( - OpWeightMsgSend = "op_weight_msg_send" - OpWeightMsgMultiSend = "op_weight_msg_multisend" -) - -// WeightedOperations returns all the operations from the module with their respective weights -func WeightedOperations( - appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, bk keeper.Keeper, -) simulation.WeightedOperations { - var weightMsgSend, weightMsgMultiSend int - appParams.GetOrGenerate(cdc, OpWeightMsgSend, &weightMsgSend, nil, - func(_ *rand.Rand) { - weightMsgSend = simappparams.DefaultWeightMsgSend - }, - ) - - appParams.GetOrGenerate(cdc, OpWeightMsgMultiSend, &weightMsgMultiSend, nil, - func(_ *rand.Rand) { - weightMsgMultiSend = simappparams.DefaultWeightMsgMultiSend - }, - ) - - return simulation.WeightedOperations{ - simulation.NewWeightedOperation( - weightMsgSend, - SimulateMsgSend(ak, bk), - ), - simulation.NewWeightedOperation( - weightMsgMultiSend, - SimulateMsgMultiSend(ak, bk), - ), - } -} - -// SimulateMsgSend tests and runs a single msg send where both -// accounts already exist. -func SimulateMsgSend(ak types.AccountKeeper, bk keeper.Keeper) simtypes.Operation { - return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, - accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - from, to, coins, skip := randomSendFields(r, ctx, accs, bk, ak) - - // if coins slice is empty, we can not create valid types.MsgSend - if len(coins) == 0 { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, "empty coins slice"), nil, nil - } - - // Check send_enabled status of each coin denom - if err := bk.IsSendEnabledCoins(ctx, coins...); err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, err.Error()), nil, nil - } - - if skip { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, "skip all transfers"), nil, nil - } - - msg := types.NewMsgSend(from.Address, to.Address, coins) - - err := sendMsgSend(r, app, bk, ak, msg, ctx, chainID, []cryptotypes.PrivKey{from.PrivKey}) - if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "invalid transfers"), nil, err - } - - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil - } -} - -// SimulateMsgSendToModuleAccount tests and runs a single msg send where both -// accounts already exist. -func SimulateMsgSendToModuleAccount(ak types.AccountKeeper, bk keeper.Keeper, moduleAccCount int) simtypes.Operation { - return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, - accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - from := accs[0] - - to := getModuleAccounts(ak, ctx, moduleAccCount)[0] - - spendable := bk.SpendableCoins(ctx, from.Address) - coins := simtypes.RandSubsetCoins(r, spendable) - // if coins slice is empty, we can not create valid types.MsgSend - if len(coins) == 0 { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, "empty coins slice"), nil, nil - } - - // Check send_enabled status of each coin denom - if err := bk.IsSendEnabledCoins(ctx, coins...); err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSend, err.Error()), nil, nil - } - - msg := types.NewMsgSend(from.Address, to.Address, coins) - - err := sendMsgSend(r, app, bk, ak, msg, ctx, chainID, []cryptotypes.PrivKey{from.PrivKey}) - if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "invalid transfers"), nil, err - } - - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil - } -} - -// sendMsgSend sends a transaction with a MsgSend from a provided random account. -func sendMsgSend( - r *rand.Rand, app *baseapp.BaseApp, bk keeper.Keeper, ak types.AccountKeeper, - msg *types.MsgSend, ctx sdk.Context, chainID string, privkeys []cryptotypes.PrivKey, -) error { - var ( - fees sdk.Coins - err error - ) - - from, err := sdk.AccAddressFromBech32(msg.FromAddress) - if err != nil { - return err - } - - account := ak.GetAccount(ctx, from) - spendable := bk.SpendableCoins(ctx, account.GetAddress()) - - coins, hasNeg := spendable.SafeSub(msg.Amount...) - if !hasNeg { - fees, err = simtypes.RandomFees(r, ctx, coins) - if err != nil { - return err - } - } - txGen := simappparams.MakeTestEncodingConfig().TxConfig - tx, err := simtestutil.GenSignedMockTx( - r, - txGen, - []sdk.Msg{msg}, - fees, - simtestutil.DefaultGenTxGas, - chainID, - []uint64{account.GetAccountNumber()}, - []uint64{account.GetSequence()}, - privkeys..., - ) - if err != nil { - return err - } - - _, _, err = app.SimDeliver(txGen.TxEncoder(), tx) - if err != nil { - return err - } - - return nil -} - -// SimulateMsgMultiSend tests and runs a single msg multisend, with randomized, capped number of inputs/outputs. -// all accounts in msg fields exist in state -func SimulateMsgMultiSend(ak types.AccountKeeper, bk keeper.Keeper) simtypes.Operation { - return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, - accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - // random number of inputs/outputs between [1, 3] - inputs := make([]types.Input, r.Intn(1)+1) //nolint:staticcheck // SA4030: (*math/rand.Rand).Intn(n) generates a random value 0 <= x < n; that is, the generated values don't include n; r.Intn(1) therefore always returns 0 - outputs := make([]types.Output, r.Intn(3)+1) - - // collect signer privKeys - privs := make([]cryptotypes.PrivKey, len(inputs)) - - // use map to check if address already exists as input - usedAddrs := make(map[string]bool) - - var totalSentCoins sdk.Coins - for i := range inputs { - // generate random input fields, ignore to address - from, _, coins, skip := randomSendFields(r, ctx, accs, bk, ak) - - // make sure account is fresh and not used in previous input - for usedAddrs[from.Address.String()] { - from, _, coins, skip = randomSendFields(r, ctx, accs, bk, ak) - } - - if skip { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgMultiSend, "skip all transfers"), nil, nil - } - - // set input address in used address map - usedAddrs[from.Address.String()] = true - - // set signer privkey - privs[i] = from.PrivKey - - // set next input and accumulate total sent coins - inputs[i] = types.NewInput(from.Address, coins) - totalSentCoins = totalSentCoins.Add(coins...) - } - - // Check send_enabled status of each sent coin denom - if err := bk.IsSendEnabledCoins(ctx, totalSentCoins...); err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgMultiSend, err.Error()), nil, nil - } - - for o := range outputs { - outAddr, _ := simtypes.RandomAcc(r, accs) - - var outCoins sdk.Coins - // split total sent coins into random subsets for output - if o == len(outputs)-1 { - outCoins = totalSentCoins - } else { - // take random subset of remaining coins for output - // and update remaining coins - outCoins = simtypes.RandSubsetCoins(r, totalSentCoins) - totalSentCoins = totalSentCoins.Sub(outCoins...) - } - - outputs[o] = types.NewOutput(outAddr.Address, outCoins) - } - - // remove any output that has no coins - - for i := 0; i < len(outputs); { - if outputs[i].Coins.Empty() { - outputs[i] = outputs[len(outputs)-1] - outputs = outputs[:len(outputs)-1] - } else { - // continue onto next coin - i++ - } - } - - msg := &types.MsgMultiSend{ - Inputs: inputs, - Outputs: outputs, - } - err := sendMsgMultiSend(r, app, bk, ak, msg, ctx, chainID, privs) - if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "invalid transfers"), nil, err - } - - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil - } -} - -// SimulateMsgMultiSendToModuleAccount sends coins to Module Accounts -func SimulateMsgMultiSendToModuleAccount(ak types.AccountKeeper, bk keeper.Keeper, moduleAccCount int) simtypes.Operation { - return func( - r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, - accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - inputs := make([]types.Input, 2) - outputs := make([]types.Output, moduleAccCount) - // collect signer privKeys - privs := make([]cryptotypes.PrivKey, len(inputs)) - var totalSentCoins sdk.Coins - for i := range inputs { - sender := accs[i] - privs[i] = sender.PrivKey - spendable := bk.SpendableCoins(ctx, sender.Address) - coins := simtypes.RandSubsetCoins(r, spendable) - inputs[i] = types.NewInput(sender.Address, coins) - totalSentCoins = totalSentCoins.Add(coins...) - } - if err := bk.IsSendEnabledCoins(ctx, totalSentCoins...); err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgMultiSend, err.Error()), nil, nil - } - moduleAccounts := getModuleAccounts(ak, ctx, moduleAccCount) - for i := range outputs { - var outCoins sdk.Coins - // split total sent coins into random subsets for output - if i == len(outputs)-1 { - outCoins = totalSentCoins - } else { - // take random subset of remaining coins for output - // and update remaining coins - outCoins = simtypes.RandSubsetCoins(r, totalSentCoins) - totalSentCoins = totalSentCoins.Sub(outCoins...) - } - outputs[i] = types.NewOutput(moduleAccounts[i].Address, outCoins) - } - // remove any output that has no coins - for i := 0; i < len(outputs); { - if outputs[i].Coins.Empty() { - outputs[i] = outputs[len(outputs)-1] - outputs = outputs[:len(outputs)-1] - } else { - // continue onto next coin - i++ - } - } - msg := &types.MsgMultiSend{ - Inputs: inputs, - Outputs: outputs, - } - err := sendMsgMultiSend(r, app, bk, ak, msg, ctx, chainID, privs) - if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "invalid transfers"), nil, err - } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil - } -} - -// sendMsgMultiSend sends a transaction with a MsgMultiSend from a provided random -// account. -func sendMsgMultiSend( - r *rand.Rand, app *baseapp.BaseApp, bk keeper.Keeper, ak types.AccountKeeper, - msg *types.MsgMultiSend, ctx sdk.Context, chainID string, privkeys []cryptotypes.PrivKey, -) error { - accountNumbers := make([]uint64, len(msg.Inputs)) - sequenceNumbers := make([]uint64, len(msg.Inputs)) - for i := 0; i < len(msg.Inputs); i++ { - addr := sdk.MustAccAddressFromBech32(msg.Inputs[i].Address) - acc := ak.GetAccount(ctx, addr) - accountNumbers[i] = acc.GetAccountNumber() - sequenceNumbers[i] = acc.GetSequence() - } - var ( - fees sdk.Coins - err error - ) - addr := sdk.MustAccAddressFromBech32(msg.Inputs[0].Address) - // feePayer is the first signer, i.e. first input address - feePayer := ak.GetAccount(ctx, addr) - spendable := bk.SpendableCoins(ctx, feePayer.GetAddress()) - coins, hasNeg := spendable.SafeSub(msg.Inputs[0].Coins...) - if !hasNeg { - fees, err = simtypes.RandomFees(r, ctx, coins) - if err != nil { - return err - } - } - txGen := simappparams.MakeTestEncodingConfig().TxConfig - tx, err := simtestutil.GenSignedMockTx( - r, - txGen, - []sdk.Msg{msg}, - fees, - simtestutil.DefaultGenTxGas, - chainID, - accountNumbers, - sequenceNumbers, - privkeys..., - ) - if err != nil { - return err - } - _, _, err = app.SimDeliver(txGen.TxEncoder(), tx) - if err != nil { - return err - } - return nil -} - -// randomSendFields returns the sender and recipient simulation accounts as well -// as the transferred amount. -func randomSendFields( - r *rand.Rand, ctx sdk.Context, accs []simtypes.Account, bk keeper.Keeper, ak types.AccountKeeper, -) (simtypes.Account, simtypes.Account, sdk.Coins, bool) { - from, _ := simtypes.RandomAcc(r, accs) - to, _ := simtypes.RandomAcc(r, accs) - - // disallow sending money to yourself - for from.PubKey.Equals(to.PubKey) { - to, _ = simtypes.RandomAcc(r, accs) - } - - acc := ak.GetAccount(ctx, from.Address) - if acc == nil { - return from, to, nil, true - } - - spendable := bk.SpendableCoins(ctx, acc.GetAddress()) - - sendCoins := simtypes.RandSubsetCoins(r, spendable) - if sendCoins.Empty() { - return from, to, nil, true - } - - return from, to, sendCoins, false -} - -func getModuleAccounts(ak types.AccountKeeper, ctx sdk.Context, moduleAccCount int) []simtypes.Account { - moduleAccounts := make([]simtypes.Account, moduleAccCount) - - for i := 0; i < moduleAccCount; i++ { - addr := ak.GetModuleAddress(distributiontypes.ModuleName) - acc := ak.GetAccount(ctx, addr) - mAcc := simtypes.Account{ - Address: acc.GetAddress(), - PrivKey: nil, - ConsKey: nil, - PubKey: acc.GetPubKey(), - } - moduleAccounts[i] = mAcc - } - - return moduleAccounts -} diff --git a/x/consensus_param/simulation/operations_test.go b/x/consensus_param/simulation/operations_test.go deleted file mode 100644 index 6a0b8c34ac67..000000000000 --- a/x/consensus_param/simulation/operations_test.go +++ /dev/null @@ -1,207 +0,0 @@ -package simulation_test - -import ( - "math/rand" - "testing" - - "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - "github.com/cosmos/cosmos-sdk/simapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/bank/simulation" - "github.com/cosmos/cosmos-sdk/x/bank/testutil" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -type SimTestSuite struct { - suite.Suite - - ctx sdk.Context - app *simapp.SimApp -} - -func (suite *SimTestSuite) SetupTest() { - checkTx := false - app := simapp.Setup(suite.T(), checkTx) - suite.app = app - suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{}) -} - -// TestWeightedOperations tests the weights of the operations. -func (suite *SimTestSuite) TestWeightedOperations() { - cdc := suite.app.AppCodec() - appParams := make(simtypes.AppParams) - - weightesOps := simulation.WeightedOperations(appParams, cdc, suite.app.AccountKeeper, suite.app.BankKeeper) - - // setup 3 accounts - s := rand.NewSource(1) - r := rand.New(s) - accs := suite.getTestingAccounts(r, 3) - - expected := []struct { - weight int - opMsgRoute string - opMsgName string - }{ - {simappparams.DefaultWeightMsgSend, types.ModuleName, types.TypeMsgSend}, - {simappparams.DefaultWeightMsgMultiSend, types.ModuleName, types.TypeMsgMultiSend}, - } - - for i, w := range weightesOps { - operationMsg, _, err := w.Op()(r, suite.app.BaseApp, suite.ctx, accs, "") - suite.Require().NoError(err) - - // the following checks are very much dependent from the ordering of the output given - // by WeightedOperations. if the ordering in WeightedOperations changes some tests - // will fail - suite.Require().Equal(expected[i].weight, w.Weight(), "weight should be the same") - suite.Require().Equal(expected[i].opMsgRoute, operationMsg.Route, "route should be the same") - suite.Require().Equal(expected[i].opMsgName, operationMsg.Name, "operation Msg name should be the same") - } -} - -// TestSimulateMsgSend tests the normal scenario of a valid message of type TypeMsgSend. -// Abonormal scenarios, where the message is created by an errors, are not tested here. -func (suite *SimTestSuite) TestSimulateMsgSend() { - // setup 3 accounts - s := rand.NewSource(1) - r := rand.New(s) - accounts := suite.getTestingAccounts(r, 3) - - // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) - - // execute operation - op := simulation.SimulateMsgSend(suite.app.AccountKeeper, suite.app.BankKeeper) - operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "") - suite.Require().NoError(err) - - var msg types.MsgSend - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - suite.Require().True(operationMsg.OK) - suite.Require().Equal("65337742stake", msg.Amount.String()) - suite.Require().Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.FromAddress) - suite.Require().Equal("cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.ToAddress) - suite.Require().Equal(types.TypeMsgSend, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) - suite.Require().Len(futureOperations, 0) -} - -// TestSimulateMsgSend tests the normal scenario of a valid message of type TypeMsgMultiSend. -// Abonormal scenarios, where the message is created by an errors, are not tested here. -func (suite *SimTestSuite) TestSimulateMsgMultiSend() { - // setup 3 accounts - s := rand.NewSource(1) - r := rand.New(s) - accounts := suite.getTestingAccounts(r, 3) - - // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) - - // execute operation - op := simulation.SimulateMsgMultiSend(suite.app.AccountKeeper, suite.app.BankKeeper) - operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "") - require := suite.Require() - require.NoError(err) - - var msg types.MsgMultiSend - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - require.True(operationMsg.OK) - require.Len(msg.Inputs, 1) - require.Equal("cosmos1tnh2q55v8wyygtt9srz5safamzdengsnqeycj3", msg.Inputs[0].Address) - require.Equal("114949958stake", msg.Inputs[0].Coins.String()) - require.Len(msg.Outputs, 2) - require.Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Outputs[1].Address) - require.Equal("107287087stake", msg.Outputs[1].Coins.String()) - require.Equal(types.TypeMsgMultiSend, msg.Type()) - require.Equal(types.ModuleName, msg.Route()) - require.Len(futureOperations, 0) -} - -func (suite *SimTestSuite) TestSimulateModuleAccountMsgSend() { - const ( - accCount = 1 - moduleAccCount = 1 - ) - - s := rand.NewSource(1) - r := rand.New(s) - accounts := suite.getTestingAccounts(r, accCount) - - // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) - - // execute operation - op := simulation.SimulateMsgSendToModuleAccount(suite.app.AccountKeeper, suite.app.BankKeeper, moduleAccCount) - - s = rand.NewSource(1) - r = rand.New(s) - - operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "") - suite.Require().Error(err) - - var msg types.MsgSend - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - suite.Require().False(operationMsg.OK) - suite.Require().Equal(operationMsg.Comment, "invalid transfers") - suite.Require().Equal(types.TypeMsgSend, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) - suite.Require().Len(futureOperations, 0) -} - -func (suite *SimTestSuite) TestSimulateMsgMultiSendToModuleAccount() { - const ( - accCount = 2 - mAccCount = 2 - ) - - s := rand.NewSource(1) - r := rand.New(s) - accounts := suite.getTestingAccounts(r, accCount) - - // begin a new block - suite.app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) - - // execute operation - op := simulation.SimulateMsgMultiSendToModuleAccount(suite.app.AccountKeeper, suite.app.BankKeeper, mAccCount) - - operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "") - suite.Require().Error(err) - - var msg types.MsgMultiSend - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - suite.Require().False(operationMsg.OK) // sending tokens to a module account should fail - suite.Require().Equal(operationMsg.Comment, "invalid transfers") - suite.Require().Equal(types.TypeMsgMultiSend, msg.Type()) - suite.Require().Equal(types.ModuleName, msg.Route()) - suite.Require().Len(futureOperations, 0) -} - -func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Account { - accounts := simtypes.RandomAccounts(r, n) - - initAmt := suite.app.StakingKeeper.TokensFromConsensusPower(suite.ctx, 200) - initCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initAmt)) - - // add coins to the accounts - for _, account := range accounts { - acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, account.Address) - suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - suite.Require().NoError(testutil.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins)) - } - - return accounts -} - -func TestSimTestSuite(t *testing.T) { - suite.Run(t, new(SimTestSuite)) -} diff --git a/x/consensus_param/simulation/params.go b/x/consensus_param/simulation/params.go deleted file mode 100644 index 08decd4e1e63..000000000000 --- a/x/consensus_param/simulation/params.go +++ /dev/null @@ -1,25 +0,0 @@ -package simulation - -// DONTCOVER - -import ( - "fmt" - "math/rand" - - "github.com/cosmos/cosmos-sdk/x/simulation" - - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// ParamChanges defines the parameters that can be modified by param change proposals -// on the simulation -func ParamChanges(r *rand.Rand) []simtypes.ParamChange { - return []simtypes.ParamChange{ - simulation.NewSimParamChange(types.ModuleName, string(types.KeyDefaultSendEnabled), - func(r *rand.Rand) string { - return fmt.Sprintf("%v", RandomGenesisDefaultSendEnabledParam(r)) - }, - ), - } -} diff --git a/x/consensus_param/simulation/params_test.go b/x/consensus_param/simulation/params_test.go deleted file mode 100644 index df6604367a1d..000000000000 --- a/x/consensus_param/simulation/params_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package simulation_test - -import ( - "math/rand" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/x/bank/simulation" -) - -func TestParamChanges(t *testing.T) { - s := rand.NewSource(1) - r := rand.New(s) - - expected := []struct { - composedKey string - key string - simValue string - subspace string - }{ - {"bank/DefaultSendEnabled", "DefaultSendEnabled", "true", "bank"}, - } - - paramChanges := simulation.ParamChanges(r) - - require.Len(t, paramChanges, len(expected)) - - for i, p := range paramChanges { - require.Equal(t, expected[i].composedKey, p.ComposedKey()) - require.Equal(t, expected[i].key, p.Key()) - require.Equal(t, expected[i].simValue, p.SimValue()(r)) - require.Equal(t, expected[i].subspace, p.Subspace()) - } -} diff --git a/x/consensus_param/types/query.pb.go b/x/consensus_param/types/query.pb.go index 4708226e0a1e..48bcf42011b7 100644 --- a/x/consensus_param/types/query.pb.go +++ b/x/consensus_param/types/query.pb.go @@ -69,7 +69,7 @@ var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo // QueryParamsResponse defines the response type for querying x/bank parameters. type QueryParamsResponse struct { - Params types.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Params *types.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -105,16 +105,16 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetParams() types.ConsensusParams { +func (m *QueryParamsResponse) GetParams() *types.ConsensusParams { if m != nil { return m.Params } - return types.ConsensusParams{} + return nil } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.consensus_param.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.consensus_param.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.consensus_param.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.consensus_param.v1.QueryParamsResponse") } func init() { @@ -122,28 +122,28 @@ func init() { } var fileDescriptor_3d2ae9668ec06671 = []byte{ - // 332 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x4f, 0x4b, 0x3b, 0x31, - 0x10, 0xdd, 0xfc, 0xf8, 0xd9, 0xc3, 0x7a, 0x5b, 0x7b, 0x90, 0x6a, 0xa3, 0x56, 0x04, 0x11, 0xcc, - 0xd0, 0xd6, 0xbb, 0xa0, 0x77, 0xd1, 0x1e, 0x3c, 0x78, 0x91, 0x6c, 0x1b, 0xd6, 0xa5, 0x6e, 0x26, - 0xdd, 0x64, 0x8b, 0xbd, 0xfa, 0x09, 0x04, 0xc1, 0xb3, 0x1f, 0xa7, 0xc7, 0x82, 0x17, 0x4f, 0x22, - 0xad, 0x1f, 0x44, 0x36, 0x89, 0xf5, 0x4f, 0x41, 0xf0, 0x94, 0x61, 0xe6, 0xbd, 0x37, 0x2f, 0x2f, - 0x09, 0x77, 0xba, 0xa8, 0x33, 0xd4, 0xd0, 0x45, 0xa9, 0x85, 0xd4, 0x85, 0xbe, 0x54, 0x3c, 0xe7, - 0x19, 0x0c, 0x9b, 0x30, 0x28, 0x44, 0x3e, 0x62, 0x2a, 0x47, 0x83, 0x11, 0x75, 0x30, 0xf6, 0x03, - 0xc6, 0x86, 0xcd, 0x58, 0x18, 0xde, 0xac, 0xed, 0x79, 0x99, 0x98, 0x6b, 0xe1, 0x88, 0xe0, 0x47, - 0xa0, 0x78, 0x92, 0x4a, 0x6e, 0x52, 0x94, 0x4e, 0xab, 0x56, 0x4d, 0x30, 0x41, 0x5b, 0x42, 0x59, - 0xf9, 0xee, 0x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, 0x2f, 0x02, 0x00, 0x00, + // 323 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0x3f, 0x4b, 0x3b, 0x41, + 0x10, 0xcd, 0xfe, 0xe0, 0x97, 0xe2, 0xec, 0xce, 0x14, 0x1a, 0xcd, 0xa2, 0x11, 0x41, 0x84, 0xec, + 0x70, 0xd1, 0xc6, 0x56, 0x7b, 0x89, 0x96, 0x36, 0xb2, 0x97, 0x2c, 0xeb, 0x11, 0x6f, 0x67, 0x73, + 0xbb, 0x17, 0x4c, 0x6b, 0x6d, 0x21, 0x08, 0x7e, 0x26, 0xcb, 0x80, 0x8d, 0xa5, 0x24, 0x7e, 0x10, + 0xb9, 0xdd, 0x35, 0xfe, 0x09, 0x82, 0xd5, 0x0e, 0x33, 0xef, 0xbd, 0x79, 0xfb, 0x26, 0xda, 0xed, + 0xa3, 0xc9, 0xd1, 0x40, 0x1f, 0x95, 0x11, 0xca, 0x94, 0xe6, 0x52, 0xf3, 0x82, 0xe7, 0x30, 0x4e, + 0x60, 0x54, 0x8a, 0x62, 0xc2, 0x74, 0x81, 0x16, 0xe3, 0x75, 0x0f, 0x63, 0x3f, 0x60, 0x6c, 0x9c, + 0x34, 0xf7, 0x83, 0x42, 0xca, 0x8d, 0xf0, 0x1c, 0x18, 0x27, 0xa9, 0xb0, 0x3c, 0x01, 0xcd, 0x65, + 0xa6, 0xb8, 0xcd, 0x50, 0x79, 0x99, 0x66, 0x43, 0xa2, 0x44, 0x57, 0x42, 0x55, 0x85, 0xee, 0xa6, + 0x44, 0x94, 0xd7, 0x02, 0xb8, 0xce, 0x80, 0x2b, 0x85, 0xd6, 0x51, 0x4c, 0x98, 0xb6, 0xac, 0x50, + 0x03, 0x51, 0xe4, 0x99, 0xb2, 0x60, 0x27, 0x5a, 0x18, 0x70, 0xab, 0xc3, 0xb8, 0xdd, 0x88, 0xe2, + 0xb3, 0x6a, 0x69, 0xcf, 0x35, 0xcf, 0xc5, 0xa8, 0x14, 0xc6, 0xb6, 0x7b, 0xd1, 0xea, 0xb7, 0xae, + 0xd1, 0x95, 0xf1, 0xf8, 0x28, 0xaa, 0x7b, 0xf2, 0x1a, 0xd9, 0x22, 0x7b, 0x2b, 0xdd, 0x6d, 0xf6, + 0x29, 0xce, 0x9c, 0x38, 0x3b, 0xf9, 0xf8, 0x61, 0xa0, 0x06, 0x42, 0xf7, 0x91, 0x44, 0xff, 0x9d, + 0x64, 0x7c, 0x47, 0xa2, 0xba, 0x1f, 0xc6, 0x1d, 0xf6, 0x6b, 0x2e, 0x6c, 0xd9, 0x55, 0x93, 0xfd, + 0x15, 0xee, 0xed, 0xb6, 0x77, 0x6e, 0x9f, 0xdf, 0x1e, 0xfe, 0xb5, 0xe2, 0x0d, 0x58, 0x64, 0xac, + 0x86, 0x5f, 0xd2, 0xad, 0xc0, 0xc7, 0xa7, 0x4f, 0x33, 0x4a, 0xa6, 0x33, 0x4a, 0x5e, 0x67, 0x94, + 0xdc, 0xcf, 0x69, 0x6d, 0x3a, 0xa7, 0xb5, 0x97, 0x39, 0xad, 0x5d, 0x1c, 0xca, 0xcc, 0x5e, 0x95, + 0x29, 0xeb, 0x63, 0x0e, 0x8b, 0x33, 0x57, 0x4f, 0xc7, 0x0c, 0x86, 0x70, 0xb3, 0x74, 0x73, 0x17, + 0x40, 0x5a, 0x77, 0xb9, 0x1e, 0xbc, 0x07, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xfa, 0x35, 0x91, 0x1a, + 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -172,7 +172,7 @@ func NewQueryClient(cc *grpc.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1beta1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -207,7 +207,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.consensus_param.v1beta1.Query/Params", + FullMethod: "/cosmos.consensus_param.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -216,7 +216,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.consensus_param.v1beta1.Query", + ServiceName: "cosmos.consensus_param.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -271,16 +271,18 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + 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 -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -310,8 +312,10 @@ func (m *QueryParamsResponse) Size() (n int) { } var l int _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -429,6 +433,9 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Params == nil { + m.Params = &types.ConsensusParams{} + } if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/consensus_param/types/tx.pb.go b/x/consensus_param/types/tx.pb.go index c9ff74108425..d08f4d6a5234 100644 --- a/x/consensus_param/types/tx.pb.go +++ b/x/consensus_param/types/tx.pb.go @@ -36,7 +36,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 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/bank parameters to update. + // params defines the x/consensus_params parameters to update. // // NOTE: All parameters must be supplied. Params types.ConsensusParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` @@ -130,8 +130,8 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.consensus_param.v1beta1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.consensus_param.v1beta1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.consensus_param.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.consensus_param.v1.MsgUpdateParamsResponse") } func init() { @@ -139,29 +139,28 @@ func init() { } var fileDescriptor_512bd98009ecbd38 = []byte{ - // 340 bytes of a gzipped FileDescriptorProto + // 334 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0x8e, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, - 0x83, 0xa8, 0xd1, 0x43, 0x53, 0xa3, 0x57, 0x66, 0x98, 0x94, 0x5a, 0x92, 0x68, 0x28, 0x25, 0x92, - 0x9e,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0x07, 0xc5, 0xe9, 0xfa, 0x7a, 0xf8, 0x03, 0x56, - 0x0f, 0xcd, 0x3c, 0x29, 0x73, 0x12, 0x35, 0xc0, 0x1c, 0xe0, 0xe4, 0x77, 0xe2, 0x91, 0x1c, 0xe3, - 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, - 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x26, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, - 0xb9, 0xfa, 0xf0, 0xa4, 0x00, 0xa2, 0x74, 0x8b, 0x53, 0xb2, 0xf5, 0x2b, 0x30, 0xd2, 0x05, 0x38, - 0x64, 0x92, 0xd8, 0xc0, 0xf1, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x24, 0x41, 0xec, 0x6a, - 0x3e, 0x02, 0x00, 0x00, + 0x84, 0xa8, 0xd1, 0x43, 0x53, 0xa3, 0x57, 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, + 0xa5, 0x0f, 0x62, 0x41, 0x34, 0x48, 0x41, 0x35, 0xc4, 0x43, 0x24, 0xa0, 0xba, 0x21, 0x52, 0xe2, + 0x50, 0xfb, 0x72, 0x8b, 0xd3, 0x41, 0x76, 0xe4, 0x16, 0xa7, 0x43, 0x25, 0x64, 0x4b, 0x52, 0xf3, + 0x52, 0x52, 0x8b, 0x72, 0x33, 0xf3, 0x4a, 0xf4, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0xf5, 0xc1, 0x96, + 0x40, 0xf5, 0x29, 0xcd, 0x62, 0xe4, 0xe2, 0xf7, 0x2d, 0x4e, 0x0f, 0x2d, 0x48, 0x49, 0x2c, 0x49, + 0x0d, 0x00, 0xcb, 0x08, 0x99, 0x71, 0x71, 0x26, 0x96, 0x96, 0x64, 0xe4, 0x17, 0x65, 0x96, 0x54, + 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x49, 0x5c, 0xda, 0xa2, 0x2b, 0x02, 0xb5, 0xd0, 0x31, + 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, 0x33, 0x2f, 0x3d, 0x08, 0xa1, 0x54, 0xc8, + 0x9e, 0x8b, 0x0d, 0x62, 0xb6, 0x04, 0x93, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xa2, 0x1e, 0xc2, 0x6e, + 0x3d, 0xb0, 0xdd, 0x7a, 0xce, 0x30, 0xaf, 0x42, 0xac, 0x72, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, + 0x08, 0xaa, 0xcd, 0x8a, 0xaf, 0xe9, 0xf9, 0x06, 0x2d, 0x84, 0x81, 0x4a, 0x92, 0x5c, 0xe2, 0x68, + 0x6e, 0x0b, 0x4a, 0x2d, 0x2e, 0x00, 0x19, 0x61, 0x54, 0xca, 0xc5, 0xec, 0x5b, 0x9c, 0x2e, 0x94, + 0xc7, 0xc5, 0x83, 0xe2, 0x74, 0x2d, 0x3d, 0x9c, 0x61, 0xaa, 0x87, 0x66, 0x94, 0x94, 0x11, 0xf1, + 0x6a, 0x61, 0xd6, 0x3a, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, + 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, + 0x49, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x3c, 0xee, 0x41, 0x94, + 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, 0x46, 0x42, 0x00, 0x87, 0x47, 0x12, 0x1b, 0x38, 0x16, 0x8c, + 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x27, 0xa5, 0x61, 0x2f, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -193,7 +192,7 @@ func NewMsgClient(cc *grpc.ClientConn) MsgClient { func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1beta1.Msg/UpdateParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1.Msg/UpdateParams", in, out, opts...) if err != nil { return nil, err } @@ -231,7 +230,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.consensus_param.v1beta1.Msg/UpdateParams", + FullMethod: "/cosmos.consensus_param.v1.Msg/UpdateParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) @@ -240,7 +239,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.consensus_param.v1beta1.Msg", + ServiceName: "cosmos.consensus_param.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { From f88a482ac1976eb733adcd412fd0892669e5df9e Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 11 Aug 2022 11:47:39 +0200 Subject: [PATCH 03/60] comment out tests --- baseapp/abci_test.go | 2 +- baseapp/baseapp_test.go | 4 +- x/consensus_param/module.go | 107 ++++++----------------------- x/params/module.go | 7 +- x/params/types/consensus_params.go | 26 ------- 5 files changed, 27 insertions(+), 119 deletions(-) delete mode 100644 x/params/types/consensus_params.go diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index c33b3c79ecf7..6195dff9d029 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -109,7 +109,7 @@ func TestGetBlockRentionHeight(t *testing.T) { for name, tc := range testCases { tc := tc - tc.bapp.SetParamStore(¶mStore{db: dbm.NewMemDB()}) + // tc.bapp.SetParamStore(¶mStore{db: dbm.NewMemDB()}) tc.bapp.InitChain(abci.RequestInitChain{ ConsensusParams: &tmprototypes.ConsensusParams{ Evidence: &tmprototypes.EvidenceParams{ diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 5be9331b6260..70b45affdd24 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -125,7 +125,7 @@ func setupBaseApp(t *testing.T, options ...func(*BaseApp)) *BaseApp { require.Equal(t, t.Name(), app.Name()) app.MountStores(capKey1, capKey2) - app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) + // app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) // stores are mounted err := app.LoadLatestVersion() @@ -2191,7 +2191,7 @@ func TestBaseApp_EndBlock(t *testing.T) { } app := NewBaseApp(name, logger, db, nil) - app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) + // app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) app.InitChain(abci.RequestInitChain{ ConsensusParams: cp, }) diff --git a/x/consensus_param/module.go b/x/consensus_param/module.go index 6c7c0727383b..81f634cac803 100644 --- a/x/consensus_param/module.go +++ b/x/consensus_param/module.go @@ -3,9 +3,6 @@ package bank import ( "context" "encoding/json" - "fmt" - "math/rand" - "time" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -14,23 +11,19 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/consensus_param/client/cli" "github.com/cosmos/cosmos-sdk/x/consensus_param/exported" "github.com/cosmos/cosmos-sdk/x/consensus_param/keeper" "github.com/cosmos/cosmos-sdk/x/consensus_param/types" ) // ConsensusVersion defines the current x/bank module consensus version. -const ConsensusVersion = 4 +const ConsensusVersion = 1 var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} ) // AppModuleBasic defines the basic application module used by the bank module. @@ -42,57 +35,46 @@ type AppModuleBasic struct { func (AppModuleBasic) Name() string { return types.ModuleName } // RegisterLegacyAminoCodec registers the bank module's types on the LegacyAmino codec. -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterLegacyAminoCodec(cdc) -} +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} // DefaultGenesis returns default genesis state as raw bytes for the bank // module. func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesisState()) + return nil } -// ValidateGenesis performs genesis state validation for the bank module. +// ValidateGenesis performs genesis state validation func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { - var data types.GenesisState - if err := cdc.UnmarshalJSON(bz, &data); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - - return data.Validate() + return nil } -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the bank module. +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { panic(err) } } -// GetTxCmd returns the root tx command for the bank module. +// GetTxCmd returns the root tx command func (AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() + return nil } -// GetQueryCmd returns no root query command for the bank module. +// GetQueryCmd returns no root query command func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() + return nil } // RegisterInterfaces registers interfaces and implementations of the bank module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) - - // Register legacy interfaces for migration scripts. - v1bank.RegisterInterfaces(registry) } -// AppModule implements an application module for the bank module. +// AppModule implements an application module type AppModule struct { AppModuleBasic - keeper keeper.Keeper - accountKeeper types.AccountKeeper + keeper keeper.Keeper // legacySubspace is used solely for migration of x/params managed parameters legacySubspace exported.Subspace @@ -101,16 +83,15 @@ type AppModule struct { // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(am.keeper)) } // NewAppModule creates a new AppModule object -func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, accountKeeper types.AccountKeeper, ss exported.Subspace) AppModule { +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ss exported.Subspace) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, keeper: keeper, - accountKeeper: accountKeeper, legacySubspace: ss, } } @@ -118,60 +99,16 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, accountKeeper types.Acc // Name returns the bank module's name. func (AppModule) Name() string { return types.ModuleName } -// RegisterInvariants registers the bank module invariants. -func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { - keeper.RegisterInvariants(ir, am.keeper) -} - -// QuerierRoute returns the bank module's querier route name. -func (AppModule) QuerierRoute() string { return types.RouterKey } - -// InitGenesis performs genesis initialization for the bank module. It returns -// no validator updates. +// InitGenesis is handled by for init genesis of consensus params func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - start := time.Now() - var genesisState types.GenesisState - cdc.MustUnmarshalJSON(data, &genesisState) - telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") - - am.keeper.InitGenesis(ctx, &genesisState) - return []abci.ValidatorUpdate{} + return nil } -// ExportGenesis returns the exported genesis state as raw bytes for the bank -// module. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - gs := am.keeper.ExportGenesis(ctx) - return cdc.MustMarshalJSON(gs) -} +// ExportGenesis is handled by tendermint export of genesis +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { return nil } // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } -// AppModuleSimulation functions - -// GenerateGenesisState creates a randomized GenState of the bank module. -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { -} - -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - -// RandomizedParams creates randomized distribution param changes for the simulator. - -// 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 supply module's types -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - return []simtypes.WeightedOperation{} -} +// RegisterInvariants does nothing, there are no invariants to enforce +func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} diff --git a/x/params/module.go b/x/params/module.go index 82ccd75c48a1..31e58ba7e98b 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -16,7 +16,6 @@ import ( "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -172,13 +171,11 @@ type paramsOutputs struct { func provideModule(in paramsInputs) paramsOutputs { k := keeper.NewKeeper(in.Cdc, in.LegacyAmino, in.KvStoreKey, in.TransientStoreKey) - baseappOpt := func(app *baseapp.BaseApp) { - app.SetParamStore(k.Subspace(baseapp.Paramspace).WithKeyTable(types.ConsensusParamsKeyTable())) - } + m := runtime.WrapAppModule(NewAppModule(k)) govHandler := govv1beta1.HandlerRoute{RouteKey: proposal.RouterKey, Handler: NewParamChangeProposalHandler(k)} - return paramsOutputs{ParamsKeeper: k, BaseAppOption: baseappOpt, Module: m, GovHandler: govHandler} + return paramsOutputs{ParamsKeeper: k, Module: m, GovHandler: govHandler} } type subspaceInputs struct { diff --git a/x/params/types/consensus_params.go b/x/params/types/consensus_params.go deleted file mode 100644 index 4c7edb562090..000000000000 --- a/x/params/types/consensus_params.go +++ /dev/null @@ -1,26 +0,0 @@ -package types - -import ( - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - "github.com/cosmos/cosmos-sdk/baseapp" -) - -// ConsensusParamsKeyTable returns an x/params module keyTable to be used in -// the BaseApp's ParamStore. The KeyTable registers the types along with the -// standard validation functions. Applications can choose to adopt this KeyTable -// or provider their own when the existing validation functions do not suite their -// needs. -func ConsensusParamsKeyTable() KeyTable { - return NewKeyTable( - NewParamSetPair( - baseapp.ParamStoreKeyBlockParams, tmproto.BlockParams{}, baseapp.ValidateBlockParams, - ), - NewParamSetPair( - baseapp.ParamStoreKeyEvidenceParams, tmproto.EvidenceParams{}, baseapp.ValidateEvidenceParams, - ), - NewParamSetPair( - baseapp.ParamStoreKeyValidatorParams, tmproto.ValidatorParams{}, baseapp.ValidateValidatorParams, - ), - ) -} From 99a14764a8d1b93bc38a2eb6c0ce4e704c357582 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 11 Aug 2022 12:11:03 +0200 Subject: [PATCH 04/60] setup legacy app --- baseapp/baseapp.go | 18 ++++++++--------- baseapp/params.go | 6 +++--- simapp/app_legacy.go | 9 +++++++-- x/consensus_param/exported/exported.go | 6 +++--- x/consensus_param/keeper/grpc_query.go | 4 ---- x/consensus_param/keeper/keeper.go | 27 ++++++++++---------------- x/consensus_param/types/params.go | 15 +------------- 7 files changed, 33 insertions(+), 52 deletions(-) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index d831541a003c..36d1372e4fe4 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -426,14 +426,7 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams panic(err) } - return &cp -} - -// AddRunTxRecoveryHandler adds custom app.runTx method panic handlers. -func (app *BaseApp) AddRunTxRecoveryHandler(handlers ...RecoveryHandler) { - for _, h := range handlers { - app.runTxRecoveryMiddleware = newRecoveryMiddleware(h, app.runTxRecoveryMiddleware) - } + return cp } // StoreConsensusParams sets the consensus parameters to the baseapp's param store. @@ -446,11 +439,18 @@ func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusP return } - app.paramStore.Set(ctx, *cp) + app.paramStore.Set(ctx, cp) // We're explicitly not storing the Tendermint app_version in the param store. It's // stored instead in the x/upgrade store, with its own bump logic. } +// AddRunTxRecoveryHandler adds custom app.runTx method panic handlers. +func (app *BaseApp) AddRunTxRecoveryHandler(handlers ...RecoveryHandler) { + for _, h := range handlers { + app.runTxRecoveryMiddleware = newRecoveryMiddleware(h, app.runTxRecoveryMiddleware) + } +} + // getMaximumBlockGas gets the maximum gas from the consensus params. It panics // if maximum block gas is less than negative one and returns zero if negative // one. diff --git a/baseapp/params.go b/baseapp/params.go index 021ba6bed900..dec49a22e0dd 100644 --- a/baseapp/params.go +++ b/baseapp/params.go @@ -9,7 +9,7 @@ import ( // ParamStore defines the interface the parameter store used by the BaseApp must // fulfill. type ParamStore interface { - Get(ctx sdk.Context) (tmproto.ConsensusParams, error) - Has(ctx sdk.Context, key []byte) bool - Set(ctx sdk.Context, cp tmproto.ConsensusParams) + Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) + Has(ctx sdk.Context) bool + Set(ctx sdk.Context, cp *tmproto.ConsensusParams) } diff --git a/simapp/app_legacy.go b/simapp/app_legacy.go index 0ec50e6468fd..e761bce6a0f1 100644 --- a/simapp/app_legacy.go +++ b/simapp/app_legacy.go @@ -53,6 +53,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/capability" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus_param/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus_param/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" @@ -184,6 +186,7 @@ type SimApp struct { FeeGrantKeeper feegrantkeeper.Keeper GroupKeeper groupkeeper.Keeper NFTKeeper nftkeeper.Keeper + ConsensusParams consensusparamkeeper.Keeper // the module manager ModuleManager *module.Manager @@ -228,7 +231,7 @@ func NewSimApp( keys := sdk.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, crisistypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, + govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, capabilitytypes.StoreKey, authzkeeper.StoreKey, nftkeeper.StoreKey, group.StoreKey, ) @@ -256,8 +259,10 @@ func NewSimApp( app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) + app.ConsensusParams = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) + // set the BaseApp's parameter store - bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())) + bApp.SetParamStore(&app.ConsensusParams) app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) // Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating diff --git a/x/consensus_param/exported/exported.go b/x/consensus_param/exported/exported.go index 9a01ea72fb73..7d17fc4f057c 100644 --- a/x/consensus_param/exported/exported.go +++ b/x/consensus_param/exported/exported.go @@ -8,7 +8,7 @@ import ( // ProtocolVersionSetter defines the interface fulfilled by BaseApp // which allows setting it's appVersion field. type ConsensusParamSetter interface { - Get(ctx sdk.Context, key []byte) (tmproto.ConsensusParams, error) - Has(ctx sdk.Context, key []byte) bool - Set(ctx sdk.Context, cp tmproto.ConsensusParams) + Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) + Has(ctx sdk.Context) bool + Set(ctx sdk.Context, cp *tmproto.ConsensusParams) } diff --git a/x/consensus_param/keeper/grpc_query.go b/x/consensus_param/keeper/grpc_query.go index e90e03c25881..ebd03e95117a 100644 --- a/x/consensus_param/keeper/grpc_query.go +++ b/x/consensus_param/keeper/grpc_query.go @@ -22,10 +22,6 @@ func NewQuerier(keeper Keeper) Querier { // Balance implements the Query/Balance gRPC method func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - sdkCtx := sdk.UnwrapSDKContext(ctx) params, err := k.Keeper.Get(sdkCtx) diff --git a/x/consensus_param/keeper/keeper.go b/x/consensus_param/keeper/keeper.go index 85171643ab64..dcf7b7c8c8cf 100644 --- a/x/consensus_param/keeper/keeper.go +++ b/x/consensus_param/keeper/keeper.go @@ -10,30 +10,23 @@ import ( "github.com/cosmos/cosmos-sdk/x/consensus_param/types" ) +var _ exported.ConsensusParamSetter = (*Keeper)(nil) + type Keeper struct { - storeKey storetypes.StoreKey - cdc codec.BinaryCodec - paramSetter exported.ConsensusParamSetter - authority string + storeKey storetypes.StoreKey + cdc codec.BinaryCodec + + authority string } -func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramSetter exported.ConsensusParamSetter, authority string) Keeper { +func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, authority string) Keeper { return Keeper{ - storeKey: storeKey, - cdc: cdc, - paramSetter: paramSetter, - authority: authority, + storeKey: storeKey, + cdc: cdc, + authority: authority, } } -func (k *Keeper) SetParamSetter(paramSetter exported.ConsensusParamSetter) { - k.paramSetter = paramSetter -} - -func (k *Keeper) GetParamSetter() exported.ConsensusParamSetter { - return k.paramSetter -} - func (k *Keeper) GetAuthority() string { return k.authority } diff --git a/x/consensus_param/types/params.go b/x/consensus_param/types/params.go index 7f96bb630fa8..f04556c6b6ff 100644 --- a/x/consensus_param/types/params.go +++ b/x/consensus_param/types/params.go @@ -4,20 +4,7 @@ import ( tmtypes "github.com/tendermint/tendermint/types" ) -// DefaultDefaultSendEnabled is the value that DefaultSendEnabled will have from DefaultParams(). -var DefaultDefaultSendEnabled = true - -// NewParams creates a new parameter configuration for the bank module -func NewParams(defaultSendEnabled bool) tmtypes.ConsensusParams { - return tmtypes.ConsensusParams{} -} - -// DefaultParams is the default parameter configuration for the bank module -func DefaultParams() tmtypes.ConsensusParams { - return tmtypes.ConsensusParams{} -} - -// Validate all bank module parameters +// Validate all module parameters func Validate(p tmtypes.ConsensusParams) error { return p.ValidateConsensusParams() From bd70956b0972e42eed4dc8782b1270aedf5212cf Mon Sep 17 00:00:00 2001 From: Jeancarlo Barrios Date: Mon, 29 Aug 2022 10:25:02 -0600 Subject: [PATCH 05/60] feat: minor improvements to pr (#13031) * remove lint error for accountkeeper and bankkeeper cant be nil * regenerated protos with removing some unused imports * add legacy exported + keeper and module dep inject functions --- api/cosmos/consensus_param/v1/query.pulsar.go | 78 +++++++++---------- baseapp/grpcrouter.go | 5 +- client/grpc/reflection/reflection.pb.go | 7 +- client/grpc/tmservice/query.pb.go | 7 +- proto/cosmos/consensus_param/v1/query.proto | 2 - x/auth/ante/ante.go | 5 +- x/consensus_param/exported/exported.go | 24 ++++-- x/consensus_param/keeper/grpc_query.go | 4 +- x/consensus_param/keeper/keeper.go | 4 +- x/consensus_param/module.go | 62 +++++++++++++-- x/consensus_param/types/query.pb.go | 51 ++++++------ x/consensus_param/types/tx.pb.go | 7 +- 12 files changed, 154 insertions(+), 102 deletions(-) diff --git a/api/cosmos/consensus_param/v1/query.pulsar.go b/api/cosmos/consensus_param/v1/query.pulsar.go index a3025a6b2bb1..7e7c6cf7b53c 100644 --- a/api/cosmos/consensus_param/v1/query.pulsar.go +++ b/api/cosmos/consensus_param/v1/query.pulsar.go @@ -2,11 +2,9 @@ package consensus_paramv1 import ( - _ "cosmossdk.io/api/cosmos/base/query/v1beta1" types "cosmossdk.io/api/tendermint/types" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/gogo/protobuf/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" @@ -890,46 +888,42 @@ var file_cosmos_consensus_param_v1_query_proto_rawDesc = []byte{ 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, - 0x76, 0x31, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, - 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, - 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x96, 0x01, 0x0a, 0x05, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x8c, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2d, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, - 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x42, 0xeb, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x96, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x8c, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, + 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0xeb, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, + 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/baseapp/grpcrouter.go b/baseapp/grpcrouter.go index 3e3e54691a7f..72ec5320206d 100644 --- a/baseapp/grpcrouter.go +++ b/baseapp/grpcrouter.go @@ -114,8 +114,5 @@ func (qrt *GRPCQueryRouter) SetInterfaceRegistry(interfaceRegistry codectypes.In qrt.cdc = codec.NewProtoCodec(interfaceRegistry).GRPCCodec() // Once we have an interface registry, we can register the interface // registry reflection gRPC service. - reflection.RegisterReflectionServiceServer( - qrt, - reflection.NewReflectionServiceServer(interfaceRegistry), - ) + reflection.RegisterReflectionServiceServer(qrt, reflection.NewReflectionServiceServer(interfaceRegistry)) } diff --git a/client/grpc/reflection/reflection.pb.go b/client/grpc/reflection/reflection.pb.go index 271b71fe9295..66dbef0c7105 100644 --- a/client/grpc/reflection/reflection.pb.go +++ b/client/grpc/reflection/reflection.pb.go @@ -6,6 +6,7 @@ package reflection import ( context "context" fmt "fmt" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" @@ -264,10 +265,10 @@ type ReflectionServiceClient interface { } type reflectionServiceClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewReflectionServiceClient(cc *grpc.ClientConn) ReflectionServiceClient { +func NewReflectionServiceClient(cc grpc1.ClientConn) ReflectionServiceClient { return &reflectionServiceClient{cc} } @@ -310,7 +311,7 @@ func (*UnimplementedReflectionServiceServer) ListImplementations(ctx context.Con return nil, status.Errorf(codes.Unimplemented, "method ListImplementations not implemented") } -func RegisterReflectionServiceServer(s *grpc.Server, srv ReflectionServiceServer) { +func RegisterReflectionServiceServer(s grpc1.Server, srv ReflectionServiceServer) { s.RegisterService(&_ReflectionService_serviceDesc, srv) } diff --git a/client/grpc/tmservice/query.pb.go b/client/grpc/tmservice/query.pb.go index 15c3cd42f39f..1ce38e1c5430 100644 --- a/client/grpc/tmservice/query.pb.go +++ b/client/grpc/tmservice/query.pb.go @@ -10,6 +10,7 @@ import ( types "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" p2p "github.com/tendermint/tendermint/proto/tendermint/p2p" types1 "github.com/tendermint/tendermint/proto/tendermint/types" @@ -1314,10 +1315,10 @@ type ServiceClient interface { } type serviceClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewServiceClient(cc *grpc.ClientConn) ServiceClient { +func NewServiceClient(cc grpc1.ClientConn) ServiceClient { return &serviceClient{cc} } @@ -1432,7 +1433,7 @@ func (*UnimplementedServiceServer) ABCIQuery(ctx context.Context, req *ABCIQuery return nil, status.Errorf(codes.Unimplemented, "method ABCIQuery not implemented") } -func RegisterServiceServer(s *grpc.Server, srv ServiceServer) { +func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { s.RegisterService(&_Service_serviceDesc, srv) } diff --git a/proto/cosmos/consensus_param/v1/query.proto b/proto/cosmos/consensus_param/v1/query.proto index 83f16631fae7..ff3b4cfb800a 100644 --- a/proto/cosmos/consensus_param/v1/query.proto +++ b/proto/cosmos/consensus_param/v1/query.proto @@ -1,8 +1,6 @@ syntax = "proto3"; package cosmos.consensus_param.v1; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "tendermint/types/params.proto"; diff --git a/x/auth/ante/ante.go b/x/auth/ante/ante.go index a562e67ee39c..44a6184c18af 100644 --- a/x/auth/ante/ante.go +++ b/x/auth/ante/ante.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/auth/types" + "reflect" ) // HandlerOptions are the options required for constructing a default SDK AnteHandler. @@ -23,11 +24,11 @@ type HandlerOptions struct { // numbers, checks signatures & account numbers, and deducts fees from the first // signer. func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { - if options.AccountKeeper == nil { + if reflect.ValueOf(options.AccountKeeper).IsNil() || reflect.ValueOf(options.AccountKeeper).IsZero() { return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder") } - if options.BankKeeper == nil { + if reflect.ValueOf(options.BankKeeper).IsNil() || reflect.ValueOf(options.BankKeeper).IsZero() { return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder") } diff --git a/x/consensus_param/exported/exported.go b/x/consensus_param/exported/exported.go index 7d17fc4f057c..a76e5b101cfd 100644 --- a/x/consensus_param/exported/exported.go +++ b/x/consensus_param/exported/exported.go @@ -5,10 +5,20 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) -// ProtocolVersionSetter defines the interface fulfilled by BaseApp -// which allows setting it's appVersion field. -type ConsensusParamSetter interface { - Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) - Has(ctx sdk.Context) bool - Set(ctx sdk.Context, cp *tmproto.ConsensusParams) -} +type ( + // Subspace defines an interface that implements the legacy x/params Subspace + // type. + // + // NOTE: This is used solely for migration of x/params managed parameters. + Subspace interface { + Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) + } + + // ConsensusParamSetter ProtocolVersionSetter defines the interface fulfilled by BaseApp + // which allows setting its appVersion field. + ConsensusParamSetter interface { + Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) + Has(ctx sdk.Context) bool + Set(ctx sdk.Context, cp *tmproto.ConsensusParams) + } +) diff --git a/x/consensus_param/keeper/grpc_query.go b/x/consensus_param/keeper/grpc_query.go index ebd03e95117a..966512b03402 100644 --- a/x/consensus_param/keeper/grpc_query.go +++ b/x/consensus_param/keeper/grpc_query.go @@ -12,15 +12,17 @@ import ( var _ types.QueryServer = Querier{} +// Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper type Querier struct { Keeper } +// NewQuerier constructor for the Querier struct func NewQuerier(keeper Keeper) Querier { return Querier{Keeper: keeper} } -// Balance implements the Query/Balance gRPC method +// Params Balance implements the Query/Balance gRPC method func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) diff --git a/x/consensus_param/keeper/keeper.go b/x/consensus_param/keeper/keeper.go index dcf7b7c8c8cf..9f1b89ee6ba8 100644 --- a/x/consensus_param/keeper/keeper.go +++ b/x/consensus_param/keeper/keeper.go @@ -31,6 +31,7 @@ func (k *Keeper) GetAuthority() string { return k.authority } +// Get gets the consensus parameters func (k *Keeper) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { store := ctx.KVStore(k.storeKey) @@ -50,8 +51,9 @@ func (k *Keeper) Has(ctx sdk.Context) bool { return store.Has(types.ParamStoreKeyConsensusParams) } +// Set sets the consensus parameters func (k *Keeper) Set(ctx sdk.Context, cp *tmproto.ConsensusParams) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.storeKey) store.Set(types.ParamStoreKeyConsensusParams, k.cdc.MustMarshal(cp)) } diff --git a/x/consensus_param/module.go b/x/consensus_param/module.go index 81f634cac803..1fa24c015c94 100644 --- a/x/consensus_param/module.go +++ b/x/consensus_param/module.go @@ -2,8 +2,13 @@ package bank import ( "context" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/depinject" "encoding/json" - + "github.com/cosmos/cosmos-sdk/runtime" + store "github.com/cosmos/cosmos-sdk/store/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" @@ -16,6 +21,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/consensus_param/exported" "github.com/cosmos/cosmos-sdk/x/consensus_param/keeper" "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + + modulev1 "cosmossdk.io/api/cosmos/consensus_param/module/v1" ) // ConsensusVersion defines the current x/bank module consensus version. @@ -26,18 +33,18 @@ var ( _ module.AppModuleBasic = AppModuleBasic{} ) -// AppModuleBasic defines the basic application module used by the bank module. +// AppModuleBasic defines the basic application module used by the consensus_param module. type AppModuleBasic struct { cdc codec.Codec } -// Name returns the bank module's name. +// Name returns the consensus_param module's name. func (AppModuleBasic) Name() string { return types.ModuleName } -// RegisterLegacyAminoCodec registers the bank module's types on the LegacyAmino codec. +// RegisterLegacyAminoCodec registers the consensus_param module's types on the LegacyAmino codec. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} -// DefaultGenesis returns default genesis state as raw bytes for the bank +// DefaultGenesis returns default genesis state as raw bytes for the consensus_param // module. func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { return nil @@ -96,10 +103,10 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ss exported.Subspace) A } } -// Name returns the bank module's name. +// Name returns the consensus_param module's name. func (AppModule) Name() string { return types.ModuleName } -// InitGenesis is handled by for init genesis of consensus params +// InitGenesis is handled by for init genesis of consensus_param func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { return nil } @@ -112,3 +119,44 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // RegisterInvariants does nothing, there are no invariants to enforce func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(provideModuleBasic, provideModule), + ) +} + +func provideModuleBasic() runtime.AppModuleBasicWrapper { + return runtime.WrapAppModuleBasic(AppModuleBasic{}) +} + +type consensusParamInputs struct { + depinject.In + + Cdc codec.Codec + Key *store.KVStoreKey + ModuleKey depinject.OwnModuleKey + Authority map[string]sdk.AccAddress `optional:"true"` + + // LegacySubspace is used solely for migration of x/params managed parameters + LegacySubspace exported.Subspace +} + +type consensusParamOutputs struct { + depinject.Out + + consensusParamKeeper keeper.Keeper + Module runtime.AppModuleWrapper +} + +func provideModule(in consensusParamInputs) consensusParamOutputs { + authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] + if !ok { + // default to governance authority if not provided + authority = authtypes.NewModuleAddress(govtypes.ModuleName) + } + k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) + m := NewAppModule(in.Cdc, k, in.LegacySubspace) + return consensusParamOutputs{consensusParamKeeper: k, Module: runtime.WrapAppModule(m)} +} diff --git a/x/consensus_param/types/query.pb.go b/x/consensus_param/types/query.pb.go index 48bcf42011b7..7cea8c6a2562 100644 --- a/x/consensus_param/types/query.pb.go +++ b/x/consensus_param/types/query.pb.go @@ -6,8 +6,7 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" types "github.com/tendermint/tendermint/proto/tendermint/types" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -122,28 +121,26 @@ func init() { } var fileDescriptor_3d2ae9668ec06671 = []byte{ - // 323 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0x3f, 0x4b, 0x3b, 0x41, - 0x10, 0xcd, 0xfe, 0xe0, 0x97, 0xe2, 0xec, 0xce, 0x14, 0x1a, 0xcd, 0xa2, 0x11, 0x41, 0x84, 0xec, - 0x70, 0xd1, 0xc6, 0x56, 0x7b, 0x89, 0x96, 0x36, 0xb2, 0x97, 0x2c, 0xeb, 0x11, 0x6f, 0x67, 0x73, - 0xbb, 0x17, 0x4c, 0x6b, 0x6d, 0x21, 0x08, 0x7e, 0x26, 0xcb, 0x80, 0x8d, 0xa5, 0x24, 0x7e, 0x10, - 0xb9, 0xdd, 0x35, 0xfe, 0x09, 0x82, 0xd5, 0x0e, 0x33, 0xef, 0xbd, 0x79, 0xfb, 0x26, 0xda, 0xed, - 0xa3, 0xc9, 0xd1, 0x40, 0x1f, 0x95, 0x11, 0xca, 0x94, 0xe6, 0x52, 0xf3, 0x82, 0xe7, 0x30, 0x4e, - 0x60, 0x54, 0x8a, 0x62, 0xc2, 0x74, 0x81, 0x16, 0xe3, 0x75, 0x0f, 0x63, 0x3f, 0x60, 0x6c, 0x9c, - 0x34, 0xf7, 0x83, 0x42, 0xca, 0x8d, 0xf0, 0x1c, 0x18, 0x27, 0xa9, 0xb0, 0x3c, 0x01, 0xcd, 0x65, - 0xa6, 0xb8, 0xcd, 0x50, 0x79, 0x99, 0x66, 0x43, 0xa2, 0x44, 0x57, 0x42, 0x55, 0x85, 0xee, 0xa6, - 0x44, 0x94, 0xd7, 0x02, 0xb8, 0xce, 0x80, 0x2b, 0x85, 0xd6, 0x51, 0x4c, 0x98, 0xb6, 0xac, 0x50, - 0x03, 0x51, 0xe4, 0x99, 0xb2, 0x60, 0x27, 0x5a, 0x18, 0x70, 0xab, 0xc3, 0xb8, 0xdd, 0x88, 0xe2, - 0xb3, 0x6a, 0x69, 0xcf, 0x35, 0xcf, 0xc5, 0xa8, 0x14, 0xc6, 0xb6, 0x7b, 0xd1, 0xea, 0xb7, 0xae, - 0xd1, 0x95, 0xf1, 0xf8, 0x28, 0xaa, 0x7b, 0xf2, 0x1a, 0xd9, 0x22, 0x7b, 0x2b, 0xdd, 0x6d, 0xf6, - 0x29, 0xce, 0x9c, 0x38, 0x3b, 0xf9, 0xf8, 0x61, 0xa0, 0x06, 0x42, 0xf7, 0x91, 0x44, 0xff, 0x9d, - 0x64, 0x7c, 0x47, 0xa2, 0xba, 0x1f, 0xc6, 0x1d, 0xf6, 0x6b, 0x2e, 0x6c, 0xd9, 0x55, 0x93, 0xfd, - 0x15, 0xee, 0xed, 0xb6, 0x77, 0x6e, 0x9f, 0xdf, 0x1e, 0xfe, 0xb5, 0xe2, 0x0d, 0x58, 0x64, 0xac, - 0x86, 0x5f, 0xd2, 0xad, 0xc0, 0xc7, 0xa7, 0x4f, 0x33, 0x4a, 0xa6, 0x33, 0x4a, 0x5e, 0x67, 0x94, - 0xdc, 0xcf, 0x69, 0x6d, 0x3a, 0xa7, 0xb5, 0x97, 0x39, 0xad, 0x5d, 0x1c, 0xca, 0xcc, 0x5e, 0x95, - 0x29, 0xeb, 0x63, 0x0e, 0x8b, 0x33, 0x57, 0x4f, 0xc7, 0x0c, 0x86, 0x70, 0xb3, 0x74, 0x73, 0x17, - 0x40, 0x5a, 0x77, 0xb9, 0x1e, 0xbc, 0x07, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xfa, 0x35, 0x91, 0x1a, - 0x02, 0x00, 0x00, + // 296 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0x8e, 0x2f, 0x48, 0x2c, + 0x4a, 0xcc, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x92, 0x84, 0x28, 0xd3, 0x43,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b1, 0x1c, + 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x99, 0xa4, 0x67, 0x96, 0x64, 0x94, + 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0x23, 0x09, 0x44, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x57, + 0x60, 0xc4, 0x18, 0x38, 0x00, 0x92, 0xd8, 0xc0, 0xe1, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, + 0x2a, 0x1e, 0x98, 0xab, 0xd8, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -163,10 +160,10 @@ type QueryClient interface { } type queryClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewQueryClient(cc *grpc.ClientConn) QueryClient { +func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } @@ -193,7 +190,7 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsReq return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func RegisterQueryServer(s *grpc.Server, srv QueryServer) { +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } diff --git a/x/consensus_param/types/tx.pb.go b/x/consensus_param/types/tx.pb.go index d08f4d6a5234..325ad78b3044 100644 --- a/x/consensus_param/types/tx.pb.go +++ b/x/consensus_param/types/tx.pb.go @@ -9,6 +9,7 @@ import ( _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" types "github.com/tendermint/tendermint/proto/tendermint/types" grpc "google.golang.org/grpc" @@ -183,10 +184,10 @@ type MsgClient interface { } type msgClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewMsgClient(cc *grpc.ClientConn) MsgClient { +func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } @@ -216,7 +217,7 @@ func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateP return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } -func RegisterMsgServer(s *grpc.Server, srv MsgServer) { +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } From f6cac8545a808fde866a992e827775e6bb082b9a Mon Sep 17 00:00:00 2001 From: Jeancarlo Date: Mon, 29 Aug 2022 18:28:04 -0600 Subject: [PATCH 06/60] add migrations --- x/consensus_param/exported/exported.go | 6 +- x/consensus_param/keeper/migrations.go | 25 +++++++++ x/consensus_param/migrations/v1/keys.go | 10 ++++ x/consensus_param/migrations/v2/keys.go | 9 +++ x/consensus_param/migrations/v2/store.go | 45 +++++++++++++++ x/consensus_param/migrations/v2/store_test.go | 56 +++++++++++++++++++ x/consensus_param/module.go | 8 +-- x/consensus_param/types/keys.go | 9 +++ x/consensus_param/types/util.go | 8 --- 9 files changed, 161 insertions(+), 15 deletions(-) create mode 100644 x/consensus_param/keeper/migrations.go create mode 100644 x/consensus_param/migrations/v1/keys.go create mode 100644 x/consensus_param/migrations/v2/keys.go create mode 100644 x/consensus_param/migrations/v2/store.go create mode 100644 x/consensus_param/migrations/v2/store_test.go create mode 100644 x/consensus_param/types/keys.go diff --git a/x/consensus_param/exported/exported.go b/x/consensus_param/exported/exported.go index a76e5b101cfd..dfceb8e87915 100644 --- a/x/consensus_param/exported/exported.go +++ b/x/consensus_param/exported/exported.go @@ -6,12 +6,12 @@ import ( ) type ( - // Subspace defines an interface that implements the legacy x/params Subspace + // ParamStore defines an interface that implements the legacy x/params Subspace // type. // // NOTE: This is used solely for migration of x/params managed parameters. - Subspace interface { - Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) + ParamStore interface { + Get(ctx sdk.Context, key []byte, ptr interface{}) } // ConsensusParamSetter ProtocolVersionSetter defines the interface fulfilled by BaseApp diff --git a/x/consensus_param/keeper/migrations.go b/x/consensus_param/keeper/migrations.go new file mode 100644 index 000000000000..dfbdbb8c0252 --- /dev/null +++ b/x/consensus_param/keeper/migrations.go @@ -0,0 +1,25 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/consensus_param/exported" + v2 "github.com/cosmos/cosmos-sdk/x/consensus_param/migrations/v2" +) + +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + keeper *Keeper + legacyParamStore exported.ParamStore +} + +// NewMigrator returns a new Migrator. +func NewMigrator(keeper *Keeper, legacyParamStore exported.ParamStore) Migrator { + return Migrator{ + keeper: keeper, + legacyParamStore: legacyParamStore, + } +} + +func (m Migrator) MigrateV1toV2(ctx sdk.Context) error { + return v2.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.legacyParamStore) +} diff --git a/x/consensus_param/migrations/v1/keys.go b/x/consensus_param/migrations/v1/keys.go new file mode 100644 index 000000000000..6059513a3295 --- /dev/null +++ b/x/consensus_param/migrations/v1/keys.go @@ -0,0 +1,10 @@ +package v1 + +const Paramspace = "baseapp" + +// Parameter store keys for all the consensus parameter types. +var ( + ParamStoreKeyBlockParams = []byte("BlockParams") + ParamStoreKeyEvidenceParams = []byte("EvidenceParams") + ParamStoreKeyValidatorParams = []byte("ValidatorParams") +) diff --git a/x/consensus_param/migrations/v2/keys.go b/x/consensus_param/migrations/v2/keys.go new file mode 100644 index 000000000000..6ed2ce9947ff --- /dev/null +++ b/x/consensus_param/migrations/v2/keys.go @@ -0,0 +1,9 @@ +package v2 + +const ( + ModuleName = "consensus_param" + + StoreKey = ModuleName +) + +var ParamStoreKeyConsensusParams = []byte("ConsensusParams") diff --git a/x/consensus_param/migrations/v2/store.go b/x/consensus_param/migrations/v2/store.go new file mode 100644 index 000000000000..21b51a8553cc --- /dev/null +++ b/x/consensus_param/migrations/v2/store.go @@ -0,0 +1,45 @@ +package v2 + +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/consensus_param/exported" + v1 "github.com/cosmos/cosmos-sdk/x/consensus_param/migrations/v1" + "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + tmtypes "github.com/tendermint/tendermint/types" +) + +func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, legacySubspace exported.ParamStore) error { + store := ctx.KVStore(storeKey) + + consensusParams := new(tmproto.ConsensusParams) + + consensusParams.Version = &tmproto.VersionParams{AppVersion: 0} + + var bp tmproto.BlockParams + legacySubspace.Get(ctx, v1.ParamStoreKeyBlockParams, &bp) + consensusParams.Block = &bp + + var ep tmproto.EvidenceParams + legacySubspace.Get(ctx, v1.ParamStoreKeyEvidenceParams, &ep) + consensusParams.Evidence = &ep + + var vp tmproto.ValidatorParams + legacySubspace.Get(ctx, v1.ParamStoreKeyValidatorParams, &vp) + consensusParams.Validator = &vp + + var versionParams tmproto.VersionParams + consensusParams.Version = &versionParams + + if err := types.Validate(tmtypes.ConsensusParamsFromProto(*consensusParams)); err != nil { + return err + } + + bz := cdc.MustMarshal(consensusParams) + store.Set(types.ParamStoreKeyConsensusParams, bz) + + return nil +} diff --git a/x/consensus_param/migrations/v2/store_test.go b/x/consensus_param/migrations/v2/store_test.go new file mode 100644 index 000000000000..91e6b0d6f611 --- /dev/null +++ b/x/consensus_param/migrations/v2/store_test.go @@ -0,0 +1,56 @@ +package v2_test + +import ( + "testing" + + "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/consensus_param" + v1 "github.com/cosmos/cosmos-sdk/x/consensus_param/migrations/v1" + v2 "github.com/cosmos/cosmos-sdk/x/consensus_param/migrations/v2" + "github.com/stretchr/testify/require" + tmtypes "github.com/tendermint/tendermint/types" + + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +) + +type mockParamStore struct { + ps tmproto.ConsensusParams +} + +func newMockSubspace(consensusParams tmproto.ConsensusParams) mockParamStore { + return mockParamStore{ps: consensusParams} +} + +func (ms mockParamStore) Get(ctx sdk.Context, key []byte, ps interface{}) { + switch stringKey := string(key); stringKey { + case string(v1.ParamStoreKeyBlockParams): + *ps.(*tmproto.BlockParams) = *ms.ps.Block + case string(v1.ParamStoreKeyValidatorParams): + *ps.(*tmproto.ValidatorParams) = *ms.ps.Validator + case string(v1.ParamStoreKeyEvidenceParams): + *ps.(*tmproto.EvidenceParams) = *ms.ps.Evidence + default: + *ps.(*tmproto.VersionParams) = tmproto.VersionParams{AppVersion: 0} + } +} + +func TestMigrate(t *testing.T) { + encCfg := moduletestutil.MakeTestEncodingConfig(consensus_param.AppModuleBasic{}) + cdc := encCfg.Codec + + storeKey := sdk.NewKVStoreKey(v2.ModuleName) + tKey := sdk.NewTransientStoreKey("transient_test") + ctx := testutil.DefaultContext(storeKey, tKey) + store := ctx.KVStore(storeKey) + + legacyParamStore := newMockSubspace(tmtypes.DefaultConsensusParams().ToProto()) + require.NoError(t, v2.MigrateStore(ctx, storeKey, cdc, legacyParamStore)) + + var res tmproto.ConsensusParams + bz := store.Get(v2.ParamStoreKeyConsensusParams) + require.NoError(t, cdc.Unmarshal(bz, &res)) + require.Equal(t, legacyParamStore.ps, res) + +} diff --git a/x/consensus_param/module.go b/x/consensus_param/module.go index 1fa24c015c94..b9411269db5f 100644 --- a/x/consensus_param/module.go +++ b/x/consensus_param/module.go @@ -1,4 +1,4 @@ -package bank +package consensus_param import ( "context" @@ -84,7 +84,7 @@ type AppModule struct { keeper keeper.Keeper // legacySubspace is used solely for migration of x/params managed parameters - legacySubspace exported.Subspace + legacySubspace exported.ParamStore } // RegisterServices registers module services. @@ -95,7 +95,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // NewAppModule creates a new AppModule object -func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ss exported.Subspace) AppModule { +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ss exported.ParamStore) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, keeper: keeper, @@ -140,7 +140,7 @@ type consensusParamInputs struct { Authority map[string]sdk.AccAddress `optional:"true"` // LegacySubspace is used solely for migration of x/params managed parameters - LegacySubspace exported.Subspace + LegacySubspace exported.ParamStore } type consensusParamOutputs struct { diff --git a/x/consensus_param/types/keys.go b/x/consensus_param/types/keys.go new file mode 100644 index 000000000000..3124c0209f73 --- /dev/null +++ b/x/consensus_param/types/keys.go @@ -0,0 +1,9 @@ +package types + +const ( + ModuleName = "consensus_param" + + StoreKey = ModuleName +) + +var ParamStoreKeyConsensusParams = []byte("ConsensusParams") diff --git a/x/consensus_param/types/util.go b/x/consensus_param/types/util.go index c99f45269389..583747135494 100644 --- a/x/consensus_param/types/util.go +++ b/x/consensus_param/types/util.go @@ -4,14 +4,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -const ( - ModuleName = "consensus_param" - - StoreKey = ModuleName -) - -var ParamStoreKeyConsensusParams = []byte("ConsensusParams") - // x/consensus_param module sentinel errors var ( ErrUnauthorized = sdkerrors.Register(ModuleName, 2, "unauthorized action") From 94390b3914521ef3409d0adaf8c98f2a8561e665 Mon Sep 17 00:00:00 2001 From: Jeancarlo Date: Wed, 31 Aug 2022 08:01:06 -0600 Subject: [PATCH 07/60] empty struct --- x/consensus_param/migrations/v2/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/consensus_param/migrations/v2/store.go b/x/consensus_param/migrations/v2/store.go index 21b51a8553cc..9ce07b89e5de 100644 --- a/x/consensus_param/migrations/v2/store.go +++ b/x/consensus_param/migrations/v2/store.go @@ -17,7 +17,7 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar consensusParams := new(tmproto.ConsensusParams) - consensusParams.Version = &tmproto.VersionParams{AppVersion: 0} + consensusParams.Version = &tmproto.VersionParams{} var bp tmproto.BlockParams legacySubspace.Get(ctx, v1.ParamStoreKeyBlockParams, &bp) From fffd4db1060770e7190201c73eb3276c47b402e6 Mon Sep 17 00:00:00 2001 From: Jeancarlo Date: Fri, 2 Sep 2022 08:53:15 -0600 Subject: [PATCH 08/60] commented depinject code --- x/consensus_param/module.go | 81 ++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/x/consensus_param/module.go b/x/consensus_param/module.go index b9411269db5f..a763682043c6 100644 --- a/x/consensus_param/module.go +++ b/x/consensus_param/module.go @@ -2,13 +2,11 @@ package consensus_param import ( "context" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/depinject" + //"cosmossdk.io/depinject" "encoding/json" "github.com/cosmos/cosmos-sdk/runtime" - store "github.com/cosmos/cosmos-sdk/store/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + //authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + //govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" @@ -21,8 +19,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/consensus_param/exported" "github.com/cosmos/cosmos-sdk/x/consensus_param/keeper" "github.com/cosmos/cosmos-sdk/x/consensus_param/types" - - modulev1 "cosmossdk.io/api/cosmos/consensus_param/module/v1" ) // ConsensusVersion defines the current x/bank module consensus version. @@ -120,43 +116,44 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // RegisterInvariants does nothing, there are no invariants to enforce func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} -func init() { - appmodule.Register( - &modulev1.Module{}, - appmodule.Provide(provideModuleBasic, provideModule), - ) -} +//func init() { +// appmodule.Register( +// &modulev1.Module{}, +// appmodule.Provide(provideModuleBasic, provideModule), +// ) +//} func provideModuleBasic() runtime.AppModuleBasicWrapper { return runtime.WrapAppModuleBasic(AppModuleBasic{}) } -type consensusParamInputs struct { - depinject.In - - Cdc codec.Codec - Key *store.KVStoreKey - ModuleKey depinject.OwnModuleKey - Authority map[string]sdk.AccAddress `optional:"true"` - - // LegacySubspace is used solely for migration of x/params managed parameters - LegacySubspace exported.ParamStore -} - -type consensusParamOutputs struct { - depinject.Out - - consensusParamKeeper keeper.Keeper - Module runtime.AppModuleWrapper -} - -func provideModule(in consensusParamInputs) consensusParamOutputs { - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) - } - k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) - m := NewAppModule(in.Cdc, k, in.LegacySubspace) - return consensusParamOutputs{consensusParamKeeper: k, Module: runtime.WrapAppModule(m)} -} +// +//type consensusParamInputs struct { +// depinject.In +// +// Cdc codec.Codec +// Key *store.KVStoreKey +// ModuleKey depinject.OwnModuleKey +// Authority map[string]sdk.AccAddress `optional:"true"` +// +// // LegacySubspace is used solely for migration of x/params managed parameters +// LegacySubspace exported.ParamStore +//} +// +//type consensusParamOutputs struct { +// depinject.Out +// +// consensusParamKeeper keeper.Keeper +// Module runtime.AppModuleWrapper +//} + +//func provideModule(in consensusParamInputs) consensusParamOutputs { +// authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] +// if !ok { +// // default to governance authority if not provided +// authority = authtypes.NewModuleAddress(govtypes.ModuleName) +// } +// k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) +// m := NewAppModule(in.Cdc, k, in.LegacySubspace) +// return consensusParamOutputs{consensusParamKeeper: k, Module: runtime.WrapAppModule(m)} +//} From 6f55f8b93576c94747d2f4e89b2224bc6bef1386 Mon Sep 17 00:00:00 2001 From: Jeancarlo Date: Sat, 3 Sep 2022 09:17:35 -0600 Subject: [PATCH 09/60] change proto to not recieve version and finish migration and migration tests --- api/cosmos/consensus_param/v1/query.pulsar.go | 46 +-- .../consensus_param/v1/query_grpc.pb.go | 4 +- api/cosmos/consensus_param/v1/tx.pulsar.go | 326 ++++++++++++++---- api/cosmos/consensus_param/v1/tx_grpc.pb.go | 4 +- proto/cosmos/consensus_param/v1/query.proto | 8 +- proto/cosmos/consensus_param/v1/tx.proto | 6 +- x/consensus_param/keeper/msg_server.go | 4 +- x/consensus_param/migrations/v2/store.go | 2 - x/consensus_param/types/msgs.go | 20 +- x/consensus_param/types/query.pb.go | 27 +- x/consensus_param/types/query.pb.gw.go | 2 +- x/consensus_param/types/tx.pb.go | 174 ++++++++-- 12 files changed, 469 insertions(+), 154 deletions(-) diff --git a/api/cosmos/consensus_param/v1/query.pulsar.go b/api/cosmos/consensus_param/v1/query.pulsar.go index 7e7c6cf7b53c..ad6d434683cc 100644 --- a/api/cosmos/consensus_param/v1/query.pulsar.go +++ b/api/cosmos/consensus_param/v1/query.pulsar.go @@ -818,7 +818,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// QueryParamsRequest defines the request type for querying x/bank parameters. +// QueryParamsRequest defines the request type for querying x/consensus_param parameters. type QueryParamsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -845,7 +845,7 @@ func (*QueryParamsRequest) Descriptor() ([]byte, []int) { return file_cosmos_consensus_param_v1_query_proto_rawDescGZIP(), []int{0} } -// QueryParamsResponse defines the response type for querying x/bank parameters. +// QueryParamsResponse defines the response type for querying x/consensus_param parameters. type QueryParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -898,32 +898,32 @@ var file_cosmos_consensus_param_v1_query_proto_rawDesc = []byte{ 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x96, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x8c, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2d, 0x2e, 0x63, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x9c, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x92, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, - 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x42, 0xeb, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, - 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xeb, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, + 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/consensus_param/v1/query_grpc.pb.go b/api/cosmos/consensus_param/v1/query_grpc.pb.go index 00ed21d9126d..1c60a7d8b3f9 100644 --- a/api/cosmos/consensus_param/v1/query_grpc.pb.go +++ b/api/cosmos/consensus_param/v1/query_grpc.pb.go @@ -22,7 +22,7 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type QueryClient interface { - // Params queries the parameters of x/bank module. + // Params queries the parameters of x/consensus_param module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) } @@ -47,7 +47,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . // All implementations must embed UnimplementedQueryServer // for forward compatibility type QueryServer interface { - // Params queries the parameters of x/bank module. + // Params queries the parameters of x/consensus_param module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) mustEmbedUnimplementedQueryServer() } diff --git a/api/cosmos/consensus_param/v1/tx.pulsar.go b/api/cosmos/consensus_param/v1/tx.pulsar.go index fedb608cb92b..f50ced3c1cff 100644 --- a/api/cosmos/consensus_param/v1/tx.pulsar.go +++ b/api/cosmos/consensus_param/v1/tx.pulsar.go @@ -19,14 +19,18 @@ import ( var ( md_MsgUpdateParams protoreflect.MessageDescriptor fd_MsgUpdateParams_authority protoreflect.FieldDescriptor - fd_MsgUpdateParams_params protoreflect.FieldDescriptor + fd_MsgUpdateParams_block protoreflect.FieldDescriptor + fd_MsgUpdateParams_evidence protoreflect.FieldDescriptor + fd_MsgUpdateParams_validator protoreflect.FieldDescriptor ) func init() { file_cosmos_consensus_param_v1_tx_proto_init() md_MsgUpdateParams = File_cosmos_consensus_param_v1_tx_proto.Messages().ByName("MsgUpdateParams") fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") - fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") + fd_MsgUpdateParams_block = md_MsgUpdateParams.Fields().ByName("block") + fd_MsgUpdateParams_evidence = md_MsgUpdateParams.Fields().ByName("evidence") + fd_MsgUpdateParams_validator = md_MsgUpdateParams.Fields().ByName("validator") } var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) @@ -100,9 +104,21 @@ func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescript return } } - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_MsgUpdateParams_params, value) { + if x.Block != nil { + value := protoreflect.ValueOfMessage(x.Block.ProtoReflect()) + if !f(fd_MsgUpdateParams_block, value) { + return + } + } + if x.Evidence != nil { + value := protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) + if !f(fd_MsgUpdateParams_evidence, value) { + return + } + } + if x.Validator != nil { + value := protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) + if !f(fd_MsgUpdateParams_validator, value) { return } } @@ -123,8 +139,12 @@ func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bo switch fd.FullName() { case "cosmos.consensus_param.v1.MsgUpdateParams.authority": return x.Authority != "" - case "cosmos.consensus_param.v1.MsgUpdateParams.params": - return x.Params != nil + case "cosmos.consensus_param.v1.MsgUpdateParams.block": + return x.Block != nil + case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + return x.Evidence != nil + case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + return x.Validator != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) @@ -143,8 +163,12 @@ func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) switch fd.FullName() { case "cosmos.consensus_param.v1.MsgUpdateParams.authority": x.Authority = "" - case "cosmos.consensus_param.v1.MsgUpdateParams.params": - x.Params = nil + case "cosmos.consensus_param.v1.MsgUpdateParams.block": + x.Block = nil + case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + x.Evidence = nil + case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + x.Validator = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) @@ -164,8 +188,14 @@ func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescri case "cosmos.consensus_param.v1.MsgUpdateParams.authority": value := x.Authority return protoreflect.ValueOfString(value) - case "cosmos.consensus_param.v1.MsgUpdateParams.params": - value := x.Params + case "cosmos.consensus_param.v1.MsgUpdateParams.block": + value := x.Block + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + value := x.Evidence + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + value := x.Validator return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { @@ -189,8 +219,12 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va switch fd.FullName() { case "cosmos.consensus_param.v1.MsgUpdateParams.authority": x.Authority = value.Interface().(string) - case "cosmos.consensus_param.v1.MsgUpdateParams.params": - x.Params = value.Message().Interface().(*types.ConsensusParams) + case "cosmos.consensus_param.v1.MsgUpdateParams.block": + x.Block = value.Message().Interface().(*types.BlockParams) + case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + x.Evidence = value.Message().Interface().(*types.EvidenceParams) + case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + x.Validator = value.Message().Interface().(*types.ValidatorParams) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) @@ -211,11 +245,21 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va // 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.consensus_param.v1.MsgUpdateParams.params": - if x.Params == nil { - x.Params = new(types.ConsensusParams) + case "cosmos.consensus_param.v1.MsgUpdateParams.block": + if x.Block == nil { + x.Block = new(types.BlockParams) + } + return protoreflect.ValueOfMessage(x.Block.ProtoReflect()) + case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + if x.Evidence == nil { + x.Evidence = new(types.EvidenceParams) } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + return protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) + case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + if x.Validator == nil { + x.Validator = new(types.ValidatorParams) + } + return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) case "cosmos.consensus_param.v1.MsgUpdateParams.authority": panic(fmt.Errorf("field authority of message cosmos.consensus_param.v1.MsgUpdateParams is not mutable")) default: @@ -233,8 +277,14 @@ func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescripto switch fd.FullName() { case "cosmos.consensus_param.v1.MsgUpdateParams.authority": return protoreflect.ValueOfString("") - case "cosmos.consensus_param.v1.MsgUpdateParams.params": - m := new(types.ConsensusParams) + case "cosmos.consensus_param.v1.MsgUpdateParams.block": + m := new(types.BlockParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + m := new(types.EvidenceParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + m := new(types.ValidatorParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { @@ -309,8 +359,16 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Params != nil { - l = options.Size(x.Params) + if x.Block != nil { + l = options.Size(x.Block) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Evidence != nil { + l = options.Size(x.Evidence) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Validator != nil { + l = options.Size(x.Validator) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -342,8 +400,36 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) + if x.Validator != nil { + encoded, err := options.Marshal(x.Validator) + 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.Evidence != nil { + encoded, err := options.Marshal(x.Evidence) + 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.Block != nil { + encoded, err := options.Marshal(x.Block) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -446,7 +532,43 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { 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) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Block", 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.Block == nil { + x.Block = &types.BlockParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Block); 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 Evidence", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -473,10 +595,46 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Params == nil { - x.Params = &types.ConsensusParams{} + if x.Evidence == nil { + x.Evidence = &types.EvidenceParams{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Evidence); 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 Validator", 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.Validator == nil { + x.Validator = &types.ValidatorParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validator); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -897,7 +1055,9 @@ type MsgUpdateParams struct { // params defines the x/consensus_params parameters to update. // // NOTE: All parameters must be supplied. - Params *types.ConsensusParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` + Block *types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Evidence *types.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *types.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` } func (x *MsgUpdateParams) Reset() { @@ -927,9 +1087,23 @@ func (x *MsgUpdateParams) GetAuthority() string { return "" } -func (x *MsgUpdateParams) GetParams() *types.ConsensusParams { +func (x *MsgUpdateParams) GetBlock() *types.BlockParams { + if x != nil { + return x.Block + } + return nil +} + +func (x *MsgUpdateParams) GetEvidence() *types.EvidenceParams { + if x != nil { + return x.Evidence + } + return nil +} + +func (x *MsgUpdateParams) GetValidator() *types.ValidatorParams { if x != nil { - return x.Params + return x.Validator } return nil } @@ -977,41 +1151,49 @@ var file_cosmos_consensus_param_v1_tx_proto_rawDesc = []byte{ 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, + 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, 0x02, 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, 0x3f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 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, 0x75, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x6e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 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, 0xe8, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, - 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, - 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x69, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x42, 0x0a, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 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, 0x75, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x6e, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2a, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 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, 0xe8, 0x01, 0x0a, + 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x07, + 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1030,17 +1212,21 @@ var file_cosmos_consensus_param_v1_tx_proto_msgTypes = make([]protoimpl.MessageI var file_cosmos_consensus_param_v1_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: cosmos.consensus_param.v1.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: cosmos.consensus_param.v1.MsgUpdateParamsResponse - (*types.ConsensusParams)(nil), // 2: tendermint.types.ConsensusParams + (*types.BlockParams)(nil), // 2: tendermint.types.BlockParams + (*types.EvidenceParams)(nil), // 3: tendermint.types.EvidenceParams + (*types.ValidatorParams)(nil), // 4: tendermint.types.ValidatorParams } var file_cosmos_consensus_param_v1_tx_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus_param.v1.MsgUpdateParams.params:type_name -> tendermint.types.ConsensusParams - 0, // 1: cosmos.consensus_param.v1.Msg.UpdateParams:input_type -> cosmos.consensus_param.v1.MsgUpdateParams - 1, // 2: cosmos.consensus_param.v1.Msg.UpdateParams:output_type -> cosmos.consensus_param.v1.MsgUpdateParamsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 2, // 0: cosmos.consensus_param.v1.MsgUpdateParams.block:type_name -> tendermint.types.BlockParams + 3, // 1: cosmos.consensus_param.v1.MsgUpdateParams.evidence:type_name -> tendermint.types.EvidenceParams + 4, // 2: cosmos.consensus_param.v1.MsgUpdateParams.validator:type_name -> tendermint.types.ValidatorParams + 0, // 3: cosmos.consensus_param.v1.Msg.UpdateParams:input_type -> cosmos.consensus_param.v1.MsgUpdateParams + 1, // 4: cosmos.consensus_param.v1.Msg.UpdateParams:output_type -> cosmos.consensus_param.v1.MsgUpdateParamsResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_cosmos_consensus_param_v1_tx_proto_init() } diff --git a/api/cosmos/consensus_param/v1/tx_grpc.pb.go b/api/cosmos/consensus_param/v1/tx_grpc.pb.go index ead8b7c6d37a..8cee688baa39 100644 --- a/api/cosmos/consensus_param/v1/tx_grpc.pb.go +++ b/api/cosmos/consensus_param/v1/tx_grpc.pb.go @@ -22,7 +22,7 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MsgClient interface { - // UpdateParams defines a governance operation for updating the x/bank module parameters. + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 @@ -50,7 +50,7 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // All implementations must embed UnimplementedMsgServer // for forward compatibility type MsgServer interface { - // UpdateParams defines a governance operation for updating the x/bank module parameters. + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 diff --git a/proto/cosmos/consensus_param/v1/query.proto b/proto/cosmos/consensus_param/v1/query.proto index ff3b4cfb800a..cfb37aa41a89 100644 --- a/proto/cosmos/consensus_param/v1/query.proto +++ b/proto/cosmos/consensus_param/v1/query.proto @@ -8,16 +8,16 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/consensus_param/types"; // Query defines the gRPC querier service. service Query { - // Params queries the parameters of x/bank module. + // Params queries the parameters of x/consensus_param module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/params"; + option (google.api.http).get = "/cosmos/consensus_param/v1/params"; } } -// QueryParamsRequest defines the request type for querying x/bank parameters. +// QueryParamsRequest defines the request type for querying x/consensus_param parameters. message QueryParamsRequest {} -// QueryParamsResponse defines the response type for querying x/bank parameters. +// QueryParamsResponse defines the response type for querying x/consensus_param parameters. message QueryParamsResponse { tendermint.types.ConsensusParams params = 1; } diff --git a/proto/cosmos/consensus_param/v1/tx.proto b/proto/cosmos/consensus_param/v1/tx.proto index 4f17de5556f6..5ed2574efc94 100644 --- a/proto/cosmos/consensus_param/v1/tx.proto +++ b/proto/cosmos/consensus_param/v1/tx.proto @@ -10,7 +10,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/consensus_param/types"; // Msg defines the bank Msg service. service Msg { - // UpdateParams defines a governance operation for updating the x/bank module parameters. + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 @@ -29,7 +29,9 @@ message MsgUpdateParams { // params defines the x/consensus_params parameters to update. // // NOTE: All parameters must be supplied. - tendermint.types.ConsensusParams params = 2 [(gogoproto.nullable) = false]; + tendermint.types.BlockParams block = 2 [(gogoproto.nullable) = false]; + tendermint.types.EvidenceParams evidence = 3 [(gogoproto.nullable) = false]; + tendermint.types.ValidatorParams validator = 4 [(gogoproto.nullable) = false]; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/x/consensus_param/keeper/msg_server.go b/x/consensus_param/keeper/msg_server.go index 2b79ba225222..0afac422ba95 100644 --- a/x/consensus_param/keeper/msg_server.go +++ b/x/consensus_param/keeper/msg_server.go @@ -27,7 +27,9 @@ func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParam } ctx := sdk.UnwrapSDKContext(goCtx) - k.Set(ctx, &req.Params) + + consensusParams := req.ToProtoConsensusParams() + k.Set(ctx, &consensusParams) ctx.EventManager().EmitEvent( sdk.NewEvent( diff --git a/x/consensus_param/migrations/v2/store.go b/x/consensus_param/migrations/v2/store.go index 9ce07b89e5de..8711b03b0568 100644 --- a/x/consensus_param/migrations/v2/store.go +++ b/x/consensus_param/migrations/v2/store.go @@ -17,8 +17,6 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar consensusParams := new(tmproto.ConsensusParams) - consensusParams.Version = &tmproto.VersionParams{} - var bp tmproto.BlockParams legacySubspace.Get(ctx, v1.ParamStoreKeyBlockParams, &bp) consensusParams.Block = &bp diff --git a/x/consensus_param/types/msgs.go b/x/consensus_param/types/msgs.go index c9f3e5622f37..a74e402fc53b 100644 --- a/x/consensus_param/types/msgs.go +++ b/x/consensus_param/types/msgs.go @@ -2,6 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" ) @@ -29,6 +30,23 @@ func (msg MsgUpdateParams) GetSignBytes() []byte { // ValidateBasic performs basic MsgUpdateParams message validation. func (msg MsgUpdateParams) ValidateBasic() error { - params := tmtypes.ConsensusParamsFromProto(msg.Params) + params := tmtypes.ConsensusParamsFromProto(msg.ToProtoConsensusParams()) return Validate(params) } + +func (msg MsgUpdateParams) ToProtoConsensusParams() tmproto.ConsensusParams { + return tmproto.ConsensusParams{ + Block: &tmproto.BlockParams{ + MaxBytes: msg.Block.MaxBytes, + MaxGas: msg.Block.MaxGas, + }, + Evidence: &tmproto.EvidenceParams{ + MaxAgeNumBlocks: msg.Evidence.MaxAgeNumBlocks, + MaxAgeDuration: msg.Evidence.MaxAgeDuration, + MaxBytes: msg.Evidence.MaxBytes, + }, + Validator: &tmproto.ValidatorParams{ + PubKeyTypes: msg.Validator.PubKeyTypes, + }, + } +} diff --git a/x/consensus_param/types/query.pb.go b/x/consensus_param/types/query.pb.go index 7cea8c6a2562..5be5839ca7b2 100644 --- a/x/consensus_param/types/query.pb.go +++ b/x/consensus_param/types/query.pb.go @@ -29,7 +29,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryParamsRequest defines the request type for querying x/bank parameters. +// QueryParamsRequest defines the request type for querying x/consensus_param parameters. type QueryParamsRequest struct { } @@ -66,7 +66,7 @@ func (m *QueryParamsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo -// QueryParamsResponse defines the response type for querying x/bank parameters. +// QueryParamsResponse defines the response type for querying x/consensus_param parameters. type QueryParamsResponse struct { Params *types.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } @@ -121,7 +121,7 @@ func init() { } var fileDescriptor_3d2ae9668ec06671 = []byte{ - // 296 bytes of a gzipped FileDescriptorProto + // 283 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce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xa4, 0x67, 0x96, 0x64, 0x94, - 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0x23, 0x09, 0x44, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x57, - 0x60, 0xc4, 0x18, 0x38, 0x00, 0x92, 0xd8, 0xc0, 0xe1, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, - 0x2a, 0x1e, 0x98, 0xab, 0xd8, 0x01, 0x00, 0x00, + 0x50, 0xad, 0x50, 0x0d, 0x46, 0x73, 0x18, 0xb9, 0x58, 0xc1, 0x46, 0x0a, 0x4d, 0x62, 0xe4, 0x62, + 0x83, 0x48, 0x0a, 0xe9, 0xea, 0xe1, 0xf4, 0x95, 0x1e, 0xa6, 0xab, 0xa4, 0xf4, 0x88, 0x55, 0x0e, + 0x71, 0xae, 0x92, 0x66, 0xd3, 0xe5, 0x27, 0x93, 0x99, 0x94, 0x85, 0x14, 0xf5, 0x71, 0x87, 0x31, + 0xc4, 0x79, 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, + 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x92, + 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x8b, 0x30, 0x06, 0x44, 0xe9, 0x16, 0xa7, + 0x64, 0xeb, 0x57, 0x60, 0x98, 0x09, 0x0e, 0x86, 0x24, 0x36, 0x70, 0xe8, 0x1a, 0x03, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x59, 0xcf, 0xea, 0xbf, 0xde, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -155,7 +154,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Params queries the parameters of x/bank module. + // Params queries the parameters of x/consensus_param module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) } @@ -178,7 +177,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . // QueryServer is the server API for Query service. type QueryServer interface { - // Params queries the parameters of x/bank module. + // Params queries the parameters of x/consensus_param module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) } diff --git a/x/consensus_param/types/query.pb.gw.go b/x/consensus_param/types/query.pb.gw.go index 03edaa120b8c..972bac058000 100644 --- a/x/consensus_param/types/query.pb.gw.go +++ b/x/consensus_param/types/query.pb.gw.go @@ -145,7 +145,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "consensus_param", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/consensus_param/types/tx.pb.go b/x/consensus_param/types/tx.pb.go index 325ad78b3044..b6a09c715fe5 100644 --- a/x/consensus_param/types/tx.pb.go +++ b/x/consensus_param/types/tx.pb.go @@ -40,7 +40,9 @@ type MsgUpdateParams struct { // params defines the x/consensus_params parameters to update. // // NOTE: All parameters must be supplied. - Params types.ConsensusParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` + Block types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block"` + Evidence types.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"` + Validator types.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator"` } func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } @@ -83,11 +85,25 @@ func (m *MsgUpdateParams) GetAuthority() string { return "" } -func (m *MsgUpdateParams) GetParams() types.ConsensusParams { +func (m *MsgUpdateParams) GetBlock() types.BlockParams { if m != nil { - return m.Params + return m.Block } - return types.ConsensusParams{} + return types.BlockParams{} +} + +func (m *MsgUpdateParams) GetEvidence() types.EvidenceParams { + if m != nil { + return m.Evidence + } + return types.EvidenceParams{} +} + +func (m *MsgUpdateParams) GetValidator() types.ValidatorParams { + if m != nil { + return m.Validator + } + return types.ValidatorParams{} } // MsgUpdateParamsResponse defines the response structure for executing a @@ -140,28 +156,32 @@ func init() { } var fileDescriptor_512bd98009ecbd38 = []byte{ - // 334 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0x8e, 0x2f, 0x48, 0x2c, - 0x4a, 0xcc, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, - 0x84, 0xa8, 0xd1, 0x43, 0x53, 0xa3, 0x57, 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, - 0xa5, 0x0f, 0x62, 0x41, 0x34, 0x48, 0x41, 0x35, 0xc4, 0x43, 0x24, 0xa0, 0xba, 0x21, 0x52, 0xe2, - 0x50, 0xfb, 0x72, 0x8b, 0xd3, 0x41, 0x76, 0xe4, 0x16, 0xa7, 0x43, 0x25, 0x64, 0x4b, 0x52, 0xf3, - 0x52, 0x52, 0x8b, 0x72, 0x33, 0xf3, 0x4a, 0xf4, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0xf5, 0xc1, 0x96, - 0x40, 0xf5, 0x29, 0xcd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3e, 0x3c, 0xee, 0x41, 0x94, - 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, 0x46, 0x42, 0x00, 0x87, 0x47, 0x12, 0x1b, 0x38, 0x16, 0x8c, - 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x27, 0xa5, 0x61, 0x2f, 0x02, 0x00, 0x00, + // 388 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x6a, 0xc2, 0x40, + 0x18, 0x85, 0x13, 0xb5, 0xa5, 0x4e, 0x4b, 0x0b, 0x41, 0x30, 0x0a, 0xa6, 0xd6, 0x95, 0x08, 0xce, + 0xa0, 0x2d, 0x85, 0x76, 0xd7, 0x80, 0x4b, 0x4b, 0xb1, 0xb4, 0x8b, 0x6e, 0x24, 0x26, 0xc3, 0x18, + 0x34, 0x99, 0x90, 0x99, 0x04, 0xdd, 0xf6, 0x04, 0xbd, 0x41, 0xaf, 0xd0, 0x45, 0x0f, 0xe1, 0x52, + 0xba, 0xea, 0xaa, 0x14, 0x5d, 0xf4, 0x1a, 0x25, 0x93, 0x68, 0x50, 0x29, 0x74, 0x95, 0xc0, 0x7b, + 0xdf, 0x7b, 0xcc, 0xff, 0xff, 0xa0, 0x66, 0x52, 0xe6, 0x50, 0x86, 0x4c, 0xea, 0x32, 0xec, 0xb2, + 0x80, 0xf5, 0x3d, 0xc3, 0x37, 0x1c, 0x14, 0xb6, 0x10, 0x9f, 0x40, 0xcf, 0xa7, 0x9c, 0x2a, 0xa5, + 0xd8, 0x03, 0xb7, 0x3c, 0x30, 0x6c, 0x95, 0x0b, 0x84, 0x12, 0x2a, 0x5c, 0x28, 0xfa, 0x8b, 0x81, + 0x72, 0x02, 0xf4, 0x63, 0x21, 0xa1, 0x63, 0xa9, 0x98, 0xf4, 0x39, 0x8c, 0x44, 0x1d, 0x0e, 0x23, + 0x89, 0x50, 0xe1,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 0x9e, 0x2f, 0x34, 0xf9, 0x7b, 0xa1, 0xc9, + 0x2f, 0x4b, 0x4d, 0x9a, 0x2f, 0x35, 0xe9, 0x73, 0xa9, 0x49, 0x4f, 0x17, 0xc4, 0xe6, 0xc3, 0x60, + 0x00, 0x4d, 0xea, 0xa0, 0xf5, 0x01, 0x46, 0x9f, 0x26, 0xb3, 0x46, 0x68, 0xb2, 0x73, 0x8d, 0x62, + 0x24, 0x83, 0x7d, 0x71, 0x0a, 0xe7, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x36, 0x92, 0xbf, 0x44, + 0xb4, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -176,7 +196,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // UpdateParams defines a governance operation for updating the x/bank module parameters. + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 @@ -202,7 +222,7 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. type MsgServer interface { - // UpdateParams defines a governance operation for updating the x/bank module parameters. + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 @@ -273,7 +293,27 @@ func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -336,7 +376,11 @@ func (m *MsgUpdateParams) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Params.Size() + l = m.Block.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.Evidence.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.Validator.Size() n += 1 + l + sovTx(uint64(l)) return n } @@ -419,7 +463,73 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Block", 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.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -446,7 +556,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From 97d19f10b070d7634fc9478c19592ed3f5977c68 Mon Sep 17 00:00:00 2001 From: Jeancarlo Date: Sat, 3 Sep 2022 13:16:18 -0600 Subject: [PATCH 10/60] add keeper base test --- x/consensus_param/keeper/keeper_test.go | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 x/consensus_param/keeper/keeper_test.go diff --git a/x/consensus_param/keeper/keeper_test.go b/x/consensus_param/keeper/keeper_test.go new file mode 100644 index 000000000000..3ef2f2143bbb --- /dev/null +++ b/x/consensus_param/keeper/keeper_test.go @@ -0,0 +1,49 @@ +package keeper_test + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus_param/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/stretchr/testify/suite" +) + +type KeeperTestSuite struct { + suite.Suite + ctx sdk.Context + consensusParamsKeeper *consensusparamkeeper.Keeper + + queryClient consensusparamtypes.QueryClient + msgServer consensusparamtypes.MsgServer +} + +func (s *KeeperTestSuite) SetupTest() { + key := sdk.NewKVStoreKey(consensusparamtypes.StoreKey) + testCtx := testutil.DefaultContextWithDB(s.T(), key, sdk.NewTransientStoreKey("transient_test")) + ctx := testCtx.Ctx.WithBlockHeader(tmproto.Header{}) + encCfg := moduletestutil.MakeTestEncodingConfig() + + keeper := consensusparamkeeper.NewKeeper(encCfg.Codec, key, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + + s.ctx = ctx + s.consensusParamsKeeper = &keeper + + consensusparamtypes.RegisterInterfaces(encCfg.InterfaceRegistry) + queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) + consensusparamtypes.RegisterQueryServer(queryHelper, consensusparamkeeper.NewQuerier(keeper)) + s.queryClient = consensusparamtypes.NewQueryClient(queryHelper) + s.msgServer = consensusparamkeeper.NewMsgServerImpl(keeper) + +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} From dada35d3b50db7e3566381763725ed44000c38c9 Mon Sep 17 00:00:00 2001 From: Jeancarlo Date: Sun, 4 Sep 2022 17:04:43 -0600 Subject: [PATCH 11/60] add keeper and update msg test --- x/consensus_param/keeper/msg_server.go | 4 ++ x/consensus_param/keeper/msg_server_test.go | 65 +++++++++++++++++++++ x/consensus_param/types/msgs.go | 1 + 3 files changed, 70 insertions(+) create mode 100644 x/consensus_param/keeper/msg_server_test.go diff --git a/x/consensus_param/keeper/msg_server.go b/x/consensus_param/keeper/msg_server.go index 0afac422ba95..27978c48e35d 100644 --- a/x/consensus_param/keeper/msg_server.go +++ b/x/consensus_param/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + tmtypes "github.com/tendermint/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -29,6 +30,9 @@ func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParam ctx := sdk.UnwrapSDKContext(goCtx) consensusParams := req.ToProtoConsensusParams() + if err := types.Validate(tmtypes.ConsensusParamsFromProto(consensusParams)); err != nil { + return nil, err + } k.Set(ctx, &consensusParams) ctx.EventManager().EmitEvent( diff --git a/x/consensus_param/keeper/msg_server_test.go b/x/consensus_param/keeper/msg_server_test.go new file mode 100644 index 000000000000..f75eb38e0baa --- /dev/null +++ b/x/consensus_param/keeper/msg_server_test.go @@ -0,0 +1,65 @@ +package keeper_test + +import ( + "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmtypes "github.com/tendermint/tendermint/types" +) + +func (s *KeeperTestSuite) TestUpdateParams() { + defaultConsensusParams := tmtypes.DefaultConsensusParams().ToProto() + testCases := []struct { + name string + input *types.MsgUpdateParams + expErr bool + expErrMsg string + }{ + { + name: "valid params", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: *defaultConsensusParams.Block, + Validator: *defaultConsensusParams.Validator, + Evidence: *defaultConsensusParams.Evidence, + }, + expErr: false, + expErrMsg: "", + }, + { + name: "invalid params", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: tmproto.BlockParams{MaxGas: -10, MaxBytes: -10}, + Validator: *defaultConsensusParams.Validator, + Evidence: *defaultConsensusParams.Evidence, + }, + expErr: true, + expErrMsg: "block.MaxBytes must be greater than 0. Got -10", + }, + { + name: "invalid authority", + input: &types.MsgUpdateParams{ + Authority: "invalid", + Block: *defaultConsensusParams.Block, + Validator: *defaultConsensusParams.Validator, + Evidence: *defaultConsensusParams.Evidence, + }, + expErr: true, + expErrMsg: "invalid authority", + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.name, func() { + s.SetupTest() + _, err := s.msgServer.UpdateParams(s.ctx, tc.input) + if tc.expErr { + s.Require().Error(err) + s.Require().Contains(err.Error(), tc.expErrMsg) + } else { + s.Require().NoError(err) + } + }) + } +} diff --git a/x/consensus_param/types/msgs.go b/x/consensus_param/types/msgs.go index a74e402fc53b..d2af9990d706 100644 --- a/x/consensus_param/types/msgs.go +++ b/x/consensus_param/types/msgs.go @@ -48,5 +48,6 @@ func (msg MsgUpdateParams) ToProtoConsensusParams() tmproto.ConsensusParams { Validator: &tmproto.ValidatorParams{ PubKeyTypes: msg.Validator.PubKeyTypes, }, + Version: tmtypes.DefaultConsensusParams().ToProto().Version, } } From fdc99224eac756db34e6bd5a86fee991e2d16426 Mon Sep 17 00:00:00 2001 From: Jeancarlo Date: Sun, 4 Sep 2022 17:57:07 -0600 Subject: [PATCH 12/60] add query test --- x/consensus_param/keeper/grpc_query_test.go | 63 +++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 x/consensus_param/keeper/grpc_query_test.go diff --git a/x/consensus_param/keeper/grpc_query_test.go b/x/consensus_param/keeper/grpc_query_test.go new file mode 100644 index 000000000000..43b60ca66606 --- /dev/null +++ b/x/consensus_param/keeper/grpc_query_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmtypes "github.com/tendermint/tendermint/types" +) + +func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { + defaultConsensusParams := tmtypes.DefaultConsensusParams().ToProto() + + testCases := []struct { + msg string + req types.QueryParamsRequest + malleate func() + response types.QueryParamsResponse + expPass bool + }{ + { + "success", + types.QueryParamsRequest{}, + func() { + input := &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: *defaultConsensusParams.Block, + Validator: *defaultConsensusParams.Validator, + Evidence: *defaultConsensusParams.Evidence, + } + s.msgServer.UpdateParams(s.ctx, input) + }, + types.QueryParamsResponse{ + Params: &tmproto.ConsensusParams{ + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Version: defaultConsensusParams.Version, + }, + }, + true, + }, + } + + for _, tc := range testCases { + s.Run(tc.msg, func() { + s.SetupTest() // reset + + tc.malleate() + ctx := sdk.WrapSDKContext(s.ctx) + + res, err := s.queryClient.Params(ctx, &tc.req) + + if tc.expPass { + s.Require().NoError(err) + s.Require().NotNil(res) + s.Require().Equal(tc.response.Params, res.Params) + } else { + s.Require().Error(err) + s.Require().Nil(res) + } + }) + } +} From 269f664035e55ee738700550600de83f1a8f37c4 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 5 Sep 2022 17:49:48 +0200 Subject: [PATCH 13/60] lint --- baseapp/deliver_tx_test.go | 4 ---- x/auth/ante/ante.go | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/baseapp/deliver_tx_test.go b/baseapp/deliver_tx_test.go index 8cac0b94c403..ce0a3b95fa0c 100644 --- a/baseapp/deliver_tx_test.go +++ b/baseapp/deliver_tx_test.go @@ -966,7 +966,6 @@ func TestBaseApp_EndBlock(t *testing.T) { } app := baseapp.NewBaseApp(name, logger, db, nil) - app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) app.InitChain(abci.RequestInitChain{ ConsensusParams: cp, }) @@ -1562,7 +1561,6 @@ func TestMaxBlockGasLimits(t *testing.T) { txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) // set the TxDecoder in the BaseApp for minimal tx simulations app.SetTxDecoder(txConfig.TxDecoder()) - app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) app.InitChain(abci.RequestInitChain{ ConsensusParams: &tmproto.ConsensusParams{ @@ -1821,7 +1819,6 @@ func TestGasConsumptionBadTx(t *testing.T) { txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) // set the TxDecoder in the BaseApp for minimal tx simulations app.SetTxDecoder(txConfig.TxDecoder()) - app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) app.InitChain(abci.RequestInitChain{ ConsensusParams: &tmproto.ConsensusParams{ @@ -1884,7 +1881,6 @@ func TestQuery(t *testing.T) { txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) // set the TxDecoder in the BaseApp for minimal tx simulations app.SetTxDecoder(txConfig.TxDecoder()) - app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) app.InitChain(abci.RequestInitChain{}) diff --git a/x/auth/ante/ante.go b/x/auth/ante/ante.go index 44a6184c18af..74162d125aaf 100644 --- a/x/auth/ante/ante.go +++ b/x/auth/ante/ante.go @@ -1,12 +1,13 @@ package ante import ( + "reflect" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/auth/types" - "reflect" ) // HandlerOptions are the options required for constructing a default SDK AnteHandler. From 8f2a66af48134369968b3573106be709c7eb992c Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 5 Sep 2022 18:32:28 +0200 Subject: [PATCH 14/60] set param store --- baseapp/abci_test.go | 24 +++++++++++++++--------- baseapp/deliver_tx_test.go | 26 ++++++++++++++++++-------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index 510c0ad3ed05..f2d38b33d0cb 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -116,7 +116,7 @@ func TestGetBlockRentionHeight(t *testing.T) { for name, tc := range testCases { tc := tc - // tc.bapp.SetParamStore(¶mStore{db: dbm.NewMemDB()}) + tc.bapp.SetParamStore(¶mStore{db: dbm.NewMemDB()}) tc.bapp.InitChain(abci.RequestInitChain{ ConsensusParams: &tmproto.ConsensusParams{ Evidence: &tmproto.EvidenceParams{ @@ -177,17 +177,19 @@ type paramStore struct { db *dbm.MemDB } -func (ps *paramStore) Set(_ sdk.Context, key []byte, value interface{}) { +var ParamstoreKey = []byte("paramstore") + +func (ps *paramStore) Set(_ sdk.Context, value *tmproto.ConsensusParams) { bz, err := json.Marshal(value) if err != nil { panic(err) } - ps.db.Set(key, bz) + ps.db.Set(ParamstoreKey, bz) } -func (ps *paramStore) Has(_ sdk.Context, key []byte) bool { - ok, err := ps.db.Has(key) +func (ps *paramStore) Has(_ sdk.Context) bool { + ok, err := ps.db.Has(ParamstoreKey) if err != nil { panic(err) } @@ -195,17 +197,21 @@ func (ps *paramStore) Has(_ sdk.Context, key []byte) bool { return ok } -func (ps *paramStore) Get(_ sdk.Context, key []byte, ptr interface{}) { - bz, err := ps.db.Get(key) +func (ps paramStore) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { + bz, err := ps.db.Get(ParamstoreKey) if err != nil { panic(err) } if len(bz) == 0 { - return + return nil, nil } - if err := json.Unmarshal(bz, ptr); err != nil { + var params *tmproto.ConsensusParams + + if err := json.Unmarshal(bz, params); err != nil { panic(err) } + + return params, nil } diff --git a/baseapp/deliver_tx_test.go b/baseapp/deliver_tx_test.go index ce0a3b95fa0c..295c27de6680 100644 --- a/baseapp/deliver_tx_test.go +++ b/baseapp/deliver_tx_test.go @@ -966,6 +966,7 @@ func TestBaseApp_EndBlock(t *testing.T) { } app := baseapp.NewBaseApp(name, logger, db, nil) + app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) app.InitChain(abci.RequestInitChain{ ConsensusParams: cp, }) @@ -1561,6 +1562,7 @@ func TestMaxBlockGasLimits(t *testing.T) { txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) // set the TxDecoder in the BaseApp for minimal tx simulations app.SetTxDecoder(txConfig.TxDecoder()) + app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) app.InitChain(abci.RequestInitChain{ ConsensusParams: &tmproto.ConsensusParams{ @@ -1819,6 +1821,7 @@ func TestGasConsumptionBadTx(t *testing.T) { txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) // set the TxDecoder in the BaseApp for minimal tx simulations app.SetTxDecoder(txConfig.TxDecoder()) + app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) app.InitChain(abci.RequestInitChain{ ConsensusParams: &tmproto.ConsensusParams{ @@ -1881,6 +1884,7 @@ func TestQuery(t *testing.T) { txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) // set the TxDecoder in the BaseApp for minimal tx simulations app.SetTxDecoder(txConfig.TxDecoder()) + app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) app.InitChain(abci.RequestInitChain{}) @@ -2148,17 +2152,19 @@ type paramStore struct { db *dbm.MemDB } -func (ps *paramStore) Set(_ sdk.Context, key []byte, value interface{}) { +var ParamstoreKey = []byte("paramstore") + +func (ps *paramStore) Set(_ sdk.Context, value *tmproto.ConsensusParams) { bz, err := json.Marshal(value) if err != nil { panic(err) } - ps.db.Set(key, bz) + ps.db.Set(ParamstoreKey, bz) } -func (ps *paramStore) Has(_ sdk.Context, key []byte) bool { - ok, err := ps.db.Has(key) +func (ps *paramStore) Has(_ sdk.Context) bool { + ok, err := ps.db.Has(ParamstoreKey) if err != nil { panic(err) } @@ -2166,17 +2172,21 @@ func (ps *paramStore) Has(_ sdk.Context, key []byte) bool { return ok } -func (ps *paramStore) Get(_ sdk.Context, key []byte, ptr interface{}) { - bz, err := ps.db.Get(key) +func (ps paramStore) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { + bz, err := ps.db.Get(ParamstoreKey) if err != nil { panic(err) } if len(bz) == 0 { - return + return nil, nil } - if err := json.Unmarshal(bz, ptr); err != nil { + var params *tmproto.ConsensusParams + + if err := json.Unmarshal(bz, params); err != nil { panic(err) } + + return params, nil } From 09e0ab864a26ba3b55318083c177519203d32bb9 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 09:36:28 +0200 Subject: [PATCH 15/60] fix issues --- x/consensus_param/migrations/v2/store_test.go | 2 +- x/consensus_param/types/params.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x/consensus_param/migrations/v2/store_test.go b/x/consensus_param/migrations/v2/store_test.go index 91e6b0d6f611..bdb8fa3d1852 100644 --- a/x/consensus_param/migrations/v2/store_test.go +++ b/x/consensus_param/migrations/v2/store_test.go @@ -32,7 +32,7 @@ func (ms mockParamStore) Get(ctx sdk.Context, key []byte, ps interface{}) { case string(v1.ParamStoreKeyEvidenceParams): *ps.(*tmproto.EvidenceParams) = *ms.ps.Evidence default: - *ps.(*tmproto.VersionParams) = tmproto.VersionParams{AppVersion: 0} + *ps.(*tmproto.VersionParams) = tmproto.VersionParams{App: 0} } } diff --git a/x/consensus_param/types/params.go b/x/consensus_param/types/params.go index f04556c6b6ff..2778b0a15c23 100644 --- a/x/consensus_param/types/params.go +++ b/x/consensus_param/types/params.go @@ -6,7 +6,7 @@ import ( // Validate all module parameters func Validate(p tmtypes.ConsensusParams) error { - return p.ValidateConsensusParams() + return p.ValidateBasic() } From 09a72c6fb80a857c27a1669faca1e1ba199809f5 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 10:05:22 +0200 Subject: [PATCH 16/60] fix somethings and get blocked by depinject --- baseapp/abci_test.go | 13 +++++++------ baseapp/baseapp.go | 1 - baseapp/baseapp_test.go | 1 + baseapp/deliver_tx_test.go | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index f2d38b33d0cb..20b308cdfed8 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -2,6 +2,7 @@ package baseapp import ( "encoding/json" + "errors" "os" "testing" @@ -197,21 +198,21 @@ func (ps *paramStore) Has(_ sdk.Context) bool { return ok } -func (ps paramStore) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { +func (ps paramStore) Get(_ sdk.Context) (*tmproto.ConsensusParams, error) { bz, err := ps.db.Get(ParamstoreKey) if err != nil { - panic(err) + return nil, err } if len(bz) == 0 { - return nil, nil + return nil, errors.New("no consensus params") } - var params *tmproto.ConsensusParams + var params tmproto.ConsensusParams - if err := json.Unmarshal(bz, params); err != nil { + if err := json.Unmarshal(bz, ¶ms); err != nil { panic(err) } - return params, nil + return ¶ms, nil } diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 1466aca4738d..89405f056d73 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -416,7 +416,6 @@ func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusP if cp == nil { return } - app.paramStore.Set(ctx, cp) // We're explicitly not storing the Tendermint app_version in the param store. It's // stored instead in the x/upgrade store, with its own bump logic. diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 6ebe3819940f..697841e1a81d 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -103,6 +103,7 @@ func setupBaseApp(t *testing.T, options ...func(*BaseApp)) *BaseApp { require.Equal(t, t.Name(), app.Name()) app.MountStores(capKey1, capKey2) + app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) // stores are mounted err := app.LoadLatestVersion() diff --git a/baseapp/deliver_tx_test.go b/baseapp/deliver_tx_test.go index 295c27de6680..b9e06e0450a5 100644 --- a/baseapp/deliver_tx_test.go +++ b/baseapp/deliver_tx_test.go @@ -2182,11 +2182,11 @@ func (ps paramStore) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { return nil, nil } - var params *tmproto.ConsensusParams + var params tmproto.ConsensusParams - if err := json.Unmarshal(bz, params); err != nil { + if err := json.Unmarshal(bz, ¶ms); err != nil { panic(err) } - return params, nil + return ¶ms, nil } From 163c7f5484994705a72813d2c1d57e78ef7e5a6b Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 10:18:50 +0200 Subject: [PATCH 17/60] rename module to consensus --- x/{consensus_param => consensus}/README.md | 0 x/{consensus_param => consensus}/exported/exported.go | 0 x/{consensus_param => consensus}/keeper/grpc_query.go | 2 +- .../keeper/grpc_query_test.go | 2 +- x/{consensus_param => consensus}/keeper/keeper.go | 4 ++-- x/{consensus_param => consensus}/keeper/keeper_test.go | 4 ++-- x/{consensus_param => consensus}/keeper/migrations.go | 4 ++-- x/{consensus_param => consensus}/keeper/msg_server.go | 3 ++- .../keeper/msg_server_test.go | 2 +- x/{consensus_param => consensus}/migrations/v1/keys.go | 0 x/{consensus_param => consensus}/migrations/v2/keys.go | 0 x/{consensus_param => consensus}/migrations/v2/store.go | 6 +++--- .../migrations/v2/store_test.go | 0 x/{consensus_param => consensus}/module.go | 0 .../testutil/expected_keepers_mocks.go | 0 .../testutil/test_helpers.go | 0 x/{consensus_param => consensus}/types/codec.go | 0 x/consensus/types/keys.go | 9 +++++++++ x/{consensus_param => consensus}/types/msgs.go | 0 x/{consensus_param => consensus}/types/params.go | 0 x/{consensus_param => consensus}/types/query.pb.go | 0 x/{consensus_param => consensus}/types/query.pb.gw.go | 0 x/{consensus_param => consensus}/types/tx.pb.go | 0 x/{consensus_param => consensus}/types/util.go | 0 x/consensus_param/types/keys.go | 9 --------- 25 files changed, 23 insertions(+), 22 deletions(-) rename x/{consensus_param => consensus}/README.md (100%) rename x/{consensus_param => consensus}/exported/exported.go (100%) rename x/{consensus_param => consensus}/keeper/grpc_query.go (93%) rename x/{consensus_param => consensus}/keeper/grpc_query_test.go (96%) rename x/{consensus_param => consensus}/keeper/keeper.go (91%) rename x/{consensus_param => consensus}/keeper/keeper_test.go (91%) rename x/{consensus_param => consensus}/keeper/migrations.go (82%) rename x/{consensus_param => consensus}/keeper/msg_server.go (95%) rename x/{consensus_param => consensus}/keeper/msg_server_test.go (96%) rename x/{consensus_param => consensus}/migrations/v1/keys.go (100%) rename x/{consensus_param => consensus}/migrations/v2/keys.go (100%) rename x/{consensus_param => consensus}/migrations/v2/store.go (86%) rename x/{consensus_param => consensus}/migrations/v2/store_test.go (100%) rename x/{consensus_param => consensus}/module.go (100%) rename x/{consensus_param => consensus}/testutil/expected_keepers_mocks.go (100%) rename x/{consensus_param => consensus}/testutil/test_helpers.go (100%) rename x/{consensus_param => consensus}/types/codec.go (100%) create mode 100644 x/consensus/types/keys.go rename x/{consensus_param => consensus}/types/msgs.go (100%) rename x/{consensus_param => consensus}/types/params.go (100%) rename x/{consensus_param => consensus}/types/query.pb.go (100%) rename x/{consensus_param => consensus}/types/query.pb.gw.go (100%) rename x/{consensus_param => consensus}/types/tx.pb.go (100%) rename x/{consensus_param => consensus}/types/util.go (100%) delete mode 100644 x/consensus_param/types/keys.go diff --git a/x/consensus_param/README.md b/x/consensus/README.md similarity index 100% rename from x/consensus_param/README.md rename to x/consensus/README.md diff --git a/x/consensus_param/exported/exported.go b/x/consensus/exported/exported.go similarity index 100% rename from x/consensus_param/exported/exported.go rename to x/consensus/exported/exported.go diff --git a/x/consensus_param/keeper/grpc_query.go b/x/consensus/keeper/grpc_query.go similarity index 93% rename from x/consensus_param/keeper/grpc_query.go rename to x/consensus/keeper/grpc_query.go index 966512b03402..81cbfb8aace2 100644 --- a/x/consensus_param/keeper/grpc_query.go +++ b/x/consensus/keeper/grpc_query.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/status" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + "github.com/cosmos/cosmos-sdk/x/consensus/types" ) var _ types.QueryServer = Querier{} diff --git a/x/consensus_param/keeper/grpc_query_test.go b/x/consensus/keeper/grpc_query_test.go similarity index 96% rename from x/consensus_param/keeper/grpc_query_test.go rename to x/consensus/keeper/grpc_query_test.go index 43b60ca66606..f04223086c14 100644 --- a/x/consensus_param/keeper/grpc_query_test.go +++ b/x/consensus/keeper/grpc_query_test.go @@ -2,7 +2,7 @@ package keeper_test import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + "github.com/cosmos/cosmos-sdk/x/consensus/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" ) diff --git a/x/consensus_param/keeper/keeper.go b/x/consensus/keeper/keeper.go similarity index 91% rename from x/consensus_param/keeper/keeper.go rename to x/consensus/keeper/keeper.go index 9f1b89ee6ba8..cf99c07f2bbc 100644 --- a/x/consensus_param/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -6,8 +6,8 @@ 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/consensus_param/exported" - "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + "github.com/cosmos/cosmos-sdk/x/consensus/exported" + "github.com/cosmos/cosmos-sdk/x/consensus/types" ) var _ exported.ConsensusParamSetter = (*Keeper)(nil) diff --git a/x/consensus_param/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go similarity index 91% rename from x/consensus_param/keeper/keeper_test.go rename to x/consensus/keeper/keeper_test.go index 3ef2f2143bbb..ce1d28543978 100644 --- a/x/consensus_param/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus_param/keeper" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" diff --git a/x/consensus_param/keeper/migrations.go b/x/consensus/keeper/migrations.go similarity index 82% rename from x/consensus_param/keeper/migrations.go rename to x/consensus/keeper/migrations.go index dfbdbb8c0252..89f4d52e8342 100644 --- a/x/consensus_param/keeper/migrations.go +++ b/x/consensus/keeper/migrations.go @@ -2,8 +2,8 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/consensus_param/exported" - v2 "github.com/cosmos/cosmos-sdk/x/consensus_param/migrations/v2" + "github.com/cosmos/cosmos-sdk/x/consensus/exported" + v2 "github.com/cosmos/cosmos-sdk/x/consensus/migrations/v2" ) // Migrator is a struct for handling in-place store migrations. diff --git a/x/consensus_param/keeper/msg_server.go b/x/consensus/keeper/msg_server.go similarity index 95% rename from x/consensus_param/keeper/msg_server.go rename to x/consensus/keeper/msg_server.go index 27978c48e35d..5e430c1dfe36 100644 --- a/x/consensus_param/keeper/msg_server.go +++ b/x/consensus/keeper/msg_server.go @@ -2,11 +2,12 @@ package keeper import ( "context" + tmtypes "github.com/tendermint/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + "github.com/cosmos/cosmos-sdk/x/consensus/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) diff --git a/x/consensus_param/keeper/msg_server_test.go b/x/consensus/keeper/msg_server_test.go similarity index 96% rename from x/consensus_param/keeper/msg_server_test.go rename to x/consensus/keeper/msg_server_test.go index f75eb38e0baa..88343e91c57c 100644 --- a/x/consensus_param/keeper/msg_server_test.go +++ b/x/consensus/keeper/msg_server_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + "github.com/cosmos/cosmos-sdk/x/consensus/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" ) diff --git a/x/consensus_param/migrations/v1/keys.go b/x/consensus/migrations/v1/keys.go similarity index 100% rename from x/consensus_param/migrations/v1/keys.go rename to x/consensus/migrations/v1/keys.go diff --git a/x/consensus_param/migrations/v2/keys.go b/x/consensus/migrations/v2/keys.go similarity index 100% rename from x/consensus_param/migrations/v2/keys.go rename to x/consensus/migrations/v2/keys.go diff --git a/x/consensus_param/migrations/v2/store.go b/x/consensus/migrations/v2/store.go similarity index 86% rename from x/consensus_param/migrations/v2/store.go rename to x/consensus/migrations/v2/store.go index 8711b03b0568..1964ed7ef2a3 100644 --- a/x/consensus_param/migrations/v2/store.go +++ b/x/consensus/migrations/v2/store.go @@ -4,9 +4,9 @@ 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/consensus_param/exported" - v1 "github.com/cosmos/cosmos-sdk/x/consensus_param/migrations/v1" - "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + "github.com/cosmos/cosmos-sdk/x/consensus/exported" + v1 "github.com/cosmos/cosmos-sdk/x/consensus/migrations/v1" + "github.com/cosmos/cosmos-sdk/x/consensus/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" diff --git a/x/consensus_param/migrations/v2/store_test.go b/x/consensus/migrations/v2/store_test.go similarity index 100% rename from x/consensus_param/migrations/v2/store_test.go rename to x/consensus/migrations/v2/store_test.go diff --git a/x/consensus_param/module.go b/x/consensus/module.go similarity index 100% rename from x/consensus_param/module.go rename to x/consensus/module.go diff --git a/x/consensus_param/testutil/expected_keepers_mocks.go b/x/consensus/testutil/expected_keepers_mocks.go similarity index 100% rename from x/consensus_param/testutil/expected_keepers_mocks.go rename to x/consensus/testutil/expected_keepers_mocks.go diff --git a/x/consensus_param/testutil/test_helpers.go b/x/consensus/testutil/test_helpers.go similarity index 100% rename from x/consensus_param/testutil/test_helpers.go rename to x/consensus/testutil/test_helpers.go diff --git a/x/consensus_param/types/codec.go b/x/consensus/types/codec.go similarity index 100% rename from x/consensus_param/types/codec.go rename to x/consensus/types/codec.go diff --git a/x/consensus/types/keys.go b/x/consensus/types/keys.go new file mode 100644 index 000000000000..8dd17af7dc13 --- /dev/null +++ b/x/consensus/types/keys.go @@ -0,0 +1,9 @@ +package types + +const ( + ModuleName = "consensus" + + StoreKey = ModuleName +) + +var ParamStoreKeyConsensusParams = []byte("Consensus") diff --git a/x/consensus_param/types/msgs.go b/x/consensus/types/msgs.go similarity index 100% rename from x/consensus_param/types/msgs.go rename to x/consensus/types/msgs.go diff --git a/x/consensus_param/types/params.go b/x/consensus/types/params.go similarity index 100% rename from x/consensus_param/types/params.go rename to x/consensus/types/params.go diff --git a/x/consensus_param/types/query.pb.go b/x/consensus/types/query.pb.go similarity index 100% rename from x/consensus_param/types/query.pb.go rename to x/consensus/types/query.pb.go diff --git a/x/consensus_param/types/query.pb.gw.go b/x/consensus/types/query.pb.gw.go similarity index 100% rename from x/consensus_param/types/query.pb.gw.go rename to x/consensus/types/query.pb.gw.go diff --git a/x/consensus_param/types/tx.pb.go b/x/consensus/types/tx.pb.go similarity index 100% rename from x/consensus_param/types/tx.pb.go rename to x/consensus/types/tx.pb.go diff --git a/x/consensus_param/types/util.go b/x/consensus/types/util.go similarity index 100% rename from x/consensus_param/types/util.go rename to x/consensus/types/util.go diff --git a/x/consensus_param/types/keys.go b/x/consensus_param/types/keys.go deleted file mode 100644 index 3124c0209f73..000000000000 --- a/x/consensus_param/types/keys.go +++ /dev/null @@ -1,9 +0,0 @@ -package types - -const ( - ModuleName = "consensus_param" - - StoreKey = ModuleName -) - -var ParamStoreKeyConsensusParams = []byte("ConsensusParams") From 76d7f87872e7862a585d51870a919920c9ce7299 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 10:23:41 +0200 Subject: [PATCH 18/60] rename module to consensus++ --- .../module/v1/module.proto | 4 +- .../v1/query.proto | 6 +- .../v1/tx.proto | 4 +- x/consensus/module.go | 89 ++++++++++--------- 4 files changed, 53 insertions(+), 50 deletions(-) rename proto/cosmos/{consensus_param => consensus}/module/v1/module.proto (63%) rename proto/cosmos/{consensus_param => consensus}/v1/query.proto (76%) rename proto/cosmos/{consensus_param => consensus}/v1/tx.proto (92%) diff --git a/proto/cosmos/consensus_param/module/v1/module.proto b/proto/cosmos/consensus/module/v1/module.proto similarity index 63% rename from proto/cosmos/consensus_param/module/v1/module.proto rename to proto/cosmos/consensus/module/v1/module.proto index c11656d7a3aa..e223e9513da7 100644 --- a/proto/cosmos/consensus_param/module/v1/module.proto +++ b/proto/cosmos/consensus/module/v1/module.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package cosmos.consensus_param.module.v1; +package cosmos.consensus.module.v1; import "cosmos/app/v1alpha1/module.proto"; // Module is the config object of the bank module. message Module { option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/x/consensus_param" + go_import: "github.com/cosmos/cosmos-sdk/x/consensus" }; } diff --git a/proto/cosmos/consensus_param/v1/query.proto b/proto/cosmos/consensus/v1/query.proto similarity index 76% rename from proto/cosmos/consensus_param/v1/query.proto rename to proto/cosmos/consensus/v1/query.proto index cfb37aa41a89..f8aaca016012 100644 --- a/proto/cosmos/consensus_param/v1/query.proto +++ b/proto/cosmos/consensus/v1/query.proto @@ -1,16 +1,16 @@ syntax = "proto3"; -package cosmos.consensus_param.v1; +package cosmos.consensus.v1; import "google/api/annotations.proto"; import "tendermint/types/params.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/consensus_param/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; // Query defines the gRPC querier service. service Query { // Params queries the parameters of x/consensus_param module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/consensus_param/v1/params"; + option (google.api.http).get = "/cosmos/consensus/v1/params"; } } diff --git a/proto/cosmos/consensus_param/v1/tx.proto b/proto/cosmos/consensus/v1/tx.proto similarity index 92% rename from proto/cosmos/consensus_param/v1/tx.proto rename to proto/cosmos/consensus/v1/tx.proto index 5ed2574efc94..ad4b58d36841 100644 --- a/proto/cosmos/consensus_param/v1/tx.proto +++ b/proto/cosmos/consensus/v1/tx.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package cosmos.consensus_param.v1; +package cosmos.consensus.v1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; import "tendermint/types/params.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/consensus_param/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; // Msg defines the bank Msg service. service Msg { diff --git a/x/consensus/module.go b/x/consensus/module.go index a763682043c6..39ed549955e7 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -2,23 +2,27 @@ package consensus_param import ( "context" - //"cosmossdk.io/depinject" "encoding/json" - "github.com/cosmos/cosmos-sdk/runtime" - //authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - //govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/depinject" + gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" + modulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/consensus_param/exported" - "github.com/cosmos/cosmos-sdk/x/consensus_param/keeper" - "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/consensus/exported" + "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + "github.com/cosmos/cosmos-sdk/x/consensus/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) // ConsensusVersion defines the current x/bank module consensus version. @@ -116,44 +120,43 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // RegisterInvariants does nothing, there are no invariants to enforce func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} -//func init() { -// appmodule.Register( -// &modulev1.Module{}, -// appmodule.Provide(provideModuleBasic, provideModule), -// ) -//} +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(provideModuleBasic, provideModule), + ) +} func provideModuleBasic() runtime.AppModuleBasicWrapper { return runtime.WrapAppModuleBasic(AppModuleBasic{}) } -// -//type consensusParamInputs struct { -// depinject.In -// -// Cdc codec.Codec -// Key *store.KVStoreKey -// ModuleKey depinject.OwnModuleKey -// Authority map[string]sdk.AccAddress `optional:"true"` -// -// // LegacySubspace is used solely for migration of x/params managed parameters -// LegacySubspace exported.ParamStore -//} -// -//type consensusParamOutputs struct { -// depinject.Out -// -// consensusParamKeeper keeper.Keeper -// Module runtime.AppModuleWrapper -//} - -//func provideModule(in consensusParamInputs) consensusParamOutputs { -// authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] -// if !ok { -// // default to governance authority if not provided -// authority = authtypes.NewModuleAddress(govtypes.ModuleName) -// } -// k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) -// m := NewAppModule(in.Cdc, k, in.LegacySubspace) -// return consensusParamOutputs{consensusParamKeeper: k, Module: runtime.WrapAppModule(m)} -//} +type consensusParamInputs struct { + depinject.In + + Cdc codec.Codec + Key *store.KVStoreKey + ModuleKey depinject.OwnModuleKey + Authority map[string]sdk.AccAddress `optional:"true"` + + // LegacySubspace is used solely for migration of x/params managed parameters + LegacySubspace exported.ParamStore +} + +type consensusParamOutputs struct { + depinject.Out + + consensusParamKeeper keeper.Keeper + Module runtime.AppModuleWrapper +} + +func provideModule(in consensusParamInputs) consensusParamOutputs { + authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] + if !ok { + // default to governance authority if not provided + authority = authtypes.NewModuleAddress(govtypes.ModuleName) + } + k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) + m := NewAppModule(in.Cdc, k, in.LegacySubspace) + return consensusParamOutputs{consensusParamKeeper: k, Module: runtime.WrapAppModule(m)} +} From 7969d86b2ee47d2195a788d8d62d5c972ceead6e Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 10:41:29 +0200 Subject: [PATCH 19/60] fix imports --- simapp/app_legacy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simapp/app_legacy.go b/simapp/app_legacy.go index dc1153ebb50b..6edc0c905a41 100644 --- a/simapp/app_legacy.go +++ b/simapp/app_legacy.go @@ -50,8 +50,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/capability" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus_param/keeper" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus_param/types" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" From 26ee3f81b28ee32a200312850dacd4f98ca226e8 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 6 Sep 2022 10:51:58 +0200 Subject: [PATCH 20/60] re-generate protos and update `app.go` --- .../module/v1/module.pulsar.go | 145 +++++---- .../v1/query.pulsar.go | 224 +++++++------ .../v1/query_grpc.pb.go | 12 +- .../v1/tx.pulsar.go | 293 +++++++++--------- .../v1/tx_grpc.pb.go | 12 +- go.mod | 3 + go.sum | 2 - proto/cosmos/consensus/module/v1/module.proto | 2 +- simapp/app.go | 37 ++- x/consensus/migrations/v2/store_test.go | 6 +- x/consensus/module.go | 8 +- x/consensus/types/query.pb.go | 68 ++-- x/consensus/types/query.pb.gw.go | 4 +- x/consensus/types/tx.pb.go | 74 +++-- 14 files changed, 444 insertions(+), 446 deletions(-) rename api/cosmos/{consensus_param => consensus}/module/v1/module.pulsar.go (69%) rename api/cosmos/{consensus_param => consensus}/v1/query.pulsar.go (76%) rename api/cosmos/{consensus_param => consensus}/v1/query_grpc.pb.go (91%) rename api/cosmos/{consensus_param => consensus}/v1/tx.pulsar.go (76%) rename api/cosmos/{consensus_param => consensus}/v1/tx_grpc.pb.go (91%) diff --git a/api/cosmos/consensus_param/module/v1/module.pulsar.go b/api/cosmos/consensus/module/v1/module.pulsar.go similarity index 69% rename from api/cosmos/consensus_param/module/v1/module.pulsar.go rename to api/cosmos/consensus/module/v1/module.pulsar.go index f418c5e8e34b..40ace367dc39 100644 --- a/api/cosmos/consensus_param/module/v1/module.pulsar.go +++ b/api/cosmos/consensus/module/v1/module.pulsar.go @@ -18,8 +18,8 @@ var ( ) func init() { - file_cosmos_consensus_param_module_v1_module_proto_init() - md_Module = File_cosmos_consensus_param_module_v1_module_proto.Messages().ByName("Module") + file_cosmos_consensus_module_v1_module_proto_init() + md_Module = File_cosmos_consensus_module_v1_module_proto.Messages().ByName("Module") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -31,7 +31,7 @@ func (x *Module) ProtoReflect() protoreflect.Message { } func (x *Module) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_param_module_v1_module_proto_msgTypes[0] + mi := &file_cosmos_consensus_module_v1_module_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -104,9 +104,9 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -120,9 +120,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus.module.v1.Module does not contain field %s", descriptor.FullName())) } } @@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.consensus_param.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.module.v1.Module", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.module.v1.Module", d.FullName())) } panic("unreachable") } @@ -373,7 +373,7 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: cosmos/consensus_param/module/v1/module.proto +// source: cosmos/consensus/module/v1/module.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -382,7 +382,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Module is the config object of the bank module. +// Module is the config object of the consensus module. type Module struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -392,7 +392,7 @@ type Module struct { func (x *Module) Reset() { *x = Module{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_param_module_v1_module_proto_msgTypes[0] + mi := &file_cosmos_consensus_module_v1_module_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -406,60 +406,57 @@ func (*Module) ProtoMessage() {} // Deprecated: Use Module.ProtoReflect.Descriptor instead. func (*Module) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_param_module_v1_module_proto_rawDescGZIP(), []int{0} + return file_cosmos_consensus_module_v1_module_proto_rawDescGZIP(), []int{0} } -var File_cosmos_consensus_param_module_v1_module_proto protoreflect.FileDescriptor - -var file_cosmos_consensus_param_module_v1_module_proto_rawDesc = []byte{ - 0x0a, 0x2d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, - 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x40, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x36, 0xba, - 0xc0, 0x96, 0xda, 0x01, 0x30, 0x0a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x42, 0x8e, 0x02, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, - 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x4d, 0xaa, - 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_cosmos_consensus_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_consensus_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, + 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x3a, 0x30, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2a, 0x0a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x42, 0xee, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, + 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, + 0x4d, 0xaa, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_cosmos_consensus_param_module_v1_module_proto_rawDescOnce sync.Once - file_cosmos_consensus_param_module_v1_module_proto_rawDescData = file_cosmos_consensus_param_module_v1_module_proto_rawDesc + file_cosmos_consensus_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_consensus_module_v1_module_proto_rawDescData = file_cosmos_consensus_module_v1_module_proto_rawDesc ) -func file_cosmos_consensus_param_module_v1_module_proto_rawDescGZIP() []byte { - file_cosmos_consensus_param_module_v1_module_proto_rawDescOnce.Do(func() { - file_cosmos_consensus_param_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_param_module_v1_module_proto_rawDescData) +func file_cosmos_consensus_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_consensus_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_consensus_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_module_v1_module_proto_rawDescData) }) - return file_cosmos_consensus_param_module_v1_module_proto_rawDescData + return file_cosmos_consensus_module_v1_module_proto_rawDescData } -var file_cosmos_consensus_param_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_cosmos_consensus_param_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: cosmos.consensus_param.module.v1.Module +var file_cosmos_consensus_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_consensus_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.consensus.module.v1.Module } -var file_cosmos_consensus_param_module_v1_module_proto_depIdxs = []int32{ +var file_cosmos_consensus_module_v1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -467,13 +464,13 @@ var file_cosmos_consensus_param_module_v1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_cosmos_consensus_param_module_v1_module_proto_init() } -func file_cosmos_consensus_param_module_v1_module_proto_init() { - if File_cosmos_consensus_param_module_v1_module_proto != nil { +func init() { file_cosmos_consensus_module_v1_module_proto_init() } +func file_cosmos_consensus_module_v1_module_proto_init() { + if File_cosmos_consensus_module_v1_module_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_cosmos_consensus_param_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_consensus_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Module); i { case 0: return &v.state @@ -490,18 +487,18 @@ func file_cosmos_consensus_param_module_v1_module_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_consensus_param_module_v1_module_proto_rawDesc, + RawDescriptor: file_cosmos_consensus_module_v1_module_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_cosmos_consensus_param_module_v1_module_proto_goTypes, - DependencyIndexes: file_cosmos_consensus_param_module_v1_module_proto_depIdxs, - MessageInfos: file_cosmos_consensus_param_module_v1_module_proto_msgTypes, + GoTypes: file_cosmos_consensus_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_consensus_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_consensus_module_v1_module_proto_msgTypes, }.Build() - File_cosmos_consensus_param_module_v1_module_proto = out.File - file_cosmos_consensus_param_module_v1_module_proto_rawDesc = nil - file_cosmos_consensus_param_module_v1_module_proto_goTypes = nil - file_cosmos_consensus_param_module_v1_module_proto_depIdxs = nil + File_cosmos_consensus_module_v1_module_proto = out.File + file_cosmos_consensus_module_v1_module_proto_rawDesc = nil + file_cosmos_consensus_module_v1_module_proto_goTypes = nil + file_cosmos_consensus_module_v1_module_proto_depIdxs = nil } diff --git a/api/cosmos/consensus_param/v1/query.pulsar.go b/api/cosmos/consensus/v1/query.pulsar.go similarity index 76% rename from api/cosmos/consensus_param/v1/query.pulsar.go rename to api/cosmos/consensus/v1/query.pulsar.go index ad6d434683cc..97daabbcc2be 100644 --- a/api/cosmos/consensus_param/v1/query.pulsar.go +++ b/api/cosmos/consensus/v1/query.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package consensus_paramv1 +package consensusv1 import ( types "cosmossdk.io/api/tendermint/types" @@ -19,8 +19,8 @@ var ( ) func init() { - file_cosmos_consensus_param_v1_query_proto_init() - md_QueryParamsRequest = File_cosmos_consensus_param_v1_query_proto.Messages().ByName("QueryParamsRequest") + file_cosmos_consensus_v1_query_proto_init() + md_QueryParamsRequest = File_cosmos_consensus_v1_query_proto.Messages().ByName("QueryParamsRequest") } var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) @@ -32,7 +32,7 @@ func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { } func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_param_v1_query_proto_msgTypes[0] + mi := &file_cosmos_consensus_v1_query_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -105,9 +105,9 @@ func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -121,9 +121,9 @@ func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescripto switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -137,9 +137,9 @@ func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDes switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) } } @@ -157,9 +157,9 @@ func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -177,9 +177,9 @@ func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescrip switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -190,9 +190,9 @@ func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescri switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsRequest")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsRequest does not contain field %s", fd.FullName())) } } @@ -202,7 +202,7 @@ func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescri func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1.QueryParamsRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.QueryParamsRequest", d.FullName())) } panic("unreachable") } @@ -376,8 +376,8 @@ var ( ) func init() { - file_cosmos_consensus_param_v1_query_proto_init() - md_QueryParamsResponse = File_cosmos_consensus_param_v1_query_proto.Messages().ByName("QueryParamsResponse") + file_cosmos_consensus_v1_query_proto_init() + md_QueryParamsResponse = File_cosmos_consensus_v1_query_proto.Messages().ByName("QueryParamsResponse") fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") } @@ -390,7 +390,7 @@ func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { } func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_param_v1_query_proto_msgTypes[1] + mi := &file_cosmos_consensus_v1_query_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -467,13 +467,13 @@ func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDesc // a repeated field is populated if it is non-empty. func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.consensus_param.v1.QueryParamsResponse.params": + case "cosmos.consensus.v1.QueryParamsResponse.params": return x.Params != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -485,13 +485,13 @@ func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.consensus_param.v1.QueryParamsResponse.params": + case "cosmos.consensus.v1.QueryParamsResponse.params": x.Params = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -503,14 +503,14 @@ func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescript // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.consensus_param.v1.QueryParamsResponse.params": + case "cosmos.consensus.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.consensus_param.v1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) } } @@ -526,13 +526,13 @@ func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDe // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.consensus_param.v1.QueryParamsResponse.params": + case "cosmos.consensus.v1.QueryParamsResponse.params": x.Params = value.Message().Interface().(*types.ConsensusParams) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -548,16 +548,16 @@ func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.consensus_param.v1.QueryParamsResponse.params": + case "cosmos.consensus.v1.QueryParamsResponse.params": if x.Params == nil { x.Params = new(types.ConsensusParams) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -566,14 +566,14 @@ func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescri // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.consensus_param.v1.QueryParamsResponse.params": + case "cosmos.consensus.v1.QueryParamsResponse.params": m := new(types.ConsensusParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.QueryParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.QueryParamsResponse does not contain field %s", fd.FullName())) } } @@ -583,7 +583,7 @@ func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescr func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus_param.v1.QueryParamsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.QueryParamsResponse", d.FullName())) } panic("unreachable") } @@ -809,7 +809,7 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: cosmos/consensus_param/v1/query.proto +// source: cosmos/consensus/v1/query.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -828,7 +828,7 @@ type QueryParamsRequest struct { func (x *QueryParamsRequest) Reset() { *x = QueryParamsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_param_v1_query_proto_msgTypes[0] + mi := &file_cosmos_consensus_v1_query_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -842,7 +842,7 @@ func (*QueryParamsRequest) ProtoMessage() {} // Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_param_v1_query_proto_rawDescGZIP(), []int{0} + return file_cosmos_consensus_v1_query_proto_rawDescGZIP(), []int{0} } // QueryParamsResponse defines the response type for querying x/consensus_param parameters. @@ -857,7 +857,7 @@ type QueryParamsResponse struct { func (x *QueryParamsResponse) Reset() { *x = QueryParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_param_v1_query_proto_msgTypes[1] + mi := &file_cosmos_consensus_v1_query_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -871,7 +871,7 @@ func (*QueryParamsResponse) ProtoMessage() {} // Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_param_v1_query_proto_rawDescGZIP(), []int{1} + return file_cosmos_consensus_v1_query_proto_rawDescGZIP(), []int{1} } func (x *QueryParamsResponse) GetParams() *types.ConsensusParams { @@ -881,73 +881,69 @@ func (x *QueryParamsResponse) GetParams() *types.ConsensusParams { return nil } -var File_cosmos_consensus_param_v1_query_proto protoreflect.FileDescriptor - -var file_cosmos_consensus_param_v1_query_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, - 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x9c, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x92, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xeb, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, - 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_cosmos_consensus_v1_query_proto protoreflect.FileDescriptor + +var file_cosmos_consensus_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x8a, 0x01, 0x0a, 0x05, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_cosmos_consensus_param_v1_query_proto_rawDescOnce sync.Once - file_cosmos_consensus_param_v1_query_proto_rawDescData = file_cosmos_consensus_param_v1_query_proto_rawDesc + file_cosmos_consensus_v1_query_proto_rawDescOnce sync.Once + file_cosmos_consensus_v1_query_proto_rawDescData = file_cosmos_consensus_v1_query_proto_rawDesc ) -func file_cosmos_consensus_param_v1_query_proto_rawDescGZIP() []byte { - file_cosmos_consensus_param_v1_query_proto_rawDescOnce.Do(func() { - file_cosmos_consensus_param_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_param_v1_query_proto_rawDescData) +func file_cosmos_consensus_v1_query_proto_rawDescGZIP() []byte { + file_cosmos_consensus_v1_query_proto_rawDescOnce.Do(func() { + file_cosmos_consensus_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_v1_query_proto_rawDescData) }) - return file_cosmos_consensus_param_v1_query_proto_rawDescData + return file_cosmos_consensus_v1_query_proto_rawDescData } -var file_cosmos_consensus_param_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_cosmos_consensus_param_v1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: cosmos.consensus_param.v1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: cosmos.consensus_param.v1.QueryParamsResponse +var file_cosmos_consensus_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_consensus_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: cosmos.consensus.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: cosmos.consensus.v1.QueryParamsResponse (*types.ConsensusParams)(nil), // 2: tendermint.types.ConsensusParams } -var file_cosmos_consensus_param_v1_query_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus_param.v1.QueryParamsResponse.params:type_name -> tendermint.types.ConsensusParams - 0, // 1: cosmos.consensus_param.v1.Query.Params:input_type -> cosmos.consensus_param.v1.QueryParamsRequest - 1, // 2: cosmos.consensus_param.v1.Query.Params:output_type -> cosmos.consensus_param.v1.QueryParamsResponse +var file_cosmos_consensus_v1_query_proto_depIdxs = []int32{ + 2, // 0: cosmos.consensus.v1.QueryParamsResponse.params:type_name -> tendermint.types.ConsensusParams + 0, // 1: cosmos.consensus.v1.Query.Params:input_type -> cosmos.consensus.v1.QueryParamsRequest + 1, // 2: cosmos.consensus.v1.Query.Params:output_type -> cosmos.consensus.v1.QueryParamsResponse 2, // [2:3] is the sub-list for method output_type 1, // [1:2] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -955,13 +951,13 @@ var file_cosmos_consensus_param_v1_query_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_cosmos_consensus_param_v1_query_proto_init() } -func file_cosmos_consensus_param_v1_query_proto_init() { - if File_cosmos_consensus_param_v1_query_proto != nil { +func init() { file_cosmos_consensus_v1_query_proto_init() } +func file_cosmos_consensus_v1_query_proto_init() { + if File_cosmos_consensus_v1_query_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_cosmos_consensus_param_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_consensus_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { case 0: return &v.state @@ -973,7 +969,7 @@ func file_cosmos_consensus_param_v1_query_proto_init() { return nil } } - file_cosmos_consensus_param_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_consensus_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsResponse); i { case 0: return &v.state @@ -990,18 +986,18 @@ func file_cosmos_consensus_param_v1_query_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_consensus_param_v1_query_proto_rawDesc, + RawDescriptor: file_cosmos_consensus_v1_query_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_cosmos_consensus_param_v1_query_proto_goTypes, - DependencyIndexes: file_cosmos_consensus_param_v1_query_proto_depIdxs, - MessageInfos: file_cosmos_consensus_param_v1_query_proto_msgTypes, + GoTypes: file_cosmos_consensus_v1_query_proto_goTypes, + DependencyIndexes: file_cosmos_consensus_v1_query_proto_depIdxs, + MessageInfos: file_cosmos_consensus_v1_query_proto_msgTypes, }.Build() - File_cosmos_consensus_param_v1_query_proto = out.File - file_cosmos_consensus_param_v1_query_proto_rawDesc = nil - file_cosmos_consensus_param_v1_query_proto_goTypes = nil - file_cosmos_consensus_param_v1_query_proto_depIdxs = nil + File_cosmos_consensus_v1_query_proto = out.File + file_cosmos_consensus_v1_query_proto_rawDesc = nil + file_cosmos_consensus_v1_query_proto_goTypes = nil + file_cosmos_consensus_v1_query_proto_depIdxs = nil } diff --git a/api/cosmos/consensus_param/v1/query_grpc.pb.go b/api/cosmos/consensus/v1/query_grpc.pb.go similarity index 91% rename from api/cosmos/consensus_param/v1/query_grpc.pb.go rename to api/cosmos/consensus/v1/query_grpc.pb.go index 1c60a7d8b3f9..32c40ff53bd8 100644 --- a/api/cosmos/consensus_param/v1/query_grpc.pb.go +++ b/api/cosmos/consensus/v1/query_grpc.pb.go @@ -2,9 +2,9 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: cosmos/consensus_param/v1/query.proto +// source: cosmos/consensus/v1/query.proto -package consensus_paramv1 +package consensusv1 import ( context "context" @@ -36,7 +36,7 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.consensus.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -82,7 +82,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.consensus_param.v1.Query/Params", + FullMethod: "/cosmos.consensus.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -94,7 +94,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.consensus_param.v1.Query", + ServiceName: "cosmos.consensus.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -103,5 +103,5 @@ var Query_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/consensus_param/v1/query.proto", + Metadata: "cosmos/consensus/v1/query.proto", } diff --git a/api/cosmos/consensus_param/v1/tx.pulsar.go b/api/cosmos/consensus/v1/tx.pulsar.go similarity index 76% rename from api/cosmos/consensus_param/v1/tx.pulsar.go rename to api/cosmos/consensus/v1/tx.pulsar.go index f50ced3c1cff..3e2fbb36fc45 100644 --- a/api/cosmos/consensus_param/v1/tx.pulsar.go +++ b/api/cosmos/consensus/v1/tx.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package consensus_paramv1 +package consensusv1 import ( _ "cosmossdk.io/api/cosmos/msg/v1" @@ -25,8 +25,8 @@ var ( ) func init() { - file_cosmos_consensus_param_v1_tx_proto_init() - md_MsgUpdateParams = File_cosmos_consensus_param_v1_tx_proto.Messages().ByName("MsgUpdateParams") + file_cosmos_consensus_v1_tx_proto_init() + md_MsgUpdateParams = File_cosmos_consensus_v1_tx_proto.Messages().ByName("MsgUpdateParams") fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") fd_MsgUpdateParams_block = md_MsgUpdateParams.Fields().ByName("block") fd_MsgUpdateParams_evidence = md_MsgUpdateParams.Fields().ByName("evidence") @@ -42,7 +42,7 @@ func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { } func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_param_v1_tx_proto_msgTypes[0] + mi := &file_cosmos_consensus_v1_tx_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -137,19 +137,19 @@ func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescript // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.consensus_param.v1.MsgUpdateParams.authority": + case "cosmos.consensus.v1.MsgUpdateParams.authority": return x.Authority != "" - case "cosmos.consensus_param.v1.MsgUpdateParams.block": + case "cosmos.consensus.v1.MsgUpdateParams.block": return x.Block != nil - case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + case "cosmos.consensus.v1.MsgUpdateParams.evidence": return x.Evidence != nil - case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + case "cosmos.consensus.v1.MsgUpdateParams.validator": return x.Validator != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -161,19 +161,19 @@ func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bo // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.consensus_param.v1.MsgUpdateParams.authority": + case "cosmos.consensus.v1.MsgUpdateParams.authority": x.Authority = "" - case "cosmos.consensus_param.v1.MsgUpdateParams.block": + case "cosmos.consensus.v1.MsgUpdateParams.block": x.Block = nil - case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + case "cosmos.consensus.v1.MsgUpdateParams.evidence": x.Evidence = nil - case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + case "cosmos.consensus.v1.MsgUpdateParams.validator": x.Validator = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -185,23 +185,23 @@ func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) // 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.consensus_param.v1.MsgUpdateParams.authority": + case "cosmos.consensus.v1.MsgUpdateParams.authority": value := x.Authority return protoreflect.ValueOfString(value) - case "cosmos.consensus_param.v1.MsgUpdateParams.block": + case "cosmos.consensus.v1.MsgUpdateParams.block": value := x.Block return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + case "cosmos.consensus.v1.MsgUpdateParams.evidence": value := x.Evidence return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + case "cosmos.consensus.v1.MsgUpdateParams.validator": value := x.Validator return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) } } @@ -217,19 +217,19 @@ func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescri // 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.consensus_param.v1.MsgUpdateParams.authority": + case "cosmos.consensus.v1.MsgUpdateParams.authority": x.Authority = value.Interface().(string) - case "cosmos.consensus_param.v1.MsgUpdateParams.block": + case "cosmos.consensus.v1.MsgUpdateParams.block": x.Block = value.Message().Interface().(*types.BlockParams) - case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + case "cosmos.consensus.v1.MsgUpdateParams.evidence": x.Evidence = value.Message().Interface().(*types.EvidenceParams) - case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + case "cosmos.consensus.v1.MsgUpdateParams.validator": x.Validator = value.Message().Interface().(*types.ValidatorParams) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -245,28 +245,28 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va // 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.consensus_param.v1.MsgUpdateParams.block": + case "cosmos.consensus.v1.MsgUpdateParams.block": if x.Block == nil { x.Block = new(types.BlockParams) } return protoreflect.ValueOfMessage(x.Block.ProtoReflect()) - case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + case "cosmos.consensus.v1.MsgUpdateParams.evidence": if x.Evidence == nil { x.Evidence = new(types.EvidenceParams) } return protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) - case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + case "cosmos.consensus.v1.MsgUpdateParams.validator": if x.Validator == nil { x.Validator = new(types.ValidatorParams) } return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) - case "cosmos.consensus_param.v1.MsgUpdateParams.authority": - panic(fmt.Errorf("field authority of message cosmos.consensus_param.v1.MsgUpdateParams is not mutable")) + case "cosmos.consensus.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message cosmos.consensus.v1.MsgUpdateParams is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -275,22 +275,22 @@ func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor // 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.consensus_param.v1.MsgUpdateParams.authority": + case "cosmos.consensus.v1.MsgUpdateParams.authority": return protoreflect.ValueOfString("") - case "cosmos.consensus_param.v1.MsgUpdateParams.block": + case "cosmos.consensus.v1.MsgUpdateParams.block": m := new(types.BlockParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus_param.v1.MsgUpdateParams.evidence": + case "cosmos.consensus.v1.MsgUpdateParams.evidence": m := new(types.EvidenceParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus_param.v1.MsgUpdateParams.validator": + case "cosmos.consensus.v1.MsgUpdateParams.validator": m := new(types.ValidatorParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -300,7 +300,7 @@ func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescripto 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.consensus_param.v1.MsgUpdateParams", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.MsgUpdateParams", d.FullName())) } panic("unreachable") } @@ -678,8 +678,8 @@ var ( ) func init() { - file_cosmos_consensus_param_v1_tx_proto_init() - md_MsgUpdateParamsResponse = File_cosmos_consensus_param_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") + file_cosmos_consensus_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_cosmos_consensus_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") } var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) @@ -691,7 +691,7 @@ func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { } func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_param_v1_tx_proto_msgTypes[1] + mi := &file_cosmos_consensus_v1_tx_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -764,9 +764,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescri switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -780,9 +780,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDesc switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -796,9 +796,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.Fie switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) } } @@ -816,9 +816,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescri switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -836,9 +836,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDe switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -849,9 +849,9 @@ func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldD switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus_param.v1.MsgUpdateParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus_param.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -861,7 +861,7 @@ func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldD 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.consensus_param.v1.MsgUpdateParamsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.MsgUpdateParamsResponse", d.FullName())) } panic("unreachable") } @@ -1033,7 +1033,7 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: cosmos/consensus_param/v1/tx.proto +// source: cosmos/consensus/v1/tx.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -1063,7 +1063,7 @@ type MsgUpdateParams struct { func (x *MsgUpdateParams) Reset() { *x = MsgUpdateParams{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_param_v1_tx_proto_msgTypes[0] + mi := &file_cosmos_consensus_v1_tx_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1077,7 +1077,7 @@ func (*MsgUpdateParams) ProtoMessage() {} // Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_param_v1_tx_proto_rawDescGZIP(), []int{0} + return file_cosmos_consensus_v1_tx_proto_rawDescGZIP(), []int{0} } func (x *MsgUpdateParams) GetAuthority() string { @@ -1121,7 +1121,7 @@ type MsgUpdateParamsResponse struct { func (x *MsgUpdateParamsResponse) Reset() { *x = MsgUpdateParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_param_v1_tx_proto_msgTypes[1] + mi := &file_cosmos_consensus_v1_tx_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1135,93 +1135,90 @@ func (*MsgUpdateParamsResponse) ProtoMessage() {} // Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_param_v1_tx_proto_rawDescGZIP(), []int{1} + return file_cosmos_consensus_v1_tx_proto_rawDescGZIP(), []int{1} } -var File_cosmos_consensus_param_v1_tx_proto protoreflect.FileDescriptor - -var file_cosmos_consensus_param_v1_tx_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x1a, - 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, 0x02, 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, 0x39, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x42, 0x0a, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, - 0x6e, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, - 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 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, 0x75, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x6e, 0x0a, 0x0c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2a, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 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, 0xe8, 0x01, 0x0a, - 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x07, - 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x18, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_cosmos_consensus_v1_tx_proto protoreflect.FileDescriptor + +var file_cosmos_consensus_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, + 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, 0x02, 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, 0x39, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x42, 0x0a, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x65, + 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 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, 0x69, 0x0a, 0x03, 0x4d, 0x73, 0x67, + 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 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, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, + 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, + 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( - file_cosmos_consensus_param_v1_tx_proto_rawDescOnce sync.Once - file_cosmos_consensus_param_v1_tx_proto_rawDescData = file_cosmos_consensus_param_v1_tx_proto_rawDesc + file_cosmos_consensus_v1_tx_proto_rawDescOnce sync.Once + file_cosmos_consensus_v1_tx_proto_rawDescData = file_cosmos_consensus_v1_tx_proto_rawDesc ) -func file_cosmos_consensus_param_v1_tx_proto_rawDescGZIP() []byte { - file_cosmos_consensus_param_v1_tx_proto_rawDescOnce.Do(func() { - file_cosmos_consensus_param_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_param_v1_tx_proto_rawDescData) +func file_cosmos_consensus_v1_tx_proto_rawDescGZIP() []byte { + file_cosmos_consensus_v1_tx_proto_rawDescOnce.Do(func() { + file_cosmos_consensus_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_v1_tx_proto_rawDescData) }) - return file_cosmos_consensus_param_v1_tx_proto_rawDescData + return file_cosmos_consensus_v1_tx_proto_rawDescData } -var file_cosmos_consensus_param_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_cosmos_consensus_param_v1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: cosmos.consensus_param.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: cosmos.consensus_param.v1.MsgUpdateParamsResponse +var file_cosmos_consensus_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_consensus_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: cosmos.consensus.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: cosmos.consensus.v1.MsgUpdateParamsResponse (*types.BlockParams)(nil), // 2: tendermint.types.BlockParams (*types.EvidenceParams)(nil), // 3: tendermint.types.EvidenceParams (*types.ValidatorParams)(nil), // 4: tendermint.types.ValidatorParams } -var file_cosmos_consensus_param_v1_tx_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus_param.v1.MsgUpdateParams.block:type_name -> tendermint.types.BlockParams - 3, // 1: cosmos.consensus_param.v1.MsgUpdateParams.evidence:type_name -> tendermint.types.EvidenceParams - 4, // 2: cosmos.consensus_param.v1.MsgUpdateParams.validator:type_name -> tendermint.types.ValidatorParams - 0, // 3: cosmos.consensus_param.v1.Msg.UpdateParams:input_type -> cosmos.consensus_param.v1.MsgUpdateParams - 1, // 4: cosmos.consensus_param.v1.Msg.UpdateParams:output_type -> cosmos.consensus_param.v1.MsgUpdateParamsResponse +var file_cosmos_consensus_v1_tx_proto_depIdxs = []int32{ + 2, // 0: cosmos.consensus.v1.MsgUpdateParams.block:type_name -> tendermint.types.BlockParams + 3, // 1: cosmos.consensus.v1.MsgUpdateParams.evidence:type_name -> tendermint.types.EvidenceParams + 4, // 2: cosmos.consensus.v1.MsgUpdateParams.validator:type_name -> tendermint.types.ValidatorParams + 0, // 3: cosmos.consensus.v1.Msg.UpdateParams:input_type -> cosmos.consensus.v1.MsgUpdateParams + 1, // 4: cosmos.consensus.v1.Msg.UpdateParams:output_type -> cosmos.consensus.v1.MsgUpdateParamsResponse 4, // [4:5] is the sub-list for method output_type 3, // [3:4] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name @@ -1229,13 +1226,13 @@ var file_cosmos_consensus_param_v1_tx_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_cosmos_consensus_param_v1_tx_proto_init() } -func file_cosmos_consensus_param_v1_tx_proto_init() { - if File_cosmos_consensus_param_v1_tx_proto != nil { +func init() { file_cosmos_consensus_v1_tx_proto_init() } +func file_cosmos_consensus_v1_tx_proto_init() { + if File_cosmos_consensus_v1_tx_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_cosmos_consensus_param_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_consensus_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { case 0: return &v.state @@ -1247,7 +1244,7 @@ func file_cosmos_consensus_param_v1_tx_proto_init() { return nil } } - file_cosmos_consensus_param_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_consensus_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParamsResponse); i { case 0: return &v.state @@ -1264,18 +1261,18 @@ func file_cosmos_consensus_param_v1_tx_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_consensus_param_v1_tx_proto_rawDesc, + RawDescriptor: file_cosmos_consensus_v1_tx_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_cosmos_consensus_param_v1_tx_proto_goTypes, - DependencyIndexes: file_cosmos_consensus_param_v1_tx_proto_depIdxs, - MessageInfos: file_cosmos_consensus_param_v1_tx_proto_msgTypes, + GoTypes: file_cosmos_consensus_v1_tx_proto_goTypes, + DependencyIndexes: file_cosmos_consensus_v1_tx_proto_depIdxs, + MessageInfos: file_cosmos_consensus_v1_tx_proto_msgTypes, }.Build() - File_cosmos_consensus_param_v1_tx_proto = out.File - file_cosmos_consensus_param_v1_tx_proto_rawDesc = nil - file_cosmos_consensus_param_v1_tx_proto_goTypes = nil - file_cosmos_consensus_param_v1_tx_proto_depIdxs = nil + File_cosmos_consensus_v1_tx_proto = out.File + file_cosmos_consensus_v1_tx_proto_rawDesc = nil + file_cosmos_consensus_v1_tx_proto_goTypes = nil + file_cosmos_consensus_v1_tx_proto_depIdxs = nil } diff --git a/api/cosmos/consensus_param/v1/tx_grpc.pb.go b/api/cosmos/consensus/v1/tx_grpc.pb.go similarity index 91% rename from api/cosmos/consensus_param/v1/tx_grpc.pb.go rename to api/cosmos/consensus/v1/tx_grpc.pb.go index 8cee688baa39..bd1142042cd1 100644 --- a/api/cosmos/consensus_param/v1/tx_grpc.pb.go +++ b/api/cosmos/consensus/v1/tx_grpc.pb.go @@ -2,9 +2,9 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: cosmos/consensus_param/v1/tx.proto +// source: cosmos/consensus/v1/tx.proto -package consensus_paramv1 +package consensusv1 import ( context "context" @@ -39,7 +39,7 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1.Msg/UpdateParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.consensus.v1.Msg/UpdateParams", in, out, opts...) if err != nil { return nil, err } @@ -88,7 +88,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.consensus_param.v1.Msg/UpdateParams", + FullMethod: "/cosmos.consensus.v1.Msg/UpdateParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) @@ -100,7 +100,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.consensus_param.v1.Msg", + ServiceName: "cosmos.consensus.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -109,5 +109,5 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/consensus_param/v1/tx.proto", + Metadata: "cosmos/consensus/v1/tx.proto", } diff --git a/go.mod b/go.mod index 468f7b04efa9..8ad9a8f82865 100644 --- a/go.mod +++ b/go.mod @@ -290,6 +290,9 @@ require ( ) replace ( + + // TODO MUST BE REMOVED IN THE NEXT FOLLOWING PR (or this PR needs to be split and cosmossdk.io/api tagged) + cosmossdk.io/api => ./api github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 diff --git a/go.sum b/go.sum index 54c131ef9215..e79c4cf5fd18 100644 --- a/go.sum +++ b/go.sum @@ -59,8 +59,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0 h1:6RRlFMv1omScs6iq2hfE3IvgE+l6RfJPampq8UZc5TU= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.1.0-alpha9 h1:8QQT+BhaMpcCgR4Wm8JVuhhtj4a7uZjsxvvWvmsQFB0= -cosmossdk.io/api v0.1.0-alpha9/go.mod h1:PyJpp0BY4tHLI0kzkiUzpZxgOE+pJbhDPleYrA5yVio= cosmossdk.io/core v0.2.0 h1:gwDzEzCX4tyegDAgmNOsVaiSKG4ILg7wo2D5KW0bhMQ= cosmossdk.io/core v0.2.0/go.mod h1:w5HHliErOpYv2LlUPA2FYYHtElsCaf9oiXM6TM+ueZI= cosmossdk.io/depinject v1.0.0-alpha.2 h1:pVcPnqc8bY2GCHVMj77rk6Ew7uz0K3QhrUHdqoKvO5g= diff --git a/proto/cosmos/consensus/module/v1/module.proto b/proto/cosmos/consensus/module/v1/module.proto index e223e9513da7..f5e73a8e1047 100644 --- a/proto/cosmos/consensus/module/v1/module.proto +++ b/proto/cosmos/consensus/module/v1/module.proto @@ -4,7 +4,7 @@ package cosmos.consensus.module.v1; import "cosmos/app/v1alpha1/module.proto"; -// Module is the config object of the bank module. +// Module is the config object of the consensus module. message Module { option (cosmos.app.v1alpha1.module) = { go_import: "github.com/cosmos/cosmos-sdk/x/consensus" diff --git a/simapp/app.go b/simapp/app.go index 5c8e3a4f8947..e5aad73c63b8 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -45,6 +45,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/capability" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + consensus "github.com/cosmos/cosmos-sdk/x/consensus" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" @@ -120,6 +122,7 @@ var ( groupmodule.AppModuleBasic{}, vesting.AppModuleBasic{}, nftmodule.AppModuleBasic{}, + consensus.AppModuleBasic{}, ) ) @@ -142,22 +145,23 @@ type SimApp struct { keys map[string]*storetypes.KVStoreKey // keepers - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper *stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - GovKeeper *govkeeper.Keeper - CrisisKeeper *crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - AuthzKeeper authzkeeper.Keeper - EvidenceKeeper evidencekeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - GroupKeeper groupkeeper.Keeper - NFTKeeper nftkeeper.Keeper + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + CapabilityKeeper *capabilitykeeper.Keeper + StakingKeeper *stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper + MintKeeper mintkeeper.Keeper + DistrKeeper distrkeeper.Keeper + GovKeeper *govkeeper.Keeper + CrisisKeeper *crisiskeeper.Keeper + UpgradeKeeper upgradekeeper.Keeper + ParamsKeeper paramskeeper.Keeper + AuthzKeeper authzkeeper.Keeper + EvidenceKeeper evidencekeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + GroupKeeper groupkeeper.Keeper + NFTKeeper nftkeeper.Keeper + ConsensusParamsKeeper consensusparamkeeper.Keeper // simulation manager sm *module.SimulationManager @@ -225,6 +229,7 @@ func NewSimApp( &app.FeeGrantKeeper, &app.GroupKeeper, &app.NFTKeeper, + &app.ConsensusParamsKeeper, ); err != nil { panic(err) } diff --git a/x/consensus/migrations/v2/store_test.go b/x/consensus/migrations/v2/store_test.go index bdb8fa3d1852..7358d0677eaf 100644 --- a/x/consensus/migrations/v2/store_test.go +++ b/x/consensus/migrations/v2/store_test.go @@ -6,9 +6,9 @@ import ( "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/consensus_param" - v1 "github.com/cosmos/cosmos-sdk/x/consensus_param/migrations/v1" - v2 "github.com/cosmos/cosmos-sdk/x/consensus_param/migrations/v2" + "github.com/cosmos/cosmos-sdk/x/consensus" + v1 "github.com/cosmos/cosmos-sdk/x/consensus/migrations/v1" + v2 "github.com/cosmos/cosmos-sdk/x/consensus/migrations/v2" "github.com/stretchr/testify/require" tmtypes "github.com/tendermint/tendermint/types" diff --git a/x/consensus/module.go b/x/consensus/module.go index 39ed549955e7..ebffe0a395b7 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -16,6 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" + store "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -156,7 +157,12 @@ func provideModule(in consensusParamInputs) consensusParamOutputs { // default to governance authority if not provided authority = authtypes.NewModuleAddress(govtypes.ModuleName) } + k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) m := NewAppModule(in.Cdc, k, in.LegacySubspace) - return consensusParamOutputs{consensusParamKeeper: k, Module: runtime.WrapAppModule(m)} + + return consensusParamOutputs{ + consensusParamKeeper: k, + Module: runtime.WrapAppModule(m), + } } diff --git a/x/consensus/types/query.pb.go b/x/consensus/types/query.pb.go index 5be5839ca7b2..a7e9664f2302 100644 --- a/x/consensus/types/query.pb.go +++ b/x/consensus/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/consensus_param/v1/query.proto +// source: cosmos/consensus/v1/query.proto package types @@ -37,7 +37,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3d2ae9668ec06671, []int{0} + return fileDescriptor_bf54d1e5df04cee9, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,7 +75,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3d2ae9668ec06671, []int{1} + return fileDescriptor_bf54d1e5df04cee9, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -112,34 +112,32 @@ func (m *QueryParamsResponse) GetParams() *types.ConsensusParams { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.consensus_param.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.consensus_param.v1.QueryParamsResponse") -} - -func init() { - proto.RegisterFile("cosmos/consensus_param/v1/query.proto", fileDescriptor_3d2ae9668ec06671) -} - -var fileDescriptor_3d2ae9668ec06671 = []byte{ - // 283 bytes of a gzipped FileDescript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0xf4, 0x95, 0x1e, 0xa6, 0xab, 0xa4, 0xf4, 0x88, 0x55, 0x0e, - 0x71, 0xae, 0x92, 0x66, 0xd3, 0xe5, 0x27, 0x93, 0x99, 0x94, 0x85, 0x14, 0xf5, 0x71, 0x87, 0x31, - 0xc4, 0x79, 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, - 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x92, - 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x8b, 0x30, 0x06, 0x44, 0xe9, 0x16, 0xa7, - 0x64, 0xeb, 0x57, 0x60, 0x98, 0x09, 0x0e, 0x86, 0x24, 0x36, 0x70, 0xe8, 0x1a, 0x03, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x59, 0xcf, 0xea, 0xbf, 0xde, 0x01, 0x00, 0x00, + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.consensus.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.consensus.v1.QueryParamsResponse") +} + +func init() { proto.RegisterFile("cosmos/consensus/v1/query.proto", fileDescriptor_bf54d1e5df04cee9) } + +var fileDescriptor_bf54d1e5df04cee9 = []byte{ + // 279 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, + 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x28, 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8d, 0xc7, 0x72, 0x0c, 0x51, 0x7a, 0xe9, 0x99, 0x25, 0x19, + 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0x08, 0x03, 0x40, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, + 0x92, 0x69, 0x60, 0xef, 0x26, 0xb1, 0x81, 0x43, 0xd1, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x1b, + 0xa2, 0x35, 0xa1, 0xba, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -168,7 +166,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.consensus.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -203,7 +201,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.consensus_param.v1.Query/Params", + FullMethod: "/cosmos.consensus.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -212,7 +210,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.consensus_param.v1.Query", + ServiceName: "cosmos.consensus.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -221,7 +219,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/consensus_param/v1/query.proto", + Metadata: "cosmos/consensus/v1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/consensus/types/query.pb.gw.go b/x/consensus/types/query.pb.gw.go index 972bac058000..c2bd4deb378f 100644 --- a/x/consensus/types/query.pb.gw.go +++ b/x/consensus/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/consensus_param/v1/query.proto +// source: cosmos/consensus/v1/query.proto /* Package types is a reverse proxy. @@ -145,7 +145,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "consensus_param", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "consensus", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/consensus/types/tx.pb.go b/x/consensus/types/tx.pb.go index b6a09c715fe5..9d9354bfe697 100644 --- a/x/consensus/types/tx.pb.go +++ b/x/consensus/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/consensus_param/v1/tx.proto +// source: cosmos/consensus/v1/tx.proto package types @@ -49,7 +49,7 @@ 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_512bd98009ecbd38, []int{0} + return fileDescriptor_2135c60575ab504d, []int{0} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -117,7 +117,7 @@ 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_512bd98009ecbd38, []int{1} + return fileDescriptor_2135c60575ab504d, []int{1} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -147,41 +147,39 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.consensus_param.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.consensus_param.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.consensus.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.consensus.v1.MsgUpdateParamsResponse") } -func init() { - proto.RegisterFile("cosmos/consensus_param/v1/tx.proto", fileDescriptor_512bd98009ecbd38) -} +func init() { proto.RegisterFile("cosmos/consensus/v1/tx.proto", fileDescriptor_2135c60575ab504d) } -var fileDescriptor_512bd98009ecbd38 = []byte{ +var fileDescriptor_2135c60575ab504d = []byte{ // 388 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x6a, 0xc2, 0x40, - 0x18, 0x85, 0x13, 0xb5, 0xa5, 0x4e, 0x4b, 0x0b, 0x41, 0x30, 0x0a, 0xa6, 0xd6, 0x95, 0x08, 0xce, - 0xa0, 0x2d, 0x85, 0x76, 0xd7, 0x80, 0x4b, 0x4b, 0xb1, 0xb4, 0x8b, 0x6e, 0x24, 0x26, 0xc3, 0x18, - 0x34, 0x99, 0x90, 0x99, 0x04, 0xdd, 0xf6, 0x04, 0xbd, 0x41, 0xaf, 0xd0, 0x45, 0x0f, 0xe1, 0x52, - 0xba, 0xea, 0xaa, 0x14, 0x5d, 0xf4, 0x1a, 0x25, 0x93, 0x68, 0x50, 0x29, 0x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xf3, 0xd3, 0xf3, 0xc1, 0xf2, 0xfa, 0x20, 0x16, 0x44, 0xa9, 0x94, + 0x24, 0x44, 0x69, 0x3c, 0x44, 0x02, 0xaa, 0x0f, 0x22, 0x25, 0x0e, 0xb5, 0x23, 0xb7, 0x38, 0x1d, + 0x64, 0x7a, 0x6e, 0x71, 0x3a, 0x54, 0x42, 0xb6, 0x24, 0x35, 0x2f, 0x25, 0xb5, 0x28, 0x37, 0x33, + 0xaf, 0x44, 0xbf, 0xa4, 0xb2, 0x20, 0xb5, 0x58, 0xbf, 0x20, 0xb1, 0x28, 0x31, 0x17, 0xaa, 0x4f, + 0x69, 0x3e, 0x13, 0x17, 0xbf, 0x6f, 0x71, 0x7a, 0x68, 0x41, 0x4a, 0x62, 0x49, 0x6a, 0x00, 0x58, + 0x46, 0xc8, 0x8c, 0x8b, 0x33, 0xb1, 0xb4, 0x24, 0x23, 0xbf, 0x28, 0xb3, 0xa4, 0x52, 0x82, 0x51, + 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe2, 0xd2, 0x16, 0x5d, 0x11, 0xa8, 0x85, 0x8e, 0x29, 0x29, 0x45, + 0xa9, 0xc5, 0xc5, 0xc1, 0x25, 0x45, 0x99, 0x79, 0xe9, 0x41, 0x08, 0xa5, 0x42, 0x96, 0x5c, 0xac, + 0x49, 0x39, 0xf9, 0xc9, 0xd9, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0xb2, 0x7a, 0x08, 0xab, + 0xf5, 0xc0, 0x56, 0xeb, 0x39, 0x81, 0xa4, 0x21, 0xb6, 0x38, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, + 0x04, 0xd1, 0x21, 0xe4, 0xc4, 0xc5, 0x91, 0x5a, 0x96, 0x99, 0x92, 0x9a, 0x97, 0x9c, 0x2a, 0xc1, + 0x0c, 0xd6, 0xad, 0x80, 0xa9, 0xdb, 0x15, 0xaa, 0x02, 0xc5, 0x00, 0xb8, 0x3e, 0x21, 0x57, 0x2e, + 0xce, 0xb2, 0xc4, 0x9c, 0xcc, 0x94, 0xc4, 0x92, 0xfc, 0x22, 0x09, 0x16, 0xb0, 0x21, 0x8a, 0x98, + 0x86, 0x84, 0xc1, 0x94, 0xa0, 0x98, 0x82, 0xd0, 0x69, 0xc5, 0xd7, 0xf4, 0x7c, 0x83, 0x16, 0xc2, + 0x57, 0x4a, 0x92, 0x5c, 0xe2, 0x68, 0x01, 0x14, 0x94, 0x5a, 0x5c, 0x00, 0x8a, 0x2c, 0xa3, 0x4c, + 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x24, 0x2e, 0x1e, 0x94, 0xf0, 0x53, 0xd1, 0xc3, 0x12, 0xa5, + 0x7a, 0x68, 0x86, 0x48, 0xe9, 0x10, 0xa3, 0x0a, 0x66, 0x95, 0x93, 0xc7, 0x89, 0x47, 0x72, 0x8c, + 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, + 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, + 0xe7, 0xea, 0xc3, 0x13, 0x1a, 0x88, 0xd2, 0x2d, 0x4e, 0xc9, 0xd6, 0xaf, 0x40, 0x4a, 0x75, 0xe0, + 0x00, 0x48, 0x62, 0x03, 0x47, 0xbc, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x06, 0x96, 0x20, 0x80, + 0x96, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -213,7 +211,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus_param.v1.Msg/UpdateParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/cosmos.consensus.v1.Msg/UpdateParams", in, out, opts...) if err != nil { return nil, err } @@ -251,7 +249,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.consensus_param.v1.Msg/UpdateParams", + FullMethod: "/cosmos.consensus.v1.Msg/UpdateParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) @@ -260,7 +258,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.consensus_param.v1.Msg", + ServiceName: "cosmos.consensus.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -269,7 +267,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/consensus_param/v1/tx.proto", + Metadata: "cosmos/consensus/v1/tx.proto", } func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { From ccc6cfc3ada99d6da7e33d8cf435a770a10ff667 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 6 Sep 2022 11:02:10 +0200 Subject: [PATCH 21/60] `make lint-fix` --- x/consensus/README.md | 7 +++++-- x/consensus/keeper/keeper.go | 1 - x/consensus/module.go | 1 - x/consensus/types/msgs.go | 4 +--- x/consensus/types/params.go | 1 - 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/x/consensus/README.md b/x/consensus/README.md index b9b428e19af3..fb20f9827d5f 100644 --- a/x/consensus/README.md +++ b/x/consensus/README.md @@ -1,7 +1,10 @@ -# Consensus Parameters +# `x/consensus` -* [ConsensusParams](spec/README.md) - Functionality to modify consensus params. +Functionality to modify consensus params. diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index cf99c07f2bbc..b6ea18f67984 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -53,7 +53,6 @@ func (k *Keeper) Has(ctx sdk.Context) bool { // Set sets the consensus parameters func (k *Keeper) Set(ctx sdk.Context, cp *tmproto.ConsensusParams) { - store := ctx.KVStore(k.storeKey) store.Set(types.ParamStoreKeyConsensusParams, k.cdc.MustMarshal(cp)) } diff --git a/x/consensus/module.go b/x/consensus/module.go index ebffe0a395b7..3ed7b6122c51 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -92,7 +92,6 @@ type AppModule struct { func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(am.keeper)) - } // NewAppModule creates a new AppModule object diff --git a/x/consensus/types/msgs.go b/x/consensus/types/msgs.go index d2af9990d706..eaa00b0c7bb4 100644 --- a/x/consensus/types/msgs.go +++ b/x/consensus/types/msgs.go @@ -11,9 +11,7 @@ const ( TypeMsgUpdateParams = "update_params" ) -var ( - _ sdk.Msg = &MsgUpdateParams{} -) +var _ sdk.Msg = &MsgUpdateParams{} // GetSigners returns the signer addresses that are expected to sign the result // of GetSignBytes. diff --git a/x/consensus/types/params.go b/x/consensus/types/params.go index 2778b0a15c23..d4d48b7afc38 100644 --- a/x/consensus/types/params.go +++ b/x/consensus/types/params.go @@ -7,7 +7,6 @@ import ( // Validate all module parameters func Validate(p tmtypes.ConsensusParams) error { return p.ValidateBasic() - } // String implements the Stringer interface. From 6ff7c3f7cedc80fafd63cf2b2e2ad9b4ff6dae2b Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 6 Sep 2022 11:12:06 +0200 Subject: [PATCH 22/60] wire x/consensus --- simapp/app_config.go | 6 ++++++ x/consensus/module.go | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/simapp/app_config.go b/simapp/app_config.go index b2c140018dde..a9180ecb1f45 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -9,6 +9,7 @@ import ( authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" capabilitymodulev1 "cosmossdk.io/api/cosmos/capability/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" crisismodulev1 "cosmossdk.io/api/cosmos/crisis/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" evidencemodulev1 "cosmossdk.io/api/cosmos/evidence/module/v1" @@ -32,6 +33,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" @@ -217,6 +219,10 @@ var ( Name: crisistypes.ModuleName, Config: appconfig.WrapAny(&crisismodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, }, }) ) diff --git a/x/consensus/module.go b/x/consensus/module.go index 3ed7b6122c51..620b43259dc5 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -146,8 +146,8 @@ type consensusParamInputs struct { type consensusParamOutputs struct { depinject.Out - consensusParamKeeper keeper.Keeper - Module runtime.AppModuleWrapper + Keeper keeper.Keeper + Module runtime.AppModuleWrapper } func provideModule(in consensusParamInputs) consensusParamOutputs { @@ -161,7 +161,7 @@ func provideModule(in consensusParamInputs) consensusParamOutputs { m := NewAppModule(in.Cdc, k, in.LegacySubspace) return consensusParamOutputs{ - consensusParamKeeper: k, - Module: runtime.WrapAppModule(m), + Keeper: k, + Module: runtime.WrapAppModule(m), } } From 5251ed44317fe693fd4e2e9554830a357fd14b1d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 12:57:52 +0200 Subject: [PATCH 23/60] wire consesnsus param --- x/consensus/module.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/x/consensus/module.go b/x/consensus/module.go index 620b43259dc5..5c67af2ac761 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -12,6 +12,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" modulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -146,8 +147,9 @@ type consensusParamInputs struct { type consensusParamOutputs struct { depinject.Out - Keeper keeper.Keeper - Module runtime.AppModuleWrapper + Keeper keeper.Keeper + Module runtime.AppModuleWrapper + BaseAppOption runtime.BaseAppOption } func provideModule(in consensusParamInputs) consensusParamOutputs { @@ -159,9 +161,13 @@ func provideModule(in consensusParamInputs) consensusParamOutputs { k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) m := NewAppModule(in.Cdc, k, in.LegacySubspace) + baseappOpt := func(app *baseapp.BaseApp) { + app.SetParamStore(&k) + } return consensusParamOutputs{ - Keeper: k, - Module: runtime.WrapAppModule(m), + Keeper: k, + Module: runtime.WrapAppModule(m), + BaseAppOption: baseappOpt, } } From a51e73cb26e12de447cbb9ca6dff014509e0dfe4 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 13:00:10 +0200 Subject: [PATCH 24/60] wire in baseapp --- baseapp/util_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/baseapp/util_test.go b/baseapp/util_test.go index 55d6137212c2..018842caad22 100644 --- a/baseapp/util_test.go +++ b/baseapp/util_test.go @@ -11,6 +11,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" @@ -28,6 +29,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" _ "github.com/cosmos/cosmos-sdk/x/bank" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/mint" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" _ "github.com/cosmos/cosmos-sdk/x/params" @@ -79,6 +81,7 @@ func makeTestConfig() depinject.Config { "auth", "bank", "params", + "consensus", }, EndBlockers: []string{ "staking", @@ -86,6 +89,7 @@ func makeTestConfig() depinject.Config { "bank", "mint", "params", + "consensus", }, OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{ { @@ -99,6 +103,7 @@ func makeTestConfig() depinject.Config { "staking", "mint", "params", + "consensus", }, }), }, @@ -134,6 +139,10 @@ func makeTestConfig() depinject.Config { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), }, + { + Name: "consensus", + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, }, }) } From 65b27eca59a3f298640bfd8a458a087e60cf8781 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 14:16:49 +0200 Subject: [PATCH 25/60] minor fix --- baseapp/block_gas_test.go | 2 +- baseapp/util_test.go | 8 ++++---- x/params/module.go | 7 +++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index 280b3bd4f2dc..cca66c291f14 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -86,8 +86,8 @@ func TestBaseApp_BlockGas(t *testing.T) { appConfig := depinject.Configs(makeTestConfig()) err = depinject.Inject(appConfig, - &bankKeeper, &accountKeeper, + &bankKeeper, ¶msKeeper, &stakingKeeper, &interfaceRegistry, diff --git a/baseapp/util_test.go b/baseapp/util_test.go index 018842caad22..8acd70d52884 100644 --- a/baseapp/util_test.go +++ b/baseapp/util_test.go @@ -135,14 +135,14 @@ func makeTestConfig() depinject.Config { Name: "mint", Config: appconfig.WrapAny(&mintmodulev1.Module{}), }, - { - Name: "tx", - Config: appconfig.WrapAny(&txmodulev1.Module{}), - }, { Name: "consensus", Config: appconfig.WrapAny(&consensusmodulev1.Module{}), }, + { + Name: "tx", + Config: appconfig.WrapAny(&txmodulev1.Module{}), + }, }, }) } diff --git a/x/params/module.go b/x/params/module.go index 0783042e9ac5..5db9addd596d 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -157,10 +157,9 @@ type paramsInputs struct { type paramsOutputs struct { depinject.Out - ParamsKeeper keeper.Keeper - BaseAppOption runtime.BaseAppOption - Module runtime.AppModuleWrapper - GovHandler govv1beta1.HandlerRoute + ParamsKeeper keeper.Keeper + Module runtime.AppModuleWrapper + GovHandler govv1beta1.HandlerRoute } func provideModule(in paramsInputs) paramsOutputs { From 5870cd718569b604e02aebde8989b27aa3f0ad30 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 6 Sep 2022 09:55:57 -0400 Subject: [PATCH 26/60] remove unnecessary uses of reflection in NewAnteHandler --- x/auth/ante/ante.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/x/auth/ante/ante.go b/x/auth/ante/ante.go index 74162d125aaf..a562e67ee39c 100644 --- a/x/auth/ante/ante.go +++ b/x/auth/ante/ante.go @@ -1,8 +1,6 @@ package ante import ( - "reflect" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx/signing" @@ -25,11 +23,11 @@ type HandlerOptions struct { // numbers, checks signatures & account numbers, and deducts fees from the first // signer. func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { - if reflect.ValueOf(options.AccountKeeper).IsNil() || reflect.ValueOf(options.AccountKeeper).IsZero() { + if options.AccountKeeper == nil { return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder") } - if reflect.ValueOf(options.BankKeeper).IsNil() || reflect.ValueOf(options.BankKeeper).IsZero() { + if options.BankKeeper == nil { return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder") } From ab5b29d1531278422ae95a561e26eedfe0e3ebc2 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 18:29:00 +0200 Subject: [PATCH 27/60] setup tests --- testutil/configurator/configurator.go | 12 ++++++++++++ testutil/network/network.go | 1 + x/auth/testutil/app_config.go | 10 ++++++++++ x/authz/testutil/app_config.go | 10 ++++++++++ x/bank/app_test.go | 2 ++ x/bank/simulation/operations_test.go | 2 ++ x/capability/testutil/app_config.go | 10 ++++++++++ x/distribution/testutil/app_config.go | 10 ++++++++++ x/evidence/testutil/app_config.go | 10 ++++++++++ x/feegrant/testutil/app_config.go | 10 ++++++++++ x/group/testutil/app_config.go | 10 ++++++++++ x/mint/testutil/app_config.go | 10 ++++++++++ x/nft/testutil/app_config.go | 10 ++++++++++ x/params/testutil/app_config.go | 10 ++++++++++ x/slashing/testutil/app_config.go | 10 ++++++++++ x/staking/testutil/app_config.go | 10 ++++++++++ 16 files changed, 137 insertions(+) diff --git a/testutil/configurator/configurator.go b/testutil/configurator/configurator.go index 4c0c950ba48e..692eede43313 100644 --- a/testutil/configurator/configurator.go +++ b/testutil/configurator/configurator.go @@ -5,6 +5,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" @@ -37,6 +38,7 @@ var beginBlockOrder = []string{ "nft", "group", "params", + "consensus", "vesting", } @@ -57,6 +59,7 @@ var endBlockersOrder = []string{ "nft", "group", "params", + "consensus", "upgrade", "vesting", } @@ -78,6 +81,7 @@ var initGenesisOrder = []string{ "nft", "group", "params", + "consensus", "upgrade", "vesting", } @@ -197,6 +201,14 @@ func GovModule() ModuleOption { } } } +func ConsensusModule() ModuleOption { + return func(config *appConfig) { + config.moduleConfigs["consensus"] = &appv1alpha1.ModuleConfig{ + Name: "consensus", + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + } + } +} func MintModule() ModuleOption { return func(config *appConfig) { diff --git a/testutil/network/network.go b/testutil/network/network.go index 9a6917b00ec2..d7770a05449d 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -140,6 +140,7 @@ func MinimumAppConfig() depinject.Config { configurator.BankModule(), configurator.GenutilModule(), configurator.StakingModule(), + configurator.ConsensusModule(), configurator.TxModule()) } diff --git a/x/auth/testutil/app_config.go b/x/auth/testutil/app_config.go index 9717d6c8d14e..3581e689ce98 100644 --- a/x/auth/testutil/app_config.go +++ b/x/auth/testutil/app_config.go @@ -5,6 +5,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/auth/vesting" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/feegrant/module" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/params" @@ -14,6 +15,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/feegrant" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -24,6 +26,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" @@ -45,6 +48,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, vestingtypes.ModuleName, }, EndBlockers: []string{ @@ -54,6 +58,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, vestingtypes.ModuleName, }, InitGenesis: []string{ @@ -63,6 +68,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, vestingtypes.ModuleName, }, }), @@ -97,6 +103,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), diff --git a/x/authz/testutil/app_config.go b/x/authz/testutil/app_config.go index 0a19fd6eb72e..d96539edc813 100644 --- a/x/authz/testutil/app_config.go +++ b/x/authz/testutil/app_config.go @@ -5,6 +5,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/authz/module" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/gov" _ "github.com/cosmos/cosmos-sdk/x/mint" @@ -15,6 +16,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -26,6 +28,7 @@ import ( authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" @@ -47,6 +50,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, authz.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ minttypes.ModuleName, @@ -56,6 +60,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, authz.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -65,6 +70,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, authz.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -101,6 +107,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: genutiltypes.ModuleName, Config: appconfig.WrapAny(&genutilmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: authz.ModuleName, Config: appconfig.WrapAny(&authzmodulev1.Module{}), diff --git a/x/bank/app_test.go b/x/bank/app_test.go index 5cb32662516e..7ae41d4a2cc1 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -20,6 +20,7 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -105,6 +106,7 @@ func createTestSuite(t *testing.T, genesisAccounts []authtypes.GenesisAccount) s configurator.AuthModule(), configurator.StakingModule(), configurator.TxModule(), + configurator.ConsensusModule(), configurator.BankModule()), startupCfg, &res.BankKeeper, &res.AccountKeeper) diff --git a/x/bank/simulation/operations_test.go b/x/bank/simulation/operations_test.go index 6f4b5057cdd9..69381df19892 100644 --- a/x/bank/simulation/operations_test.go +++ b/x/bank/simulation/operations_test.go @@ -21,6 +21,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/simulation" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -45,6 +46,7 @@ func (suite *SimTestSuite) SetupTest() { configurator.ParamsModule(), configurator.BankModule(), configurator.StakingModule(), + configurator.ConsensusModule(), configurator.TxModule(), ), &suite.accountKeeper, &suite.bankKeeper, &suite.cdc, &appBuilder) diff --git a/x/capability/testutil/app_config.go b/x/capability/testutil/app_config.go index bdc3954b95ba..5c6171e225b7 100644 --- a/x/capability/testutil/app_config.go +++ b/x/capability/testutil/app_config.go @@ -5,6 +5,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/capability" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" @@ -13,6 +14,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -22,6 +24,7 @@ import ( authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" capabilitymodulev1 "cosmossdk.io/api/cosmos/capability/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" @@ -41,6 +44,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -49,6 +53,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ capabilitytypes.ModuleName, @@ -57,6 +62,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ stakingtypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -91,6 +97,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: genutiltypes.ModuleName, Config: appconfig.WrapAny(&genutilmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: capabilitytypes.ModuleName, Config: appconfig.WrapAny(&capabilitymodulev1.Module{ diff --git a/x/distribution/testutil/app_config.go b/x/distribution/testutil/app_config.go index 67aff35b9b28..d1cb0dd29984 100644 --- a/x/distribution/testutil/app_config.go +++ b/x/distribution/testutil/app_config.go @@ -4,6 +4,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/distribution" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/mint" @@ -13,6 +14,7 @@ import ( "cosmossdk.io/core/appconfig" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -23,6 +25,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" @@ -45,6 +48,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -54,6 +58,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ minttypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -63,6 +68,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ minttypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -91,6 +97,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), diff --git a/x/evidence/testutil/app_config.go b/x/evidence/testutil/app_config.go index 5c14e66a197f..1f40dccbc5bf 100644 --- a/x/evidence/testutil/app_config.go +++ b/x/evidence/testutil/app_config.go @@ -4,6 +4,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/evidence" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/params" @@ -13,6 +14,7 @@ import ( "cosmossdk.io/core/appconfig" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -24,6 +26,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" evidencemodulev1 "cosmossdk.io/api/cosmos/evidence/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" @@ -46,6 +49,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -55,6 +59,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, evidencetypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -64,6 +69,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, evidencetypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -95,6 +101,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), diff --git a/x/feegrant/testutil/app_config.go b/x/feegrant/testutil/app_config.go index e1e2f021118a..3745e6bbc00a 100644 --- a/x/feegrant/testutil/app_config.go +++ b/x/feegrant/testutil/app_config.go @@ -5,6 +5,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/auth/vesting" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/feegrant/module" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/mint" @@ -15,6 +16,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/feegrant" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -25,6 +27,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" @@ -47,6 +50,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ feegrant.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -56,6 +60,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ feegrant.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -65,6 +70,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ feegrant.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -96,6 +102,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), diff --git a/x/group/testutil/app_config.go b/x/group/testutil/app_config.go index ffba8ac1c66a..b34ee163f465 100644 --- a/x/group/testutil/app_config.go +++ b/x/group/testutil/app_config.go @@ -9,6 +9,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/authz" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/group/module" _ "github.com/cosmos/cosmos-sdk/x/mint" @@ -18,6 +19,7 @@ import ( "cosmossdk.io/core/appconfig" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/group" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -28,6 +30,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" groupmodulev1 "cosmossdk.io/api/cosmos/group/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" @@ -49,6 +52,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, group.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -58,6 +62,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, group.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -67,6 +72,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, group.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -94,6 +100,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), diff --git a/x/mint/testutil/app_config.go b/x/mint/testutil/app_config.go index 47e4ed4de7fd..2bf57b360a53 100644 --- a/x/mint/testutil/app_config.go +++ b/x/mint/testutil/app_config.go @@ -5,6 +5,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/mint" _ "github.com/cosmos/cosmos-sdk/x/params" @@ -12,6 +13,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -21,6 +23,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" @@ -41,6 +44,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -49,6 +53,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ minttypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -57,6 +62,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ minttypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -84,6 +90,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), diff --git a/x/nft/testutil/app_config.go b/x/nft/testutil/app_config.go index 467313f8d3d9..062faa7c6cd3 100644 --- a/x/nft/testutil/app_config.go +++ b/x/nft/testutil/app_config.go @@ -5,6 +5,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/mint" _ "github.com/cosmos/cosmos-sdk/x/nft/module" @@ -13,6 +14,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/nft" @@ -23,6 +25,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" nftmodulev1 "cosmossdk.io/api/cosmos/nft/module/v1" @@ -45,6 +48,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, nft.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -54,6 +58,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, nft.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -63,6 +68,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, nft.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -91,6 +97,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), diff --git a/x/params/testutil/app_config.go b/x/params/testutil/app_config.go index 133872dc0a60..363369458b89 100644 --- a/x/params/testutil/app_config.go +++ b/x/params/testutil/app_config.go @@ -4,6 +4,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" @@ -11,6 +12,7 @@ import ( "cosmossdk.io/core/appconfig" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -19,6 +21,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" @@ -37,6 +40,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -44,6 +48,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -51,6 +56,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ stakingtypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -77,6 +83,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), diff --git a/x/slashing/testutil/app_config.go b/x/slashing/testutil/app_config.go index 9b88072054f6..9944561cf7e9 100644 --- a/x/slashing/testutil/app_config.go +++ b/x/slashing/testutil/app_config.go @@ -4,6 +4,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/distribution" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/mint" @@ -14,6 +15,7 @@ import ( "cosmossdk.io/core/appconfig" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -25,6 +27,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" @@ -49,6 +52,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, slashingtypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -59,6 +63,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ minttypes.ModuleName, slashingtypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -69,6 +74,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ slashingtypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -102,6 +108,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), diff --git a/x/staking/testutil/app_config.go b/x/staking/testutil/app_config.go index 32507cd4e8a3..6663235d0dbd 100644 --- a/x/staking/testutil/app_config.go +++ b/x/staking/testutil/app_config.go @@ -4,6 +4,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/distribution" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/mint" @@ -14,6 +15,7 @@ import ( "cosmossdk.io/core/appconfig" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -25,6 +27,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" @@ -49,6 +52,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ genutiltypes.ModuleName, slashingtypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ stakingtypes.ModuleName, @@ -59,6 +63,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ minttypes.ModuleName, slashingtypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, InitGenesis: []string{ authtypes.ModuleName, @@ -69,6 +74,7 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ slashingtypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, }, }), }, @@ -102,6 +108,10 @@ var AppConfig = appconfig.Compose(&appv1alpha1.Config{ Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, { Name: "tx", Config: appconfig.WrapAny(&txmodulev1.Module{}), From a9e3e2bf8f0ac718b5ab2b01a89bdbbeb802f356 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 18:37:54 +0200 Subject: [PATCH 28/60] fix tests --- testutil/network/network.go | 1 + x/simulation/operations_test.go | 1 + x/slashing/app_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/testutil/network/network.go b/testutil/network/network.go index d7770a05449d..2117e2c618df 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -50,6 +50,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" _ "github.com/cosmos/cosmos-sdk/x/bank" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/cosmos-sdk/x/consensus" "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" diff --git a/x/simulation/operations_test.go b/x/simulation/operations_test.go index 58a1180c817d..7392d1c5d76a 100644 --- a/x/simulation/operations_test.go +++ b/x/simulation/operations_test.go @@ -245,6 +245,7 @@ func (suite *SimTestSuite) SetupTest() { configurator.BankModule(), configurator.StakingModule(), configurator.TxModule(), + configurator.ConsensusModule(), configurator.DistributionModule(), ), &suite.accountKeeper, &suite.bankKeeper, diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index 94fadd0ad9e5..ce3f5df9ee9a 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -57,6 +57,7 @@ func TestSlashingMsgs(t *testing.T) { configurator.StakingModule(), configurator.SlashingModule(), configurator.TxModule(), + configurator.ConsensusModule(), configurator.BankModule()), startupCfg, &stakingKeeper, &bankKeeper, &slashingKeeper) From 3a109bbb38cbddcba5ce6997a2576f889d1f6fa8 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 18:58:33 +0200 Subject: [PATCH 29/60] fix tests++ --- simapp/app.go | 7 ++++--- simapp/app_config.go | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index e5aad73c63b8..f1a6fc454c01 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -46,7 +46,8 @@ import ( capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" consensus "github.com/cosmos/cosmos-sdk/x/consensus" - consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" @@ -161,7 +162,7 @@ type SimApp struct { FeeGrantKeeper feegrantkeeper.Keeper GroupKeeper groupkeeper.Keeper NFTKeeper nftkeeper.Keeper - ConsensusParamsKeeper consensusparamkeeper.Keeper + ConsensusParamsKeeper consensuskeeper.Keeper // simulation manager sm *module.SimulationManager @@ -259,7 +260,7 @@ func NewSimApp( distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, nft.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, - vestingtypes.ModuleName, + vestingtypes.ModuleName, consensustypes.ModuleName, } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) diff --git a/simapp/app_config.go b/simapp/app_config.go index a9180ecb1f45..4bd7a1548905 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -104,6 +104,7 @@ var ( group.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, + consensustypes.ModuleName, }, EndBlockers: []string{ crisistypes.ModuleName, @@ -122,6 +123,7 @@ var ( nft.ModuleName, group.ModuleName, paramstypes.ModuleName, + consensustypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, }, From 00b2f916d3ad98c3160fe628054ea7d173e998ba Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 19:07:09 +0200 Subject: [PATCH 30/60] tests+++ --- tests/integration/bank/keeper/keeper_test.go | 1 + tests/integration/genutil/gentx_test.go | 2 ++ tests/integration/gov/genesis_test.go | 2 ++ types/query/pagination_test.go | 2 ++ x/gov/common_test.go | 2 ++ x/gov/simulation/operations_test.go | 2 ++ 6 files changed, 11 insertions(+) diff --git a/tests/integration/bank/keeper/keeper_test.go b/tests/integration/bank/keeper/keeper_test.go index 24413331d28b..4c341798ea68 100644 --- a/tests/integration/bank/keeper/keeper_test.go +++ b/tests/integration/bank/keeper/keeper_test.go @@ -130,6 +130,7 @@ func (suite *IntegrationTestSuite) SetupTest() { configurator.BankModule(), configurator.StakingModule(), configurator.ParamsModule(), + configurator.ConsensusModule(), configurator.VestingModule()), &suite.accountKeeper, &suite.bankKeeper, &suite.stakingKeeper, &interfaceRegistry, &suite.appCodec, &suite.authConfig) diff --git a/tests/integration/genutil/gentx_test.go b/tests/integration/genutil/gentx_test.go index f2b384c72586..4f9346673073 100644 --- a/tests/integration/genutil/gentx_test.go +++ b/tests/integration/genutil/gentx_test.go @@ -26,6 +26,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/bank/testutil" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/cosmos-sdk/x/consensus" "github.com/cosmos/cosmos-sdk/x/genutil" "github.com/cosmos/cosmos-sdk/x/genutil/types" _ "github.com/cosmos/cosmos-sdk/x/params" @@ -67,6 +68,7 @@ func (suite *GenTxTestSuite) SetupTest() { configurator.TxModule(), configurator.StakingModule(), configurator.ParamsModule(), + configurator.ConsensusModule(), configurator.AuthModule()), simtestutil.DefaultStartUpConfig(), &encCfg.InterfaceRegistry, &encCfg.Codec, &encCfg.TxConfig, &encCfg.Amino, diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index ef8ecf93f423..4fb466a70e0b 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -19,6 +19,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -51,6 +52,7 @@ var appConfig = configurator.NewAppConfig( configurator.GovModule(), configurator.DistributionModule(), configurator.MintModule(), + configurator.ConsensusModule(), ) func TestImportExportQueues(t *testing.T) { diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index 512db35a180c..53597c1be812 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -26,6 +26,7 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/params" ) @@ -67,6 +68,7 @@ func (s *paginationTestSuite) SetupTest() { configurator.AuthModule(), configurator.BankModule(), configurator.ParamsModule(), + configurator.ConsensusModule(), configurator.OmitInitGenesis(), ), &bankKeeper, &accountKeeper, ®, &cdc) diff --git a/x/gov/common_test.go b/x/gov/common_test.go index 2c9212eaaa63..ca3512f4b255 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -18,6 +18,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" _ "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + _ "github.com/cosmos/cosmos-sdk/x/consensus" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -116,6 +117,7 @@ func createTestSuite(t *testing.T) suite { configurator.StakingModule(), configurator.BankModule(), configurator.GovModule(), + configurator.ConsensusModule(), ), simtestutil.DefaultStartUpConfig(), &res.AccountKeeper, &res.BankKeeper, &res.GovKeeper, &res.StakingKeeper, diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 267934307206..144d9ad1425c 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -22,6 +22,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/testutil" + _ "github.com/cosmos/cosmos-sdk/x/consensus" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -296,6 +297,7 @@ func createTestSuite(t *testing.T, isCheckTx bool) (suite, sdk.Context) { configurator.ParamsModule(), configurator.BankModule(), configurator.StakingModule(), + configurator.ConsensusModule(), configurator.GovModule(), ), &res.AccountKeeper, &res.BankKeeper, &res.GovKeeper, &res.StakingKeeper, &res.cdc) require.NoError(t, err) From 3e0611d6a73ca3817b422fc686bed12fa3cd112f Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 21:24:19 +0200 Subject: [PATCH 31/60] tests+++ --- tests/e2e/client/grpc/tmservice/service_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/client/grpc/tmservice/service_test.go b/tests/e2e/client/grpc/tmservice/service_test.go index 5ab389ae3111..3ea44fe753ff 100644 --- a/tests/e2e/client/grpc/tmservice/service_test.go +++ b/tests/e2e/client/grpc/tmservice/service_test.go @@ -44,6 +44,7 @@ func (s *IntegrationTestSuite) SetupSuite() { configurator.GenutilModule(), configurator.StakingModule(), configurator.GovModule(), + configurator.ConsensusModule(), configurator.TxModule()) cfg, err := network.DefaultConfigWithAppConfig(appConfig) From 3ee02527eec3133a87015b1f10bf26fc9d48599f Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 21:31:24 +0200 Subject: [PATCH 32/60] fix migration tests --- x/consensus/migrations/v2/keys.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/consensus/migrations/v2/keys.go b/x/consensus/migrations/v2/keys.go index 6ed2ce9947ff..0014a7605327 100644 --- a/x/consensus/migrations/v2/keys.go +++ b/x/consensus/migrations/v2/keys.go @@ -1,9 +1,9 @@ package v2 const ( - ModuleName = "consensus_param" + ModuleName = "consensus" StoreKey = ModuleName ) -var ParamStoreKeyConsensusParams = []byte("ConsensusParams") +var ParamStoreKeyConsensusParams = []byte("Consensus") From 547b32895887262edc776ad0e36a41ce544667cc Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 6 Sep 2022 21:34:43 +0200 Subject: [PATCH 33/60] lint++ --- depinject/module_key.go | 5 +++-- orm/internal/testutil/testutil.go | 1 - testutil/configurator/configurator.go | 1 + x/auth/vesting/msg_server_test.go | 6 +++--- x/consensus/keeper/keeper_test.go | 1 - x/consensus/migrations/v2/store_test.go | 1 - x/group/client/cli/tx_test.go | 12 ------------ 7 files changed, 7 insertions(+), 20 deletions(-) diff --git a/depinject/module_key.go b/depinject/module_key.go index 8fba64f9436a..dc63c28eab51 100644 --- a/depinject/module_key.go +++ b/depinject/module_key.go @@ -51,8 +51,9 @@ var ownModuleKeyType = reflect.TypeOf((*OwnModuleKey)(nil)).Elem() // not equal. // // Usage: -// moduleKeyCtx := &ModuleKeyContext{} -// fooKey := moduleKeyCtx.For("foo") +// +// moduleKeyCtx := &ModuleKeyContext{} +// fooKey := moduleKeyCtx.For("foo") type ModuleKeyContext struct { moduleKeys map[string]*moduleKey } diff --git a/orm/internal/testutil/testutil.go b/orm/internal/testutil/testutil.go index a4856eb1a0bc..13556fdd0dc4 100644 --- a/orm/internal/testutil/testutil.go +++ b/orm/internal/testutil/testutil.go @@ -169,7 +169,6 @@ func (k TestKeyCodec) Draw(t *rapid.T, id string) []protoreflect.Value { n := len(k.KeySpecs) keyValues := make([]protoreflect.Value, n) for i, k := range k.KeySpecs { - keyValues[i] = protoreflect.ValueOf(k.Gen.Draw(t, fmt.Sprintf("%s[%d]", id, i))) } return keyValues diff --git a/testutil/configurator/configurator.go b/testutil/configurator/configurator.go index 692eede43313..f62cd27efab6 100644 --- a/testutil/configurator/configurator.go +++ b/testutil/configurator/configurator.go @@ -201,6 +201,7 @@ func GovModule() ModuleOption { } } } + func ConsensusModule() ModuleOption { return func(config *appConfig) { config.moduleConfigs["consensus"] = &appv1alpha1.ModuleConfig{ diff --git a/x/auth/vesting/msg_server_test.go b/x/auth/vesting/msg_server_test.go index 574b4120021b..300d48c995dc 100644 --- a/x/auth/vesting/msg_server_test.go +++ b/x/auth/vesting/msg_server_test.go @@ -9,13 +9,13 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/testutil" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" vestingtestutil "github.com/cosmos/cosmos-sdk/x/auth/vesting/testutil" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index ce1d28543978..4fe39755199a 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -41,7 +41,6 @@ func (s *KeeperTestSuite) SetupTest() { consensusparamtypes.RegisterQueryServer(queryHelper, consensusparamkeeper.NewQuerier(keeper)) s.queryClient = consensusparamtypes.NewQueryClient(queryHelper) s.msgServer = consensusparamkeeper.NewMsgServerImpl(keeper) - } func TestKeeperTestSuite(t *testing.T) { diff --git a/x/consensus/migrations/v2/store_test.go b/x/consensus/migrations/v2/store_test.go index 7358d0677eaf..7fbe6c904bb0 100644 --- a/x/consensus/migrations/v2/store_test.go +++ b/x/consensus/migrations/v2/store_test.go @@ -52,5 +52,4 @@ func TestMigrate(t *testing.T) { bz := store.Get(v2.ParamStoreKeyConsensusParams) require.NoError(t, cdc.Unmarshal(bz, &res)) require.Equal(t, legacyParamStore.ps, res) - } diff --git a/x/group/client/cli/tx_test.go b/x/group/client/cli/tx_test.go index 55e3c39a669c..7322c9aa05dd 100644 --- a/x/group/client/cli/tx_test.go +++ b/x/group/client/cli/tx_test.go @@ -286,7 +286,6 @@ func (s *CLITestSuite) TestTxCreateGroup() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -541,7 +540,6 @@ func (s *CLITestSuite) TestTxUpdateGroupMetadata() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -674,7 +672,6 @@ func (s *CLITestSuite) TestTxUpdateGroupMembers() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -859,7 +856,6 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1055,7 +1051,6 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1183,7 +1178,6 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyAdmin() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1364,7 +1358,6 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1380,7 +1373,6 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { } }) } - } func (s *CLITestSuite) TestTxUpdateGroupPolicyMetadata() { @@ -1502,7 +1494,6 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyMetadata() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1620,7 +1611,6 @@ func (s *CLITestSuite) TestTxSubmitProposal() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1743,7 +1733,6 @@ func (s *CLITestSuite) TestTxVote() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) @@ -1819,7 +1808,6 @@ func (s *CLITestSuite) TestTxWithdrawProposal() { tc := tc s.Run(tc.name, func() { - var outBuf bytes.Buffer clientCtx := tc.ctxGen().WithOutput(&outBuf) From 8817805ca4447048a559942b339bdd64303d838e Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 8 Sep 2022 05:57:32 +0200 Subject: [PATCH 34/60] fix simapp --- simapp/go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/simapp/go.mod b/simapp/go.mod index 3c3ef3b4e143..572fa7c8fb94 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -153,6 +153,7 @@ require ( replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 github.com/cosmos/cosmos-sdk => ../. + cosmossdk.io/api => ../api github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 ) From c17cdf69fc5de9f823274fc9410298854705bbc9 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 8 Sep 2022 05:57:57 +0200 Subject: [PATCH 35/60] fix simapp --- simapp/go.mod | 2 +- simapp/go.sum | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/simapp/go.mod b/simapp/go.mod index 572fa7c8fb94..01b33bc45114 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -151,9 +151,9 @@ require ( ) replace ( + cosmossdk.io/api => ../api github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 github.com/cosmos/cosmos-sdk => ../. - cosmossdk.io/api => ../api github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 ) diff --git a/simapp/go.sum b/simapp/go.sum index 937cb9cea7e7..618d67125407 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -57,8 +57,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0 h1:6RRlFMv1omScs6iq2hfE3IvgE+l6RfJPampq8UZc5TU= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.1.0-alpha9 h1:8QQT+BhaMpcCgR4Wm8JVuhhtj4a7uZjsxvvWvmsQFB0= -cosmossdk.io/api v0.1.0-alpha9/go.mod h1:PyJpp0BY4tHLI0kzkiUzpZxgOE+pJbhDPleYrA5yVio= cosmossdk.io/core v0.2.0 h1:gwDzEzCX4tyegDAgmNOsVaiSKG4ILg7wo2D5KW0bhMQ= cosmossdk.io/core v0.2.0/go.mod h1:w5HHliErOpYv2LlUPA2FYYHtElsCaf9oiXM6TM+ueZI= cosmossdk.io/depinject v1.0.0-alpha.2 h1:pVcPnqc8bY2GCHVMj77rk6Ew7uz0K3QhrUHdqoKvO5g= From a3754b74f34737a826616972fcd95beee2d081ae Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 12 Sep 2022 09:52:46 +0200 Subject: [PATCH 36/60] fix --- x/bank/app_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index 16f665d80dc7..fc4a3a6d6740 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -111,7 +111,7 @@ func createTestSuite(t *testing.T, genesisAccounts []authtypes.GenesisAccount) s configurator.StakingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.BankModule()), + configurator.BankModule(), configurator.GovModule(), ), startupCfg, &res.BankKeeper, &res.AccountKeeper) From 6ef2f75e214e7a66db7d835cde8cc14888de8b9d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 23 Sep 2022 16:27:16 -0500 Subject: [PATCH 37/60] fix some tests --- baseapp/block_gas_test.go | 3 --- x/consensus/module.go | 13 +++++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index cca66c291f14..e603bb13d094 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -32,7 +32,6 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) @@ -73,7 +72,6 @@ func TestBaseApp_BlockGas(t *testing.T) { var ( bankKeeper bankkeeper.Keeper accountKeeper authkeeper.AccountKeeper - paramsKeeper paramskeeper.Keeper stakingKeeper *stakingkeeper.Keeper appBuilder *runtime.AppBuilder txConfig client.TxConfig @@ -88,7 +86,6 @@ func TestBaseApp_BlockGas(t *testing.T) { err = depinject.Inject(appConfig, &accountKeeper, &bankKeeper, - ¶msKeeper, &stakingKeeper, &interfaceRegistry, &txConfig, diff --git a/x/consensus/module.go b/x/consensus/module.go index 9f57e9fa2074..45e7279db940 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -12,6 +12,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" modulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -165,13 +166,13 @@ func provideModule(in consensusParamInputs) consensusParamOutputs { k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) m := NewAppModule(in.Cdc, k, in.LegacySubspace) - // baseappOpt := func(app *baseapp.BaseApp) { - // app.SetParamStore(&k) - // } + baseappOpt := func(app *baseapp.BaseApp) { + app.SetParamStore(&k) + } return consensusParamOutputs{ - Keeper: k, - Module: runtime.WrapAppModule(m), - // BaseAppOption: baseappOpt, + Keeper: k, + Module: runtime.WrapAppModule(m), + BaseAppOption: baseappOpt, } } From e65c71437e1f7a628bd089367a3215bdb7bdf1f4 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 23 Sep 2022 16:30:54 -0500 Subject: [PATCH 38/60] remove staking and return error --- baseapp/block_gas_test.go | 3 --- baseapp/deliver_tx_test.go | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index e603bb13d094..eb2656a811fb 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -32,7 +32,6 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) var blockMaxGas = uint64(simtestutil.DefaultConsensusParams.Block.MaxGas) @@ -72,7 +71,6 @@ func TestBaseApp_BlockGas(t *testing.T) { var ( bankKeeper bankkeeper.Keeper accountKeeper authkeeper.AccountKeeper - stakingKeeper *stakingkeeper.Keeper appBuilder *runtime.AppBuilder txConfig client.TxConfig cdc codec.Codec @@ -86,7 +84,6 @@ func TestBaseApp_BlockGas(t *testing.T) { err = depinject.Inject(appConfig, &accountKeeper, &bankKeeper, - &stakingKeeper, &interfaceRegistry, &txConfig, &cdc, diff --git a/baseapp/deliver_tx_test.go b/baseapp/deliver_tx_test.go index 408b47c345e1..5633d3057bbf 100644 --- a/baseapp/deliver_tx_test.go +++ b/baseapp/deliver_tx_test.go @@ -5,6 +5,7 @@ import ( "context" "encoding/binary" "encoding/json" + "errors" "fmt" "math/rand" "net/url" @@ -2179,7 +2180,7 @@ func (ps paramStore) Get(ctx sdk.Context) (*tmproto.ConsensusParams, error) { } if len(bz) == 0 { - return nil, nil + return nil, errors.New("params not found") } var params tmproto.ConsensusParams From 5a5088e85362b30707cde381d38b82e13442997e Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 23 Sep 2022 16:32:02 -0500 Subject: [PATCH 39/60] revert order change --- baseapp/block_gas_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index eb2656a811fb..47f2fbd351ce 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -82,8 +82,8 @@ func TestBaseApp_BlockGas(t *testing.T) { appConfig := depinject.Configs(makeTestConfig()) err = depinject.Inject(appConfig, - &accountKeeper, &bankKeeper, + &accountKeeper, &interfaceRegistry, &txConfig, &cdc, From d378fb0949077e2614fa01534e7768c9e25d036a Mon Sep 17 00:00:00 2001 From: Marko Date: Fri, 23 Sep 2022 16:34:13 -0500 Subject: [PATCH 40/60] Update baseapp/baseapp.go Co-authored-by: Aleksandr Bezobchuk --- baseapp/baseapp.go | 1 + 1 file changed, 1 insertion(+) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 784997fa30b2..7fa566197217 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -418,6 +418,7 @@ func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusP if cp == nil { return } + app.paramStore.Set(ctx, cp) // We're explicitly not storing the Tendermint app_version in the param store. It's // stored instead in the x/upgrade store, with its own bump logic. From 394ff491cb445b3e0014c4b685593c79d83bea56 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 10:21:39 -0700 Subject: [PATCH 41/60] lint --- x/consensus/keeper/grpc_query_test.go | 5 +++-- x/consensus/keeper/keeper_test.go | 6 +++--- x/consensus/keeper/msg_server.go | 1 + x/consensus/module.go | 3 +-- x/consensus/types/keys.go | 2 ++ x/consensus/types/msgs.go | 3 ++- x/consensus/types/params.go | 3 ++- x/consensus/types/util.go | 2 +- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/x/consensus/keeper/grpc_query_test.go b/x/consensus/keeper/grpc_query_test.go index f54a32a389ff..cfd139afef2b 100644 --- a/x/consensus/keeper/grpc_query_test.go +++ b/x/consensus/keeper/grpc_query_test.go @@ -1,10 +1,11 @@ package keeper_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/consensus/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/consensus/types" ) func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index 4fe39755199a..1cb94f24fa8e 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -3,6 +3,9 @@ package keeper_test import ( "testing" + "github.com/stretchr/testify/suite" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,9 +14,6 @@ import ( consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - "github.com/stretchr/testify/suite" ) type KeeperTestSuite struct { diff --git a/x/consensus/keeper/msg_server.go b/x/consensus/keeper/msg_server.go index 5e430c1dfe36..a3e7b5c857d2 100644 --- a/x/consensus/keeper/msg_server.go +++ b/x/consensus/keeper/msg_server.go @@ -34,6 +34,7 @@ func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParam if err := types.Validate(tmtypes.ConsensusParamsFromProto(consensusParams)); err != nil { return nil, err } + k.Set(ctx, &consensusParams) ctx.EventManager().EmitEvent( diff --git a/x/consensus/module.go b/x/consensus/module.go index 45e7279db940..8595ec045133 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -4,14 +4,13 @@ import ( "context" "encoding/json" + modulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" "cosmossdk.io/core/appmodule" "cosmossdk.io/depinject" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" - modulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/consensus/types/keys.go b/x/consensus/types/keys.go index 8dd17af7dc13..5ce0fc2cbe4a 100644 --- a/x/consensus/types/keys.go +++ b/x/consensus/types/keys.go @@ -1,8 +1,10 @@ package types const ( + // ModuleName defines the name of the x/consensus module. ModuleName = "consensus" + // StoreKey defines the module's store key. StoreKey = ModuleName ) diff --git a/x/consensus/types/msgs.go b/x/consensus/types/msgs.go index eaa00b0c7bb4..3f5cbfe4c4b3 100644 --- a/x/consensus/types/msgs.go +++ b/x/consensus/types/msgs.go @@ -1,9 +1,10 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // bank message types diff --git a/x/consensus/types/params.go b/x/consensus/types/params.go index b707f8ffb688..5ecf68d9c9fa 100644 --- a/x/consensus/types/params.go +++ b/x/consensus/types/params.go @@ -4,7 +4,8 @@ import ( tmtypes "github.com/tendermint/tendermint/types" ) -// Validate all module parameters +// Validate performs basic validation of ConsensusParams returning an error upon +// failure. func Validate(p tmtypes.ConsensusParams) error { return p.ValidateBasic() } diff --git a/x/consensus/types/util.go b/x/consensus/types/util.go index c08c6b7e9d28..8bbba8278187 100644 --- a/x/consensus/types/util.go +++ b/x/consensus/types/util.go @@ -4,7 +4,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// x/consensus_param module sentinel errors +// Sentinel errors for the x/consensus module. var ( ErrUnauthorized = sdkerrors.Register(ModuleName, 2, "unauthorized action") ) From abd7a036dd624dae2adbade1d34a7a96902befd0 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 10:30:25 -0700 Subject: [PATCH 42/60] lint --- simapp/go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/simapp/go.mod b/simapp/go.mod index 7f328a7a72f4..d80103332baf 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -153,7 +153,6 @@ require ( ) replace ( - cosmossdk.io/api => ../api github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 github.com/cosmos/cosmos-sdk => ../. // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. From 571163fac39292aa93100631860b346e154170a7 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 10:56:25 -0700 Subject: [PATCH 43/60] updates --- baseapp/baseapp.go | 3 +-- simapp/app.go | 9 ++++++--- simapp/upgrades.go | 10 +++++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index b9339882d713..b9618ca989b2 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -5,6 +5,7 @@ import ( "sort" "strings" + "github.com/cosmos/gogoproto/proto" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto/tmhash" "github.com/tendermint/tendermint/libs/log" @@ -12,8 +13,6 @@ import ( dbm "github.com/tendermint/tm-db" "golang.org/x/exp/maps" - "github.com/cosmos/gogoproto/proto" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/snapshots" "github.com/cosmos/cosmos-sdk/store" diff --git a/simapp/app.go b/simapp/app.go index 75ebaa6dd308..44a2f5e6e110 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -197,10 +197,13 @@ func NewSimApp( // supply the application options appOpts, - // for providing a custom inflaction function for x/mint - // add here your custom function that implements the minttypes.InflationCalculationFn interface. + // For providing a custom inflation function for x/mint add here your + // custom function that implements the minttypes.InflationCalculationFn + // interface. - // for providing a custom authority to a module simply add it below. By default the governance module is the default authority. + // For providing a custom authority to a module simply add it below. By + // default the governance module is the default authority. + // // map[string]sdk.AccAddress{ // minttypes.ModuleName: authtypes.NewModuleAddress(authtypes.ModuleName), // }, diff --git a/simapp/upgrades.go b/simapp/upgrades.go index 4caab418ac7a..707cb70a68d6 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -16,10 +16,14 @@ import ( const UpgradeName = "v045-to-v046" func (app SimApp) RegisterUpgradeHandlers() { - app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, - func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + app.UpgradeKeeper.SetUpgradeHandler( + UpgradeName, + func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // TODO: Decide how to handle baseapp consensus parameter migration. + // app.ConsensusParamsKeeper.Set(ctx, ...) return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) - }) + }, + ) upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { From 664c917e9eac4029e9adee1279ee8b1c6d63ad4c Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 11:03:57 -0700 Subject: [PATCH 44/60] updates --- x/consensus/module.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/x/consensus/module.go b/x/consensus/module.go index 8595ec045133..95908f83c0e3 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -96,11 +96,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // NewAppModule creates a new AppModule object -func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ss exported.ParamStore) AppModule { +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, keeper: keeper, - legacySubspace: ss, } } @@ -143,9 +142,6 @@ type consensusParamInputs struct { Key *store.KVStoreKey ModuleKey depinject.OwnModuleKey Authority map[string]sdk.AccAddress `optional:"true"` - - // LegacySubspace is used solely for migration of x/params managed parameters - LegacySubspace exported.ParamStore } type consensusParamOutputs struct { @@ -164,7 +160,7 @@ func provideModule(in consensusParamInputs) consensusParamOutputs { } k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) - m := NewAppModule(in.Cdc, k, in.LegacySubspace) + m := NewAppModule(in.Cdc, k) baseappOpt := func(app *baseapp.BaseApp) { app.SetParamStore(&k) } From 4fc68982b4cf6f5672eebbc30c7675895de14692 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 11:26:01 -0700 Subject: [PATCH 45/60] updates --- baseapp/params_legacy.go | 118 ++++++++++++++++++++++ simapp/app_legacy.go | 2 +- simapp/upgrades.go | 12 ++- x/params/types/consensus_params_legacy.go | 22 ++++ x/staking/types/params_legacy.go | 2 +- 5 files changed, 152 insertions(+), 4 deletions(-) create mode 100644 baseapp/params_legacy.go create mode 100644 x/params/types/consensus_params_legacy.go diff --git a/baseapp/params_legacy.go b/baseapp/params_legacy.go new file mode 100644 index 000000000000..eee34cbf0501 --- /dev/null +++ b/baseapp/params_legacy.go @@ -0,0 +1,118 @@ +/* +Deprecated. + +Legacy types are defined below to aid in the migration of Tendermint consensus +parameters from use of the now deprecated x/params modules to a new dedicated +x/consensus module. + +Application developers should ensure that they implement their upgrade handler +correctly such that app.ConsensusParamsKeeper.Set() is called with the values +returned by GetConsensusParams(). + +Example: +*/ +package baseapp + +import ( + "errors" + "fmt" + + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +const Paramspace = "baseapp" + +var ( + ParamStoreKeyBlockParams = []byte("BlockParams") + ParamStoreKeyEvidenceParams = []byte("EvidenceParams") + ParamStoreKeyValidatorParams = []byte("ValidatorParams") +) + +type LegacyParamStore interface { + Get(ctx sdk.Context, key []byte, ptr interface{}) + Has(ctx sdk.Context, key []byte) bool +} + +func ValidateBlockParams(i interface{}) error { + v, ok := i.(tmproto.BlockParams) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.MaxBytes <= 0 { + return fmt.Errorf("block maximum bytes must be positive: %d", v.MaxBytes) + } + + if v.MaxGas < -1 { + return fmt.Errorf("block maximum gas must be greater than or equal to -1: %d", v.MaxGas) + } + + return nil +} + +func ValidateEvidenceParams(i interface{}) error { + v, ok := i.(tmproto.EvidenceParams) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.MaxAgeNumBlocks <= 0 { + return fmt.Errorf("evidence maximum age in blocks must be positive: %d", v.MaxAgeNumBlocks) + } + + if v.MaxAgeDuration <= 0 { + return fmt.Errorf("evidence maximum age time duration must be positive: %v", v.MaxAgeDuration) + } + + if v.MaxBytes < 0 { + return fmt.Errorf("maximum evidence bytes must be non-negative: %v", v.MaxBytes) + } + + return nil +} + +func ValidateValidatorParams(i interface{}) error { + v, ok := i.(tmproto.ValidatorParams) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if len(v.PubKeyTypes) == 0 { + return errors.New("validator allowed pubkey types must not be empty") + } + + return nil +} + +func GetConsensusParams(ctx sdk.Context, paramStore LegacyParamStore) *tmproto.ConsensusParams { + if paramStore == nil { + return nil + } + + cp := new(tmproto.ConsensusParams) + + if paramStore.Has(ctx, ParamStoreKeyBlockParams) { + var bp tmproto.BlockParams + + paramStore.Get(ctx, ParamStoreKeyBlockParams, &bp) + cp.Block = &bp + } + + if paramStore.Has(ctx, ParamStoreKeyEvidenceParams) { + var ep tmproto.EvidenceParams + + paramStore.Get(ctx, ParamStoreKeyEvidenceParams, &ep) + cp.Evidence = &ep + } + + if paramStore.Has(ctx, ParamStoreKeyValidatorParams) { + var vp tmproto.ValidatorParams + + paramStore.Get(ctx, ParamStoreKeyValidatorParams, &vp) + cp.Validator = &vp + } + + return cp +} diff --git a/simapp/app_legacy.go b/simapp/app_legacy.go index 0656cd349ae6..7bd4872967bf 100644 --- a/simapp/app_legacy.go +++ b/simapp/app_legacy.go @@ -344,7 +344,7 @@ func NewSimApp( ), ) - // RegisterUpgradeHandlers is used for registering any on-chain upgrades + // RegisterUpgradeHandlers is used for registering any on-chain upgrades. app.RegisterUpgradeHandlers() app.NFTKeeper = nftkeeper.NewKeeper(keys[nftkeeper.StoreKey], appCodec, app.AccountKeeper, app.BankKeeper) diff --git a/simapp/upgrades.go b/simapp/upgrades.go index 707cb70a68d6..9822062d5932 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -1,11 +1,13 @@ package simapp import ( + "github.com/cosmos/cosmos-sdk/baseapp" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/group" "github.com/cosmos/cosmos-sdk/x/nft" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) @@ -16,11 +18,17 @@ import ( const UpgradeName = "v045-to-v046" func (app SimApp) RegisterUpgradeHandlers() { + baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) + app.UpgradeKeeper.SetUpgradeHandler( UpgradeName, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - // TODO: Decide how to handle baseapp consensus parameter migration. - // app.ConsensusParamsKeeper.Set(ctx, ...) + if cp := baseapp.GetConsensusParams(ctx, baseAppLegacySS); cp != nil { + app.ConsensusParamsKeeper.Set(ctx, cp) + } else { + ctx.Logger().Info("warning: consensus parameters are undefined; skipping migration", "upgrade", UpgradeName) + } + return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) }, ) diff --git a/x/params/types/consensus_params_legacy.go b/x/params/types/consensus_params_legacy.go new file mode 100644 index 000000000000..a102aa9a47bc --- /dev/null +++ b/x/params/types/consensus_params_legacy.go @@ -0,0 +1,22 @@ +package types + +import ( + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/baseapp" +) + +// Deprecated. +func ConsensusParamsKeyTable() KeyTable { + return NewKeyTable( + NewParamSetPair( + baseapp.ParamStoreKeyBlockParams, tmproto.BlockParams{}, baseapp.ValidateBlockParams, + ), + NewParamSetPair( + baseapp.ParamStoreKeyEvidenceParams, tmproto.EvidenceParams{}, baseapp.ValidateEvidenceParams, + ), + NewParamSetPair( + baseapp.ParamStoreKeyValidatorParams, tmproto.ValidatorParams{}, baseapp.ValidateValidatorParams, + ), + ) +} diff --git a/x/staking/types/params_legacy.go b/x/staking/types/params_legacy.go index 499dc7c2f768..df474c02ffa1 100644 --- a/x/staking/types/params_legacy.go +++ b/x/staking/types/params_legacy.go @@ -14,7 +14,7 @@ var ( var _ paramtypes.ParamSet = (*Params)(nil) // ParamTable for staking module -// Deprecated: now params can be accesed on key `0x51` on the staking store. +// Deprecated: now params can be accessed on key `0x51` on the staking store. func ParamKeyTable() paramtypes.KeyTable { return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) } From dc46fbe9399c95a08193af2137dfb3256acf4233 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 11:26:45 -0700 Subject: [PATCH 46/60] updates --- simapp/upgrades.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/simapp/upgrades.go b/simapp/upgrades.go index 9822062d5932..253a1c17bf80 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -5,17 +5,17 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/group" - "github.com/cosmos/cosmos-sdk/x/nft" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -// UpgradeName defines the on-chain upgrade name for the sample simap upgrade from v045 to v046. +// UpgradeName defines the on-chain upgrade name for the sample SimApp upgrade +// from v045 to v046. // -// NOTE: This upgrade defines a reference implementation of what an upgrade could look like -// when an application is migrating from Cosmos SDK version v0.45.x to v0.46.x. -const UpgradeName = "v045-to-v046" +// NOTE: This upgrade defines a reference implementation of what an upgrade +// could look like when an application is migrating from Cosmos SDK version +// v0.45.x to v0.46.x. +const UpgradeName = "v046-to-v047" func (app SimApp) RegisterUpgradeHandlers() { baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) @@ -39,12 +39,7 @@ func (app SimApp) RegisterUpgradeHandlers() { } if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{ - group.ModuleName, - nft.ModuleName, - }, - } + storeUpgrades := storetypes.StoreUpgrades{} // configure store loader that checks if version == upgradeHeight and applies store upgrades app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) From c56e743ffebaae5c86accb7fb24bdea2f0f023fb Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 11:28:22 -0700 Subject: [PATCH 47/60] updates --- baseapp/params_legacy.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/baseapp/params_legacy.go b/baseapp/params_legacy.go index eee34cbf0501..f0191188ee10 100644 --- a/baseapp/params_legacy.go +++ b/baseapp/params_legacy.go @@ -10,6 +10,24 @@ correctly such that app.ConsensusParamsKeeper.Set() is called with the values returned by GetConsensusParams(). Example: + + baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) + + app.UpgradeKeeper.SetUpgradeHandler( + UpgradeName, + func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + if cp := baseapp.GetConsensusParams(ctx, baseAppLegacySS); cp != nil { + app.ConsensusParamsKeeper.Set(ctx, cp) + } else { + ctx.Logger().Info("warning: consensus parameters are undefined; skipping migration", "upgrade", UpgradeName) + } + + return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) + }, + ) + +Developers can also bypass the use of the legacy Params subspace and set the +values to app.ConsensusParamsKeeper.Set() explicitly. */ package baseapp From 6dba3fa103a2e5e81888536a141c79fadc11c2fa Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 11:29:11 -0700 Subject: [PATCH 48/60] updates --- simapp/upgrades.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simapp/upgrades.go b/simapp/upgrades.go index 253a1c17bf80..2c2681719407 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -10,11 +10,11 @@ import ( ) // UpgradeName defines the on-chain upgrade name for the sample SimApp upgrade -// from v045 to v046. +// from v046 to v047. // // NOTE: This upgrade defines a reference implementation of what an upgrade // could look like when an application is migrating from Cosmos SDK version -// v0.45.x to v0.46.x. +// v0.46.x to v0.47.x. const UpgradeName = "v046-to-v047" func (app SimApp) RegisterUpgradeHandlers() { From 8465b82f13bad8db6c785e49a0c6ffd454e5427f Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 11:30:44 -0700 Subject: [PATCH 49/60] updates --- baseapp/params_legacy.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/baseapp/params_legacy.go b/baseapp/params_legacy.go index f0191188ee10..ef6423e3b42e 100644 --- a/baseapp/params_legacy.go +++ b/baseapp/params_legacy.go @@ -28,6 +28,9 @@ Example: Developers can also bypass the use of the legacy Params subspace and set the values to app.ConsensusParamsKeeper.Set() explicitly. + +Note, for new chains this is not necessary as Tendermint's consensus parameters +will automatically be set for you in InitChain. */ package baseapp From 32c9cc1f1b2b73e6277eb9cce305204656d356b2 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 11:37:59 -0700 Subject: [PATCH 50/60] updates --- x/consensus/module.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x/consensus/module.go b/x/consensus/module.go index 95908f83c0e3..5c09fe156877 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -20,7 +20,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/consensus/exported" "github.com/cosmos/cosmos-sdk/x/consensus/keeper" "github.com/cosmos/cosmos-sdk/x/consensus/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -84,9 +83,6 @@ type AppModule struct { AppModuleBasic keeper keeper.Keeper - - // legacySubspace is used solely for migration of x/params managed parameters - legacySubspace exported.ParamStore } // RegisterServices registers module services. From 9303a65abb494e4e6358942fbb1d2e9dc07f811e Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 11:48:56 -0700 Subject: [PATCH 51/60] updates --- simapp/app_legacy.go | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/simapp/app_legacy.go b/simapp/app_legacy.go index 7bd4872967bf..f3b8c85f3dd7 100644 --- a/simapp/app_legacy.go +++ b/simapp/app_legacy.go @@ -168,23 +168,23 @@ type SimApp struct { memKeys map[string]*storetypes.MemoryStoreKey // keepers - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper *stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper - CrisisKeeper *crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - AuthzKeeper authzkeeper.Keeper - EvidenceKeeper evidencekeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - GroupKeeper groupkeeper.Keeper - NFTKeeper nftkeeper.Keeper - ConsensusParams consensusparamkeeper.Keeper + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + CapabilityKeeper *capabilitykeeper.Keeper + StakingKeeper *stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper + MintKeeper mintkeeper.Keeper + DistrKeeper distrkeeper.Keeper + GovKeeper govkeeper.Keeper + CrisisKeeper *crisiskeeper.Keeper + UpgradeKeeper upgradekeeper.Keeper + ParamsKeeper paramskeeper.Keeper + AuthzKeeper authzkeeper.Keeper + EvidenceKeeper evidencekeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + GroupKeeper groupkeeper.Keeper + NFTKeeper nftkeeper.Keeper + ConsensusParamsKeeper consensusparamkeeper.Keeper // the module manager ModuleManager *module.Manager @@ -259,10 +259,9 @@ func NewSimApp( app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) - app.ConsensusParams = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) - // set the BaseApp's parameter store - bApp.SetParamStore(&app.ConsensusParams) + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) + bApp.SetParamStore(&app.ConsensusParamsKeeper) app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) // Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating From 6f0d36cc32072dbcbc06d6fd701ed84483a7e981 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 11:57:09 -0700 Subject: [PATCH 52/60] updates --- baseapp/deliver_tx_test.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/baseapp/deliver_tx_test.go b/baseapp/deliver_tx_test.go index 1ff6e9ea8aa9..ededd512433f 100644 --- a/baseapp/deliver_tx_test.go +++ b/baseapp/deliver_tx_test.go @@ -18,6 +18,14 @@ import ( "unsafe" "cosmossdk.io/depinject" + "github.com/cosmos/gogoproto/jsonpb" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/baseapp" baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil" "github.com/cosmos/cosmos-sdk/client" @@ -35,13 +43,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/signing" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - "github.com/cosmos/gogoproto/jsonpb" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - dbm "github.com/tendermint/tm-db" ) var ( @@ -572,9 +573,13 @@ func TestGRPCQuery(t *testing.T) { app := setupBaseApp(t, grpcQueryOpt) app.GRPCQueryRouter().SetInterfaceRegistry(codectypes.NewInterfaceRegistry()) - app.InitChain(abci.RequestInitChain{}) + app.InitChain(abci.RequestInitChain{ + ConsensusParams: &tmproto.ConsensusParams{}, + }) + header := tmproto.Header{Height: app.LastBlockHeight() + 1} app.BeginBlock(abci.RequestBeginBlock{Header: header}) + app.Commit() req := testdata.SayHelloRequest{Name: "foo"} From 9a841377760128bb3c6bccbff5ce0d9dbe1b2db4 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 13:14:25 -0700 Subject: [PATCH 53/60] updates --- baseapp/deliver_tx_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/baseapp/deliver_tx_test.go b/baseapp/deliver_tx_test.go index ededd512433f..1a31045d051f 100644 --- a/baseapp/deliver_tx_test.go +++ b/baseapp/deliver_tx_test.go @@ -107,7 +107,9 @@ func setupBaseAppWithSnapshots(t *testing.T, config *setupConfig) (*baseapp.Base // set the TxDecoder in the BaseApp for minimal tx simulations app.SetTxDecoder(txConfig.TxDecoder()) - app.InitChain(abci.RequestInitChain{}) + app.InitChain(abci.RequestInitChain{ + ConsensusParams: &tmproto.ConsensusParams{}, + }) r := rand.New(rand.NewSource(3920758213583)) keyCounter := 0 From 1fd6d1d16e9b040d3833769dddbb16124981de60 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 13:14:40 -0700 Subject: [PATCH 54/60] updates --- baseapp/deliver_tx_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/baseapp/deliver_tx_test.go b/baseapp/deliver_tx_test.go index 1a31045d051f..c1b64050d647 100644 --- a/baseapp/deliver_tx_test.go +++ b/baseapp/deliver_tx_test.go @@ -104,6 +104,7 @@ func setupBaseAppWithSnapshots(t *testing.T, config *setupConfig) (*baseapp.Base // patch in TxConfig instead of using an output from x/auth/tx txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) + // set the TxDecoder in the BaseApp for minimal tx simulations app.SetTxDecoder(txConfig.TxDecoder()) From eb982d66f71f1d4bc29b2ecc1d6a8a77a31c8022 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 13:32:52 -0700 Subject: [PATCH 55/60] updates --- baseapp/params_legacy.go | 8 ++++++++ simapp/upgrades.go | 8 +++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/baseapp/params_legacy.go b/baseapp/params_legacy.go index ef6423e3b42e..8fed7253df0d 100644 --- a/baseapp/params_legacy.go +++ b/baseapp/params_legacy.go @@ -137,3 +137,11 @@ func GetConsensusParams(ctx sdk.Context, paramStore LegacyParamStore) *tmproto.C return cp } + +func MigrateParams(ctx sdk.Context, lps LegacyParamStore, ps ParamStore) { + if cp := GetConsensusParams(ctx, lps); cp != nil { + ps.Set(ctx, cp) + } else { + ctx.Logger().Info("warning: consensus parameters are undefined; skipping migration") + } +} diff --git a/simapp/upgrades.go b/simapp/upgrades.go index 2c2681719407..1324d9d98e8e 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -23,11 +23,9 @@ func (app SimApp) RegisterUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler( UpgradeName, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - if cp := baseapp.GetConsensusParams(ctx, baseAppLegacySS); cp != nil { - app.ConsensusParamsKeeper.Set(ctx, cp) - } else { - ctx.Logger().Info("warning: consensus parameters are undefined; skipping migration", "upgrade", UpgradeName) - } + // Migrate Tendermint consensus parameters from x/params module to a + // dedicated x/consensus module. + baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) }, From 49abe6dc491d0dffa3e5b3c6cce680445a9464e4 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 4 Oct 2022 13:49:26 -0700 Subject: [PATCH 56/60] updates --- baseapp/deliver_tx_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/baseapp/deliver_tx_test.go b/baseapp/deliver_tx_test.go index c1b64050d647..b7daf0505bfc 100644 --- a/baseapp/deliver_tx_test.go +++ b/baseapp/deliver_tx_test.go @@ -1895,7 +1895,9 @@ func TestQuery(t *testing.T) { app.SetTxDecoder(txConfig.TxDecoder()) app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) - app.InitChain(abci.RequestInitChain{}) + app.InitChain(abci.RequestInitChain{ + ConsensusParams: &tmproto.ConsensusParams{}, + }) // NOTE: "/store/key1" tells us KVStore // and the final "/key" says to use the data as the From c3ff0bd02b0ce7e6572ffa84010282192d3f01a1 Mon Sep 17 00:00:00 2001 From: Facundo Medica Date: Tue, 4 Oct 2022 18:05:05 -0300 Subject: [PATCH 57/60] fix make rosetta-data + run --- contrib/rosetta/configuration/data.sh | 2 +- contrib/rosetta/rosetta-ci/data.tar.gz | Bin 44504 -> 42701 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/rosetta/configuration/data.sh b/contrib/rosetta/configuration/data.sh index 51806fcea631..22bdcbacb0b3 100644 --- a/contrib/rosetta/configuration/data.sh +++ b/contrib/rosetta/configuration/data.sh @@ -45,7 +45,7 @@ sleep 10 # send transaction to deterministic address echo sending transaction with addr $addr -simd tx bank send "$addr" cosmos19g9cm8ymzchq2qkcdv3zgqtwayj9asv3hjv5u5 100stake --yes --keyring-backend=test --broadcast-mode=block --chain-id=testing +simd tx bank send "$addr" cosmos19g9cm8ymzchq2qkcdv3zgqtwayj9asv3hjv5u5 100stake --yes --keyring-backend=test --chain-id=testing sleep 10 diff --git a/contrib/rosetta/rosetta-ci/data.tar.gz b/contrib/rosetta/rosetta-ci/data.tar.gz index 7290a7bc1a8127f47389e058050c55b2ab613188..2f2dc13dc5a5c8b285cdd711af2b4270648f5d1c 100644 GIT binary patch literal 42701 zcmZsCWlSYJ&@S!{i@UqK>*DUdu(-R!!CBm07k60Poy9r0%i`{C=iK-Ee%v27w`rPm zGM!AO^Ym#dWU&Yk|68Ch4dC@sbvJ3DQ?GHSVCi3S46}vByn`NV~Ur}>pmMGtA3?{KVpNv>UU4NI4X8{`%h#4+=ZimRqWqsF=G0Ws16)3P~hJi zb`=Qjd37D4q0o*%V&3U?{QV179KN&rinr^Ra-RR&v81Al%`4Ridb$ANJ<%m29=<#Q z@aA2q9N4KZO9Bf&9P*TF+^AQ#kcNuLB%oXk z<%qjl&m41gqLuwKJBXDgeU$crA}%GJ*e682al(kAG8J)#w|%nl!l}n;tTIodb(i6k979!GOuQCS9?kKndW5q^ktqDH)P{HA=v3i`F(H z0g+FxZNm=Zq7=E48N)}7FJh9wCBt|}FYRa5HJov#%quib4XaMWk!oS*=oTlUJiKy; zI2-)8ywtEM(2oarPSt46EQxA3`a4O&TZiz`N%+*upB~bZG0glRl(;#fyiDDL5=&&5 zYR~f5l?l)8=n_&iPBM^k$UduFDQtE8;38lh26eG8@2s^s4@J8?CTEY2@Ea>ycDA&F zF8e4hG7pRP5FgW{1%c|%KUrEF`b{IHwZWR>_mu(RFwF@PY5w_8BC=L#^Gg<}cn&99}F(xP)kvtYoC zFry2JV^2-sRuL*ac4Adk!PSrKDQTZ}xYeakamR>I&xybI4&t}#%X^R81_TKjT0a}g zU|CvuMXnuix%8M6Zk?H1#~3jvaIG@luJda^EAH`O<#RX1r^~qArx9mHQ)GOwkXD&0 z6yy6?xE0e;g&ktNMaZu&wcr$vvv6Ye_ca!TV?nUu-{TkN7WIAW)Een_G}@&H#B%r-fnFP4(ys1*}^p`!(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rw|YT&kKSUk_$y&&`3js0}E%`lA3MMJD%5ZI6~u26ETQ7xQW ztyU!saFT@?wN|BX2-G79OTMH*KS!`lm*YtKnLHif%FR)VFYjwr2AI-RYlp>`erPq? zt=SK~38BrF=v-AooH~nwt+~3;F7d%`8jMbW%?3kXhF5KK|M)?a7!Q1UE)&)syk39v zAX`1_OizQAnDPc>`LY#sCqH0lpl^(LE+-(W~_ z-cvq4yL|m*8fQ@>5H8+0%6r7q=?yMkJ>MLj{L&2KqvXZb#c*}&?B(`hYb)G3ih|uA ze`@~l>UcNK+pDjmVe1hlL`8tNRlY6->&th6*Qx^kU~=sAz5k6SFc?Sl@TR2XoAySh z(cWm#!f8lHt!h9<)n93`=po`CCfE;MO^rocmztX(s2#qQeSg$lScb-c@UAXr@1k*V z3|PWnW&6`ij>3NT`q`vC8+X>$&)T!|xwWzRGJ1U4+>Y1VyWf2~+-tvDJH9`Ca(Vgv z&j*uN>t~aTsdG73!F6ANx~2lJw^=@qwD^>B_>m`Vc@0YNz?|;V+2UsQTev zdw+P|Z*2_!`{j6L_)|XEX|DdT{S#4u-OU&MOVkZ>?Nz zCY{$CKi%JXaoGxA?&Z%fI_poOi-VP?t;^SgLr8kRz5iF!hCY8je?EUcfBt Date: Wed, 5 Oct 2022 13:32:58 +0200 Subject: [PATCH 58/60] add upgrade and changelog entry --- CHANGELOG.md | 2 ++ UPGRADING.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2843951c10db..6fa308e228e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/bank) [#11981](https://github.com/cosmos/cosmos-sdk/pull/11981) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. * (x/auth) [#13210](https://github.com/cosmos/cosmos-sdk/pull/13210) Add `Query/AccountInfo` endpoint for simplified access to basic account info. * (cli) [#13147](https://github.com/cosmos/cosmos-sdk/pull/13147) Add the `--append` flag to the `sign-batch` CLI cmd to combine the messages and sign those txs which are created with `--generate-only`. +* (x/consensus) [#12905](https://github.com/cosmos/cosmos-sdk/pull/12905) Create consensus module to handle modification of consensus parameters. + * Params module is still required for the next upgrade, later it can be removed ### Improvements diff --git a/UPGRADING.md b/UPGRADING.md index 8821f85e1972..086e620fa00f 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -69,6 +69,52 @@ By default, the new `MinInitialDepositRatio` parameter is set to zero during mig feature is disabled. If chains wish to utilize the minimum proposal deposits at time of submission, the migration logic needs to be modified to set the new parameter to the desired value. +#### `x/consensus` + +Introducing a new module to handle consensus parameters from tendermint. For migration it is required to add specific migrations for the module. + +```go +func (app SimApp) RegisterUpgradeHandlers() { + ----> baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) <---- + + app.UpgradeKeeper.SetUpgradeHandler( + UpgradeName, + func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // Migrate Tendermint consensus parameters from x/params module to a + // dedicated x/consensus module. + ----> baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) <---- + + return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) + }, + ) + + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(err) + } + + if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{} + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } +} +``` + +The old params module is required to still be imported in your app.go in order to handle this migration. + +##### App.go Changes + +Previous: +```go +bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())) +``` + +After: +```go +app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) +bApp.SetParamStore(&app.ConsensusParamsKeeper) +``` + ### Ledger Ledger support has been generalized to enable use of different apps and keytypes that use `secp256k1`. The Ledger interface remains the same, but it can now be provided through the Keyring `Options`, allowing higher-level chains to connect to different Ledger apps or use custom implementations. In addition, higher-level chains can provide custom key implementations around the Ledger public key, to enable greater flexibility with address generation and signing. From ecf490fdd53c49fe32c30644da6c5577f69259d1 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 5 Oct 2022 10:40:46 -0700 Subject: [PATCH 59/60] updates --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fa308e228e3..c6446bc9cd7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,8 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/bank) [#11981](https://github.com/cosmos/cosmos-sdk/pull/11981) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. * (x/auth) [#13210](https://github.com/cosmos/cosmos-sdk/pull/13210) Add `Query/AccountInfo` endpoint for simplified access to basic account info. * (cli) [#13147](https://github.com/cosmos/cosmos-sdk/pull/13147) Add the `--append` flag to the `sign-batch` CLI cmd to combine the messages and sign those txs which are created with `--generate-only`. -* (x/consensus) [#12905](https://github.com/cosmos/cosmos-sdk/pull/12905) Create consensus module to handle modification of consensus parameters. - * Params module is still required for the next upgrade, later it can be removed +* (x/consensus) [#12905](https://github.com/cosmos/cosmos-sdk/pull/12905) Create a new `x/consensus` module that is now responsible for maintaining Tendermint consensus parameters instead of `x/param`. Legacy types remain in order to facilitate parameter migration from the deprecated `x/params`. App developers should ensure that they execute `baseapp.MigrateParams` during their chain upgrade. These legacy types will be removed in a future release. ### Improvements From a339f8f0392a71e7f0b7093565d8ee46b2da9cf0 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 5 Oct 2022 10:43:45 -0700 Subject: [PATCH 60/60] updates --- UPGRADING.md | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 086e620fa00f..2aa309e6cd4b 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -52,8 +52,10 @@ Please use the `ghcr.io/cosmos/proto-builder` image (version >= `0.11.0`) for ge #### Broadcast Mode -Broadcast mode `block` was deprecated and has been removed. Please use `sync` mode instead. -When upgrading your tests from `block` to `sync` and checking for a transaction code, you need to query the transaction first (with its hash) to get the correct code. +Broadcast mode `block` was deprecated and has been removed. Please use `sync` mode +instead. When upgrading your tests from `block` to `sync` and checking for a +transaction code, you need to query the transaction first (with its hash) to get +the correct code. ### Modules @@ -71,7 +73,12 @@ modified to set the new parameter to the desired value. #### `x/consensus` -Introducing a new module to handle consensus parameters from tendermint. For migration it is required to add specific migrations for the module. +Introducing a new `x/consensus` module to handle managing Tendermint consensus +parameters. For migration it is required to call a specific migration to migrate +existing parameters from the deprecated `x/params` to `x/consensus` module. App +developers should ensure to call `baseapp.MigrateParams` in their upgrade handler. + +Example: ```go func (app SimApp) RegisterUpgradeHandlers() { @@ -84,19 +91,13 @@ func (app SimApp) RegisterUpgradeHandlers() { // dedicated x/consensus module. ----> baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) <---- + // ... + return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) }, ) - upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() - if err != nil { - panic(err) - } - - if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - storeUpgrades := storetypes.StoreUpgrades{} - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) - } + // ... } ``` @@ -105,11 +106,13 @@ The old params module is required to still be imported in your app.go in order t ##### App.go Changes Previous: + ```go bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())) ``` After: + ```go app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) bApp.SetParamStore(&app.ConsensusParamsKeeper)