diff --git a/api/initia/dynamicfee/module/v1/module.pulsar.go b/api/initia/dynamicfee/module/v1/module.pulsar.go new file mode 100644 index 000000000..5a0ce19f9 --- /dev/null +++ b/api/initia/dynamicfee/module/v1/module.pulsar.go @@ -0,0 +1,583 @@ +// 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 + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_initia_dynamicfee_module_v1_module_proto_init() + md_Module = File_initia_dynamicfee_module_v1_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +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_initia_dynamicfee_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) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "initia.dynamicfee.module.v1.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.module.v1.Module")) + } + panic(fmt.Errorf("message initia.dynamicfee.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() { + case "initia.dynamicfee.module.v1.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.module.v1.Module")) + } + panic(fmt.Errorf("message initia.dynamicfee.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() { + case "initia.dynamicfee.module.v1.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.module.v1.Module")) + } + panic(fmt.Errorf("message initia.dynamicfee.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() { + case "initia.dynamicfee.module.v1.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.module.v1.Module")) + } + panic(fmt.Errorf("message initia.dynamicfee.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() { + case "initia.dynamicfee.module.v1.Module.authority": + panic(fmt.Errorf("field authority of message initia.dynamicfee.module.v1.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.module.v1.Module")) + } + panic(fmt.Errorf("message initia.dynamicfee.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() { + case "initia.dynamicfee.module.v1.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.module.v1.Module")) + } + panic(fmt.Errorf("message initia.dynamicfee.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 initia.dynamicfee.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 + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*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 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] = 0x12 + } + 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 { + case 2: + 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 + 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: initia/dynamicfee/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 builder module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Authority defines the custom module authority. + // If not set, defaults to the governance module. + Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_initia_dynamicfee_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_initia_dynamicfee_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_initia_dynamicfee_module_v1_module_proto protoreflect.FileDescriptor + +var file_initia_dynamicfee_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, + 0x66, 0x65, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 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, 0x5b, 0x0a, 0x06, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x3a, 0x33, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2d, 0x0a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x78, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x2d, 0x66, 0x65, 0x65, 0x42, 0x85, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, + 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, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x49, 0x44, 0x4d, 0xaa, 0x02, 0x1b, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1b, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x27, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, 0x79, 0x6e, + 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, + 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x3a, 0x3a, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, + 0x65, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_initia_dynamicfee_module_v1_module_proto_rawDescOnce sync.Once + file_initia_dynamicfee_module_v1_module_proto_rawDescData = file_initia_dynamicfee_module_v1_module_proto_rawDesc +) + +func file_initia_dynamicfee_module_v1_module_proto_rawDescGZIP() []byte { + file_initia_dynamicfee_module_v1_module_proto_rawDescOnce.Do(func() { + file_initia_dynamicfee_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_initia_dynamicfee_module_v1_module_proto_rawDescData) + }) + return file_initia_dynamicfee_module_v1_module_proto_rawDescData +} + +var file_initia_dynamicfee_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_initia_dynamicfee_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: initia.dynamicfee.module.v1.Module +} +var file_initia_dynamicfee_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_initia_dynamicfee_module_v1_module_proto_init() } +func file_initia_dynamicfee_module_v1_module_proto_init() { + if File_initia_dynamicfee_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_initia_dynamicfee_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_initia_dynamicfee_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_initia_dynamicfee_module_v1_module_proto_goTypes, + DependencyIndexes: file_initia_dynamicfee_module_v1_module_proto_depIdxs, + MessageInfos: file_initia_dynamicfee_module_v1_module_proto_msgTypes, + }.Build() + File_initia_dynamicfee_module_v1_module_proto = out.File + file_initia_dynamicfee_module_v1_module_proto_rawDesc = nil + file_initia_dynamicfee_module_v1_module_proto_goTypes = nil + file_initia_dynamicfee_module_v1_module_proto_depIdxs = nil +} diff --git a/api/initia/dynamicfee/v1/genesis.pulsar.go b/api/initia/dynamicfee/v1/genesis.pulsar.go new file mode 100644 index 000000000..a2b559521 --- /dev/null +++ b/api/initia/dynamicfee/v1/genesis.pulsar.go @@ -0,0 +1,598 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package dynamicfeev1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/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_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor +) + +func init() { + file_initia_dynamicfee_v1_genesis_proto_init() + md_GenesisState = File_initia_dynamicfee_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_initia_dynamicfee_v1_genesis_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_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// 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_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(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_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_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_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "initia.dynamicfee.v1.GenesisState.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.GenesisState")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.GenesisState 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_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "initia.dynamicfee.v1.GenesisState.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.GenesisState")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.GenesisState 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_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "initia.dynamicfee.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.GenesisState")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.GenesisState 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_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "initia.dynamicfee.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.GenesisState")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.GenesisState 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_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "initia.dynamicfee.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.GenesisState")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.GenesisState 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_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "initia.dynamicfee.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.GenesisState")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.GenesisState 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_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in initia.dynamicfee.v1.GenesisState", 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_GenesisState) 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_GenesisState) 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_GenesisState) 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_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + 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().(*GenesisState) + 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().(*GenesisState) + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: 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 = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: initia/dynamicfee/v1/genesis.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) +) + +// GenesisState - genesis state of x/move +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_initia_dynamicfee_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_initia_dynamicfee_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_initia_dynamicfee_v1_genesis_proto protoreflect.FileDescriptor + +var file_initia_dynamicfee_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, + 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, + 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, + 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 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, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, + 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xdf, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, + 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x79, 0x6e, 0x61, + 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x44, 0x58, 0xaa, 0x02, + 0x14, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, + 0x65, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x14, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x20, 0x49, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x16, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x3a, 0x3a, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, + 0x63, 0x66, 0x65, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_initia_dynamicfee_v1_genesis_proto_rawDescOnce sync.Once + file_initia_dynamicfee_v1_genesis_proto_rawDescData = file_initia_dynamicfee_v1_genesis_proto_rawDesc +) + +func file_initia_dynamicfee_v1_genesis_proto_rawDescGZIP() []byte { + file_initia_dynamicfee_v1_genesis_proto_rawDescOnce.Do(func() { + file_initia_dynamicfee_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_initia_dynamicfee_v1_genesis_proto_rawDescData) + }) + return file_initia_dynamicfee_v1_genesis_proto_rawDescData +} + +var file_initia_dynamicfee_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_initia_dynamicfee_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: initia.dynamicfee.v1.GenesisState + (*Params)(nil), // 1: initia.dynamicfee.v1.Params +} +var file_initia_dynamicfee_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: initia.dynamicfee.v1.GenesisState.params:type_name -> initia.dynamicfee.v1.Params + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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_initia_dynamicfee_v1_genesis_proto_init() } +func file_initia_dynamicfee_v1_genesis_proto_init() { + if File_initia_dynamicfee_v1_genesis_proto != nil { + return + } + file_initia_dynamicfee_v1_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_initia_dynamicfee_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); 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_initia_dynamicfee_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_initia_dynamicfee_v1_genesis_proto_goTypes, + DependencyIndexes: file_initia_dynamicfee_v1_genesis_proto_depIdxs, + MessageInfos: file_initia_dynamicfee_v1_genesis_proto_msgTypes, + }.Build() + File_initia_dynamicfee_v1_genesis_proto = out.File + file_initia_dynamicfee_v1_genesis_proto_rawDesc = nil + file_initia_dynamicfee_v1_genesis_proto_goTypes = nil + file_initia_dynamicfee_v1_genesis_proto_depIdxs = nil +} diff --git a/api/initia/dynamicfee/v1/query.pulsar.go b/api/initia/dynamicfee/v1/query.pulsar.go new file mode 100644 index 000000000..a7f9c4259 --- /dev/null +++ b/api/initia/dynamicfee/v1/query.pulsar.go @@ -0,0 +1,1015 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package dynamicfeev1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/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_initia_dynamicfee_v1_query_proto_init() + md_QueryParamsRequest = File_initia_dynamicfee_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_initia_dynamicfee_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: initia.dynamicfee.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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: initia.dynamicfee.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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: initia.dynamicfee.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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: initia.dynamicfee.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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: initia.dynamicfee.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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: initia.dynamicfee.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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 initia.dynamicfee.v1.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_initia_dynamicfee_v1_query_proto_init() + md_QueryParamsResponse = File_initia_dynamicfee_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_initia_dynamicfee_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 "initia.dynamicfee.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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 "initia.dynamicfee.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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 "initia.dynamicfee.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: initia.dynamicfee.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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 "initia.dynamicfee.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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 "initia.dynamicfee.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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 "initia.dynamicfee.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.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 initia.dynamicfee.v1.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 = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: initia/dynamicfee/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 is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_initia_dynamicfee_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_initia_dynamicfee_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_initia_dynamicfee_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_initia_dynamicfee_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_initia_dynamicfee_v1_query_proto protoreflect.FileDescriptor + +var file_initia_dynamicfee_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, + 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x20, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 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, 0x51, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x8d, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x83, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x28, 0x2e, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xe5, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0xa8, 0xe2, 0x1e, + 0x00, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, + 0x73, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2f, 0x76, + 0x31, 0x3b, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x49, 0x44, 0x58, 0xaa, 0x02, 0x14, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x44, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x14, 0x49, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x20, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, 0x79, 0x6e, 0x61, + 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x3a, 0x3a, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_initia_dynamicfee_v1_query_proto_rawDescOnce sync.Once + file_initia_dynamicfee_v1_query_proto_rawDescData = file_initia_dynamicfee_v1_query_proto_rawDesc +) + +func file_initia_dynamicfee_v1_query_proto_rawDescGZIP() []byte { + file_initia_dynamicfee_v1_query_proto_rawDescOnce.Do(func() { + file_initia_dynamicfee_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_initia_dynamicfee_v1_query_proto_rawDescData) + }) + return file_initia_dynamicfee_v1_query_proto_rawDescData +} + +var file_initia_dynamicfee_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_initia_dynamicfee_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: initia.dynamicfee.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: initia.dynamicfee.v1.QueryParamsResponse + (*Params)(nil), // 2: initia.dynamicfee.v1.Params +} +var file_initia_dynamicfee_v1_query_proto_depIdxs = []int32{ + 2, // 0: initia.dynamicfee.v1.QueryParamsResponse.params:type_name -> initia.dynamicfee.v1.Params + 0, // 1: initia.dynamicfee.v1.Query.Params:input_type -> initia.dynamicfee.v1.QueryParamsRequest + 1, // 2: initia.dynamicfee.v1.Query.Params:output_type -> initia.dynamicfee.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 + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_initia_dynamicfee_v1_query_proto_init() } +func file_initia_dynamicfee_v1_query_proto_init() { + if File_initia_dynamicfee_v1_query_proto != nil { + return + } + file_initia_dynamicfee_v1_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_initia_dynamicfee_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_initia_dynamicfee_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_initia_dynamicfee_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_initia_dynamicfee_v1_query_proto_goTypes, + DependencyIndexes: file_initia_dynamicfee_v1_query_proto_depIdxs, + MessageInfos: file_initia_dynamicfee_v1_query_proto_msgTypes, + }.Build() + File_initia_dynamicfee_v1_query_proto = out.File + file_initia_dynamicfee_v1_query_proto_rawDesc = nil + file_initia_dynamicfee_v1_query_proto_goTypes = nil + file_initia_dynamicfee_v1_query_proto_depIdxs = nil +} diff --git a/api/initia/dynamicfee/v1/query_grpc.pb.go b/api/initia/dynamicfee/v1/query_grpc.pb.go new file mode 100644 index 000000000..4dee79817 --- /dev/null +++ b/api/initia/dynamicfee/v1/query_grpc.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: initia/dynamicfee/v1/query.proto + +package dynamicfeev1 + +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 + +const ( + Query_Params_FullMethodName = "/initia.dynamicfee.v1.Query/Params" +) + +// 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 params + 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, Query_Params_FullMethodName, 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 params + 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: Query_Params_FullMethodName, + } + 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: "initia.dynamicfee.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "initia/dynamicfee/v1/query.proto", +} diff --git a/api/initia/dynamicfee/v1/tx.pulsar.go b/api/initia/dynamicfee/v1/tx.pulsar.go new file mode 100644 index 000000000..57e76a136 --- /dev/null +++ b/api/initia/dynamicfee/v1/tx.pulsar.go @@ -0,0 +1,1095 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package dynamicfeev1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/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_initia_dynamicfee_v1_tx_proto_init() + md_MsgUpdateParams = File_initia_dynamicfee_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_initia_dynamicfee_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 "initia.dynamicfee.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "initia.dynamicfee.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "initia.dynamicfee.v1.MsgUpdateParams.authority": + x.Authority = "" + case "initia.dynamicfee.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "initia.dynamicfee.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "initia.dynamicfee.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: initia.dynamicfee.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "initia.dynamicfee.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "initia.dynamicfee.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "initia.dynamicfee.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "initia.dynamicfee.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message initia.dynamicfee.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "initia.dynamicfee.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "initia.dynamicfee.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in initia.dynamicfee.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_initia_dynamicfee_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_initia_dynamicfee_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_initia_dynamicfee_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: initia.dynamicfee.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in initia.dynamicfee.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: initia/dynamicfee/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. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module + // (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/dynamic-fee parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_initia_dynamicfee_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_initia_dynamicfee_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_initia_dynamicfee_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_initia_dynamicfee_v1_tx_proto_rawDescGZIP(), []int{1} +} + +var File_initia_dynamicfee_v1_tx_proto protoreflect.FileDescriptor + +var file_initia_dynamicfee_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, + 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, + 0x65, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, + 0x6e, 0x6f, 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, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 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, 0x1c, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, + 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x3a, 0x2d, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1a, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, + 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 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, 0x72, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, + 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2d, 0x2e, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 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, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, + 0xde, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x49, 0x44, 0x58, 0xaa, 0x02, 0x14, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x14, + 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, + 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x20, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x3a, 0x3a, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_initia_dynamicfee_v1_tx_proto_rawDescOnce sync.Once + file_initia_dynamicfee_v1_tx_proto_rawDescData = file_initia_dynamicfee_v1_tx_proto_rawDesc +) + +func file_initia_dynamicfee_v1_tx_proto_rawDescGZIP() []byte { + file_initia_dynamicfee_v1_tx_proto_rawDescOnce.Do(func() { + file_initia_dynamicfee_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_initia_dynamicfee_v1_tx_proto_rawDescData) + }) + return file_initia_dynamicfee_v1_tx_proto_rawDescData +} + +var file_initia_dynamicfee_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_initia_dynamicfee_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: initia.dynamicfee.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: initia.dynamicfee.v1.MsgUpdateParamsResponse + (*Params)(nil), // 2: initia.dynamicfee.v1.Params +} +var file_initia_dynamicfee_v1_tx_proto_depIdxs = []int32{ + 2, // 0: initia.dynamicfee.v1.MsgUpdateParams.params:type_name -> initia.dynamicfee.v1.Params + 0, // 1: initia.dynamicfee.v1.Msg.UpdateParams:input_type -> initia.dynamicfee.v1.MsgUpdateParams + 1, // 2: initia.dynamicfee.v1.Msg.UpdateParams:output_type -> initia.dynamicfee.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 +} + +func init() { file_initia_dynamicfee_v1_tx_proto_init() } +func file_initia_dynamicfee_v1_tx_proto_init() { + if File_initia_dynamicfee_v1_tx_proto != nil { + return + } + file_initia_dynamicfee_v1_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_initia_dynamicfee_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_initia_dynamicfee_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_initia_dynamicfee_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_initia_dynamicfee_v1_tx_proto_goTypes, + DependencyIndexes: file_initia_dynamicfee_v1_tx_proto_depIdxs, + MessageInfos: file_initia_dynamicfee_v1_tx_proto_msgTypes, + }.Build() + File_initia_dynamicfee_v1_tx_proto = out.File + file_initia_dynamicfee_v1_tx_proto_rawDesc = nil + file_initia_dynamicfee_v1_tx_proto_goTypes = nil + file_initia_dynamicfee_v1_tx_proto_depIdxs = nil +} diff --git a/api/initia/dynamicfee/v1/tx_grpc.pb.go b/api/initia/dynamicfee/v1/tx_grpc.pb.go new file mode 100644 index 000000000..24849d036 --- /dev/null +++ b/api/initia/dynamicfee/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.3.0 +// - protoc (unknown) +// source: initia/dynamicfee/v1/tx.proto + +package dynamicfeev1 + +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 + +const ( + Msg_UpdateParams_FullMethodName = "/initia.dynamicfee.v1.Msg/UpdateParams" +) + +// 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 an operation for updating the x/dynamic-fee module + // parameters. + 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, Msg_UpdateParams_FullMethodName, 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 an operation for updating the x/dynamic-fee module + // parameters. + 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: Msg_UpdateParams_FullMethodName, + } + 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: "initia.dynamicfee.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "initia/dynamicfee/v1/tx.proto", +} diff --git a/api/initia/dynamicfee/v1/types.pulsar.go b/api/initia/dynamicfee/v1/types.pulsar.go new file mode 100644 index 000000000..bb6ba3f71 --- /dev/null +++ b/api/initia/dynamicfee/v1/types.pulsar.go @@ -0,0 +1,875 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package dynamicfeev1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/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_Params protoreflect.MessageDescriptor + fd_Params_base_gas_price protoreflect.FieldDescriptor + fd_Params_min_base_gas_price protoreflect.FieldDescriptor + fd_Params_max_base_gas_price protoreflect.FieldDescriptor + fd_Params_max_change_rate protoreflect.FieldDescriptor + fd_Params_target_gas protoreflect.FieldDescriptor +) + +func init() { + file_initia_dynamicfee_v1_types_proto_init() + md_Params = File_initia_dynamicfee_v1_types_proto.Messages().ByName("Params") + fd_Params_base_gas_price = md_Params.Fields().ByName("base_gas_price") + fd_Params_min_base_gas_price = md_Params.Fields().ByName("min_base_gas_price") + fd_Params_max_base_gas_price = md_Params.Fields().ByName("max_base_gas_price") + fd_Params_max_change_rate = md_Params.Fields().ByName("max_change_rate") + fd_Params_target_gas = md_Params.Fields().ByName("target_gas") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_initia_dynamicfee_v1_types_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_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BaseGasPrice != "" { + value := protoreflect.ValueOfString(x.BaseGasPrice) + if !f(fd_Params_base_gas_price, value) { + return + } + } + if x.MinBaseGasPrice != "" { + value := protoreflect.ValueOfString(x.MinBaseGasPrice) + if !f(fd_Params_min_base_gas_price, value) { + return + } + } + if x.MaxBaseGasPrice != "" { + value := protoreflect.ValueOfString(x.MaxBaseGasPrice) + if !f(fd_Params_max_base_gas_price, value) { + return + } + } + if x.MaxChangeRate != "" { + value := protoreflect.ValueOfString(x.MaxChangeRate) + if !f(fd_Params_max_change_rate, value) { + return + } + } + if x.TargetGas != int64(0) { + value := protoreflect.ValueOfInt64(x.TargetGas) + if !f(fd_Params_target_gas, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "initia.dynamicfee.v1.Params.base_gas_price": + return x.BaseGasPrice != "" + case "initia.dynamicfee.v1.Params.min_base_gas_price": + return x.MinBaseGasPrice != "" + case "initia.dynamicfee.v1.Params.max_base_gas_price": + return x.MaxBaseGasPrice != "" + case "initia.dynamicfee.v1.Params.max_change_rate": + return x.MaxChangeRate != "" + case "initia.dynamicfee.v1.Params.target_gas": + return x.TargetGas != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.Params")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "initia.dynamicfee.v1.Params.base_gas_price": + x.BaseGasPrice = "" + case "initia.dynamicfee.v1.Params.min_base_gas_price": + x.MinBaseGasPrice = "" + case "initia.dynamicfee.v1.Params.max_base_gas_price": + x.MaxBaseGasPrice = "" + case "initia.dynamicfee.v1.Params.max_change_rate": + x.MaxChangeRate = "" + case "initia.dynamicfee.v1.Params.target_gas": + x.TargetGas = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.Params")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "initia.dynamicfee.v1.Params.base_gas_price": + value := x.BaseGasPrice + return protoreflect.ValueOfString(value) + case "initia.dynamicfee.v1.Params.min_base_gas_price": + value := x.MinBaseGasPrice + return protoreflect.ValueOfString(value) + case "initia.dynamicfee.v1.Params.max_base_gas_price": + value := x.MaxBaseGasPrice + return protoreflect.ValueOfString(value) + case "initia.dynamicfee.v1.Params.max_change_rate": + value := x.MaxChangeRate + return protoreflect.ValueOfString(value) + case "initia.dynamicfee.v1.Params.target_gas": + value := x.TargetGas + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.Params")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "initia.dynamicfee.v1.Params.base_gas_price": + x.BaseGasPrice = value.Interface().(string) + case "initia.dynamicfee.v1.Params.min_base_gas_price": + x.MinBaseGasPrice = value.Interface().(string) + case "initia.dynamicfee.v1.Params.max_base_gas_price": + x.MaxBaseGasPrice = value.Interface().(string) + case "initia.dynamicfee.v1.Params.max_change_rate": + x.MaxChangeRate = value.Interface().(string) + case "initia.dynamicfee.v1.Params.target_gas": + x.TargetGas = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.Params")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "initia.dynamicfee.v1.Params.base_gas_price": + panic(fmt.Errorf("field base_gas_price of message initia.dynamicfee.v1.Params is not mutable")) + case "initia.dynamicfee.v1.Params.min_base_gas_price": + panic(fmt.Errorf("field min_base_gas_price of message initia.dynamicfee.v1.Params is not mutable")) + case "initia.dynamicfee.v1.Params.max_base_gas_price": + panic(fmt.Errorf("field max_base_gas_price of message initia.dynamicfee.v1.Params is not mutable")) + case "initia.dynamicfee.v1.Params.max_change_rate": + panic(fmt.Errorf("field max_change_rate of message initia.dynamicfee.v1.Params is not mutable")) + case "initia.dynamicfee.v1.Params.target_gas": + panic(fmt.Errorf("field target_gas of message initia.dynamicfee.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.Params")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "initia.dynamicfee.v1.Params.base_gas_price": + return protoreflect.ValueOfString("") + case "initia.dynamicfee.v1.Params.min_base_gas_price": + return protoreflect.ValueOfString("") + case "initia.dynamicfee.v1.Params.max_base_gas_price": + return protoreflect.ValueOfString("") + case "initia.dynamicfee.v1.Params.max_change_rate": + return protoreflect.ValueOfString("") + case "initia.dynamicfee.v1.Params.target_gas": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: initia.dynamicfee.v1.Params")) + } + panic(fmt.Errorf("message initia.dynamicfee.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in initia.dynamicfee.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.BaseGasPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MinBaseGasPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MaxBaseGasPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MaxChangeRate) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TargetGas != 0 { + n += 1 + runtime.Sov(uint64(x.TargetGas)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.TargetGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TargetGas)) + i-- + dAtA[i] = 0x28 + } + if len(x.MaxChangeRate) > 0 { + i -= len(x.MaxChangeRate) + copy(dAtA[i:], x.MaxChangeRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaxChangeRate))) + i-- + dAtA[i] = 0x22 + } + if len(x.MaxBaseGasPrice) > 0 { + i -= len(x.MaxBaseGasPrice) + copy(dAtA[i:], x.MaxBaseGasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaxBaseGasPrice))) + i-- + dAtA[i] = 0x1a + } + if len(x.MinBaseGasPrice) > 0 { + i -= len(x.MinBaseGasPrice) + copy(dAtA[i:], x.MinBaseGasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinBaseGasPrice))) + i-- + dAtA[i] = 0x12 + } + if len(x.BaseGasPrice) > 0 { + i -= len(x.BaseGasPrice) + copy(dAtA[i:], x.BaseGasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BaseGasPrice))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BaseGasPrice", 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.BaseGasPrice = 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 MinBaseGasPrice", 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.MinBaseGasPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxBaseGasPrice", 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.MaxBaseGasPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxChangeRate", 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.MaxChangeRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TargetGas", wireType) + } + x.TargetGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.TargetGas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: initia/dynamicfee/v1/types.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) +) + +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BaseGasPrice string `protobuf:"bytes,1,opt,name=base_gas_price,json=baseGasPrice,proto3" json:"base_gas_price,omitempty"` + MinBaseGasPrice string `protobuf:"bytes,2,opt,name=min_base_gas_price,json=minBaseGasPrice,proto3" json:"min_base_gas_price,omitempty"` + MaxBaseGasPrice string `protobuf:"bytes,3,opt,name=max_base_gas_price,json=maxBaseGasPrice,proto3" json:"max_base_gas_price,omitempty"` + MaxChangeRate string `protobuf:"bytes,4,opt,name=max_change_rate,json=maxChangeRate,proto3" json:"max_change_rate,omitempty"` + TargetGas int64 `protobuf:"varint,5,opt,name=target_gas,json=targetGas,proto3" json:"target_gas,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_initia_dynamicfee_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_initia_dynamicfee_v1_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetBaseGasPrice() string { + if x != nil { + return x.BaseGasPrice + } + return "" +} + +func (x *Params) GetMinBaseGasPrice() string { + if x != nil { + return x.MinBaseGasPrice + } + return "" +} + +func (x *Params) GetMaxBaseGasPrice() string { + if x != nil { + return x.MaxBaseGasPrice + } + return "" +} + +func (x *Params) GetMaxChangeRate() string { + if x != nil { + return x.MaxChangeRate + } + return "" +} + +func (x *Params) GetTargetGas() int64 { + if x != nil { + return x.TargetGas + } + return 0 +} + +var File_initia_dynamicfee_v1_types_proto protoreflect.FileDescriptor + +var file_initia_dynamicfee_v1_types_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, + 0x66, 0x65, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, + 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xe4, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x67, 0x0a, 0x0e, + 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x15, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x47, 0x61, 0x73, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x12, 0x6d, 0x69, 0x6e, 0x5f, 0x62, 0x61, 0x73, + 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x45, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x6d, 0x69, 0x6e, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x42, 0x61, 0x73, + 0x65, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x12, 0x6d, 0x61, 0x78, + 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x45, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x19, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x61, 0x73, + 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x6d, 0x61, + 0x78, 0x42, 0x61, 0x73, 0x65, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, + 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x42, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x16, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, + 0x72, 0x61, 0x74, 0x65, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x47, 0x61, 0x73, 0x42, 0xe5, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0xa8, + 0xe2, 0x1e, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, + 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x49, 0x44, 0x58, 0xaa, 0x02, 0x14, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x14, + 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, + 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x20, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x44, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x3a, 0x3a, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x66, 0x65, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_initia_dynamicfee_v1_types_proto_rawDescOnce sync.Once + file_initia_dynamicfee_v1_types_proto_rawDescData = file_initia_dynamicfee_v1_types_proto_rawDesc +) + +func file_initia_dynamicfee_v1_types_proto_rawDescGZIP() []byte { + file_initia_dynamicfee_v1_types_proto_rawDescOnce.Do(func() { + file_initia_dynamicfee_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_initia_dynamicfee_v1_types_proto_rawDescData) + }) + return file_initia_dynamicfee_v1_types_proto_rawDescData +} + +var file_initia_dynamicfee_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_initia_dynamicfee_v1_types_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: initia.dynamicfee.v1.Params +} +var file_initia_dynamicfee_v1_types_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_initia_dynamicfee_v1_types_proto_init() } +func file_initia_dynamicfee_v1_types_proto_init() { + if File_initia_dynamicfee_v1_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_initia_dynamicfee_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_initia_dynamicfee_v1_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_initia_dynamicfee_v1_types_proto_goTypes, + DependencyIndexes: file_initia_dynamicfee_v1_types_proto_depIdxs, + MessageInfos: file_initia_dynamicfee_v1_types_proto_msgTypes, + }.Build() + File_initia_dynamicfee_v1_types_proto = out.File + file_initia_dynamicfee_v1_types_proto_rawDesc = nil + file_initia_dynamicfee_v1_types_proto_goTypes = nil + file_initia_dynamicfee_v1_types_proto_depIdxs = nil +} diff --git a/api/initia/move/v1/types.pulsar.go b/api/initia/move/v1/types.pulsar.go index 266fc8c68..474c7da25 100644 --- a/api/initia/move/v1/types.pulsar.go +++ b/api/initia/move/v1/types.pulsar.go @@ -5965,7 +5965,8 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + // Deprecated: Do not use. BaseMinGasPrice string `protobuf:"bytes,2,opt,name=base_min_gas_price,json=baseMinGasPrice,proto3" json:"base_min_gas_price,omitempty"` // CSR: Percentage of fees distributed to developers ContractSharedRevenueRatio string `protobuf:"bytes,3,opt,name=contract_shared_revenue_ratio,json=contractSharedRevenueRatio,proto3" json:"contract_shared_revenue_ratio,omitempty"` @@ -6003,6 +6004,7 @@ func (x *Params) GetBaseDenom() string { return "" } +// Deprecated: Do not use. func (x *Params) GetBaseMinGasPrice() string { if x != nil { return x.BaseMinGasPrice @@ -6037,7 +6039,8 @@ type RawParams struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + // Deprecated: Do not use. BaseMinGasPrice string `protobuf:"bytes,2,opt,name=base_min_gas_price,json=baseMinGasPrice,proto3" json:"base_min_gas_price,omitempty"` // CSR: Percentage of fees distributed to developers ContractSharedRevenueRatio string `protobuf:"bytes,3,opt,name=contract_shared_revenue_ratio,json=contractSharedRevenueRatio,proto3" json:"contract_shared_revenue_ratio,omitempty"` @@ -6072,6 +6075,7 @@ func (x *RawParams) GetBaseDenom() string { return "" } +// Deprecated: Do not use. func (x *RawParams) GetBaseMinGasPrice() string { if x != nil { return x.BaseMinGasPrice @@ -6537,135 +6541,135 @@ var file_initia_move_v1_types_proto_rawDesc = []byte{ 0x69, 0x74, 0x69, 0x61, 0x2e, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, - 0x72, 0x0a, 0x12, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x45, 0xc8, 0xde, 0x1f, + 0x74, 0x0a, 0x12, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x47, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x0f, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x69, 0x6e, 0x47, 0x61, 0x73, 0x50, 0x72, - 0x69, 0x63, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x5f, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x50, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, - 0xf2, 0xde, 0x1f, 0x24, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x2a, 0x01, 0x18, 0x01, 0x52, 0x0f, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x69, 0x6e, 0x47, 0x61, 0x73, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, - 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x1a, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, 0x76, - 0x65, 0x6e, 0x75, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0d, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x12, 0x51, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, 0x22, 0xf2, 0xde, - 0x1f, 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x65, 0x72, 0x73, 0x3a, 0x18, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, - 0x2a, 0x0b, 0x6d, 0x6f, 0x76, 0x65, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xdb, 0x02, - 0x0a, 0x09, 0x52, 0x61, 0x77, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, - 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x62, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x72, 0x0a, 0x12, 0x62, 0x61, - 0x73, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x45, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x19, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x67, 0x61, - 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x62, - 0x61, 0x73, 0x65, 0x4d, 0x69, 0x6e, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x93, - 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x72, - 0x65, 0x64, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x50, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x24, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x68, - 0x61, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x5f, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x52, - 0x61, 0x74, 0x69, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0xb8, 0x01, 0x0a, 0x06, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x50, 0xc8, + 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, + 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x24, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x76, 0x65, + 0x6e, 0x75, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x52, + 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x12, 0x51, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, 0x22, + 0xf2, 0xde, 0x1f, 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x73, 0x22, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x65, 0x72, 0x73, 0x3a, 0x18, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, + 0xe7, 0xb0, 0x2a, 0x0b, 0x6d, 0x6f, 0x76, 0x65, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, + 0xdd, 0x02, 0x0a, 0x09, 0x52, 0x61, 0x77, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, + 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x74, 0x0a, 0x12, + 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x47, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, + 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, + 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x18, + 0x01, 0x52, 0x0f, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x69, 0x6e, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, 0x5f, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x50, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, + 0xde, 0x1f, 0x24, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x75, 0x65, + 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x1a, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, 0x76, 0x65, + 0x6e, 0x75, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0d, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, + 0xb8, 0x01, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x62, 0x69, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x61, 0x62, 0x69, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, + 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0d, 0x75, 0x70, 0x67, + 0x72, 0x61, 0x64, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x61, 0x0a, 0x08, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x62, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x61, 0x62, 0x69, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x12, 0x44, 0x0a, 0x0e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x61, 0x2e, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, - 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0d, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x61, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0x85, 0x01, 0x0a, 0x08, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x54, 0x61, 0x67, 0x12, - 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x22, 0x5f, 0x0a, 0x09, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x0a, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x22, 0x4b, 0x0a, 0x12, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x35, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, - 0x2e, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x61, - 0x0a, 0x07, 0x44, 0x65, 0x78, 0x50, 0x61, 0x69, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x51, 0x75, 0x6f, 0x74, 0x65, - 0x12, 0x2f, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x70, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xe2, 0xde, 0x1f, 0x0a, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x4c, 0x50, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4c, - 0x70, 0x22, 0x8f, 0x01, 0x0a, 0x18, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x41, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x25, - 0x0a, 0x0e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x0e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x01, 0x52, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x2a, 0x3f, 0x0a, 0x0d, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x54, 0x49, - 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4d, 0x4d, 0x55, 0x54, 0x41, 0x42, - 0x4c, 0x45, 0x10, 0x02, 0x42, 0xbb, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0xa8, 0xe2, 0x1e, 0x01, 0x0a, - 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x6d, 0x6f, 0x76, 0x65, - 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, 0x6d, 0x6f, 0x76, 0x65, - 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x76, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x4d, 0x58, - 0xaa, 0x02, 0x0e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x0e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x4d, 0x6f, 0x76, 0x65, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x4d, 0x6f, 0x76, 0x65, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x10, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x3a, 0x3a, 0x4d, 0x6f, 0x76, 0x65, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0x85, 0x01, + 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x74, + 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x54, 0x61, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x6f, 0x76, 0x65, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x61, 0x77, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x09, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, + 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x0a, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x4b, 0x0a, 0x12, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x35, 0x0a, 0x06, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x2e, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x67, + 0x72, 0x61, 0x64, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x22, 0x61, 0x0a, 0x07, 0x44, 0x65, 0x78, 0x50, 0x61, 0x69, 0x72, 0x12, 0x25, 0x0a, + 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x51, + 0x75, 0x6f, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x5f, 0x6c, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xe2, 0xde, 0x1f, 0x0a, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4c, 0x50, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x4c, 0x70, 0x22, 0x8f, 0x01, 0x0a, 0x18, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, + 0x65, 0x6d, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x0e, 0x66, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x01, 0x52, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x2a, 0x3f, 0x0a, 0x0d, 0x55, 0x70, 0x67, 0x72, 0x61, + 0x64, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4f, 0x4d, + 0x50, 0x41, 0x54, 0x49, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4d, 0x4d, + 0x55, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x02, 0x42, 0xbb, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0xa8, + 0xe2, 0x1e, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, + 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2f, + 0x6d, 0x6f, 0x76, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x76, 0x65, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x49, 0x4d, 0x58, 0xaa, 0x02, 0x0e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2e, 0x4d, 0x6f, + 0x76, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, 0x4d, + 0x6f, 0x76, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x5c, + 0x4d, 0x6f, 0x76, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x3a, 0x3a, 0x4d, 0x6f, + 0x76, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/ante/ante.go b/app/ante/ante.go index c15742094..c2eff30f0 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -12,25 +12,27 @@ import ( "github.com/initia-labs/initia/app/ante/accnum" "github.com/initia-labs/initia/app/ante/sigverify" + dynamicfeeante "github.com/initia-labs/initia/x/dynamic-fee/ante" moveante "github.com/initia-labs/initia/x/move/ante" - movetypes "github.com/initia-labs/initia/x/move/types" "github.com/skip-mev/block-sdk/v2/block" auctionante "github.com/skip-mev/block-sdk/v2/x/auction/ante" auctionkeeper "github.com/skip-mev/block-sdk/v2/x/auction/keeper" + + dynamicfeetypes "github.com/initia-labs/initia/x/dynamic-fee/types" ) // HandlerOptions extends the SDK's AnteHandler options by requiring the IBC // channel keeper. type HandlerOptions struct { ante.HandlerOptions - Codec codec.BinaryCodec - MoveKeeper movetypes.AnteKeeper - IBCkeeper *ibckeeper.Keeper - AuctionKeeper auctionkeeper.Keeper - TxEncoder sdk.TxEncoder - MevLane auctionante.MEVLane - FreeLane block.Lane + Codec codec.BinaryCodec + DynamicFeeKeeper dynamicfeetypes.AnteKeeper + IBCkeeper *ibckeeper.Keeper + AuctionKeeper auctionkeeper.Keeper + TxEncoder sdk.TxEncoder + MevLane auctionante.MEVLane + FreeLane block.Lane } // NewAnteHandler returns an AnteHandler that checks and increments sequence @@ -56,7 +58,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { txFeeChecker := options.TxFeeChecker if txFeeChecker == nil { - txFeeChecker = moveante.NewMempoolFeeChecker(options.MoveKeeper).CheckTxFeeWithMinGasPrices + txFeeChecker = dynamicfeeante.NewMempoolFeeChecker(options.DynamicFeeKeeper).CheckTxFeeWithMinGasPrices } freeLaneFeeChecker := func(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error) { @@ -79,6 +81,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), moveante.NewGasPricesDecorator(), + dynamicfeeante.NewBlockGasDecorator(options.DynamicFeeKeeper), ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), ante.NewValidateMemoDecorator(options.AccountKeeper), diff --git a/app/app.go b/app/app.go index f09d3f2c4..43b61371f 100644 --- a/app/app.go +++ b/app/app.go @@ -474,7 +474,7 @@ func (app *InitiaApp) Simulate(txBytes []byte) (sdk.GasInfo, *sdk.Result, error) // RegisterTxService implements the Application.RegisterTxService method. func (app *InitiaApp) RegisterTxService(clientCtx client.Context) { authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.Simulate, app.interfaceRegistry) - initiatx.RegisterTxQuery(app.GRPCQueryRouter(), app.MoveKeeper.DexKeeper()) + initiatx.RegisterTxQuery(app.GRPCQueryRouter(), app.DynamicFeeKeeper) // Register the Block SDK mempool transaction service. mempool, ok := app.Mempool().(block.Mempool) diff --git a/app/blocksdk.go b/app/blocksdk.go index 02b8cac77..4097b73e3 100644 --- a/app/blocksdk.go +++ b/app/blocksdk.go @@ -11,10 +11,10 @@ import ( appante "github.com/initia-labs/initia/app/ante" applanes "github.com/initia-labs/initia/app/lanes" - movekeeper "github.com/initia-labs/initia/x/move/keeper" // block-sdk dependencies + dynamicfeekeeper "github.com/initia-labs/initia/x/dynamic-fee/keeper" blockabci "github.com/skip-mev/block-sdk/v2/abci" blockchecktx "github.com/skip-mev/block-sdk/v2/abci/checktx" signer_extraction "github.com/skip-mev/block-sdk/v2/adapters/signer_extraction_adapter" @@ -90,13 +90,13 @@ func setupBlockSDK( FeegrantKeeper: app.FeeGrantKeeper, SignModeHandler: app.txConfig.SignModeHandler(), }, - IBCkeeper: app.IBCKeeper, - MoveKeeper: movekeeper.NewDexKeeper(app.MoveKeeper), - Codec: app.appCodec, - TxEncoder: app.txConfig.TxEncoder(), - AuctionKeeper: *app.AuctionKeeper, - MevLane: mevLane, - FreeLane: freeLane, + IBCkeeper: app.IBCKeeper, + DynamicFeeKeeper: dynamicfeekeeper.NewAnteKeeper(app.DynamicFeeKeeper), + Codec: app.appCodec, + TxEncoder: app.txConfig.TxEncoder(), + AuctionKeeper: *app.AuctionKeeper, + MevLane: mevLane, + FreeLane: freeLane, }, ) if err != nil { diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index fbcb8495f..cf41cd0dc 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -72,6 +72,8 @@ import ( applanes "github.com/initia-labs/initia/app/lanes" bankkeeper "github.com/initia-labs/initia/x/bank/keeper" distrkeeper "github.com/initia-labs/initia/x/distribution/keeper" + dynamicfeekeeper "github.com/initia-labs/initia/x/dynamic-fee/keeper" + dynamicfeetypes "github.com/initia-labs/initia/x/dynamic-fee/types" evidencekeeper "github.com/initia-labs/initia/x/evidence/keeper" govkeeper "github.com/initia-labs/initia/x/gov/keeper" ibchooks "github.com/initia-labs/initia/x/ibc-hooks" @@ -127,6 +129,7 @@ type AppKeepers struct { CrisisKeeper *crisiskeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper GroupKeeper *groupkeeper.Keeper + DynamicFeeKeeper *dynamicfeekeeper.Keeper ConsensusParamsKeeper *consensusparamkeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly EvidenceKeeper *evidencekeeper.Keeper @@ -319,6 +322,18 @@ func NewAppKeeper( ) appKeepers.GroupKeeper = &groupKeeper + dynamicFeeKeeper := dynamicfeekeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(appKeepers.keys[dynamicfeetypes.StoreKey]), + runtime.NewTransientStoreService(appKeepers.tkeys[dynamicfeetypes.TStoreKey]), + movekeeper.NewDexKeeper(appKeepers.MoveKeeper), + appKeepers.MoveKeeper, + appKeepers.MoveKeeper, + ac, + authorityAddr, + ) + appKeepers.DynamicFeeKeeper = dynamicFeeKeeper + // Create IBC Keeper appKeepers.IBCKeeper = ibckeeper.NewKeeper( appCodec, diff --git a/app/keepers/keys.go b/app/keepers/keys.go index bde47fc60..db6ea7efb 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -43,6 +43,8 @@ import ( // noble forwarding keeper forwardingtypes "github.com/noble-assets/forwarding/v2/types" + + dynamicfeetypes "github.com/initia-labs/initia/x/dynamic-fee/types" ) func (appKeepers *AppKeepers) GenerateKeys() { @@ -59,10 +61,11 @@ func (appKeepers *AppKeepers) GenerateKeys() { movetypes.StoreKey, auctiontypes.StoreKey, ophosttypes.StoreKey, oracletypes.StoreKey, packetforwardtypes.StoreKey, ibchookstypes.StoreKey, forwardingtypes.StoreKey, marketmaptypes.StoreKey, ratelimittypes.StoreKey, + dynamicfeetypes.StoreKey, ) // Define transient store keys - appKeepers.tkeys = storetypes.NewTransientStoreKeys(forwardingtypes.TransientStoreKey) + appKeepers.tkeys = storetypes.NewTransientStoreKeys(forwardingtypes.TransientStoreKey, dynamicfeetypes.TStoreKey) // MemKeys are for information that is stored only in RAM. appKeepers.memKeys = storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) diff --git a/app/modules.go b/app/modules.go index ea417e2e3..ed9c1c37f 100644 --- a/app/modules.go +++ b/app/modules.go @@ -85,6 +85,9 @@ import ( // noble forwarding keeper forwarding "github.com/noble-assets/forwarding/v2" forwardingtypes "github.com/noble-assets/forwarding/v2/types" + + dynamicfee "github.com/initia-labs/initia/x/dynamic-fee" + dynamicfeetypes "github.com/initia-labs/initia/x/dynamic-fee/types" ) var maccPerms = map[string][]string{ @@ -150,6 +153,7 @@ func appModules( ibchooks.NewAppModule(app.appCodec, *app.IBCHooksKeeper), forwarding.NewAppModule(app.ForwardingKeeper), ratelimit.NewAppModule(app.appCodec, *app.RatelimitKeeper), + dynamicfee.NewAppModule(app.appCodec, *app.DynamicFeeKeeper), } } @@ -217,6 +221,7 @@ func orderEndBlockers() []string { marketmaptypes.ModuleName, forwardingtypes.ModuleName, ratelimittypes.ModuleName, + dynamicfeetypes.ModuleName, } } @@ -232,7 +237,7 @@ func orderInitBlockers() []string { return []string{ capabilitytypes.ModuleName, authtypes.ModuleName, movetypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, - rewardtypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, + dynamicfeetypes.ModuleName, rewardtypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, group.ModuleName, upgradetypes.ModuleName, feegrant.ModuleName, consensusparamtypes.ModuleName, ibcexported.ModuleName, ibctransfertypes.ModuleName, ibcnfttransfertypes.ModuleName, icatypes.ModuleName, icaauthtypes.ModuleName, ibcfeetypes.ModuleName, diff --git a/proto/initia/dynamicfee/module/v1/module.proto b/proto/initia/dynamicfee/module/v1/module.proto new file mode 100644 index 000000000..df8a44f07 --- /dev/null +++ b/proto/initia/dynamicfee/module/v1/module.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package initia.dynamicfee.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the builder module. +message Module { + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/initia-labs/initia/x/dynamic-fee"}; + + // Authority defines the custom module authority. + // If not set, defaults to the governance module. + string authority = 2; +} diff --git a/proto/initia/dynamicfee/v1/genesis.proto b/proto/initia/dynamicfee/v1/genesis.proto new file mode 100644 index 000000000..42240c64f --- /dev/null +++ b/proto/initia/dynamicfee/v1/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package initia.dynamicfee.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "initia/dynamicfee/v1/types.proto"; + +option go_package = "github.com/initia-labs/initia/x/dynamic-fee/types"; + +// GenesisState - genesis state of x/move +message GenesisState { + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/initia/dynamicfee/v1/query.proto b/proto/initia/dynamicfee/v1/query.proto new file mode 100644 index 000000000..35833e64e --- /dev/null +++ b/proto/initia/dynamicfee/v1/query.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package initia.dynamicfee.v1; + +import "amino/amino.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "initia/dynamicfee/v1/types.proto"; + +option go_package = "github.com/initia-labs/initia/x/dynamic-fee/types"; +option (gogoproto.equal_all) = false; +option (gogoproto.goproto_getters_all) = false; + +// Query provides defines the gRPC querier service +service Query { + // Params queries the params + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/initia/dynamicfee/v1/params"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/initia/dynamicfee/v1/tx.proto b/proto/initia/dynamicfee/v1/tx.proto new file mode 100644 index 000000000..a7568ebb3 --- /dev/null +++ b/proto/initia/dynamicfee/v1/tx.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package initia.dynamicfee.v1; + +import "amino/amino.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "initia/dynamicfee/v1/types.proto"; + +option go_package = "github.com/initia-labs/initia/x/dynamic-fee/types"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the move Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines an operation for updating the x/dynamic-fee module + // parameters. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "dynamicfee/MsgUpdateParams"; + + // authority is the address that controls the module + // (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // params defines the x/dynamic-fee parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} diff --git a/proto/initia/dynamicfee/v1/types.proto b/proto/initia/dynamicfee/v1/types.proto new file mode 100644 index 000000000..66a3c903a --- /dev/null +++ b/proto/initia/dynamicfee/v1/types.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package initia.dynamicfee.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/initia-labs/initia/x/dynamic-fee/types"; +option (gogoproto.equal_all) = true; +option (gogoproto.goproto_getters_all) = false; + +message Params { + string base_gas_price = 1 [ + (gogoproto.moretags) = "yaml:\"base_gas_price\"", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + string min_base_gas_price = 2 [ + (gogoproto.moretags) = "yaml:\"min_base_gas_price\"", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + string max_base_gas_price = 3 [ + (gogoproto.moretags) = "yaml:\"max_base_gas_price\"", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + string max_change_rate = 4 [ + (gogoproto.moretags) = "yaml:\"max_change_rate\"", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + int64 target_gas = 5; +} \ No newline at end of file diff --git a/proto/initia/move/v1/types.proto b/proto/initia/move/v1/types.proto index e3d8d2c5c..f49c468b6 100644 --- a/proto/initia/move/v1/types.proto +++ b/proto/initia/move/v1/types.proto @@ -19,7 +19,8 @@ message Params { (gogoproto.moretags) = "yaml:\"base_min_gas_price\"", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, - (amino.dont_omitempty) = true + (amino.dont_omitempty) = true, + deprecated = true ]; // CSR: Percentage of fees distributed to developers @@ -48,7 +49,8 @@ message RawParams { (gogoproto.moretags) = "yaml:\"base_min_gas_price\"", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, - (amino.dont_omitempty) = true + (amino.dont_omitempty) = true, + deprecated = true ]; // CSR: Percentage of fees distributed to developers @@ -134,4 +136,4 @@ message ExecuteAuthorizationItem { string module_name = 2; // FunctionName is the name of function to execute with wildcard '*' support repeated string function_names = 3 [(gogoproto.nullable) = true]; -} +} \ No newline at end of file diff --git a/x/dynamic-fee/abci.go b/x/dynamic-fee/abci.go new file mode 100644 index 000000000..d7f268f1b --- /dev/null +++ b/x/dynamic-fee/abci.go @@ -0,0 +1,20 @@ +package dynamicfee + +import ( + "context" + "time" + + "github.com/initia-labs/initia/x/dynamic-fee/keeper" + "github.com/initia-labs/initia/x/dynamic-fee/types" + + "github.com/cosmos/cosmos-sdk/telemetry" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func EndBlocker(ctx context.Context, k keeper.Keeper) error { + defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + + // update base fee + return k.UpdateBaseGasPrice(sdk.UnwrapSDKContext(ctx)) +} diff --git a/x/dynamic-fee/abci_test.go b/x/dynamic-fee/abci_test.go new file mode 100644 index 000000000..a4bbe58b7 --- /dev/null +++ b/x/dynamic-fee/abci_test.go @@ -0,0 +1,118 @@ +package dynamicfee_test + +import ( + "testing" + + "cosmossdk.io/math" + "github.com/stretchr/testify/require" + + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/initia-labs/initia/x/dynamic-fee/types" + + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + movetypes "github.com/initia-labs/initia/x/move/types" +) + +func Test_EndBlocker(t *testing.T) { + app := createApp(t) + + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + require.NoError(t, err) + + ctx := app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + err = app.DynamicFeeKeeper.SetParams(ctx, types.Params{ + BaseGasPrice: math.LegacyNewDecWithPrec(15, 3), + MinBaseGasPrice: math.LegacyNewDecWithPrec(1, 3), + MaxBaseGasPrice: math.LegacyNewDec(10), + TargetGas: 1_000_000, + MaxChangeRate: math.LegacyNewDecWithPrec(1, 1), + }) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) + + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + require.NoError(t, err) + + // initialize staking for secondBondDenom + ctx = app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + + // fund addr2 + app.BankKeeper.SendCoins(ctx, movetypes.StdAddr, addr2, sdk.NewCoins(secondBondCoin)) + + _, err = app.Commit() + require.NoError(t, err) + + ctx = app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + lessBaseGasPrice, err := app.DynamicFeeKeeper.BaseGasPrice(ctx) + require.NoError(t, err) + require.True(t, lessBaseGasPrice.LT(types.DefaultBaseGasPrice)) + + msgs := []sdk.Msg{} + for i := 0; i < 100; i++ { + msgs = append(msgs, &banktypes.MsgSend{ + FromAddress: addr2.String(), + ToAddress: addr1.String(), + Amount: sdk.NewCoins(sdk.NewInt64Coin(secondBondDenom, 10)), + }) + } + + _, err = executeMsgsWithGasInfo(t, app, msgs, []uint64{1}, []uint64{0}, priv2) + require.NoError(t, err) + + ctx = app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + baseGasPrice, err := app.DynamicFeeKeeper.BaseGasPrice(ctx) + require.NoError(t, err) + require.True(t, baseGasPrice.GT(lessBaseGasPrice)) +} + +func Test_EndBlocker_NoBaseGasPriceChange(t *testing.T) { + app := createApp(t) + + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + require.NoError(t, err) + + ctx := app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + err = app.DynamicFeeKeeper.SetParams(ctx, types.NoBaseGasPriceChangeParams()) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) + + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + require.NoError(t, err) + + // initialize staking for secondBondDenom + ctx = app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + + // fund addr2 + app.BankKeeper.SendCoins(ctx, movetypes.StdAddr, addr2, sdk.NewCoins(secondBondCoin)) + + _, err = app.Commit() + require.NoError(t, err) + + ctx = app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + baseGasPrice, err := app.DynamicFeeKeeper.BaseGasPrice(ctx) + require.NoError(t, err) + require.True(t, baseGasPrice.Equal(types.DefaultBaseGasPrice)) + + msgs := []sdk.Msg{} + for i := 0; i < 100; i++ { + msgs = append(msgs, &banktypes.MsgSend{ + FromAddress: addr2.String(), + ToAddress: addr1.String(), + Amount: sdk.NewCoins(sdk.NewInt64Coin(secondBondDenom, 10)), + }) + } + + _, err = executeMsgsWithGasInfo(t, app, msgs, []uint64{1}, []uint64{0}, priv2) + require.NoError(t, err) + + ctx = app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + baseGasPrice, err = app.DynamicFeeKeeper.BaseGasPrice(ctx) + require.NoError(t, err) + require.True(t, baseGasPrice.Equal(types.DefaultBaseGasPrice)) +} diff --git a/x/dynamic-fee/ante/ante_test.go b/x/dynamic-fee/ante/ante_test.go new file mode 100644 index 000000000..a6a0c5753 --- /dev/null +++ b/x/dynamic-fee/ante/ante_test.go @@ -0,0 +1,134 @@ +package ante_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/suite" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "cosmossdk.io/log" + dbm "github.com/cosmos/cosmos-db" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/server" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" + + initiaapp "github.com/initia-labs/initia/app" + moveconfig "github.com/initia-labs/initia/x/move/config" + movetypes "github.com/initia-labs/initia/x/move/types" + + oracleconfig "github.com/skip-mev/connect/v2/oracle/config" +) + +// AnteTestSuite is a test suite to be used with ante handler tests. +type AnteTestSuite struct { + suite.Suite + + app *initiaapp.InitiaApp + ctx sdk.Context + clientCtx client.Context + txBuilder client.TxBuilder +} + +// returns context and app with params set on account keeper +func (suite *AnteTestSuite) createTestApp(tempDir string) (*initiaapp.InitiaApp, sdk.Context) { + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = tempDir + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + app := initiaapp.NewInitiaApp( + log.NewNopLogger(), dbm.NewMemDB(), nil, true, moveconfig.DefaultMoveConfig(), oracleconfig.NewDefaultAppConfig(), appOptions, + ) + ctx := app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + err := app.AccountKeeper.Params.Set(ctx, authtypes.DefaultParams()) + suite.NoError(err) + + app.MoveKeeper.SetParams(ctx, movetypes.DefaultParams()) + + return app, ctx +} + +// SetupTest setups a new test, with new app, context, and anteHandler. +func (suite *AnteTestSuite) SetupTest() { + tempDir := suite.T().TempDir() + suite.app, suite.ctx = suite.createTestApp(tempDir) + suite.ctx = suite.ctx.WithBlockHeight(1) + + // Set up TxConfig. + encodingConfig := initiaapp.MakeEncodingConfig() + + // We're using TestMsg encoding in some tests, so register it here. + encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) + testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) + + suite.clientCtx = client.Context{}. + WithTxConfig(encodingConfig.TxConfig) +} + +// CreateTestTx is a helper function to create a tx given multiple inputs. +func (suite *AnteTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (authsign.Tx, error) { + defaultSignMode, err := authsign.APISignModeToInternal(suite.clientCtx.TxConfig.SignModeHandler().DefaultMode()) + suite.NoError(err) + + // First round: we gather all the signer infos. We use the "set empty + // signature" hack to do that. + var sigsV2 []signing.SignatureV2 + for i, priv := range privs { + + sigV2 := signing.SignatureV2{ + PubKey: priv.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: defaultSignMode, + Signature: nil, + }, + Sequence: accSeqs[i], + } + + sigsV2 = append(sigsV2, sigV2) + } + err = suite.txBuilder.SetSignatures(sigsV2...) + if err != nil { + return nil, err + } + + // Second round: all signer infos are set, so each signer can sign. + sigsV2 = []signing.SignatureV2{} + for i, priv := range privs { + signerData := authsign.SignerData{ + Address: sdk.AccAddress(priv.PubKey().Address()).String(), + ChainID: chainID, + AccountNumber: accNums[i], + Sequence: accSeqs[i], + PubKey: priv.PubKey(), + } + sigV2, err := tx.SignWithPrivKey( + context.TODO(), defaultSignMode, signerData, + suite.txBuilder, priv, suite.clientCtx.TxConfig, accSeqs[i]) + if err != nil { + return nil, err + } + + sigsV2 = append(sigsV2, sigV2) + } + err = suite.txBuilder.SetSignatures(sigsV2...) + if err != nil { + return nil, err + } + + return suite.txBuilder.GetTx(), nil +} + +func TestAnteTestSuite(t *testing.T) { + suite.Run(t, new(AnteTestSuite)) +} diff --git a/x/dynamic-fee/ante/block_gas.go b/x/dynamic-fee/ante/block_gas.go new file mode 100644 index 000000000..aa5c5172b --- /dev/null +++ b/x/dynamic-fee/ante/block_gas.go @@ -0,0 +1,52 @@ +package ante + +import ( + "context" + + "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// custom block gas meter to accumulate gas limit not consumed +type BlockGasMeter interface { + AccumulateGas(ctx context.Context, gas uint64) error +} + +// BlockGasDecorator ante decorator to accumulate gas used in the block +type BlockGasDecorator struct { + blockGasMeter BlockGasMeter +} + +// NewBlockGasDecorator constructor of the BlockGasDecorator +func NewBlockGasDecorator(blockGasMeter BlockGasMeter) *BlockGasDecorator { + return &BlockGasDecorator{ + blockGasMeter: blockGasMeter, + } +} + +// AnteHandle that accumulate gas used in the block +func (d BlockGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + feeTx, ok := tx.(sdk.FeeTx) + if !ok { + return ctx, errors.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") + } + + gas := feeTx.GetGas() + + // record the gas amount to the block gas meter + // NOTE: use infinite gas meter to avoid gas charge for chain operation + if !simulate && !ctx.IsCheckTx() { + if err := d.blockGasMeter.AccumulateGas(ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()), gas); err != nil { + return ctx, err + } + } + + if next != nil { + return next(ctx, tx, simulate) + } + + return ctx, nil +} diff --git a/x/dynamic-fee/ante/block_gas_test.go b/x/dynamic-fee/ante/block_gas_test.go new file mode 100644 index 000000000..c046f8ac9 --- /dev/null +++ b/x/dynamic-fee/ante/block_gas_test.go @@ -0,0 +1,62 @@ +package ante_test + +import ( + "context" + + "cosmossdk.io/math" + "github.com/initia-labs/initia/x/dynamic-fee/ante" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type TestBlockGasMeter struct { + gasUsed uint64 +} + +func (t *TestBlockGasMeter) AccumulateGas(ctx context.Context, gas uint64) error { + t.gasUsed += gas + return nil +} + +func (suite *AnteTestSuite) Test_BlockGasDecorator() { + suite.SetupTest() // setup + suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() + + // keys and addresses + priv1, _, _ := testdata.KeyTestPubAddr() + + feeAmount := sdk.NewCoins(sdk.NewCoin(baseDenom, math.NewInt(100))) + gasLimit := uint64(200_000) + suite.txBuilder.SetFeeAmount(feeAmount) + suite.txBuilder.SetGasLimit(gasLimit) + + privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} + tx, err := suite.CreateTestTx(privs, accNums, accSeqs, suite.ctx.ChainID()) + suite.Require().NoError(err) + + blockGasMeter := &TestBlockGasMeter{} + decorator := ante.NewBlockGasDecorator(blockGasMeter) + + // in normal mode + _, err = decorator.AnteHandle(suite.ctx.WithIsCheckTx(false), tx, false, nil) + suite.Require().NoError(err) + + // incremented in normal mode + suite.Require().Equal(gasLimit, blockGasMeter.gasUsed) + + // in check tx mode + _, err = decorator.AnteHandle(suite.ctx.WithIsCheckTx(true), tx, true, nil) + suite.Require().NoError(err) + + // not incremented in check tx mode + suite.Require().Equal(gasLimit, blockGasMeter.gasUsed) + + // in simulation mode + _, err = decorator.AnteHandle(suite.ctx.WithIsCheckTx(false), tx, true, nil) + suite.Require().NoError(err) + + // not incremented in simulation mode + suite.Require().Equal(gasLimit, blockGasMeter.gasUsed) +} diff --git a/x/move/ante/fee.go b/x/dynamic-fee/ante/fee.go similarity index 73% rename from x/move/ante/fee.go rename to x/dynamic-fee/ante/fee.go index 8c94a2957..794a9624b 100644 --- a/x/move/ante/fee.go +++ b/x/dynamic-fee/ante/fee.go @@ -6,8 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - movetypes "github.com/initia-labs/initia/x/move/types" + dynamicfeetypes "github.com/initia-labs/initia/x/dynamic-fee/types" ) // MempoolFeeChecker will check if the transaction's fee is at least as large @@ -17,12 +16,12 @@ import ( // If fee is high enough or not CheckTx, then call next AnteHandler // CONTRACT: Tx must implement FeeTx to use MempoolFeeChecker type MempoolFeeChecker struct { - keeper movetypes.AnteKeeper + keeper dynamicfeetypes.AnteKeeper } // NewMempoolFeeChecker create MempoolFeeChecker instance func NewMempoolFeeChecker( - keeper movetypes.AnteKeeper, + keeper dynamicfeetypes.AnteKeeper, ) MempoolFeeChecker { return MempoolFeeChecker{ keeper, @@ -44,23 +43,17 @@ func (fc MempoolFeeChecker) CheckTxFeeWithMinGasPrices(ctx sdk.Context, tx sdk.T var baseDenom string var err error + if fc.keeper != nil { baseDenom, err = fc.keeper.BaseDenom(ctx) if err != nil { return nil, 0, err } - baseMinGasPrice, err := fc.keeper.BaseMinGasPrice(ctx) - if err != nil { - return nil, 0, err - } - - minGasPrices = combinedMinGasPrices(baseDenom, baseMinGasPrice, minGasPrices) - for _, coin := range feeTx.GetFee() { - basePrice, err := fc.fetchPrice(ctx, baseDenom, coin.Denom) + basePrice, err := fc.keeper.GetBaseSpotPrice(ctx, coin.Denom) if err != nil { - return nil, 1, err + return nil, 0, err } quoteAmount := coin.Amount @@ -70,6 +63,23 @@ func (fc MempoolFeeChecker) CheckTxFeeWithMinGasPrices(ctx sdk.Context, tx sdk.T if totalFeeBaseAmount.GT(math.OneInt()) { priority = totalFeeBaseAmount.Int64() } + + baseGasPrice, err := fc.keeper.BaseGasPrice(ctx) + if err != nil { + return nil, 0, err + } + + gasPriceFromTotalFee := math.LegacyNewDecFromInt(totalFeeBaseAmount).Quo(math.LegacyNewDec(int64(gas))) + + if gasPriceFromTotalFee.LT(baseGasPrice) { + return nil, 0, errors.Wrapf( + sdkerrors.ErrInsufficientFee, + "insufficient gas price; got: %s (sum %s), base gas price required: %s", + feeCoins, + gasPriceFromTotalFee.String(), + baseGasPrice.String(), + ) + } } if !minGasPrices.IsZero() { @@ -79,7 +89,6 @@ func (fc MempoolFeeChecker) CheckTxFeeWithMinGasPrices(ctx sdk.Context, tx sdk.T // convert baseDenom min gas prices to quote denom prices // and check the paid fee is enough or not. isSufficient := false - sumInBaseUnit := math.ZeroInt() if fc.keeper != nil { requiredBaseAmount := requiredFees.AmountOfNoDenomValidation(baseDenom) @@ -93,7 +102,7 @@ func (fc MempoolFeeChecker) CheckTxFeeWithMinGasPrices(ctx sdk.Context, tx sdk.T sdkerrors.ErrInsufficientFee, "insufficient fees; got: %s (sum %s), required: %s", feeCoins, - sumInBaseUnit, + totalFeeBaseAmount, requiredFees, ) } @@ -103,21 +112,3 @@ func (fc MempoolFeeChecker) CheckTxFeeWithMinGasPrices(ctx sdk.Context, tx sdk.T return feeCoins, priority, nil } - -func (fc MempoolFeeChecker) fetchPrice(ctx sdk.Context, baseDenom, quoteDenom string) (price math.LegacyDec, err error) { - if quoteDenom == baseDenom { - return math.LegacyOneDec(), nil - } - - if found, err := fc.keeper.HasDexPair(ctx, quoteDenom); err != nil { - return math.LegacyZeroDec(), err - } else if !found { - return math.LegacyZeroDec(), nil - } - - if basePrice, err := fc.keeper.GetBaseSpotPrice(ctx, quoteDenom); err != nil { - return math.LegacyZeroDec(), err - } else { - return basePrice, nil - } -} diff --git a/x/move/ante/fee_test.go b/x/dynamic-fee/ante/fee_test.go similarity index 82% rename from x/move/ante/fee_test.go rename to x/dynamic-fee/ante/fee_test.go index 4f154c9dd..1a590f8cd 100644 --- a/x/move/ante/fee_test.go +++ b/x/dynamic-fee/ante/fee_test.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/math" initiaapp "github.com/initia-labs/initia/app" - "github.com/initia-labs/initia/x/move/ante" + "github.com/initia-labs/initia/x/dynamic-fee/ante" "github.com/initia-labs/initia/x/move/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -18,27 +18,17 @@ import ( var baseDenom = initiaapp.BondDenom type TestAnteKeeper struct { - pools map[string][]math.Int - weights map[string][]math.LegacyDec - baseDenom string - baseMinGasPrice math.LegacyDec + pools map[string][]math.Int + weights map[string][]math.LegacyDec + baseDenom string + baseGasPrice math.LegacyDec } -func (k TestAnteKeeper) HasDexPair(_ context.Context, denomQuote string) (bool, error) { - _, found := k.pools[denomQuote] - if !found { - return false, nil - } - - _, found = k.weights[denomQuote] - if !found { - return false, nil +func (k TestAnteKeeper) GetBaseSpotPrice(_ context.Context, denomQuote string) (quotePrice math.LegacyDec, err error) { + if denomQuote == k.baseDenom { + return math.LegacyOneDec(), nil } - return true, nil -} - -func (k TestAnteKeeper) GetBaseSpotPrice(_ context.Context, denomQuote string) (quotePrice math.LegacyDec, err error) { balances, found := k.pools[denomQuote] if !found { return math.LegacyZeroDec(), fmt.Errorf("not found") @@ -56,8 +46,12 @@ func (k TestAnteKeeper) BaseDenom(_ context.Context) (string, error) { return k.baseDenom, nil } -func (k TestAnteKeeper) BaseMinGasPrice(ctx context.Context) (math.LegacyDec, error) { - return k.baseMinGasPrice, nil +func (k TestAnteKeeper) BaseGasPrice(ctx context.Context) (math.LegacyDec, error) { + return k.baseGasPrice, nil +} + +func (k TestAnteKeeper) AccumulateGas(ctx context.Context, gas uint64) error { + return nil } func (suite *AnteTestSuite) TestEnsureMempoolFees() { @@ -78,10 +72,10 @@ func (suite *AnteTestSuite) TestEnsureMempoolFees() { // set price 0.5 base == 1 quote fc := ante.NewMempoolFeeChecker(TestAnteKeeper{ - pools: dexPools, - weights: dexWeights, - baseDenom: baseDenom, - baseMinGasPrice: math.LegacyZeroDec(), + pools: dexPools, + weights: dexWeights, + baseDenom: baseDenom, + baseGasPrice: math.LegacyZeroDec(), }) // keys and addresses @@ -140,10 +134,10 @@ func (suite *AnteTestSuite) TestEnsureMempoolFees() { // set high base_min_gas_price to test should be failed fc = ante.NewMempoolFeeChecker(TestAnteKeeper{ - pools: dexPools, - weights: dexWeights, - baseDenom: baseDenom, - baseMinGasPrice: math.LegacyNewDecWithPrec(4, 3), + pools: dexPools, + weights: dexWeights, + baseDenom: baseDenom, + baseGasPrice: math.LegacyNewDecWithPrec(4, 3), }) suite.txBuilder.SetFeeAmount(feeAmount) diff --git a/x/move/ante/fee_utils.go b/x/dynamic-fee/ante/fee_utils.go similarity index 51% rename from x/move/ante/fee_utils.go rename to x/dynamic-fee/ante/fee_utils.go index b49aacf3c..3060e1601 100644 --- a/x/move/ante/fee_utils.go +++ b/x/dynamic-fee/ante/fee_utils.go @@ -7,26 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// combinedMinGasPrices will combine the on-chain fee and min_gas_prices. -func combinedMinGasPrices(baseDenom string, baseMinGasPrice math.LegacyDec, minGasPrices sdk.DecCoins) sdk.DecCoins { - // empty min_gas_price - if len(minGasPrices) == 0 { - return sdk.DecCoins{sdk.NewDecCoinFromDec(baseDenom, baseMinGasPrice)} - } - - baseMinGasPriceFromConfig := minGasPrices.AmountOf(baseDenom) - - // if the configured value is bigger than - // on chain baseMinGasPrice, return origin minGasPrices - if baseMinGasPriceFromConfig.GTE(baseMinGasPrice) { - return minGasPrices - } - - // else, change min gas price of base denom to on chain value - diff := baseMinGasPrice.Sub(baseMinGasPriceFromConfig) - return minGasPrices.Add(sdk.NewDecCoinFromDec(baseDenom, diff)) -} - // computeRequiredFees returns required fees func computeRequiredFees(gas storetypes.Gas, minGasPrices sdk.DecCoins) sdk.Coins { // special case: if minGasPrices=[], requiredFees=[] diff --git a/x/dynamic-fee/autocli.go b/x/dynamic-fee/autocli.go new file mode 100644 index 000000000..4fb96eb36 --- /dev/null +++ b/x/dynamic-fee/autocli.go @@ -0,0 +1,21 @@ +package dynamicfee + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + dynamicfeev1 "github.com/initia-labs/initia/api/initia/dynamicfee/v1" +) + +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: dynamicfeev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current dynamic fee parameters", + }, + }, + }, + } +} diff --git a/x/dynamic-fee/common_test.go b/x/dynamic-fee/common_test.go new file mode 100644 index 000000000..4f0674ddd --- /dev/null +++ b/x/dynamic-fee/common_test.go @@ -0,0 +1,191 @@ +package dynamicfee_test + +import ( + "slices" + "testing" + + initiaapp "github.com/initia-labs/initia/app" + customdistrtypes "github.com/initia-labs/initia/x/distribution/types" + "github.com/initia-labs/initia/x/move/types" + stakingtypes "github.com/initia-labs/initia/x/mstaking/types" + vmtypes "github.com/initia-labs/movevm/types" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + testutilsims "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" +) + +// Bond denom should be set for staking test +const bondDenom = initiaapp.BondDenom +const secondBondDenom = "ulp" + +var ( + priv1 = secp256k1.GenPrivKey() + addr1 = sdk.AccAddress(priv1.PubKey().Address()) + priv2 = secp256k1.GenPrivKey() + addr2 = sdk.AccAddress(priv2.PubKey().Address()) + + valKey = ed25519.GenPrivKey() + + commissionRates = stakingtypes.NewCommissionRates(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()) + + genCoins = sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewInt(5000000))).Sort() + bondCoin = sdk.NewCoin(bondDenom, math.NewInt(1_000_000)) + secondBondCoin = sdk.NewCoin(secondBondDenom, math.NewInt(1_000_000)) +) + +func checkBalance(t *testing.T, app *initiaapp.InitiaApp, addr sdk.AccAddress, balances sdk.Coins) { + ctxCheck := app.BaseApp.NewContext(true) + require.True(t, balances.Equal(app.BankKeeper.GetAllBalances(ctxCheck, addr))) +} + +func createApp(t *testing.T) *initiaapp.InitiaApp { + baseCoin := sdk.NewCoin(bondDenom, math.NewInt(1_000_000_000_000)) + quoteCoin := sdk.NewCoin("uusdc", math.NewInt(2_500_000_000_000)) + dexCoins := sdk.NewCoins(baseCoin, quoteCoin) + + app := initiaapp.SetupWithGenesisAccounts(nil, authtypes.GenesisAccounts{ + &authtypes.BaseAccount{Address: addr1.String()}, + &authtypes.BaseAccount{Address: addr2.String()}, + &authtypes.BaseAccount{Address: types.StdAddr.String()}, + }, + banktypes.Balance{Address: addr1.String(), Coins: genCoins}, + banktypes.Balance{Address: addr2.String(), Coins: genCoins}, + banktypes.Balance{Address: types.StdAddr.String(), Coins: dexCoins}, + ) + + checkBalance(t, app, addr1, genCoins) + checkBalance(t, app, addr2, genCoins) + checkBalance(t, app, types.StdAddr, dexCoins) + + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + require.NoError(t, err) + + ctx := app.BaseApp.NewUncachedContext(false, tmproto.Header{}) + createDexPool(t, ctx, app, baseCoin, quoteCoin, math.LegacyNewDecWithPrec(8, 1), math.LegacyNewDecWithPrec(2, 1)) + + // set reward weight + distrParams := customdistrtypes.DefaultParams() + distrParams.RewardWeights = []customdistrtypes.RewardWeight{ + {Denom: bondDenom, Weight: math.LegacyOneDec()}, + } + require.NoError(t, app.DistrKeeper.Params.Set(ctx, distrParams)) + app.StakingKeeper.SetBondDenoms(ctx, []string{bondDenom, secondBondDenom}) + + // fund second bond coin + app.BankKeeper.SendCoins(ctx, types.StdAddr, addr1, sdk.NewCoins(secondBondCoin)) + + _, err = app.Commit() + require.NoError(t, err) + + // create validator + description := stakingtypes.NewDescription("foo_moniker", "", "", "", "") + createValidatorMsg, err := stakingtypes.NewMsgCreateValidator( + sdk.ValAddress(addr1).String(), valKey.PubKey(), sdk.NewCoins(bondCoin, secondBondCoin), description, commissionRates, + ) + require.NoError(t, err) + + err = executeMsgs(t, app, []sdk.Msg{createValidatorMsg}, []uint64{0}, []uint64{0}, priv1) + require.NoError(t, err) + + checkBalance(t, app, addr1, genCoins.Sub(bondCoin)) + + return app +} + +func executeMsgs(t *testing.T, app *initiaapp.InitiaApp, msgs []sdk.Msg, accountNum []uint64, sequenceNum []uint64, priv ...cryptotypes.PrivKey) error { + txGen := initiaapp.MakeEncodingConfig().TxConfig + header := tmproto.Header{Height: app.LastBlockHeight() + 1} + _, _, err := testutilsims.SignCheckDeliver(t, txGen, app.BaseApp, header, msgs, "", accountNum, sequenceNum, true, true, priv...) + return err +} + +func executeMsgsWithGasInfo(t *testing.T, app *initiaapp.InitiaApp, msgs []sdk.Msg, accountNum []uint64, sequenceNum []uint64, priv ...cryptotypes.PrivKey) (sdk.GasInfo, error) { + txGen := initiaapp.MakeEncodingConfig().TxConfig + header := tmproto.Header{Height: app.LastBlockHeight() + 1} + gas, _, err := testutilsims.SignCheckDeliver(t, txGen, app.BaseApp, header, msgs, "", accountNum, sequenceNum, true, true, priv...) + return gas, err +} + +func decToVmArgument(t *testing.T, val math.LegacyDec) []byte { + // big-endian bytes (bytes are cloned) + bz := val.BigInt().Bytes() + + // reverse bytes to little-endian + slices.Reverse(bz) + + // serialize bytes + bz, err := vmtypes.SerializeBytes(bz) + require.NoError(t, err) + + return bz +} + +func createDexPool( + t *testing.T, ctx sdk.Context, app *initiaapp.InitiaApp, + baseCoin sdk.Coin, quoteCoin sdk.Coin, + weightBase math.LegacyDec, weightQuote math.LegacyDec, +) (metadataLP vmtypes.AccountAddress) { + metadataBase, err := types.MetadataAddressFromDenom(baseCoin.Denom) + require.NoError(t, err) + + metadataQuote, err := types.MetadataAddressFromDenom(quoteCoin.Denom) + require.NoError(t, err) + + denomLP := "ulp" + + // + // prepare arguments + // + + name, err := vmtypes.SerializeString("LP Coin") + require.NoError(t, err) + + symbol, err := vmtypes.SerializeString(denomLP) + require.NoError(t, err) + + // 0.003 == 0.3% + swapFeeBz := decToVmArgument(t, math.LegacyNewDecWithPrec(3, 3)) + weightBaseBz := decToVmArgument(t, weightBase) + weightQuoteBz := decToVmArgument(t, weightQuote) + + baseAmount, err := vmtypes.SerializeUint64(baseCoin.Amount.Uint64()) + require.NoError(t, err) + + quoteAmount, err := vmtypes.SerializeUint64(quoteCoin.Amount.Uint64()) + require.NoError(t, err) + + err = app.MoveKeeper.ExecuteEntryFunction( + ctx, + vmtypes.StdAddress, + vmtypes.StdAddress, + "dex", + "create_pair_script", + []vmtypes.TypeTag{}, + [][]byte{ + name, + symbol, + swapFeeBz, + weightBaseBz, + weightQuoteBz, + metadataBase[:], + metadataQuote[:], + baseAmount, + quoteAmount, + }, + ) + require.NoError(t, err) + + return types.NamedObjectAddress(vmtypes.StdAddress, denomLP) +} diff --git a/x/dynamic-fee/keeper/ante.go b/x/dynamic-fee/keeper/ante.go new file mode 100644 index 000000000..a879cf6ff --- /dev/null +++ b/x/dynamic-fee/keeper/ante.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/math" + "github.com/initia-labs/initia/x/dynamic-fee/types" +) + +type AnteKeeper struct { + *Keeper +} + +var _ types.AnteKeeper = AnteKeeper{} + +func NewAnteKeeper(k *Keeper) AnteKeeper { + return AnteKeeper{Keeper: k} +} + +func (k AnteKeeper) BaseDenom(ctx context.Context) (string, error) { + return k.Keeper.baseDenomKeeper.BaseDenom(ctx) +} + +func (k AnteKeeper) GetBaseSpotPrice(ctx context.Context, denom string) (math.LegacyDec, error) { + baseDenom, err := k.BaseDenom(ctx) + if err != nil { + return math.LegacyDec{}, err + } else if baseDenom == denom { + return math.LegacyOneDec(), nil + } + return k.Keeper.tokenPriceKeeper.GetBaseSpotPrice(ctx, denom) +} diff --git a/x/dynamic-fee/keeper/common_test.go b/x/dynamic-fee/keeper/common_test.go new file mode 100644 index 000000000..a07b9c14c --- /dev/null +++ b/x/dynamic-fee/keeper/common_test.go @@ -0,0 +1,698 @@ +package keeper_test + +import ( + "encoding/binary" + "encoding/hex" + "fmt" + "os" + "strings" + "testing" + "time" + + "github.com/cometbft/cometbft/crypto" + "github.com/cometbft/cometbft/crypto/ed25519" + "github.com/cometbft/cometbft/crypto/secp256k1" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "github.com/cosmos/gogoproto/proto" + + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + "github.com/stretchr/testify/require" + + "cosmossdk.io/log" + "cosmossdk.io/math" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/tx/signing" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + codecaddress "github.com/cosmos/cosmos-sdk/codec/address" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/std" + testutilsims "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/auth" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + + ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" + ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibcnfttransfer "github.com/initia-labs/initia/x/ibc/nft-transfer" + + initiaapp "github.com/initia-labs/initia/app" + initiaappparams "github.com/initia-labs/initia/app/params" + "github.com/initia-labs/initia/x/bank" + movebank "github.com/initia-labs/initia/x/bank/keeper" + "github.com/initia-labs/initia/x/distribution" + distrkeeper "github.com/initia-labs/initia/x/distribution/keeper" + customdistrtypes "github.com/initia-labs/initia/x/distribution/types" + "github.com/initia-labs/initia/x/gov" + govkeeper "github.com/initia-labs/initia/x/gov/keeper" + customgovtypes "github.com/initia-labs/initia/x/gov/types" + "github.com/initia-labs/initia/x/move" + moveconfig "github.com/initia-labs/initia/x/move/config" + movekeeper "github.com/initia-labs/initia/x/move/keeper" + movetypes "github.com/initia-labs/initia/x/move/types" + staking "github.com/initia-labs/initia/x/mstaking" + stakingkeeper "github.com/initia-labs/initia/x/mstaking/keeper" + stakingtypes "github.com/initia-labs/initia/x/mstaking/types" + reward "github.com/initia-labs/initia/x/reward" + rewardkeeper "github.com/initia-labs/initia/x/reward/keeper" + rewardtypes "github.com/initia-labs/initia/x/reward/types" + "github.com/initia-labs/initia/x/slashing" + + vmapi "github.com/initia-labs/movevm/api" + "github.com/initia-labs/movevm/precompile" + vmtypes "github.com/initia-labs/movevm/types" + + "github.com/skip-mev/connect/v2/x/oracle" + oraclekeeper "github.com/skip-mev/connect/v2/x/oracle/keeper" + oracletypes "github.com/skip-mev/connect/v2/x/oracle/types" + + dynamicfeekeeper "github.com/initia-labs/initia/x/dynamic-fee/keeper" + dynamicfeetypes "github.com/initia-labs/initia/x/dynamic-fee/types" +) + +var ModuleBasics = module.NewBasicManager( + auth.AppModuleBasic{}, + bank.AppModuleBasic{}, + staking.AppModuleBasic{}, + reward.AppModuleBasic{}, + distribution.AppModuleBasic{}, + gov.AppModuleBasic{}, + slashing.AppModuleBasic{}, + move.AppModuleBasic{}, + oracle.AppModuleBasic{}, + ibctransfer.AppModuleBasic{}, + ibcnfttransfer.AppModuleBasic{}, + ibcfee.AppModuleBasic{}, +) + +// Bond denom should be set for staking test +const bondDenom = initiaapp.BondDenom + +var ( + valPubKeys = testutilsims.CreateTestPubKeys(5) + + pubKeys = []crypto.PubKey{ + secp256k1.GenPrivKey().PubKey(), + secp256k1.GenPrivKey().PubKey(), + secp256k1.GenPrivKey().PubKey(), + secp256k1.GenPrivKey().PubKey(), + secp256k1.GenPrivKey().PubKey(), + } + + addrs = []sdk.AccAddress{ + sdk.AccAddress(pubKeys[0].Address()), + sdk.AccAddress(pubKeys[1].Address()), + sdk.AccAddress(pubKeys[2].Address()), + sdk.AccAddress(pubKeys[3].Address()), + sdk.AccAddress(pubKeys[4].Address()), + } + + valAddrs = []sdk.ValAddress{ + sdk.ValAddress(pubKeys[0].Address()), + sdk.ValAddress(pubKeys[1].Address()), + sdk.ValAddress(pubKeys[2].Address()), + sdk.ValAddress(pubKeys[3].Address()), + sdk.ValAddress(pubKeys[4].Address()), + } + + testDenoms = []string{ + "test1", + "test2", + "test3", + "test4", + "test5", + } + + initiaSupply = math.NewInt(100_000_000_000) +) + +func MakeTestCodec(t testing.TB) codec.Codec { + return MakeEncodingConfig(t).Codec +} + +func MakeEncodingConfig(_ testing.TB) initiaappparams.EncodingConfig { + interfaceRegistry, _ := codectypes.NewInterfaceRegistryWithOptions(codectypes.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signing.Options{ + AddressCodec: codecaddress.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + ValidatorAddressCodec: codecaddress.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + }, + }) + appCodec := codec.NewProtoCodec(interfaceRegistry) + legacyAmino := codec.NewLegacyAmino() + txConfig := tx.NewTxConfig(appCodec, tx.DefaultSignModes) + + std.RegisterInterfaces(interfaceRegistry) + std.RegisterLegacyAminoCodec(legacyAmino) + + ModuleBasics.RegisterLegacyAminoCodec(legacyAmino) + ModuleBasics.RegisterInterfaces(interfaceRegistry) + + return initiaappparams.EncodingConfig{ + InterfaceRegistry: interfaceRegistry, + Codec: appCodec, + TxConfig: txConfig, + Amino: legacyAmino, + } +} + +func initialTotalSupply() sdk.Coins { + faucetBalance := sdk.NewCoins(sdk.NewCoin(bondDenom, initiaSupply)) + for _, testDenom := range testDenoms { + faucetBalance = faucetBalance.Add(sdk.NewCoin(testDenom, initiaSupply)) + } + + return faucetBalance +} + +type TestFaucet struct { + t testing.TB + bankKeeper bankkeeper.Keeper + moveKeeper movekeeper.Keeper + sender sdk.AccAddress + balance sdk.Coins + minterModuleName string +} + +func NewTestFaucet(t testing.TB, ctx sdk.Context, bankKeeper bankkeeper.Keeper, moveKeeper movekeeper.Keeper, minterModuleName string, initiaSupply ...sdk.Coin) *TestFaucet { + require.NotEmpty(t, initiaSupply) + r := &TestFaucet{t: t, bankKeeper: bankKeeper, moveKeeper: moveKeeper, minterModuleName: minterModuleName} + _, _, addr := keyPubAddr() + r.sender = addr + r.Mint(ctx, addr, initiaSupply...) + r.balance = initiaSupply + return r +} + +func (f *TestFaucet) Mint(parentCtx sdk.Context, addr sdk.AccAddress, amounts ...sdk.Coin) { + amounts = sdk.Coins(amounts).Sort() + require.NotEmpty(f.t, amounts) + ctx := parentCtx.WithEventManager(sdk.NewEventManager()) // discard all faucet related events + err := f.bankKeeper.MintCoins(ctx, f.minterModuleName, amounts) + require.NoError(f.t, err) + err = f.bankKeeper.SendCoinsFromModuleToAccount(ctx, f.minterModuleName, addr, amounts) + require.NoError(f.t, err) + f.balance = f.balance.Add(amounts...) +} + +func (f *TestFaucet) Fund(parentCtx sdk.Context, receiver sdk.AccAddress, amounts ...sdk.Coin) { + require.NotEmpty(f.t, amounts) + // ensure faucet is always filled + if !f.balance.IsAllGTE(amounts) { + f.Mint(parentCtx, f.sender, amounts...) + } + ctx := parentCtx.WithEventManager(sdk.NewEventManager()) // discard all faucet related events + err := f.bankKeeper.SendCoins(ctx, f.sender, receiver, amounts) + require.NoError(f.t, err) + f.balance = f.balance.Sub(amounts...) +} + +func (f *TestFaucet) NewFundedAccount(ctx sdk.Context, amounts ...sdk.Coin) sdk.AccAddress { + _, _, addr := keyPubAddr() + f.Fund(ctx, addr, amounts...) + return addr +} + +type TestKeepers struct { + AccountKeeper authkeeper.AccountKeeper + StakingKeeper stakingkeeper.Keeper + DistKeeper distrkeeper.Keeper + BankKeeper bankkeeper.Keeper + GovKeeper govkeeper.Keeper + MoveKeeper movekeeper.Keeper + OracleKeeper oraclekeeper.Keeper + DynamicFeeKeeper dynamicfeekeeper.Keeper + EncodingConfig initiaappparams.EncodingConfig + Faucet *TestFaucet + MultiStore storetypes.CommitMultiStore +} + +// createDefaultTestInput common settings for createTestInput +func createDefaultTestInput(t testing.TB) (sdk.Context, TestKeepers) { + return createTestInput(t, false) +} + +// createTestInput encoders can be nil to accept the defaults, or set it to override some of the message handlers (like default) +func createTestInput(t testing.TB, isCheckTx bool) (sdk.Context, TestKeepers) { + return _createTestInput(t, isCheckTx, moveconfig.DefaultMoveConfig(), dbm.NewMemDB()) +} + +var keyCounter uint64 + +// we need to make this deterministic (same every test run), as encoded address size and thus gas cost, +// depends on the actual bytes (due to ugly CanonicalAddress encoding) +func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) { + keyCounter++ + seed := make([]byte, 8) + binary.BigEndian.PutUint64(seed, keyCounter) + + key := ed25519.GenPrivKeyFromSecret(seed) + pub := key.PubKey() + addr := sdk.AccAddress(pub.Address()) + return key, pub, addr +} + +// encoders can be nil to accept the defaults, or set it to override some of the message handlers (like default) +func _createTestInput( + t testing.TB, + isCheckTx bool, + moveConfig moveconfig.MoveConfig, + db dbm.DB, +) (sdk.Context, TestKeepers) { + keys := storetypes.NewKVStoreKeys( + authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, + rewardtypes.StoreKey, distributiontypes.StoreKey, slashingtypes.StoreKey, + govtypes.StoreKey, authzkeeper.StoreKey, movetypes.StoreKey, + oracletypes.StoreKey, dynamicfeetypes.StoreKey, + ) + transientKeys := storetypes.NewTransientStoreKeys(dynamicfeetypes.TStoreKey) + ms := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) + for _, v := range keys { + ms.MountStoreWithDB(v, storetypes.StoreTypeIAVL, db) + } + for _, v := range transientKeys { + ms.MountStoreWithDB(v, storetypes.StoreTypeTransient, db) + } + memKeys := storetypes.NewMemoryStoreKeys() + for _, v := range memKeys { + ms.MountStoreWithDB(v, storetypes.StoreTypeMemory, db) + } + + require.NoError(t, ms.LoadLatestVersion()) + + ctx := sdk.NewContext(ms, tmproto.Header{ + Height: 1234567, + Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), + }, isCheckTx, log.NewNopLogger()) + + encodingConfig := MakeEncodingConfig(t) + appCodec := encodingConfig.Codec + + moveKeeper := &movekeeper.Keeper{} + maccPerms := map[string][]string{ // module account permissions + authtypes.FeeCollectorName: nil, + distributiontypes.ModuleName: nil, + rewardtypes.ModuleName: nil, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + movetypes.MoveStakingModuleName: nil, + + // for testing + authtypes.Minter: {authtypes.Minter, authtypes.Burner}, + } + + ac := authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + vc := authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()) + cc := authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()) + + accountKeeper := authkeeper.NewAccountKeeper( + appCodec, + runtime.NewKVStoreService(keys[authtypes.StoreKey]), // target store + authtypes.ProtoBaseAccount, // prototype + maccPerms, + ac, + sdk.GetConfig().GetBech32AccountAddrPrefix(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + blockedAddrs := make(map[string]bool) + for acc := range maccPerms { + blockedAddrs[authtypes.NewModuleAddress(acc).String()] = true + } + + bankKeeper := movebank.NewBaseKeeper( + appCodec, + runtime.NewKVStoreService(keys[banktypes.StoreKey]), + accountKeeper, + movekeeper.NewMoveBankKeeper(moveKeeper), + blockedAddrs, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + require.NoError(t, bankKeeper.SetParams(ctx, banktypes.DefaultParams())) + + stakingKeeper := stakingkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), + accountKeeper, + bankKeeper, + movekeeper.NewVotingPowerKeeper(moveKeeper), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + vc, cc, + ) + stakingParams := stakingtypes.DefaultParams() + stakingParams.BondDenoms = []string{bondDenom} + require.NoError(t, stakingKeeper.SetParams(ctx, stakingParams)) + + rewardKeeper := rewardkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[rewardtypes.StoreKey]), + accountKeeper, + bankKeeper, + authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + rewardParams := rewardtypes.DefaultParams() + rewardParams.RewardDenom = bondDenom + require.NoError(t, rewardKeeper.SetParams(ctx, rewardParams)) + + distKeeper := distrkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[distributiontypes.StoreKey]), + accountKeeper, + bankKeeper, + stakingKeeper, + movekeeper.NewDexKeeper(moveKeeper), + authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + distrParams := customdistrtypes.DefaultParams() + distrParams.RewardWeights = []customdistrtypes.RewardWeight{ + {Denom: bondDenom, Weight: math.LegacyOneDec()}, + } + require.NoError(t, distKeeper.Params.Set(ctx, distrParams)) + stakingKeeper.SetHooks(distKeeper.Hooks()) + + // set genesis items required for distribution + require.NoError(t, distKeeper.FeePool.Set(ctx, distributiontypes.InitialFeePool())) + + accountKeeper.GetModuleAccount(ctx, movetypes.MoveStakingModuleName) + + oracleKeeper := oraclekeeper.NewKeeper( + runtime.NewKVStoreService(keys[oracletypes.StoreKey]), + appCodec, + nil, + authtypes.NewModuleAddress(govtypes.ModuleName), + ) + + queryRouter := baseapp.NewGRPCQueryRouter() + queryRouter.SetInterfaceRegistry(encodingConfig.InterfaceRegistry) + + *moveKeeper = *movekeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[movetypes.StoreKey]), + accountKeeper, + bankKeeper, + &oracleKeeper, + TestMsgRouter{}, + queryRouter, + moveConfig, + distKeeper, + stakingKeeper, + rewardKeeper, + distKeeper, + authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ac, vc, + ) + moveParams := movetypes.DefaultParams() + moveParams.BaseDenom = bondDenom + + require.NoError(t, moveKeeper.SetRawParams(ctx, moveParams.ToRaw())) + stakingKeeper.SetSlashingHooks(moveKeeper.Hooks()) + + dynamicFeeKeeper := dynamicfeekeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[dynamicfeetypes.StoreKey]), + runtime.NewTransientStoreService(transientKeys[dynamicfeetypes.TStoreKey]), + movekeeper.NewDexKeeper(moveKeeper), + moveKeeper, + moveKeeper, + ac, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + require.NoError(t, dynamicFeeKeeper.SetParams(ctx, dynamicfeetypes.Params{ + MinBaseGasPrice: math.LegacyNewDecWithPrec(1, 3), + MaxBaseGasPrice: math.LegacyNewDec(200), + BaseGasPrice: math.LegacyNewDecWithPrec(1, 2), + TargetGas: 100000, + MaxChangeRate: math.LegacyNewDecWithPrec(1, 1), + })) + + // load stdlib module bytes + moduleBytes, err := precompile.ReadStdlib() + require.NoError(t, err) + + // append test module + moduleBytes = append(moduleBytes, basicCoinModule) + + err = moveKeeper.Initialize(ctx, moduleBytes, moveParams.AllowedPublishers, bondDenom) + require.NoError(t, err) + + faucet := NewTestFaucet(t, ctx, bankKeeper, *moveKeeper, authtypes.Minter, initialTotalSupply()...) + + // set some funds to pay out validatores, based on code from: + // https://github.com/cosmos/cosmos-sdk/blob/fea231556aee4d549d7551a6190389c4328194eb/x/distribution/keeper/keeper_test.go#L50-L57 + distrAcc := distKeeper.GetDistributionAccount(ctx) + faucet.Fund(ctx, distrAcc.GetAddress(), sdk.NewCoin(bondDenom, math.NewInt(2000000))) + accountKeeper.SetModuleAccount(ctx, distrAcc) + + // register bank & move + msgRouter := baseapp.NewMsgServiceRouter() + msgRouter.SetInterfaceRegistry(encodingConfig.InterfaceRegistry) + + govConfig := govtypes.DefaultConfig() + govKeeper := govkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[govtypes.StoreKey]), + accountKeeper, + bankKeeper, + stakingKeeper, + distKeeper, + movekeeper.NewVestingKeeper(moveKeeper), + msgRouter, + govConfig, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + require.NoError(t, govKeeper.ProposalID.Set(ctx, govtypesv1.DefaultStartingProposalID)) + require.NoError(t, govKeeper.Params.Set(ctx, customgovtypes.DefaultParams())) + + cfg := sdk.GetConfig() + cfg.SetAddressVerifier(initiaapp.VerifyAddressLen()) + + am := module.NewManager( // minimal module set that we use for message/ query tests + bank.NewAppModule(appCodec, bankKeeper, accountKeeper), + staking.NewAppModule(appCodec, *stakingKeeper), + distribution.NewAppModule(appCodec, *distKeeper), + gov.NewAppModule(appCodec, govKeeper, accountKeeper, bankKeeper), + ) + am.RegisterServices(module.NewConfigurator(appCodec, msgRouter, queryRouter)) //nolint:errcheck + movetypes.RegisterMsgServer(msgRouter, movekeeper.NewMsgServerImpl(moveKeeper)) + movetypes.RegisterQueryServer(queryRouter, movekeeper.NewQuerier(moveKeeper)) + + keepers := TestKeepers{ + AccountKeeper: accountKeeper, + StakingKeeper: *stakingKeeper, + DistKeeper: *distKeeper, + MoveKeeper: *moveKeeper, + BankKeeper: bankKeeper, + GovKeeper: *govKeeper, + OracleKeeper: oracleKeeper, + DynamicFeeKeeper: *dynamicFeeKeeper, + // NftTransferKeeper: nftTransferKeeper, + EncodingConfig: encodingConfig, + Faucet: faucet, + MultiStore: ms, + } + return ctx, keepers +} + +var basicCoinModule []byte +var basicCoinModuleAbi string +var stdCoinTestModule []byte +var basicCoinMintScript []byte +var tableGeneratorModule []byte +var testAddressModule []byte +var vestingModule []byte +var submsgModule []byte + +func init() { + basicCoinModule = ReadMoveFile("BasicCoin") + basicCoinModuleAbi = "{\"address\":\"0x1\",\"name\":\"BasicCoin\",\"friends\":[],\"exposed_functions\":[{\"name\":\"get\",\"visibility\":\"public\",\"is_entry\":false,\"is_view\":true,\"generic_type_params\":[{\"constraints\":[]}],\"params\":[\"address\"],\"return\":[\"u64\"]},{\"name\":\"get_coin\",\"visibility\":\"public\",\"is_entry\":false,\"is_view\":true,\"generic_type_params\":[{\"constraints\":[]}],\"params\":[\"address\"],\"return\":[\"0x1::BasicCoin::Coin\"]},{\"name\":\"mint\",\"visibility\":\"public\",\"is_entry\":true,\"is_view\":false,\"generic_type_params\":[{\"constraints\":[]}],\"params\":[\"signer\",\"u64\"],\"return\":[]},{\"name\":\"number\",\"visibility\":\"public\",\"is_entry\":false,\"is_view\":true,\"generic_type_params\":[],\"params\":[],\"return\":[\"u64\"]}],\"structs\":[{\"name\":\"Coin\",\"is_native\":false,\"abilities\":[\"copy\",\"key\"],\"generic_type_params\":[{\"constraints\":[],\"is_phantom\":true}],\"fields\":[{\"name\":\"value\",\"type\":\"u64\"},{\"name\":\"test\",\"type\":\"bool\"}]},{\"name\":\"Initia\",\"is_native\":false,\"abilities\":[],\"generic_type_params\":[],\"fields\":[{\"name\":\"dummy_field\",\"type\":\"bool\"}]},{\"name\":\"MintEvent\",\"is_native\":false,\"abilities\":[\"drop\",\"store\"],\"generic_type_params\":[],\"fields\":[{\"name\":\"account\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"u64\"},{\"name\":\"coin_type\",\"type\":\"0x1::string::String\"}]},{\"name\":\"ViewEvent\",\"is_native\":false,\"abilities\":[\"drop\",\"store\"],\"generic_type_params\":[],\"fields\":[{\"name\":\"data\",\"type\":\"0x1::string::String\"}]}]}" + stdCoinTestModule = ReadMoveFile("StdCoinTest") + tableGeneratorModule = ReadMoveFile("TableGenerator") + testAddressModule = ReadMoveFile("TestAddress") + vestingModule = ReadMoveFile("Vesting") + submsgModule = ReadMoveFile("submsg") + + basicCoinMintScript = ReadScriptFile("main") +} + +func ReadMoveFile(filename string) []byte { + path := "../../move/keeper/binaries/" + filename + ".mv" + b, err := os.ReadFile(path) + if err != nil { + panic(err) + } + return b +} + +func ReadScriptFile(filename string) []byte { + path := "../../move/keeper/binaries/" + filename + ".mv" + b, err := os.ReadFile(path) + if err != nil { + panic(err) + } + return b +} + +type TestMsgRouter struct{} + +func (router TestMsgRouter) Handler(msg sdk.Msg) baseapp.MsgServiceHandler { + return router.HandlerByTypeURL(sdk.MsgTypeURL(msg)) +} + +func (router TestMsgRouter) HandlerByTypeURL(typeURL string) baseapp.MsgServiceHandler { + switch typeURL { + case sdk.MsgTypeURL(&movetypes.MsgExecute{}): + return func(ctx sdk.Context, _msg sdk.Msg) (*sdk.Result, error) { + msg := _msg.(*movetypes.MsgExecute) + + argStrs := []string{} + for _, arg := range msg.Args { + argStrs = append(argStrs, string(arg)) + } + + ctx.EventManager().EmitEvent(sdk.NewEvent("move_execute", + sdk.NewAttribute("sender", msg.Sender), + sdk.NewAttribute("module_addr", msg.ModuleAddress), + sdk.NewAttribute("module_name", msg.ModuleName), + sdk.NewAttribute("function_name", msg.FunctionName), + sdk.NewAttribute("type_args", strings.Join(msg.TypeArgs, ",")), + sdk.NewAttribute("args", strings.Join(argStrs, ",")), + )) + + return sdk.WrapServiceResult(ctx, &stakingtypes.MsgDelegateResponse{}, nil) + } + case sdk.MsgTypeURL(&movetypes.MsgExecuteJSON{}): + return func(ctx sdk.Context, _msg sdk.Msg) (*sdk.Result, error) { + msg := _msg.(*movetypes.MsgExecuteJSON) + + ctx.EventManager().EmitEvent(sdk.NewEvent("move_execute_with_json", + sdk.NewAttribute("sender", msg.Sender), + sdk.NewAttribute("module_addr", msg.ModuleAddress), + sdk.NewAttribute("module_name", msg.ModuleName), + sdk.NewAttribute("function_name", msg.FunctionName), + sdk.NewAttribute("type_args", strings.Join(msg.TypeArgs, ",")), + sdk.NewAttribute("args", strings.Join(msg.Args, ",")), + )) + + if msg.FunctionName == "fail" { + return nil, fmt.Errorf("fail") + } + + return sdk.WrapServiceResult(ctx, &stakingtypes.MsgDelegateResponse{}, nil) + } + case sdk.MsgTypeURL(&movetypes.MsgScript{}): + return func(ctx sdk.Context, _msg sdk.Msg) (*sdk.Result, error) { + msg := _msg.(*movetypes.MsgScript) + + argStrs := []string{} + for _, arg := range msg.Args { + argStrs = append(argStrs, string(arg)) + } + + ctx.EventManager().EmitEvent(sdk.NewEvent("move_script", + sdk.NewAttribute("sender", msg.Sender), + sdk.NewAttribute("code_bytes", hex.EncodeToString(msg.CodeBytes)), + sdk.NewAttribute("type_args", strings.Join(msg.TypeArgs, ",")), + sdk.NewAttribute("args", strings.Join(argStrs, ",")), + )) + + return sdk.WrapServiceResult(ctx, &stakingtypes.MsgDelegateResponse{}, nil) + } + case sdk.MsgTypeURL(&movetypes.MsgScriptJSON{}): + return func(ctx sdk.Context, _msg sdk.Msg) (*sdk.Result, error) { + msg := _msg.(*movetypes.MsgScriptJSON) + + ctx.EventManager().EmitEvent(sdk.NewEvent("move_script_with_json", + sdk.NewAttribute("sender", msg.Sender), + sdk.NewAttribute("code_bytes", hex.EncodeToString(msg.CodeBytes)), + sdk.NewAttribute("type_args", strings.Join(msg.TypeArgs, ",")), + sdk.NewAttribute("args", strings.Join(msg.Args, ",")), + )) + + return sdk.WrapServiceResult(ctx, &stakingtypes.MsgDelegateResponse{}, nil) + } + case sdk.MsgTypeURL(&stakingtypes.MsgDelegate{}): + return func(ctx sdk.Context, _msg sdk.Msg) (*sdk.Result, error) { + msg := _msg.(*stakingtypes.MsgDelegate) + ctx.EventManager().EmitEvent(sdk.NewEvent("delegate", + sdk.NewAttribute("delegator_address", msg.DelegatorAddress), + sdk.NewAttribute("validator_address", msg.ValidatorAddress), + sdk.NewAttribute("amount", msg.Amount.String()), + )) + + return sdk.WrapServiceResult(ctx, &stakingtypes.MsgDelegateResponse{}, nil) + } + case sdk.MsgTypeURL(&distributiontypes.MsgFundCommunityPool{}): + return func(ctx sdk.Context, _msg sdk.Msg) (*sdk.Result, error) { + msg := _msg.(*distributiontypes.MsgFundCommunityPool) + ctx.EventManager().EmitEvent(sdk.NewEvent("fund_community_pool", + sdk.NewAttribute("depositor_address", msg.Depositor), + sdk.NewAttribute("amount", msg.Amount.String()), + )) + + return sdk.WrapServiceResult(ctx, &stakingtypes.MsgDelegateResponse{}, nil) + } + case sdk.MsgTypeURL(&transfertypes.MsgTransfer{}): + return func(ctx sdk.Context, _msg sdk.Msg) (*sdk.Result, error) { + msg := _msg.(*transfertypes.MsgTransfer) + ctx.EventManager().EmitEvent(sdk.NewEvent("transfer", + sdk.NewAttribute("sender", msg.Sender), + sdk.NewAttribute("receiver", msg.Receiver), + sdk.NewAttribute("token", msg.Token.String()), + sdk.NewAttribute("source_port", msg.SourcePort), + sdk.NewAttribute("source_channel", msg.SourceChannel), + sdk.NewAttribute("timeout_height", msg.TimeoutHeight.String()), + sdk.NewAttribute("timeout_timestamp", fmt.Sprint(msg.TimeoutTimestamp)), + sdk.NewAttribute("memo", msg.Memo), + )) + + return sdk.WrapServiceResult(ctx, &stakingtypes.MsgDelegateResponse{}, nil) + } + case sdk.MsgTypeURL(&ibcfeetypes.MsgPayPacketFee{}): + return func(ctx sdk.Context, _msg sdk.Msg) (*sdk.Result, error) { + msg := _msg.(*ibcfeetypes.MsgPayPacketFee) + ctx.EventManager().EmitEvent(sdk.NewEvent("pay_fee", + sdk.NewAttribute("signer", msg.Signer), + sdk.NewAttribute("source_port", msg.SourcePortId), + sdk.NewAttribute("source_channel", msg.SourceChannelId), + sdk.NewAttribute("recv_fee", msg.Fee.RecvFee.String()), + sdk.NewAttribute("ack_fee", msg.Fee.AckFee.String()), + sdk.NewAttribute("timeout_fee", msg.Fee.TimeoutFee.String()), + sdk.NewAttribute("relayers", strings.Join(msg.Relayers, ",")), + )) + + return sdk.WrapServiceResult(ctx, &stakingtypes.MsgDelegateResponse{}, nil) + } + } + + panic("handler not registered") +} + +func MustConvertStringToTypeTag(str string) vmtypes.TypeTag { + tt, err := vmapi.TypeTagFromString(str) + if err != nil { + panic(err) + } + + return tt +} diff --git a/x/dynamic-fee/keeper/gas_price.go b/x/dynamic-fee/keeper/gas_price.go new file mode 100644 index 000000000..fd62f7a65 --- /dev/null +++ b/x/dynamic-fee/keeper/gas_price.go @@ -0,0 +1,81 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/initia-labs/initia/tx" +) + +var _ tx.GasPriceKeeper = Keeper{} + +// GasPrices return gas prices for all whitelisted denoms +func (k Keeper) GasPrices( + ctx context.Context, +) (sdk.DecCoins, error) { + params, err := k.GetParams(ctx) + if err != nil { + return nil, err + } + + baseGasPrice := params.BaseGasPrice + baseDenom, err := k.baseDenomKeeper.BaseDenom(ctx) + if err != nil { + return nil, err + } + + whitelistedTokens, err := k.whitelistKeeper.GetWhitelistedTokens(ctx) + if err != nil { + return nil, err + } + + gasPrices := sdk.NewDecCoins(sdk.NewDecCoinFromDec(baseDenom, baseGasPrice)) + for _, denom := range whitelistedTokens { + baseSpotPrice, err := k.tokenPriceKeeper.GetBaseSpotPrice(ctx, denom) + if err != nil { + return nil, err + } + if baseSpotPrice.IsZero() { + return nil, fmt.Errorf("baseSpotPrice is zero: %s", denom) + } + + gasPrice := baseGasPrice.Quo(baseSpotPrice) + gasPrices = gasPrices.Add(sdk.NewDecCoinFromDec(denom, gasPrice)) + } + + return gasPrices, nil +} + +// GasPrice return gas price for the given denom +func (k Keeper) GasPrice( + ctx context.Context, + denom string, +) (sdk.DecCoin, error) { + params, err := k.GetParams(ctx) + if err != nil { + return sdk.DecCoin{}, err + } + + baseGasPrice := params.BaseGasPrice + baseDenom, err := k.baseDenomKeeper.BaseDenom(ctx) + if err != nil { + return sdk.DecCoin{}, err + } + + // if denom is base denom, return base gas price + if denom == baseDenom { + return sdk.NewDecCoinFromDec(baseDenom, baseGasPrice), nil + } + + // if denom is not base denom, get base spot price + baseSpotPrice, err := k.tokenPriceKeeper.GetBaseSpotPrice(ctx, denom) + if err != nil { + return sdk.DecCoin{}, err + } else if baseSpotPrice.IsZero() { + return sdk.DecCoin{}, fmt.Errorf("baseSpotPrice is zero: %s", denom) + } + + return sdk.NewDecCoinFromDec(denom, baseGasPrice.Quo(baseSpotPrice)), nil +} diff --git a/x/dynamic-fee/keeper/gas_price_test.go b/x/dynamic-fee/keeper/gas_price_test.go new file mode 100644 index 000000000..f61335d61 --- /dev/null +++ b/x/dynamic-fee/keeper/gas_price_test.go @@ -0,0 +1,181 @@ +package keeper_test + +import ( + "slices" + "testing" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/initia-labs/initia/x/dynamic-fee/types" + movetypes "github.com/initia-labs/initia/x/move/types" + vmtypes "github.com/initia-labs/movevm/types" +) + +func decToVmArgument(t *testing.T, val math.LegacyDec) []byte { + // big-endian bytes (bytes are cloned) + bz := val.BigInt().Bytes() + + // reverse bytes to little-endian + slices.Reverse(bz) + + // serialize bytes + bz, err := vmtypes.SerializeBytes(bz) + require.NoError(t, err) + + return bz +} + +func createDexPool( + t *testing.T, ctx sdk.Context, input TestKeepers, + baseCoin sdk.Coin, quoteCoin sdk.Coin, + weightBase math.LegacyDec, weightQuote math.LegacyDec, +) (metadataLP vmtypes.AccountAddress) { + metadataBase, err := movetypes.MetadataAddressFromDenom(baseCoin.Denom) + require.NoError(t, err) + + metadataQuote, err := movetypes.MetadataAddressFromDenom(quoteCoin.Denom) + require.NoError(t, err) + + // fund test account for dex creation + input.Faucet.Fund(ctx, movetypes.TestAddr, baseCoin, quoteCoin) + + denomLP := "ulp" + baseCoin.Denom + quoteCoin.Denom + + // + // prepare arguments + // + + name, err := vmtypes.SerializeString("LP Coin" + baseCoin.Denom + quoteCoin.Denom) + require.NoError(t, err) + + symbol, err := vmtypes.SerializeString(denomLP) + require.NoError(t, err) + + // 0.003 == 0.3% + swapFeeBz := decToVmArgument(t, math.LegacyNewDecWithPrec(3, 3)) + weightBaseBz := decToVmArgument(t, weightBase) + weightQuoteBz := decToVmArgument(t, weightQuote) + + baseAmount, err := vmtypes.SerializeUint64(baseCoin.Amount.Uint64()) + require.NoError(t, err) + + quoteAmount, err := vmtypes.SerializeUint64(quoteCoin.Amount.Uint64()) + require.NoError(t, err) + + err = input.MoveKeeper.ExecuteEntryFunction( + ctx, + vmtypes.TestAddress, + vmtypes.StdAddress, + "dex", + "create_pair_script", + []vmtypes.TypeTag{}, + [][]byte{ + name, + symbol, + swapFeeBz, + weightBaseBz, + weightQuoteBz, + metadataBase[:], + metadataQuote[:], + baseAmount, + quoteAmount, + }, + ) + require.NoError(t, err) + + return movetypes.NamedObjectAddress(vmtypes.TestAddress, denomLP) +} + +func registerDexPool(t *testing.T, ctx sdk.Context, input TestKeepers, basePrice math.LegacyDec) ([]string, []math.LegacyDec) { + err := input.DynamicFeeKeeper.SetParams(ctx, types.Params{ + MinBaseGasPrice: basePrice, + MaxBaseGasPrice: basePrice, + BaseGasPrice: basePrice, + }) + require.NoError(t, err) + + dexKeeper := input.MoveKeeper.DexKeeper() + + baseDenom := bondDenom + baseAmount := math.NewInt(40) + + denomQuote := "uusdc" + quoteAmount := math.NewInt(10) + + metadataQuote, err := movetypes.MetadataAddressFromDenom(denomQuote) + require.NoError(t, err) + + metadataLP := createDexPool( + t, ctx, input, + sdk.NewCoin(baseDenom, baseAmount), sdk.NewCoin(denomQuote, quoteAmount), + math.LegacyNewDecWithPrec(8, 1), math.LegacyNewDecWithPrec(2, 1), + ) + + // store dex pair for queries + err = dexKeeper.SetDexPair(ctx, movetypes.DexPair{ + MetadataQuote: metadataQuote.String(), + MetadataLP: metadataLP.String(), + }) + require.NoError(t, err) + + quotePrice, err := dexKeeper.GetBaseSpotPrice(ctx, denomQuote) + require.NoError(t, err) + require.Equal(t, math.LegacyOneDec(), quotePrice) + + denomQuote2 := "utia" + quoteAmount = math.NewInt(20) + + metadataQuote2, err := movetypes.MetadataAddressFromDenom(denomQuote2) + require.NoError(t, err) + + metadataLP2 := createDexPool( + t, ctx, input, + sdk.NewCoin(baseDenom, baseAmount), sdk.NewCoin(denomQuote2, quoteAmount), + math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), + ) + + // store dex pair for queries + err = dexKeeper.SetDexPair(ctx, movetypes.DexPair{ + MetadataQuote: metadataQuote2.String(), + MetadataLP: metadataLP2.String(), + }) + require.NoError(t, err) + + quotePrice2, err := dexKeeper.GetBaseSpotPrice(ctx, denomQuote2) + require.NoError(t, err) + require.Equal(t, math.LegacyNewDec(2), quotePrice2) + + return []string{denomQuote, denomQuote2}, []math.LegacyDec{quotePrice, quotePrice2} +} + +func TestGasPrices(t *testing.T) { + ctx, input := createDefaultTestInput(t) + + basePrice := math.LegacyNewDecWithPrec(1, 2) // 0.01 + denoms, prices := registerDexPool(t, ctx, input, basePrice) + + gasPrices, err := input.DynamicFeeKeeper.GasPrices(ctx) + require.NoError(t, err) + + require.Equal(t, basePrice.Quo(gasPrices.AmountOf(denoms[0])), prices[0]) + require.Equal(t, basePrice.Quo(gasPrices.AmountOf(denoms[1])), prices[1]) +} + +func TestGasPrice(t *testing.T) { + ctx, input := createDefaultTestInput(t) + + basePrice := math.LegacyNewDecWithPrec(1, 2) // 0.01 + denoms, prices := registerDexPool(t, ctx, input, basePrice) + + gasPrice, err := input.DynamicFeeKeeper.GasPrice(ctx, denoms[0]) + require.NoError(t, err) + require.Equal(t, gasPrice.Denom, denoms[0]) + require.Equal(t, basePrice.Quo(gasPrice.Amount), prices[0]) + + gasPrice, err = input.DynamicFeeKeeper.GasPrice(ctx, denoms[1]) + require.NoError(t, err) + require.Equal(t, gasPrice.Denom, denoms[1]) + require.Equal(t, basePrice.Quo(gasPrice.Amount), prices[1]) +} diff --git a/x/dynamic-fee/keeper/genesis.go b/x/dynamic-fee/keeper/genesis.go new file mode 100644 index 000000000..af4e8c479 --- /dev/null +++ b/x/dynamic-fee/keeper/genesis.go @@ -0,0 +1,28 @@ +package keeper + +import ( + "context" + + "github.com/initia-labs/initia/x/dynamic-fee/types" +) + +// InitGenesis sets supply information for genesis. +func (k Keeper) InitGenesis(ctx context.Context, genState types.GenesisState) error { + params := genState.GetParams() + if err := k.SetParams(ctx, params); err != nil { + return err + } + return nil +} + +// ExportGenesis export genesis state +func (k Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { + var genState types.GenesisState + + var err error + genState.Params, err = k.GetParams(ctx) + if err != nil { + panic(err) + } + return &genState +} diff --git a/x/dynamic-fee/keeper/keeper.go b/x/dynamic-fee/keeper/keeper.go new file mode 100644 index 000000000..42b8e91f4 --- /dev/null +++ b/x/dynamic-fee/keeper/keeper.go @@ -0,0 +1,165 @@ +package keeper + +import ( + "context" + "errors" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/initia-labs/initia/x/dynamic-fee/types" + + "cosmossdk.io/collections" + "cosmossdk.io/core/address" + corestoretypes "cosmossdk.io/core/store" + "cosmossdk.io/math" +) + +type Keeper struct { + cdc codec.Codec + storeService corestoretypes.KVStoreService + transientService corestoretypes.TransientStoreService + + Schema collections.Schema + TransientSchema collections.Schema + + Params collections.Item[types.Params] + AccumulatedGas collections.Item[uint64] + + tokenPriceKeeper types.TokenPriceKeeper + whitelistKeeper types.WhitelistKeeper + baseDenomKeeper types.BaseDenomKeeper + + ac address.Codec + authority string +} + +func NewKeeper( + cdc codec.Codec, + storeService corestoretypes.KVStoreService, + transientService corestoretypes.TransientStoreService, + tokenPriceKeeper types.TokenPriceKeeper, + whitelistKeeper types.WhitelistKeeper, + baseDenomKeeper types.BaseDenomKeeper, + ac address.Codec, + authority string, +) *Keeper { + sb := collections.NewSchemaBuilder(storeService) + tsb := collections.NewSchemaBuilderFromAccessor(transientService.OpenTransientStore) + k := &Keeper{ + cdc: cdc, + storeService: storeService, + transientService: transientService, + + Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + AccumulatedGas: collections.NewItem(tsb, types.AccumulatedGasKey, "accumulated_gas", collections.Uint64Value), + + tokenPriceKeeper: tokenPriceKeeper, + whitelistKeeper: whitelistKeeper, + baseDenomKeeper: baseDenomKeeper, + ac: ac, + authority: authority, + } + schema, err := sb.Build() + if err != nil { + panic(err) + } + k.Schema = schema + + tSchema, err := tsb.Build() + if err != nil { + panic(err) + } + k.TransientSchema = tSchema + + return k +} + +func (k Keeper) GetAuthority() string { + return k.authority +} + +func (k Keeper) GetTokenPriceKeeper() types.TokenPriceKeeper { + return k.tokenPriceKeeper +} + +func (k Keeper) GetWhitelistKeeper() types.WhitelistKeeper { + return k.whitelistKeeper +} + +func (k Keeper) GetBaseDenomKeeper() types.BaseDenomKeeper { + return k.baseDenomKeeper +} + +func (k Keeper) SetParams(ctx context.Context, params types.Params) error { + return k.Params.Set(ctx, params) +} + +func (k Keeper) GetParams(ctx context.Context) (types.Params, error) { + return k.Params.Get(ctx) +} + +func (k Keeper) BaseGasPrice(ctx context.Context) (math.LegacyDec, error) { + params, err := k.Params.Get(ctx) + if err != nil { + return math.LegacyDec{}, err + } + + return params.BaseGasPrice, nil +} + +// this should be called in EndBlocker +func (k Keeper) UpdateBaseGasPrice(ctx sdk.Context) error { + params, err := k.Params.Get(ctx) + if err != nil { + return err + } + if params.TargetGas == 0 { + return types.ErrTargetGasZero + } + + accumulatedGas, err := k.GetAccumulatedGas(ctx) + if errors.Is(err, collections.ErrNotFound) { + accumulatedGas = 0 + } else if err != nil { + return err + } + + // baseFeeMultiplier = (accumulatedGas - targetGas) / targetGas * maxChangeRate + 1 + baseFeeMultiplier := math.LegacyNewDec(int64(accumulatedGas) - params.TargetGas). + QuoInt64(params.TargetGas). + Mul(params.MaxChangeRate). + Add(math.LegacyOneDec()) + newBaseGasPrice := params.BaseGasPrice.Mul(baseFeeMultiplier) + if newBaseGasPrice.LT(params.MinBaseGasPrice) { + newBaseGasPrice = params.MinBaseGasPrice + } + if newBaseGasPrice.GT(params.MaxBaseGasPrice) { + newBaseGasPrice = params.MaxBaseGasPrice + } + + params.BaseGasPrice = newBaseGasPrice + return k.SetParams(ctx, params) +} + +// AccumulateGas accumulates the gas used in the block +func (k Keeper) AccumulateGas(ctx context.Context, gas uint64) error { + accumulatedGas, err := k.AccumulatedGas.Get(ctx) + if errors.Is(err, collections.ErrNotFound) { + accumulatedGas = 0 + } else if err != nil { + return err + } + + accumulatedGas += gas + return k.AccumulatedGas.Set(ctx, accumulatedGas) +} + +// GetAccumulatedGas returns the accumulated gas +func (k Keeper) GetAccumulatedGas(ctx context.Context) (uint64, error) { + return k.AccumulatedGas.Get(ctx) +} + +// ResetAccumulatedGas resets the accumulated gas for testing +func (k Keeper) ResetAccumulatedGas(ctx context.Context) error { + return k.AccumulatedGas.Remove(ctx) +} diff --git a/x/dynamic-fee/keeper/keeper_test.go b/x/dynamic-fee/keeper/keeper_test.go new file mode 100644 index 000000000..2b757a6e2 --- /dev/null +++ b/x/dynamic-fee/keeper/keeper_test.go @@ -0,0 +1,69 @@ +package keeper_test + +import ( + "testing" + + "cosmossdk.io/math" + "github.com/stretchr/testify/require" + + "github.com/initia-labs/initia/x/dynamic-fee/types" +) + +func Test_UpdateBaseFee(t *testing.T) { + ctx, input := createDefaultTestInput(t) + + err := input.DynamicFeeKeeper.SetParams(ctx, types.Params{ + MinBaseGasPrice: math.LegacyNewDecWithPrec(1, 3), + MaxBaseGasPrice: math.LegacyNewDec(200), + BaseGasPrice: math.LegacyNewDecWithPrec(1, 2), + TargetGas: 100000, + MaxChangeRate: math.LegacyNewDecWithPrec(1, 1), + }) + require.NoError(t, err) + + baseGasPrice, err := input.DynamicFeeKeeper.BaseGasPrice(ctx) + require.Equal(t, math.LegacyNewDecWithPrec(1, 2), baseGasPrice) + + // accumulate gas + input.DynamicFeeKeeper.AccumulateGas(ctx, 100000) + + // update base fee + err = input.DynamicFeeKeeper.UpdateBaseGasPrice(ctx) + require.NoError(t, err) + + baseGasPrice, err = input.DynamicFeeKeeper.BaseGasPrice(ctx) + require.Equal(t, math.LegacyNewDecWithPrec(1, 2), baseGasPrice) + + // accumulate gas + input.DynamicFeeKeeper.ResetAccumulatedGas(ctx) + input.DynamicFeeKeeper.AccumulateGas(ctx, 200000) + + // update base fee + err = input.DynamicFeeKeeper.UpdateBaseGasPrice(ctx) + require.NoError(t, err) + + baseGasPrice, err = input.DynamicFeeKeeper.BaseGasPrice(ctx) + require.Equal(t, math.LegacyNewDecWithPrec(11, 3), baseGasPrice) + + // consume gas + input.DynamicFeeKeeper.ResetAccumulatedGas(ctx) + + // update base fee + err = input.DynamicFeeKeeper.UpdateBaseGasPrice(ctx) + require.NoError(t, err) + + baseGasPrice, err = input.DynamicFeeKeeper.BaseGasPrice(ctx) + require.Equal(t, math.LegacyNewDecWithPrec(99, 4), baseGasPrice) +} + +func Test_AccumulateGas(t *testing.T) { + ctx, input := createDefaultTestInput(t) + + gasLimit := uint64(100000) + err := input.DynamicFeeKeeper.AccumulateGas(ctx, gasLimit) + require.NoError(t, err) + + accumulatedGas, err := input.DynamicFeeKeeper.GetAccumulatedGas(ctx) + require.NoError(t, err) + require.Equal(t, gasLimit, accumulatedGas) +} diff --git a/x/dynamic-fee/keeper/msg_server.go b/x/dynamic-fee/keeper/msg_server.go new file mode 100644 index 000000000..3495fc984 --- /dev/null +++ b/x/dynamic-fee/keeper/msg_server.go @@ -0,0 +1,43 @@ +package keeper + +import ( + "context" + "time" + + "cosmossdk.io/errors" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + "github.com/initia-labs/initia/x/dynamic-fee/types" +) + +type MsgServer struct { + *Keeper +} + +var _ types.MsgServer = MsgServer{} + +// NewMsgServerImpl return MsgServer instance +func NewMsgServerImpl(k *Keeper) MsgServer { + return MsgServer{k} +} + +func (ms MsgServer) UpdateParams(context context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + defer telemetry.MeasureSince(time.Now(), "move", "msg", "update-params") + if ms.authority != req.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(context) + if err := req.Validate(ms.ac); err != nil { + return nil, err + } + + if err := ms.SetParams(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/dynamic-fee/keeper/msg_server_test.go b/x/dynamic-fee/keeper/msg_server_test.go new file mode 100644 index 000000000..8a72e4143 --- /dev/null +++ b/x/dynamic-fee/keeper/msg_server_test.go @@ -0,0 +1,33 @@ +package keeper_test + +import ( + "testing" + + "cosmossdk.io/math" + "github.com/stretchr/testify/require" + + "github.com/initia-labs/initia/x/dynamic-fee/keeper" + "github.com/initia-labs/initia/x/dynamic-fee/types" +) + +func Test_UpdateParams(t *testing.T) { + ctx, input := createDefaultTestInput(t) + ms := keeper.NewMsgServerImpl(&input.DynamicFeeKeeper) + + msg := &types.MsgUpdateParams{ + Authority: input.DynamicFeeKeeper.GetAuthority(), + Params: types.Params{ + BaseGasPrice: math.LegacyNewDecWithPrec(1, 2), + MinBaseGasPrice: math.LegacyNewDecWithPrec(1, 3), + MaxBaseGasPrice: math.LegacyNewDec(200), + MaxChangeRate: math.LegacyNewDecWithPrec(10, 2), + TargetGas: 1_000_000, + }, + } + _, err := ms.UpdateParams(ctx, msg) + require.NoError(t, err) + + params, err := input.DynamicFeeKeeper.GetParams(ctx) + require.NoError(t, err) + require.Equal(t, msg.Params, params) +} diff --git a/x/dynamic-fee/keeper/querier.go b/x/dynamic-fee/keeper/querier.go new file mode 100644 index 000000000..ab088ac3d --- /dev/null +++ b/x/dynamic-fee/keeper/querier.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "context" + + "github.com/initia-labs/initia/x/dynamic-fee/types" +) + +type Querier struct { + *Keeper +} + +var _ types.QueryServer = &Querier{} + +// NewQuerier return new Querier instance +func NewQuerier(k *Keeper) Querier { + return Querier{k} +} + +func (q Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + params, err := q.GetParams(ctx) + if err != nil { + return nil, err + } + + return &types.QueryParamsResponse{ + Params: params, + }, nil +} diff --git a/x/dynamic-fee/keeper/querier_test.go b/x/dynamic-fee/keeper/querier_test.go new file mode 100644 index 000000000..7a675cbda --- /dev/null +++ b/x/dynamic-fee/keeper/querier_test.go @@ -0,0 +1,22 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/initia-labs/initia/x/dynamic-fee/keeper" + "github.com/initia-labs/initia/x/dynamic-fee/types" +) + +func TestParams(t *testing.T) { + ctx, input := createDefaultTestInput(t) + + querier := keeper.NewQuerier(&input.DynamicFeeKeeper) + params, err := querier.Params(ctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + + expectedParams, err := input.DynamicFeeKeeper.GetParams(ctx) + require.NoError(t, err) + require.Equal(t, expectedParams, params.Params) +} diff --git a/x/dynamic-fee/module.go b/x/dynamic-fee/module.go new file mode 100644 index 000000000..368383521 --- /dev/null +++ b/x/dynamic-fee/module.go @@ -0,0 +1,136 @@ +package dynamicfee + +import ( + "context" + "encoding/json" + + "cosmossdk.io/core/appmodule" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + "github.com/initia-labs/initia/x/dynamic-fee/keeper" + "github.com/initia-labs/initia/x/dynamic-fee/types" +) + +const ConsensusVersion = 1 + +var ( + _ module.AppModuleBasic = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasConsensusVersion = AppModule{} + _ module.HasName = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} +) + +// AppModuleBasic defines the basic application module used by the move module. +type AppModuleBasic struct { + cdc codec.Codec +} + +func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { //nolint:staticcheck + types.RegisterLegacyAminoCodec(amino) +} + +func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, serveMux *runtime.ServeMux) { + err := types.RegisterQueryHandlerClient(context.Background(), serveMux, types.NewQueryClient(clientCtx)) + if err != nil { + panic(err) + } +} + +// Name returns the move module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// DefaultGenesis returns default genesis state as raw bytes for the move +// module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the move module. +func (b AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error { + var genState types.GenesisState + err := marshaler.UnmarshalJSON(message, &genState) + if err != nil { + return err + } + return types.ValidateGenesis(&genState) +} + +// RegisterInterfaces implements InterfaceModule +func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +// ____________________________________________________________________________ + +// AppModule implements an application module for the move module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper +} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// ConsensusVersion is a sequence number for state-breaking change of the +// module. It should be incremented on each consensus-breaking change +// introduced by the module. To avoid wrong/empty versions, the initial version +// should be set to 1. +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } + +// NewAppModule creates a new AppModule object +func NewAppModule( + cdc codec.Codec, + k keeper.Keeper, +) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{cdc}, + keeper: k, + } +} + +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(&am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(&am.keeper)) +} + +// RegisterInvariants registers the move module invariants. +func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} + +// InitGenesis performs genesis initialization for the move module. It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + + if err := am.keeper.InitGenesis(ctx, genesisState); err != nil { + panic(err) + } +} + +// ExportGenesis returns the exported genesis state as raw bytes for the move +// module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := am.keeper.ExportGenesis(ctx) + return cdc.MustMarshalJSON(gs) +} + +// EndBlock returns the end blocker for the move module. +func (am AppModule) EndBlock(ctx context.Context) error { + return EndBlocker(ctx, am.keeper) +} diff --git a/x/move/types/exported.go b/x/dynamic-fee/types/ante.go similarity index 64% rename from x/move/types/exported.go rename to x/dynamic-fee/types/ante.go index d7ab20db3..c694f6462 100644 --- a/x/move/types/exported.go +++ b/x/dynamic-fee/types/ante.go @@ -7,8 +7,8 @@ import ( ) type AnteKeeper interface { - HasDexPair(ctx context.Context, denom string) (bool, error) GetBaseSpotPrice(ctx context.Context, denomQuote string) (math.LegacyDec, error) BaseDenom(ctx context.Context) (string, error) - BaseMinGasPrice(ctx context.Context) (math.LegacyDec, error) + BaseGasPrice(ctx context.Context) (math.LegacyDec, error) + AccumulateGas(ctx context.Context, gas uint64) error } diff --git a/x/dynamic-fee/types/codec.go b/x/dynamic-fee/types/codec.go new file mode 100644 index 000000000..04882dcc1 --- /dev/null +++ b/x/dynamic-fee/types/codec.go @@ -0,0 +1,24 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +// RegisterLegacyAminoCodec registers the move types and interface +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "dynamicfee/MsgUpdateParams") + + cdc.RegisterConcrete(Params{}, "dynamicfee/Params", nil) +} + +// RegisterInterfaces registers the x/market interfaces types with the interface registry +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/dynamic-fee/types/errors.go b/x/dynamic-fee/types/errors.go new file mode 100644 index 000000000..ac1960517 --- /dev/null +++ b/x/dynamic-fee/types/errors.go @@ -0,0 +1,9 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" +) + +var ( + ErrTargetGasZero = errorsmod.Register(ModuleName, 2, "target gas is zero") +) diff --git a/x/dynamic-fee/types/expected_keeper.go b/x/dynamic-fee/types/expected_keeper.go new file mode 100644 index 000000000..117b516f5 --- /dev/null +++ b/x/dynamic-fee/types/expected_keeper.go @@ -0,0 +1,19 @@ +package types + +import ( + context "context" + + "cosmossdk.io/math" +) + +type TokenPriceKeeper interface { + GetBaseSpotPrice(ctx context.Context, denom string) (math.LegacyDec, error) +} + +type WhitelistKeeper interface { + GetWhitelistedTokens(ctx context.Context) ([]string, error) +} + +type BaseDenomKeeper interface { + BaseDenom(ctx context.Context) (string, error) +} diff --git a/x/dynamic-fee/types/genesis.go b/x/dynamic-fee/types/genesis.go new file mode 100644 index 000000000..2022ab999 --- /dev/null +++ b/x/dynamic-fee/types/genesis.go @@ -0,0 +1,21 @@ +package types + +// NewGenesisState creates a new GenesisState object +func NewGenesisState(params Params) *GenesisState { + return &GenesisState{ + Params: params, + } +} + +// DefaultGenesisState gets raw genesis raw message for testing +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + } +} + +// ValidateGenesis performs basic validation of move genesis data returning an +// error for any failed validation criteria. +func ValidateGenesis(data *GenesisState) error { + return data.Params.Validate() +} diff --git a/x/dynamic-fee/types/genesis.pb.go b/x/dynamic-fee/types/genesis.pb.go new file mode 100644 index 000000000..057b2b6b7 --- /dev/null +++ b/x/dynamic-fee/types/genesis.pb.go @@ -0,0 +1,325 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: initia/dynamicfee/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState - genesis state of x/move +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_bac96a8a45fa9c96, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "initia.dynamicfee.v1.GenesisState") +} + +func init() { + proto.RegisterFile("initia/dynamicfee/v1/genesis.proto", fileDescriptor_bac96a8a45fa9c96) +} + +var fileDescriptor_bac96a8a45fa9c96 = []byte{ + // 220 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xca, 0xcc, 0xcb, 0x2c, + 0xc9, 0x4c, 0xd4, 0x4f, 0xa9, 0xcc, 0x4b, 0xcc, 0xcd, 0x4c, 0x4e, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, + 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x81, 0xa8, 0xd1, 0x43, 0xa8, 0xd1, 0x2b, 0x33, 0x94, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, + 0x07, 0x93, 0x10, 0x85, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, + 0x55, 0xc0, 0x6a, 0x45, 0x49, 0x65, 0x41, 0x2a, 0xd4, 0x02, 0x25, 0x7f, 0x2e, 0x1e, 0x77, 0x88, + 0x8d, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, 0xf6, 0x5c, 0x6c, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, + 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x32, 0x7a, 0xd8, 0x5c, 0xa0, 0x17, 0x00, 0x56, 0xe3, + 0xc4, 0x79, 0xe2, 0x9e, 0x3c, 0xc3, 0x8a, 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xa0, 0xda, 0x9c, 0xbc, + 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, + 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x30, 0x3d, 0xb3, 0x24, 0xa3, + 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x62, 0xa8, 0x6e, 0x4e, 0x62, 0x52, 0x31, 0x94, 0xad, + 0x5f, 0x01, 0x73, 0xa5, 0x2e, 0xc8, 0x99, 0x60, 0x37, 0x26, 0xb1, 0x81, 0x1d, 0x69, 0x0c, 0x08, + 0x00, 0x00, 0xff, 0xff, 0xbd, 0xf9, 0xb2, 0x2d, 0x2b, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) 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 = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/dynamic-fee/types/keys.go b/x/dynamic-fee/types/keys.go new file mode 100644 index 000000000..89afd81c7 --- /dev/null +++ b/x/dynamic-fee/types/keys.go @@ -0,0 +1,29 @@ +package types + +const ( + // ModuleName is the name of the dynamic fee module + ModuleName = "dynamicfee" + + // StoreKey is the string store representation + StoreKey = ModuleName + + // TStoreKey is the string transient store representation + TStoreKey = "transient_" + ModuleName + + // QuerierRoute is the querier route for the dynamic fee module + QuerierRoute = ModuleName + + // RouterKey is the msg router key for the dynamic fee module + RouterKey = ModuleName +) + +// Keys for dynamic fee store +// Items are stored with the following key: values +var ( + ParamsKey = []byte{0x11} // key for parameters for module x/dynamicfee +) + +// Transient store keys +var ( + AccumulatedGasKey = []byte{0x21} // key for accumulated gas for module x/dynamicfee +) diff --git a/x/dynamic-fee/types/params.go b/x/dynamic-fee/types/params.go new file mode 100644 index 000000000..740f6e6b5 --- /dev/null +++ b/x/dynamic-fee/types/params.go @@ -0,0 +1,71 @@ +package types + +import ( + "fmt" + + "cosmossdk.io/math" +) + +var ( + DefaultBaseGasPrice = math.LegacyNewDecWithPrec(15, 3) // 0.015 + DefaultMinBaseGasPrice = math.LegacyNewDecWithPrec(15, 3) // 0.015 + DefaultMaxBaseGasPrice = math.LegacyNewDec(10) // 10 + + // 200_000_000 * 0.5 + DefaultTargetGas int64 = 100_000_000 + + // 0.1 + DefaultMaxChangeRate = math.LegacyNewDecWithPrec(1, 1) +) + +func DefaultParams() Params { + return Params{ + BaseGasPrice: DefaultBaseGasPrice, + MinBaseGasPrice: DefaultMinBaseGasPrice, + MaxBaseGasPrice: DefaultMaxBaseGasPrice, + TargetGas: DefaultTargetGas, + MaxChangeRate: DefaultMaxChangeRate, + } +} + +func NoBaseGasPriceChangeParams() Params { + return Params{ + BaseGasPrice: DefaultBaseGasPrice, + MinBaseGasPrice: DefaultMinBaseGasPrice, + MaxBaseGasPrice: DefaultMaxBaseGasPrice, + TargetGas: DefaultTargetGas, + MaxChangeRate: math.LegacyZeroDec(), + } +} + +func (p Params) Validate() error { + if p.BaseGasPrice.IsNegative() { + return fmt.Errorf("base gas price must be non-negative") + } + + if p.MinBaseGasPrice.IsNegative() { + return fmt.Errorf("min base gas price must be non-negative") + } + + if p.MaxBaseGasPrice.IsNegative() { + return fmt.Errorf("max base gas price must be non-negative") + } + + if p.TargetGas < 0 { + return fmt.Errorf("target gas must be non-negative") + } + + if p.BaseGasPrice.LT(p.MinBaseGasPrice) { + return fmt.Errorf("base gas price must be greater than or equal to min base gas price") + } + + if p.BaseGasPrice.GT(p.MaxBaseGasPrice) { + return fmt.Errorf("base gas price must be less than or equal to max base gas price") + } + + if p.MaxChangeRate.IsNegative() { + return fmt.Errorf("max change rate must be non-negative") + } + + return nil +} diff --git a/x/dynamic-fee/types/query.pb.go b/x/dynamic-fee/types/query.pb.go new file mode 100644 index 000000000..179fcb2a3 --- /dev/null +++ b/x/dynamic-fee/types/query.pb.go @@ -0,0 +1,533 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: initia/dynamicfee/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 is the request type for the Query/Params RPC method. +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_d65cd836c44c8c1b, []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 is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params defines the parameters of the module. + Params Params `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_d65cd836c44c8c1b, []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 init() { + proto.RegisterType((*QueryParamsRequest)(nil), "initia.dynamicfee.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "initia.dynamicfee.v1.QueryParamsResponse") +} + +func init() { proto.RegisterFile("initia/dynamicfee/v1/query.proto", fileDescriptor_d65cd836c44c8c1b) } + +var fileDescriptor_d65cd836c44c8c1b = []byte{ + // 328 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4a, 0x33, 0x41, + 0x10, 0xc7, 0x6f, 0x3f, 0x3e, 0x53, 0x9c, 0x95, 0x67, 0x0a, 0x09, 0x61, 0x0d, 0xc1, 0x22, 0x0a, + 0xb9, 0xe5, 0x62, 0x67, 0x99, 0x27, 0x30, 0xb1, 0xb3, 0x9b, 0x8b, 0xeb, 0xba, 0x90, 0xdb, 0xd9, + 0x64, 0x37, 0xc1, 0xb4, 0x5a, 0x0b, 0x82, 0x2f, 0xe1, 0xa3, 0xa4, 0x0c, 0xd8, 0x58, 0x89, 0x5e, + 0x7c, 0x10, 0xc9, 0xee, 0x06, 0x11, 0xaf, 0xb0, 0x39, 0x86, 0xb9, 0xdf, 0xfc, 0xf6, 0x3f, 0x13, + 0xb7, 0xa4, 0x92, 0x56, 0x02, 0xbb, 0x5a, 0x28, 0x28, 0xe4, 0xe8, 0x9a, 0x73, 0x36, 0xcf, 0xd8, + 0x64, 0xc6, 0xa7, 0x8b, 0x54, 0x4f, 0xd1, 0x62, 0x52, 0xf7, 0x44, 0xfa, 0x4d, 0xa4, 0xf3, 0xac, + 0xb1, 0x07, 0x85, 0x54, 0xc8, 0xdc, 0xd7, 0x83, 0x8d, 0x93, 0x11, 0x9a, 0x02, 0x0d, 0xcb, 0xc1, + 0x70, 0x6f, 0x60, 0xf3, 0x2c, 0xe7, 0x16, 0x32, 0xa6, 0x41, 0x48, 0x05, 0x56, 0xa2, 0x0a, 0x6c, + 0x5d, 0xa0, 0x40, 0x57, 0xb2, 0x4d, 0x15, 0xba, 0x4d, 0x81, 0x28, 0xc6, 0x9c, 0x81, 0x96, 0x0c, + 0x94, 0x42, 0xeb, 0x46, 0x4c, 0xf8, 0x5b, 0x1d, 0xd5, 0x2e, 0x34, 0x0f, 0x44, 0xbb, 0x1e, 0x27, + 0x83, 0xcd, 0xbb, 0xe7, 0x30, 0x85, 0xc2, 0x0c, 0xf9, 0x64, 0xc6, 0x8d, 0x6d, 0x0f, 0xe2, 0xfd, + 0x1f, 0x5d, 0xa3, 0x51, 0x19, 0x9e, 0x9c, 0xc5, 0x35, 0xed, 0x3a, 0x07, 0xa4, 0x45, 0x3a, 0xbb, + 0xbd, 0x66, 0x5a, 0xb5, 0x68, 0xea, 0xa7, 0xfa, 0xff, 0x97, 0x6f, 0x87, 0xd1, 0x30, 0x4c, 0xf4, + 0x1e, 0x48, 0xbc, 0xe3, 0x9c, 0xc9, 0x3d, 0x89, 0x6b, 0x1e, 0x49, 0x3a, 0xd5, 0x82, 0xdf, 0x89, + 0x1a, 0xc7, 0x7f, 0x20, 0x7d, 0xca, 0xf6, 0xd1, 0xdd, 0xcb, 0xe7, 0xd3, 0x3f, 0x9a, 0x34, 0x59, + 0xe5, 0xf6, 0x3e, 0x4f, 0xff, 0x62, 0xf9, 0x41, 0xa3, 0xe7, 0x92, 0x46, 0xcb, 0x92, 0x92, 0x55, + 0x49, 0xc9, 0x7b, 0x49, 0xc9, 0xe3, 0x9a, 0x46, 0xab, 0x35, 0x8d, 0x5e, 0xd7, 0x34, 0xba, 0xcc, + 0x84, 0xb4, 0x37, 0xb3, 0x3c, 0x1d, 0x61, 0x11, 0x4c, 0xdd, 0x31, 0xe4, 0x66, 0x6b, 0xbd, 0xdd, + 0x7a, 0xbb, 0x1b, 0xb1, 0xbb, 0x69, 0x5e, 0x73, 0x47, 0x3d, 0xfd, 0x0a, 0x00, 0x00, 0xff, 0xff, + 0xc1, 0xd2, 0xe4, 0xc7, 0x23, 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 params + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.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, "/initia.dynamicfee.v1.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 params + 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 grpc1.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: "/initia.dynamicfee.v1.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: "initia.dynamicfee.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "initia/dynamicfee/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/dynamic-fee/types/query.pb.gw.go b/x/dynamic-fee/types/query.pb.gw.go new file mode 100644 index 000000000..4fc278f1b --- /dev/null +++ b/x/dynamic-fee/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: initia/dynamicfee/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{"initia", "dynamicfee", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/dynamic-fee/types/tx.go b/x/dynamic-fee/types/tx.go new file mode 100644 index 000000000..397bb5774 --- /dev/null +++ b/x/dynamic-fee/types/tx.go @@ -0,0 +1,23 @@ +package types + +import ( + "cosmossdk.io/core/address" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var ( + _ sdk.Msg = &MsgUpdateParams{} +) + +/* MsgUpdateParams */ + +// Validate performs basic MsgUpdateParams message validation. +func (msg MsgUpdateParams) Validate(ac address.Codec) error { + if _, err := ac.StringToBytes(msg.Authority); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err) + } + + return msg.Params.Validate() +} diff --git a/x/dynamic-fee/types/tx.pb.go b/x/dynamic-fee/types/tx.pb.go new file mode 100644 index 000000000..79741d148 --- /dev/null +++ b/x/dynamic-fee/types/tx.pb.go @@ -0,0 +1,586 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: initia/dynamicfee/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + 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. +type MsgUpdateParams struct { + // authority is the address that controls the module + // (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/dynamic-fee parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_7165155b1f709eab, []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 + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +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_7165155b1f709eab, []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), "initia.dynamicfee.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "initia.dynamicfee.v1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("initia/dynamicfee/v1/tx.proto", fileDescriptor_7165155b1f709eab) } + +var fileDescriptor_7165155b1f709eab = []byte{ + // 357 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcd, 0xcc, 0xcb, 0x2c, + 0xc9, 0x4c, 0xd4, 0x4f, 0xa9, 0xcc, 0x4b, 0xcc, 0xcd, 0x4c, 0x4e, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, + 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0x48, 0xeb, 0x21, 0xa4, + 0xf5, 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0xa1, 0x94, + 0x78, 0x72, 0x7e, 0x71, 0x6e, 0x7e, 0xb1, 0x7e, 0x6e, 0x71, 0x3a, 0xc8, 0x80, 0xdc, 0xe2, 0x74, + 0xa8, 0x84, 0x24, 0x44, 0x22, 0x1e, 0xcc, 0xd3, 0x87, 0x70, 0xa0, 0x52, 0x22, 0xe9, 0xf9, 0xe9, + 0xf9, 0x10, 0x71, 0x10, 0x0b, 0x2a, 0xaa, 0x80, 0xdd, 0x45, 0x95, 0x05, 0xa9, 0x50, 0x7d, 0x4a, + 0x3b, 0x19, 0xb9, 0xf8, 0x7d, 0x8b, 0xd3, 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x03, 0x12, 0x8b, + 0x12, 0x73, 0x8b, 0x85, 0xcc, 0xb8, 0x38, 0x13, 0x4b, 0x4b, 0x32, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, + 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, 0x5a, 0xe8, 0x98, + 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x1c, 0x5c, 0x52, 0x94, 0x99, 0x97, 0x1e, 0x84, 0x50, 0x2a, 0x64, + 0xcf, 0xc5, 0x56, 0x00, 0x36, 0x41, 0x82, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x46, 0x0f, 0x9b, + 0x8f, 0xf5, 0x20, 0xb6, 0x38, 0x71, 0x9e, 0xb8, 0x27, 0xcf, 0xb0, 0xe2, 0xf9, 0x06, 0x2d, 0xc6, + 0x20, 0xa8, 0x36, 0x2b, 0xdd, 0xa6, 0xe7, 0x1b, 0xb4, 0x10, 0x06, 0x76, 0x3d, 0xdf, 0xa0, 0x25, + 0x85, 0xe4, 0x74, 0x34, 0x77, 0x2a, 0x49, 0x72, 0x89, 0xa3, 0x09, 0x05, 0xa5, 0x16, 0x17, 0xe4, + 0xe7, 0x15, 0xa7, 0x1a, 0x15, 0x71, 0x31, 0xfb, 0x16, 0xa7, 0x0b, 0xa5, 0x70, 0xf1, 0xa0, 0xf8, + 0x4c, 0x15, 0xbb, 0x8b, 0xd0, 0x4c, 0x91, 0xd2, 0x25, 0x4a, 0x19, 0xcc, 0x32, 0x29, 0xd6, 0x06, + 0x90, 0x2f, 0x9c, 0xfc, 0x4f, 0x3c, 0x94, 0x63, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, + 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, + 0x39, 0x86, 0x28, 0xc3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, + 0xe9, 0xba, 0x39, 0x89, 0x49, 0xc5, 0x50, 0xb6, 0x7e, 0x05, 0x2c, 0x8e, 0x74, 0x41, 0x3e, 0x05, + 0xc7, 0x50, 0x12, 0x1b, 0x38, 0x8a, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x85, 0xf1, 0x02, + 0x9d, 0x58, 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 an operation for updating the x/dynamic-fee module + // parameters. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.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, "/initia.dynamicfee.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines an operation for updating the x/dynamic-fee module + // parameters. + 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 grpc1.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: "/initia.dynamicfee.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "initia.dynamicfee.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "initia/dynamicfee/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/dynamic-fee/types/types.pb.go b/x/dynamic-fee/types/types.pb.go new file mode 100644 index 000000000..8d74da93a --- /dev/null +++ b/x/dynamic-fee/types/types.pb.go @@ -0,0 +1,532 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: initia/dynamicfee/v1/types.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Params struct { + BaseGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=base_gas_price,json=baseGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_gas_price" yaml:"base_gas_price"` + MinBaseGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=min_base_gas_price,json=minBaseGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_base_gas_price" yaml:"min_base_gas_price"` + MaxBaseGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=max_base_gas_price,json=maxBaseGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_base_gas_price" yaml:"max_base_gas_price"` + MaxChangeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=max_change_rate,json=maxChangeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_change_rate" yaml:"max_change_rate"` + TargetGas int64 `protobuf:"varint,5,opt,name=target_gas,json=targetGas,proto3" json:"target_gas,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_1ab0bab554cc683f, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "initia.dynamicfee.v1.Params") +} + +func init() { proto.RegisterFile("initia/dynamicfee/v1/types.proto", fileDescriptor_1ab0bab554cc683f) } + +var fileDescriptor_1ab0bab554cc683f = []byte{ + // 377 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0x4f, 0x6b, 0xe2, 0x40, + 0x18, 0x06, 0xf0, 0xcc, 0xba, 0x2b, 0x18, 0xf6, 0x0f, 0x1b, 0xdc, 0xc5, 0x75, 0xd9, 0x51, 0x3c, + 0xc9, 0x82, 0x19, 0xa4, 0xb7, 0xde, 0x9a, 0xb6, 0x78, 0xe9, 0x41, 0xec, 0xad, 0x97, 0xf0, 0x26, + 0x4e, 0xc7, 0x69, 0x9d, 0x8c, 0x64, 0xa6, 0x92, 0x7c, 0x8b, 0x7e, 0x0c, 0x8f, 0xfd, 0x18, 0x1e, + 0x3d, 0x96, 0x1e, 0xa4, 0x8d, 0x85, 0xde, 0xfb, 0x09, 0x4a, 0x12, 0x5b, 0xab, 0x5e, 0xa4, 0x97, + 0xe1, 0xe5, 0xe1, 0xe5, 0xfd, 0xcd, 0xe1, 0x31, 0xeb, 0x3c, 0xe0, 0x9a, 0x03, 0xe9, 0xc7, 0x01, + 0x08, 0xee, 0x9f, 0x53, 0x4a, 0xc6, 0x6d, 0xa2, 0xe3, 0x11, 0x55, 0xf6, 0x28, 0x94, 0x5a, 0x5a, + 0xe5, 0x7c, 0xc3, 0x5e, 0x6d, 0xd8, 0xe3, 0x76, 0xf5, 0x27, 0x08, 0x1e, 0x48, 0x92, 0xbd, 0xf9, + 0x62, 0xb5, 0xcc, 0x24, 0x93, 0xd9, 0x48, 0xd2, 0x29, 0x4f, 0x1b, 0x8f, 0x05, 0xb3, 0xd8, 0x85, + 0x10, 0x84, 0xb2, 0x98, 0xf9, 0xdd, 0x03, 0x45, 0x5d, 0x06, 0xca, 0x1d, 0x85, 0xdc, 0xa7, 0x15, + 0x54, 0x47, 0xcd, 0x92, 0x73, 0x30, 0x9d, 0xd7, 0x8c, 0xbb, 0x79, 0xed, 0xaf, 0x2f, 0x95, 0x90, + 0x4a, 0xf5, 0x2f, 0x6d, 0x2e, 0x89, 0x00, 0x3d, 0xb0, 0x4f, 0x28, 0x03, 0x3f, 0x3e, 0xa2, 0xfe, + 0xf3, 0xbc, 0xf6, 0x2b, 0x06, 0x31, 0xdc, 0x6f, 0xac, 0x9f, 0x68, 0x4c, 0x9e, 0x6e, 0xfe, 0xa3, + 0xde, 0xd7, 0x34, 0xed, 0x80, 0xea, 0xa6, 0x99, 0x15, 0x9a, 0x96, 0xe0, 0x81, 0xbb, 0x81, 0x7d, + 0xca, 0xb0, 0xe3, 0xdd, 0xb0, 0x3f, 0x39, 0xb6, 0x7d, 0x66, 0x09, 0xfe, 0x10, 0x3c, 0x70, 0x36, + 0x4d, 0x88, 0x36, 0xcd, 0xc2, 0x47, 0xcc, 0xad, 0x33, 0x6f, 0x26, 0x44, 0x6b, 0xe6, 0x85, 0x99, + 0x46, 0xae, 0x3f, 0x80, 0x80, 0x51, 0x37, 0x04, 0x4d, 0x2b, 0x9f, 0x33, 0xd0, 0xd9, 0x0d, 0xfc, + 0xbd, 0x02, 0xdf, 0xdd, 0x58, 0x6a, 0xdf, 0x04, 0x44, 0x87, 0x59, 0xda, 0x03, 0x4d, 0xad, 0x7f, + 0xa6, 0xa9, 0x21, 0x64, 0x54, 0xa7, 0xdf, 0xaa, 0x7c, 0xa9, 0xa3, 0x66, 0xa1, 0x57, 0xca, 0x93, + 0x0e, 0x28, 0xe7, 0x74, 0xfa, 0x80, 0x8d, 0x49, 0x82, 0xd1, 0x34, 0xc1, 0x68, 0x96, 0x60, 0x74, + 0x9f, 0x60, 0x74, 0xbd, 0xc0, 0xc6, 0x6c, 0x81, 0x8d, 0xdb, 0x05, 0x36, 0xce, 0xda, 0x8c, 0xeb, + 0xc1, 0x95, 0x67, 0xfb, 0x52, 0x90, 0xbc, 0x52, 0xad, 0x21, 0x78, 0x6a, 0x39, 0x93, 0xe8, 0xb5, + 0x82, 0xad, 0xb4, 0x83, 0x59, 0x01, 0xbd, 0x62, 0x56, 0xa1, 0xbd, 0x97, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xb0, 0x1b, 0xf2, 0x0f, 0xa5, 0x02, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.BaseGasPrice.Equal(that1.BaseGasPrice) { + return false + } + if !this.MinBaseGasPrice.Equal(that1.MinBaseGasPrice) { + return false + } + if !this.MaxBaseGasPrice.Equal(that1.MaxBaseGasPrice) { + return false + } + if !this.MaxChangeRate.Equal(that1.MaxChangeRate) { + return false + } + if this.TargetGas != that1.TargetGas { + return false + } + return true +} +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TargetGas != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.TargetGas)) + i-- + dAtA[i] = 0x28 + } + { + size := m.MaxChangeRate.Size() + i -= size + if _, err := m.MaxChangeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.MaxBaseGasPrice.Size() + i -= size + if _, err := m.MaxBaseGasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.MinBaseGasPrice.Size() + i -= size + if _, err := m.MinBaseGasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.BaseGasPrice.Size() + i -= size + if _, err := m.BaseGasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.BaseGasPrice.Size() + n += 1 + l + sovTypes(uint64(l)) + l = m.MinBaseGasPrice.Size() + n += 1 + l + sovTypes(uint64(l)) + l = m.MaxBaseGasPrice.Size() + n += 1 + l + sovTypes(uint64(l)) + l = m.MaxChangeRate.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.TargetGas != 0 { + n += 1 + sovTypes(uint64(m.TargetGas)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseGasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BaseGasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinBaseGasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinBaseGasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBaseGasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxBaseGasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxChangeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxChangeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetGas", wireType) + } + m.TargetGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TargetGas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/move/ante/gas_prices.go b/x/move/ante/gas_prices.go index 8affb5c6d..e483a6385 100644 --- a/x/move/ante/gas_prices.go +++ b/x/move/ante/gas_prices.go @@ -8,7 +8,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// GasPricesDecorator ante decorator to set simulation flag to a context +// GasPricesDecorator ante decorator to set gas prices to a context type GasPricesDecorator struct{} // NewGasPricesDecorator constructor of the GasPricesDecorator @@ -16,7 +16,7 @@ func NewGasPricesDecorator() *GasPricesDecorator { return &GasPricesDecorator{} } -// AnteHandle that store gas prices to a context to let the move keeper know tx gas prices. +// AnteHandle that set gas prices to a context func (d GasPricesDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { feeTx, ok := tx.(sdk.FeeTx) if !ok { @@ -31,7 +31,7 @@ func (d GasPricesDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool return ctx, errors.Wrap(sdkerrors.ErrOutOfGas, "Transaction gas cannot be zero.") } - // CSR: store a tx gas prices + // store a tx gas prices ctx = ctx.WithValue(GasPricesContextKey, sdk.NewDecCoinsFromCoins(feeCoins...).QuoDecTruncate(math.LegacyNewDec(int64(gas)))) } diff --git a/x/move/ante/gas_prices_test.go b/x/move/ante/gas_prices_test.go index 068064962..e5ef159b3 100644 --- a/x/move/ante/gas_prices_test.go +++ b/x/move/ante/gas_prices_test.go @@ -1,14 +1,29 @@ package ante_test import ( + "context" + "cosmossdk.io/math" - "github.com/initia-labs/initia/x/move/ante" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" + + initiaapp "github.com/initia-labs/initia/app" + "github.com/initia-labs/initia/x/move/ante" ) +const baseDenom = initiaapp.BondDenom + +type TestBlockGasMeter struct { + gasUsed uint64 +} + +func (t *TestBlockGasMeter) AccumulateGas(ctx context.Context, gas uint64) error { + t.gasUsed += gas + return nil +} + func (suite *AnteTestSuite) TestGasPricesDecorator() { suite.SetupTest() // setup suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() @@ -28,7 +43,7 @@ func (suite *AnteTestSuite) TestGasPricesDecorator() { decorator := ante.NewGasPricesDecorator() // in normal mode - ctx, err := decorator.AnteHandle(suite.ctx, tx, false, nil) + ctx, err := decorator.AnteHandle(suite.ctx.WithIsCheckTx(false), tx, false, nil) suite.Require().NoError(err) suite.Require().Equal(sdk.NewDecCoinsFromCoins(feeAmount...).QuoDec(math.LegacyNewDec(int64(gasLimit))), ctx.Value(ante.GasPricesContextKey).(sdk.DecCoins)) diff --git a/x/move/common_test.go b/x/move/common_test.go index 9a0f9e42e..8e3d3b668 100644 --- a/x/move/common_test.go +++ b/x/move/common_test.go @@ -111,6 +111,13 @@ func executeMsgs(t *testing.T, app *initiaapp.InitiaApp, msgs []sdk.Msg, account return err } +func executeMsgsWithGasInfo(t *testing.T, app *initiaapp.InitiaApp, msgs []sdk.Msg, accountNum []uint64, sequenceNum []uint64, priv ...cryptotypes.PrivKey) (sdk.GasInfo, error) { + txGen := initiaapp.MakeEncodingConfig().TxConfig + header := tmproto.Header{Height: app.LastBlockHeight() + 1} + gas, _, err := testutilsims.SignCheckDeliver(t, txGen, app.BaseApp, header, msgs, "", accountNum, sequenceNum, true, true, priv...) + return gas, err +} + func decToVmArgument(t *testing.T, val math.LegacyDec) []byte { // big-endian bytes (bytes are cloned) bz := val.BigInt().Bytes() diff --git a/x/move/keeper/dex.go b/x/move/keeper/dex.go index a988b9270..7087cdd7d 100644 --- a/x/move/keeper/dex.go +++ b/x/move/keeper/dex.go @@ -5,8 +5,6 @@ import ( "cosmossdk.io/math" - "github.com/pkg/errors" - sdk "github.com/cosmos/cosmos-sdk/types" distrtypes "github.com/initia-labs/initia/x/distribution/types" @@ -14,7 +12,6 @@ import ( vmtypes "github.com/initia-labs/movevm/types" ) -var _ types.AnteKeeper = DexKeeper{} var _ distrtypes.DexKeeper = DexKeeper{} // DexKeeper implement dex features @@ -169,77 +166,6 @@ func (k DexKeeper) getBaseSpotPrice( return k.BalancerKeeper().GetBaseSpotPrice(ctx, metadataLP) } -// GasPrices return gas prices for all dex pairs -func (k DexKeeper) GasPrices( - ctx context.Context, -) (sdk.DecCoins, error) { - params, err := k.GetParams(ctx) - if err != nil { - return nil, err - } - - baseDenom := params.BaseDenom - baseGasPrice := params.BaseMinGasPrice - gasPrices := sdk.NewDecCoins(sdk.NewDecCoinFromDec(baseDenom, baseGasPrice)) - err = k.DexPairs.Walk(ctx, nil, func(key, value []byte) (stop bool, err error) { - metadataQuote, err := vmtypes.NewAccountAddressFromBytes(key) - if err != nil { - return true, err - } - denomQuote, err := types.DenomFromMetadataAddress(ctx, k.MoveBankKeeper(), metadataQuote) - if err != nil { - return true, err - } - metadataLP, err := vmtypes.NewAccountAddressFromBytes(value) - if err != nil { - return true, err - } - baseSpotPrice, err := k.getBaseSpotPrice(ctx, metadataLP) - if err != nil { - return true, err - } - if baseSpotPrice.IsZero() { - return true, errors.New("baseSpotPrice is zero") - } - - gasPrice := baseGasPrice.Quo(baseSpotPrice) - gasPrices = gasPrices.Add(sdk.NewDecCoinFromDec(denomQuote, gasPrice)) - return false, nil - }) - if err != nil { - return nil, err - } - - return gasPrices, nil -} - -// GasPrice return gas price for the given denom -func (k DexKeeper) GasPrice( - ctx context.Context, - denomQuote string, -) (sdk.DecCoin, error) { - params, err := k.GetParams(ctx) - if err != nil { - return sdk.DecCoin{}, err - } - - baseDenom := params.BaseDenom - baseGasPrice := params.BaseMinGasPrice - if denomQuote == baseDenom { - return sdk.NewDecCoinFromDec(denomQuote, baseGasPrice), nil - } - - baseSpotPrice, err := k.GetBaseSpotPrice(ctx, denomQuote) - if err != nil { - return sdk.NewDecCoin(denomQuote, math.ZeroInt()), err - } - if baseSpotPrice.IsZero() { - return sdk.NewDecCoin(denomQuote, math.ZeroInt()), errors.New("baseSpotPrice is zero") - } - - return sdk.NewDecCoinFromDec(denomQuote, baseGasPrice.Quo(baseSpotPrice)), nil -} - func (k DexKeeper) SwapToBase( ctx context.Context, addr sdk.AccAddress, diff --git a/x/move/keeper/dex_test.go b/x/move/keeper/dex_test.go index 3d1e15daf..24e975be3 100644 --- a/x/move/keeper/dex_test.go +++ b/x/move/keeper/dex_test.go @@ -130,45 +130,3 @@ func TestDexPair(t *testing.T) { require.NoError(t, err) require.Equal(t, metadataLP, res) } - -func Test_Dex_GasPrices(t *testing.T) { - ctx, input := createDefaultTestInput(t) - dexKeeper := input.MoveKeeper.DexKeeper() - - baseDenom := bondDenom - baseAmount := math.NewInt(1_000_000_000_000) - - denomQuote := "uusdc" - quoteAmount := math.NewInt(1_000_000_000_000) - - metadataQuote, err := types.MetadataAddressFromDenom(denomQuote) - require.NoError(t, err) - - metadataLP := createDexPool( - t, ctx, input, - sdk.NewCoin(baseDenom, baseAmount), sdk.NewCoin(denomQuote, quoteAmount), - math.LegacyNewDecWithPrec(8, 1), math.LegacyNewDecWithPrec(2, 1), - ) - - // store dex pair for queries - err = dexKeeper.SetDexPair(ctx, types.DexPair{ - MetadataQuote: metadataQuote.String(), - MetadataLP: metadataLP.String(), - }) - require.NoError(t, err) - - quotePrice, err := dexKeeper.GetBaseSpotPrice(ctx, denomQuote) - require.NoError(t, err) - require.Equal(t, math.LegacyOneDec().QuoInt64(4), quotePrice) - - baseGasPrice, err := dexKeeper.BaseMinGasPrice(ctx) - require.NoError(t, err) - - quoteGasPrice, err := dexKeeper.GasPrice(ctx, denomQuote) - require.NoError(t, err) - require.Equal(t, baseGasPrice.MulInt64(4), quoteGasPrice.Amount) - - quoteGasPrices, err := dexKeeper.GasPrices(ctx) - require.NoError(t, err) - require.Equal(t, sdk.NewDecCoins(sdk.NewDecCoinFromDec(baseDenom, baseGasPrice), sdk.NewDecCoinFromDec(denomQuote, baseGasPrice.MulInt64(4))), quoteGasPrices) -} diff --git a/x/move/keeper/genesis.go b/x/move/keeper/genesis.go index 2bffb97f3..73f2a51cf 100644 --- a/x/move/keeper/genesis.go +++ b/x/move/keeper/genesis.go @@ -150,7 +150,6 @@ func (k Keeper) InitGenesis(ctx context.Context, moduleNames []string, genState return err } } - return nil } diff --git a/x/move/keeper/params.go b/x/move/keeper/params.go index d0711cc7f..0ce046e14 100644 --- a/x/move/keeper/params.go +++ b/x/move/keeper/params.go @@ -19,15 +19,6 @@ func (k Keeper) BaseDenom(ctx context.Context) (string, error) { return params.BaseDenom, nil } -// BaseMinGasPrice - min gas price in base denom unit -func (k Keeper) BaseMinGasPrice(ctx context.Context) (math.LegacyDec, error) { - params, err := k.GetParams(ctx) - if err != nil { - return math.LegacyDec{}, err - } - return params.BaseMinGasPrice, nil -} - // AllowedPublishers - allowed publishers func (k Keeper) AllowedPublishers(ctx context.Context) ([]vmtypes.AccountAddress, error) { return NewCodeKeeper(&k).GetAllowedPublishers(ctx) diff --git a/x/move/keeper/whitelist.go b/x/move/keeper/whitelist.go index 5653338ba..8496ec249 100644 --- a/x/move/keeper/whitelist.go +++ b/x/move/keeper/whitelist.go @@ -218,3 +218,20 @@ func (k Keeper) Delist(ctx context.Context, msg types.MsgDelist) error { return nil } + +func (k Keeper) GetWhitelistedTokens(ctx context.Context) ([]string, error) { + whitelistedTokens := []string{} + err := k.DexPairs.Walk(ctx, nil, func(key, value []byte) (stop bool, err error) { + metadataQuote, err := vmtypes.NewAccountAddressFromBytes(key) + if err != nil { + return true, err + } + denomQuote, err := types.DenomFromMetadataAddress(ctx, k.MoveBankKeeper(), metadataQuote) + if err != nil { + return true, err + } + whitelistedTokens = append(whitelistedTokens, denomQuote) + return false, nil + }) + return whitelistedTokens, err +} diff --git a/x/move/types/params.go b/x/move/types/params.go index 903c7a402..06f45b6cc 100644 --- a/x/move/types/params.go +++ b/x/move/types/params.go @@ -19,7 +19,7 @@ const ( ) var ( - DefaultBaseMinGasPrice = math.LegacyNewDecWithPrec(15, 3) // 0.015 + DefaultBaseMinGasPrice = math.LegacyZeroDec() DefaultContractSharedRevenueRatio = math.LegacyZeroDec() ) diff --git a/x/move/types/params_test.go b/x/move/types/params_test.go index 11e18bbe6..6675c633d 100644 --- a/x/move/types/params_test.go +++ b/x/move/types/params_test.go @@ -42,7 +42,6 @@ func TestRawParams(t *testing.T) { p1.ContractSharedRevenueRatio = math.LegacyOneDec() p1.BaseDenom = "venusinthemorning" - p1.BaseMinGasPrice = math.LegacyOneDec() require.NoError(t, p1.Validate(ac)) rp := p1.ToRaw() diff --git a/x/move/types/types.pb.go b/x/move/types/types.pb.go index d228851cb..3183dc804 100644 --- a/x/move/types/types.pb.go +++ b/x/move/types/types.pb.go @@ -62,7 +62,7 @@ func (UpgradePolicy) EnumDescriptor() ([]byte, []int) { // Params defines the set of move parameters. type Params struct { BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` - BaseMinGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=base_min_gas_price,json=baseMinGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_min_gas_price" yaml:"base_min_gas_price"` + BaseMinGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=base_min_gas_price,json=baseMinGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_min_gas_price" yaml:"base_min_gas_price"` // Deprecated: Do not use. // CSR: Percentage of fees distributed to developers ContractSharedRevenueRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=contract_shared_revenue_ratio,json=contractSharedRevenueRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"contract_shared_revenue_ratio" yaml:"contract_shared_revenue_ratio"` // flag whether to enable script execution @@ -107,7 +107,7 @@ var xxx_messageInfo_Params proto.InternalMessageInfo // RawParams defines the raw params to store. type RawParams struct { BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` - BaseMinGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=base_min_gas_price,json=baseMinGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_min_gas_price" yaml:"base_min_gas_price"` + BaseMinGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=base_min_gas_price,json=baseMinGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_min_gas_price" yaml:"base_min_gas_price"` // Deprecated: Do not use. // CSR: Percentage of fees distributed to developers ContractSharedRevenueRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=contract_shared_revenue_ratio,json=contractSharedRevenueRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"contract_shared_revenue_ratio" yaml:"contract_shared_revenue_ratio"` // flag whether to enable script execution @@ -490,63 +490,64 @@ func init() { func init() { proto.RegisterFile("initia/move/v1/types.proto", fileDescriptor_5ab4b0783858a3a5) } var fileDescriptor_5ab4b0783858a3a5 = []byte{ - // 894 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0xbf, 0x6f, 0x23, 0x45, - 0x14, 0xf6, 0xc6, 0x97, 0xc4, 0x7e, 0x8e, 0x7d, 0xb9, 0xd1, 0x15, 0x7b, 0x3e, 0xc5, 0x8e, 0x16, - 0x90, 0xa2, 0x20, 0x6c, 0x1d, 0x88, 0xe6, 0x1a, 0x14, 0xc7, 0x06, 0x59, 0xd8, 0xc7, 0xde, 0x9e, - 0xd3, 0xd0, 0xac, 0xc6, 0xbb, 0x73, 0xf6, 0xca, 0xbb, 0x3b, 0xcb, 0xcc, 0xac, 0x93, 0xa5, 0xa7, - 0x41, 0x48, 0x20, 0xd1, 0x50, 0x5e, 0x79, 0xe5, 0x95, 0xfc, 0x03, 0x48, 0x29, 0xaf, 0x44, 0x20, - 0x59, 0xe0, 0x14, 0x47, 0xcd, 0x5f, 0x80, 0x66, 0x66, 0x1d, 0xb0, 0x22, 0x59, 0x91, 0x10, 0x1d, - 0xcd, 0x6a, 0xde, 0xf7, 0x7d, 0x7a, 0xbf, 0x77, 0x06, 0xea, 0x41, 0x1c, 0x88, 0x00, 0xb7, 0x23, - 0x3a, 0x27, 0xed, 0xf9, 0xa3, 0xb6, 0xc8, 0x12, 0xc2, 0x5b, 0x09, 0xa3, 0x82, 0xa2, 0x9a, 0xe6, - 0x5a, 0x92, 0x6b, 0xcd, 0x1f, 0xd5, 0xef, 0xe1, 0x28, 0x88, 0x69, 0x5b, 0x7d, 0xb5, 0xa4, 0x7e, - 0x7f, 0x42, 0x27, 0x54, 0x1d, 0xdb, 0xf2, 0xa4, 0x51, 0xeb, 0xa7, 0x22, 0xec, 0xd8, 0x98, 0xe1, - 0x88, 0xa3, 0x03, 0x80, 0x31, 0xe6, 0xc4, 0xf5, 0x49, 0x4c, 0x23, 0xd3, 0x38, 0x34, 0x8e, 0xca, - 0x4e, 0x59, 0x22, 0x5d, 0x09, 0x20, 0x06, 0x48, 0xd1, 0x51, 0x10, 0xbb, 0x13, 0xcc, 0xdd, 0x84, - 0x05, 0x1e, 0x31, 0xb7, 0xa4, 0xac, 0xd3, 0xbb, 0x5c, 0x34, 0x0b, 0xbf, 0x2c, 0x9a, 0x0f, 0x3d, - 0xca, 0x23, 0xca, 0xb9, 0x3f, 0x6b, 0x05, 0xb4, 0x1d, 0x61, 0x31, 0x6d, 0x0d, 0xc8, 0x04, 0x7b, - 0x59, 0x97, 0x78, 0x7f, 0x2e, 0x9a, 0x0f, 0x32, 0x1c, 0x85, 0x8f, 0xad, 0x9b, 0x6e, 0xac, 0x97, - 0x6f, 0x5e, 0x1d, 0x1b, 0xce, 0x5d, 0xc9, 0x0c, 0x83, 0xf8, 0x13, 0xcc, 0x6d, 0x09, 0xa3, 0xef, - 0x0d, 0x38, 0xf0, 0x68, 0x2c, 0x18, 0xf6, 0x84, 0xcb, 0xa7, 0x98, 0x11, 0xdf, 0x65, 0x64, 0x4e, - 0xe2, 0x94, 0xb8, 0x0c, 0x8b, 0x80, 0x9a, 0x45, 0x15, 0xdf, 0xbe, 0x5d, 0xfc, 0xb7, 0x75, 0xfc, - 0x8d, 0x1e, 0xf3, 0x54, 0xea, 0x2b, 0xd1, 0x33, 0xa5, 0x71, 0xb4, 0xc4, 0x91, 0x0a, 0xf4, 0x0e, - 0xd4, 0xb8, 0xc7, 0x82, 0x44, 0xb8, 0x24, 0xc6, 0xe3, 0x90, 0xf8, 0xe6, 0x9d, 0x43, 0xe3, 0xa8, - 0xe4, 0x54, 0x35, 0xda, 0xd3, 0x20, 0x7a, 0x0a, 0x08, 0x87, 0x21, 0x3d, 0x27, 0xbe, 0x9b, 0xa4, - 0xe3, 0x30, 0xe0, 0x53, 0xc2, 0xb8, 0xb9, 0x7d, 0x58, 0x3c, 0x2a, 0x77, 0xac, 0xbf, 0xbb, 0x71, - 0x53, 0x93, 0xa7, 0x70, 0x2f, 0x67, 0xec, 0x6b, 0xe2, 0xb1, 0xf9, 0xc3, 0x8b, 0x66, 0xe1, 0x8f, - 0x17, 0x4d, 0xe3, 0xeb, 0x37, 0xaf, 0x8e, 0x2b, 0x6a, 0x11, 0xf4, 0xf0, 0xac, 0x5f, 0xb7, 0xa0, - 0xec, 0xe0, 0xf3, 0xff, 0x47, 0xf9, 0x5f, 0x8c, 0xd2, 0xfa, 0xd1, 0x80, 0x9d, 0x21, 0xf5, 0xd3, - 0x90, 0x20, 0x13, 0x76, 0xb1, 0xef, 0x33, 0xc2, 0x79, 0xde, 0xd7, 0x95, 0x89, 0x9a, 0x50, 0x89, - 0x94, 0xc6, 0x8d, 0x71, 0x94, 0xb7, 0xd3, 0x01, 0x0d, 0x3d, 0xc1, 0x11, 0x41, 0xfb, 0x50, 0xc4, - 0xe3, 0x40, 0xd7, 0xe9, 0xc8, 0x23, 0x7a, 0x08, 0x65, 0x86, 0xcf, 0xdd, 0x71, 0x26, 0x08, 0x57, - 0x91, 0xf7, 0x9c, 0x12, 0xc3, 0xe7, 0x1d, 0x69, 0xa3, 0x2e, 0xd4, 0xd2, 0x64, 0xc2, 0xb0, 0x4f, - 0xdc, 0x84, 0x86, 0x81, 0x97, 0x99, 0xdb, 0x87, 0xc6, 0x51, 0xed, 0xfd, 0x83, 0xd6, 0xfa, 0xcf, - 0xde, 0x3a, 0xd3, 0x2a, 0x5b, 0x89, 0x9c, 0x6a, 0xfa, 0x4f, 0xd3, 0xc2, 0x50, 0x3a, 0x9d, 0x12, - 0x6f, 0xc6, 0xd3, 0xe8, 0xdf, 0xe4, 0x5e, 0x87, 0x92, 0x97, 0xbb, 0x51, 0x05, 0xec, 0x39, 0xd7, - 0xb6, 0xf5, 0x95, 0x01, 0x25, 0x87, 0x70, 0x9a, 0x32, 0x6f, 0x53, 0x7f, 0x0e, 0x00, 0xb8, 0x60, - 0xa9, 0x27, 0x5c, 0x81, 0x27, 0x79, 0x88, 0xb2, 0x46, 0x46, 0x78, 0x82, 0xde, 0x82, 0xaa, 0x2c, - 0xc8, 0x65, 0xb9, 0xa7, 0xbc, 0x4f, 0x7b, 0x12, 0xbc, 0xf6, 0xbe, 0xa9, 0x61, 0x96, 0x0b, 0xe5, - 0x91, 0x9c, 0x57, 0x3f, 0x7e, 0x4e, 0x37, 0xe4, 0xf1, 0x00, 0x4a, 0x33, 0x92, 0xb9, 0xf2, 0xfa, - 0xcc, 0xb3, 0xd8, 0x9d, 0x91, 0x6c, 0x94, 0x25, 0x44, 0xa6, 0x38, 0xc7, 0x61, 0x4a, 0x34, 0xa9, - 0x13, 0x28, 0x2b, 0x44, 0xd2, 0xd6, 0x37, 0x06, 0x80, 0x8a, 0xd0, 0x8b, 0x05, 0xcb, 0x36, 0x84, - 0xd8, 0x87, 0xe2, 0x8c, 0x64, 0xb9, 0x77, 0x79, 0x44, 0xf7, 0x61, 0x5b, 0xf9, 0xc9, 0x9d, 0x6a, - 0x43, 0x96, 0x23, 0x53, 0x59, 0x2b, 0x67, 0x46, 0x32, 0x3d, 0xff, 0x26, 0x54, 0x74, 0x32, 0x9a, - 0xde, 0x56, 0xb4, 0xce, 0x4f, 0xd7, 0xfb, 0x29, 0xa0, 0xb5, 0xd1, 0xdb, 0xea, 0x29, 0xf8, 0x10, - 0x76, 0xf2, 0x75, 0x31, 0x6e, 0xb3, 0x2e, 0xb9, 0xd8, 0xc2, 0xb0, 0xdb, 0x25, 0x17, 0x36, 0x0e, - 0x98, 0xfc, 0x29, 0x22, 0x22, 0xb0, 0x8f, 0x05, 0x76, 0xbf, 0x48, 0xa9, 0x20, 0x79, 0x79, 0xd5, - 0x15, 0xfa, 0x54, 0x82, 0xa8, 0x0d, 0x95, 0x6b, 0x59, 0x98, 0xe4, 0xd7, 0x47, 0x6d, 0xb9, 0x68, - 0xc2, 0x30, 0x87, 0x07, 0xb6, 0x03, 0x2b, 0xc9, 0x20, 0xb1, 0xbe, 0x35, 0xc0, 0xec, 0x5d, 0x10, - 0x2f, 0x15, 0xe4, 0x24, 0x15, 0x53, 0xca, 0x82, 0x2f, 0xe5, 0x4f, 0x18, 0xf7, 0x05, 0x89, 0x54, - 0x50, 0xbd, 0x81, 0xeb, 0x3d, 0xad, 0x6a, 0xf4, 0xe4, 0xb6, 0x8b, 0xfa, 0x2e, 0xd4, 0x9e, 0xa7, - 0xb1, 0x27, 0xfd, 0x2a, 0x09, 0x37, 0x8b, 0xea, 0xc6, 0xbd, 0x73, 0xb9, 0x68, 0x1a, 0x4e, 0x75, - 0xc5, 0x49, 0x2d, 0x3f, 0xfe, 0x08, 0xaa, 0x6b, 0xdd, 0x40, 0x77, 0xa1, 0x72, 0xf6, 0xe4, 0x99, - 0xdd, 0x3b, 0xed, 0x7f, 0xdc, 0xef, 0x75, 0xf7, 0x0b, 0xa8, 0x06, 0x70, 0xfa, 0xd9, 0xd0, 0x3e, - 0x19, 0xf5, 0x3b, 0x83, 0xde, 0xbe, 0x81, 0xaa, 0x50, 0xee, 0x0f, 0x87, 0x67, 0xa3, 0x13, 0x69, - 0x6e, 0x75, 0x06, 0x97, 0xbf, 0x37, 0x0a, 0x2f, 0x97, 0x0d, 0xe3, 0x72, 0xd9, 0x30, 0x5e, 0x2f, - 0x1b, 0xc6, 0x6f, 0xcb, 0x86, 0xf1, 0xdd, 0x55, 0xa3, 0xf0, 0xfa, 0xaa, 0x51, 0xf8, 0xf9, 0xaa, - 0x51, 0xf8, 0xfc, 0x78, 0x12, 0x88, 0x69, 0x3a, 0x6e, 0x79, 0x34, 0x6a, 0xeb, 0x41, 0xbc, 0x17, - 0xe2, 0x31, 0xcf, 0xcf, 0xed, 0x0b, 0xfd, 0x9c, 0xab, 0xb7, 0x7c, 0xbc, 0xa3, 0xde, 0xe4, 0x0f, - 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x96, 0x15, 0xb1, 0x79, 0xea, 0x07, 0x00, 0x00, + // 898 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xc6, 0x4d, 0x62, 0x3f, 0xc7, 0x6e, 0x3a, 0xea, 0x61, 0xeb, 0x2a, 0x76, 0xb4, 0x80, + 0x14, 0x05, 0x61, 0xab, 0x20, 0x2e, 0xbd, 0xa0, 0x38, 0x36, 0x95, 0x85, 0x5d, 0xb6, 0x5b, 0xe7, + 0xc2, 0x65, 0x35, 0xde, 0x9d, 0xda, 0x2b, 0xef, 0xee, 0x2c, 0x33, 0xb3, 0x4e, 0x96, 0x3b, 0x17, + 0x84, 0x04, 0x12, 0x17, 0x8e, 0x3d, 0xf6, 0xd8, 0x23, 0xff, 0x80, 0x1c, 0x7b, 0x44, 0x48, 0x58, + 0xe0, 0x1c, 0xca, 0x99, 0x5f, 0x80, 0x66, 0x66, 0x1d, 0xb0, 0x2a, 0x59, 0x91, 0x10, 0xb7, 0x5e, + 0x56, 0xf3, 0xbe, 0xef, 0xd3, 0x9b, 0xef, 0xbd, 0x37, 0x3b, 0x03, 0xf5, 0x20, 0x0e, 0x44, 0x80, + 0xdb, 0x11, 0x9d, 0x93, 0xf6, 0xfc, 0x41, 0x5b, 0x64, 0x09, 0xe1, 0xad, 0x84, 0x51, 0x41, 0x51, + 0x4d, 0x73, 0x2d, 0xc9, 0xb5, 0xe6, 0x0f, 0xea, 0x77, 0x70, 0x14, 0xc4, 0xb4, 0xad, 0xbe, 0x5a, + 0x52, 0xbf, 0x3b, 0xa1, 0x13, 0xaa, 0x96, 0x6d, 0xb9, 0xd2, 0xa8, 0xf5, 0x73, 0x11, 0x76, 0x6c, + 0xcc, 0x70, 0xc4, 0xd1, 0x01, 0xc0, 0x18, 0x73, 0xe2, 0xfa, 0x24, 0xa6, 0x91, 0x69, 0x1c, 0x1a, + 0x47, 0x65, 0xa7, 0x2c, 0x91, 0xae, 0x04, 0x90, 0x00, 0xa4, 0xe8, 0x28, 0x88, 0xdd, 0x09, 0xe6, + 0x6e, 0xc2, 0x02, 0x8f, 0x98, 0x5b, 0x52, 0xd6, 0x79, 0x74, 0xb9, 0x68, 0x16, 0x7e, 0x5d, 0x34, + 0xef, 0x7b, 0x94, 0x47, 0x94, 0x73, 0x7f, 0xd6, 0x0a, 0x68, 0x3b, 0xc2, 0x62, 0xda, 0x1a, 0x90, + 0x09, 0xf6, 0xb2, 0x2e, 0xf1, 0xfe, 0x5a, 0x34, 0xef, 0x65, 0x38, 0x0a, 0x1f, 0x5a, 0x6f, 0xa6, + 0xb1, 0x5e, 0xbc, 0x7e, 0x79, 0x6c, 0x98, 0x86, 0x73, 0x5b, 0x72, 0xc3, 0x20, 0x7e, 0x84, 0xb9, + 0x2d, 0x09, 0xf4, 0x83, 0x01, 0x07, 0x1e, 0x8d, 0x05, 0xc3, 0x9e, 0x70, 0xf9, 0x14, 0x33, 0xe2, + 0xbb, 0x8c, 0xcc, 0x49, 0x9c, 0x12, 0x97, 0x61, 0x11, 0x50, 0xb3, 0xa8, 0x1c, 0xd8, 0x37, 0x73, + 0xf0, 0xae, 0x76, 0xb0, 0x31, 0xa3, 0x36, 0xe3, 0xd4, 0x57, 0xa2, 0xa7, 0x4a, 0xe3, 0x68, 0x89, + 0x23, 0x15, 0xe8, 0x3d, 0xa8, 0x71, 0x8f, 0x05, 0x89, 0x70, 0x49, 0x8c, 0xc7, 0x21, 0xf1, 0xcd, + 0x5b, 0x87, 0xc6, 0x51, 0xc9, 0xa9, 0x6a, 0xb4, 0xa7, 0x41, 0xf4, 0x04, 0x10, 0x0e, 0x43, 0x7a, + 0x4e, 0x7c, 0x37, 0x49, 0xc7, 0x61, 0xc0, 0xa7, 0x84, 0x71, 0x73, 0xfb, 0xb0, 0x78, 0x54, 0xee, + 0x58, 0xff, 0xf4, 0xe3, 0x4d, 0x4d, 0x6e, 0xe1, 0x4e, 0xce, 0xd8, 0xd7, 0xc4, 0x43, 0xf3, 0xc7, + 0xe7, 0xcd, 0xc2, 0x9f, 0xcf, 0x9b, 0xc6, 0x37, 0xaf, 0x5f, 0x1e, 0x57, 0xd4, 0x51, 0xd0, 0xe3, + 0xb3, 0x7e, 0xdb, 0x82, 0xb2, 0x83, 0xcf, 0xdf, 0x0e, 0xf3, 0xff, 0x19, 0xa6, 0xf5, 0x93, 0x01, + 0x3b, 0x43, 0xea, 0xa7, 0x21, 0x41, 0x26, 0xec, 0x62, 0xdf, 0x67, 0x84, 0xf3, 0xbc, 0xb3, 0xab, + 0x10, 0x35, 0xa1, 0x12, 0x29, 0x8d, 0x1b, 0xe3, 0x28, 0x6f, 0xa8, 0x03, 0x1a, 0x7a, 0x8c, 0x23, + 0x82, 0xf6, 0xa1, 0x88, 0xc7, 0x81, 0xae, 0xd3, 0x91, 0x4b, 0x74, 0x1f, 0xca, 0x0c, 0x9f, 0xbb, + 0xe3, 0x4c, 0x10, 0xae, 0x76, 0xde, 0x73, 0x4a, 0x0c, 0x9f, 0x77, 0x64, 0x8c, 0xba, 0x50, 0x4b, + 0x93, 0x09, 0xc3, 0x3e, 0x71, 0x13, 0x1a, 0x06, 0x5e, 0x66, 0x6e, 0x1f, 0x1a, 0x47, 0xb5, 0x0f, + 0x0f, 0x5a, 0xeb, 0x3f, 0x7c, 0xeb, 0x4c, 0xab, 0x6c, 0x25, 0x72, 0xaa, 0xe9, 0xbf, 0x43, 0x0b, + 0x43, 0xe9, 0x74, 0x4a, 0xbc, 0x19, 0x4f, 0xa3, 0xff, 0xe2, 0xbd, 0x0e, 0x25, 0x2f, 0x4f, 0xa3, + 0x0a, 0xd8, 0x73, 0xae, 0x63, 0xeb, 0x6b, 0x03, 0x4a, 0x0e, 0xe1, 0x34, 0x65, 0xde, 0xa6, 0xfe, + 0x1c, 0x00, 0x70, 0xc1, 0x52, 0x4f, 0xb8, 0x02, 0x4f, 0xf2, 0x2d, 0xca, 0x1a, 0x19, 0xe1, 0x09, + 0x7a, 0x07, 0xaa, 0xb2, 0x20, 0x97, 0xe5, 0x99, 0xf2, 0x3e, 0xed, 0x49, 0xf0, 0x3a, 0xfb, 0xa6, + 0x86, 0x59, 0x2e, 0x94, 0x47, 0x72, 0x5e, 0xfd, 0xf8, 0x19, 0xdd, 0xe0, 0xe3, 0x1e, 0x94, 0x66, + 0x24, 0x73, 0xe5, 0x15, 0x9a, 0xbb, 0xd8, 0x9d, 0x91, 0x6c, 0x94, 0x25, 0x44, 0x5a, 0x9c, 0xe3, + 0x30, 0x25, 0x9a, 0xd4, 0x06, 0xca, 0x0a, 0x91, 0xb4, 0xf5, 0xad, 0x01, 0xa0, 0x76, 0xe8, 0xc5, + 0x82, 0x65, 0x1b, 0xb6, 0xd8, 0x87, 0xe2, 0x8c, 0x64, 0x79, 0x76, 0xb9, 0x44, 0x77, 0x61, 0x5b, + 0xe5, 0xc9, 0x93, 0xea, 0x40, 0x96, 0x23, 0xad, 0xac, 0x95, 0x33, 0x23, 0x99, 0x9e, 0x7f, 0x13, + 0x2a, 0xda, 0x8c, 0xa6, 0xb7, 0x15, 0xad, 0xfd, 0xe9, 0x7a, 0x3f, 0x03, 0xb4, 0x36, 0x7a, 0x5b, + 0x3d, 0x07, 0x1f, 0xc3, 0x4e, 0x7e, 0x5c, 0x8c, 0x9b, 0x1c, 0x97, 0x5c, 0x6c, 0x61, 0xd8, 0xed, + 0x92, 0x0b, 0x1b, 0x07, 0x4c, 0xfe, 0x14, 0x11, 0x11, 0xd8, 0xc7, 0x02, 0xbb, 0x5f, 0xa6, 0x54, + 0x90, 0xbc, 0xbc, 0xea, 0x0a, 0x7d, 0x22, 0x41, 0xd4, 0x86, 0xca, 0xb5, 0x2c, 0x4c, 0xf2, 0x0b, + 0xa4, 0xb6, 0x5c, 0x34, 0x61, 0x98, 0xc3, 0x03, 0xdb, 0x81, 0x95, 0x64, 0x90, 0x58, 0xdf, 0x19, + 0x60, 0xf6, 0x2e, 0x88, 0x97, 0x0a, 0x72, 0x92, 0x8a, 0x29, 0x65, 0xc1, 0x57, 0xf2, 0x27, 0x8c, + 0xfb, 0x82, 0x44, 0x6a, 0x53, 0x7d, 0x02, 0xd7, 0x7b, 0x5a, 0xd5, 0xe8, 0xc9, 0x4d, 0x0f, 0xea, + 0xfb, 0x50, 0x7b, 0x96, 0xc6, 0x9e, 0xcc, 0xab, 0x24, 0xdc, 0x2c, 0xaa, 0x3b, 0xf7, 0xd6, 0xe5, + 0xa2, 0x69, 0x38, 0xd5, 0x15, 0x27, 0xb5, 0xfc, 0xf8, 0x13, 0xa8, 0xae, 0x75, 0x03, 0xdd, 0x86, + 0xca, 0xd9, 0xe3, 0xa7, 0x76, 0xef, 0xb4, 0xff, 0x69, 0xbf, 0xd7, 0xdd, 0x2f, 0xa0, 0x1a, 0xc0, + 0xe9, 0xe7, 0x43, 0xfb, 0x64, 0xd4, 0xef, 0x0c, 0x7a, 0xfb, 0x06, 0xaa, 0x42, 0xb9, 0x3f, 0x1c, + 0x9e, 0x8d, 0x4e, 0x64, 0xb8, 0xd5, 0x19, 0x5c, 0xfe, 0xd1, 0x28, 0xbc, 0x58, 0x36, 0x8c, 0xcb, + 0x65, 0xc3, 0x78, 0xb5, 0x6c, 0x18, 0xbf, 0x2f, 0x1b, 0xc6, 0xf7, 0x57, 0x8d, 0xc2, 0xab, 0xab, + 0x46, 0xe1, 0x97, 0xab, 0x46, 0xe1, 0x8b, 0xe3, 0x49, 0x20, 0xa6, 0xe9, 0xb8, 0xe5, 0xd1, 0xa8, + 0xad, 0x07, 0xf1, 0x41, 0x88, 0xc7, 0x3c, 0x5f, 0xb7, 0x2f, 0xf4, 0x93, 0xae, 0xde, 0xf3, 0xf1, + 0x8e, 0x7a, 0x97, 0x3f, 0xfa, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x47, 0x17, 0xda, 0xa8, 0xee, 0x07, + 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool {