diff --git a/api/utxverifier/module/v1/module.pulsar.go b/api/utxverifier/module/v1/module.pulsar.go deleted file mode 100644 index 28f19e27..00000000 --- a/api/utxverifier/module/v1/module.pulsar.go +++ /dev/null @@ -1,504 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package modulev1 - -import ( - _ "cosmossdk.io/api/cosmos/app/v1alpha1" - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_Module protoreflect.MessageDescriptor -) - -func init() { - file_utxverifier_module_v1_module_proto_init() - md_Module = File_utxverifier_module_v1_module_proto.Messages().ByName("Module") -} - -var _ protoreflect.Message = (*fastReflection_Module)(nil) - -type fastReflection_Module Module - -func (x *Module) ProtoReflect() protoreflect.Message { - return (*fastReflection_Module)(x) -} - -func (x *Module) slowProtoReflect() protoreflect.Message { - mi := &file_utxverifier_module_v1_module_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Module_messageType fastReflection_Module_messageType -var _ protoreflect.MessageType = fastReflection_Module_messageType{} - -type fastReflection_Module_messageType struct{} - -func (x fastReflection_Module_messageType) Zero() protoreflect.Message { - return (*fastReflection_Module)(nil) -} -func (x fastReflection_Module_messageType) New() protoreflect.Message { - return new(fastReflection_Module) -} -func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_Module) Type() protoreflect.MessageType { - return _fastReflection_Module_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Module) New() protoreflect.Message { - return new(fastReflection_Module) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { - return (*Module)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.module.v1.Module")) - } - panic(fmt.Errorf("message utxverifier.module.v1.Module does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.module.v1.Module")) - } - panic(fmt.Errorf("message utxverifier.module.v1.Module does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.module.v1.Module")) - } - panic(fmt.Errorf("message utxverifier.module.v1.Module does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.module.v1.Module")) - } - panic(fmt.Errorf("message utxverifier.module.v1.Module does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.module.v1.Module")) - } - panic(fmt.Errorf("message utxverifier.module.v1.Module does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.module.v1.Module")) - } - panic(fmt.Errorf("message utxverifier.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 utxverifier.module.v1.Module", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_Module) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Module) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Module) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Module) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: utxverifier/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 app config object of the module. -// Learn more: https://docs.cosmos.network/main/building-modules/depinject -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_utxverifier_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_utxverifier_module_v1_module_proto_rawDescGZIP(), []int{0} -} - -var File_utxverifier_module_v1_module_proto protoreflect.FileDescriptor - -var file_utxverifier_module_v1_module_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, - 0x72, 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, 0x36, 0x0a, - 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x2c, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x26, 0x0a, - 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x75, 0x73, 0x68, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x2d, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x42, 0xe7, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x74, - 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 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, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, - 0x75, 0x73, 0x68, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x2d, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x74, 0x78, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x4d, - 0x58, 0xaa, 0x02, 0x15, 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x55, 0x74, 0x78, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x21, 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5c, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_utxverifier_module_v1_module_proto_rawDescOnce sync.Once - file_utxverifier_module_v1_module_proto_rawDescData = file_utxverifier_module_v1_module_proto_rawDesc -) - -func file_utxverifier_module_v1_module_proto_rawDescGZIP() []byte { - file_utxverifier_module_v1_module_proto_rawDescOnce.Do(func() { - file_utxverifier_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_utxverifier_module_v1_module_proto_rawDescData) - }) - return file_utxverifier_module_v1_module_proto_rawDescData -} - -var file_utxverifier_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_utxverifier_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: utxverifier.module.v1.Module -} -var file_utxverifier_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_utxverifier_module_v1_module_proto_init() } -func file_utxverifier_module_v1_module_proto_init() { - if File_utxverifier_module_v1_module_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_utxverifier_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_utxverifier_module_v1_module_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_utxverifier_module_v1_module_proto_goTypes, - DependencyIndexes: file_utxverifier_module_v1_module_proto_depIdxs, - MessageInfos: file_utxverifier_module_v1_module_proto_msgTypes, - }.Build() - File_utxverifier_module_v1_module_proto = out.File - file_utxverifier_module_v1_module_proto_rawDesc = nil - file_utxverifier_module_v1_module_proto_goTypes = nil - file_utxverifier_module_v1_module_proto_depIdxs = nil -} diff --git a/api/utxverifier/v1/genesis.pulsar.go b/api/utxverifier/v1/genesis.pulsar.go deleted file mode 100644 index 13c78cc4..00000000 --- a/api/utxverifier/v1/genesis.pulsar.go +++ /dev/null @@ -1,1056 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package utxverifierv1 - -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_utxverifier_v1_genesis_proto_init() - md_GenesisState = File_utxverifier_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_utxverifier_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 "utxverifier.v1.GenesisState.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.GenesisState")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.GenesisState.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.GenesisState")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.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: utxverifier.v1.GenesisState")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.GenesisState.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.GenesisState")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.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: utxverifier.v1.GenesisState")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.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: utxverifier.v1.GenesisState")) - } - panic(fmt.Errorf("message utxverifier.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 utxverifier.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, - } -} - -var ( - md_Params protoreflect.MessageDescriptor - fd_Params_some_value protoreflect.FieldDescriptor -) - -func init() { - file_utxverifier_v1_genesis_proto_init() - md_Params = File_utxverifier_v1_genesis_proto.Messages().ByName("Params") - fd_Params_some_value = md_Params.Fields().ByName("some_value") -} - -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_utxverifier_v1_genesis_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_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.SomeValue != false { - value := protoreflect.ValueOfBool(x.SomeValue) - if !f(fd_Params_some_value, 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 "utxverifier.v1.Params.some_value": - return x.SomeValue != false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.Params")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.Params.some_value": - x.SomeValue = false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.Params")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.Params.some_value": - value := x.SomeValue - return protoreflect.ValueOfBool(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.Params")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.Params.some_value": - x.SomeValue = value.Bool() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.Params")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.Params.some_value": - panic(fmt.Errorf("field some_value of message utxverifier.v1.Params is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.Params")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.Params.some_value": - return protoreflect.ValueOfBool(false) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.Params")) - } - panic(fmt.Errorf("message utxverifier.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 utxverifier.v1.Params", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_Params) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Params) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.SomeValue { - n += 2 - } - 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.SomeValue { - i-- - if x.SomeValue { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - 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 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SomeValue", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.SomeValue = bool(v != 0) - 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: utxverifier/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 defines the module genesis state -type GenesisState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Params defines all the parameters of the module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *GenesisState) Reset() { - *x = GenesisState{} - if protoimpl.UnsafeEnabled { - mi := &file_utxverifier_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_utxverifier_v1_genesis_proto_rawDescGZIP(), []int{0} -} - -func (x *GenesisState) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -// Params defines the set of module parameters. -type Params struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SomeValue bool `protobuf:"varint,2,opt,name=some_value,json=someValue,proto3" json:"some_value,omitempty"` -} - -func (x *Params) Reset() { - *x = Params{} - if protoimpl.UnsafeEnabled { - mi := &file_utxverifier_v1_genesis_proto_msgTypes[1] - 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_utxverifier_v1_genesis_proto_rawDescGZIP(), []int{1} -} - -func (x *Params) GetSomeValue() bool { - if x != nil { - return x.SomeValue - } - return false -} - -var File_utxverifier_v1_genesis_proto protoreflect.FileDescriptor - -var file_utxverifier_v1_genesis_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x76, 0x31, - 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, - 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x14, - 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, - 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x44, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x48, 0x0a, - 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6f, 0x6d, 0x65, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x6f, 0x6d, - 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x1f, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, - 0x8a, 0xe7, 0xb0, 0x2a, 0x12, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc2, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, - 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0c, - 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x2d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2d, - 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x55, 0x74, - 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x55, - 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, - 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x55, 0x74, 0x78, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_utxverifier_v1_genesis_proto_rawDescOnce sync.Once - file_utxverifier_v1_genesis_proto_rawDescData = file_utxverifier_v1_genesis_proto_rawDesc -) - -func file_utxverifier_v1_genesis_proto_rawDescGZIP() []byte { - file_utxverifier_v1_genesis_proto_rawDescOnce.Do(func() { - file_utxverifier_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_utxverifier_v1_genesis_proto_rawDescData) - }) - return file_utxverifier_v1_genesis_proto_rawDescData -} - -var file_utxverifier_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_utxverifier_v1_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: utxverifier.v1.GenesisState - (*Params)(nil), // 1: utxverifier.v1.Params -} -var file_utxverifier_v1_genesis_proto_depIdxs = []int32{ - 1, // 0: utxverifier.v1.GenesisState.params:type_name -> utxverifier.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_utxverifier_v1_genesis_proto_init() } -func file_utxverifier_v1_genesis_proto_init() { - if File_utxverifier_v1_genesis_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_utxverifier_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 - } - } - file_utxverifier_v1_genesis_proto_msgTypes[1].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_utxverifier_v1_genesis_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_utxverifier_v1_genesis_proto_goTypes, - DependencyIndexes: file_utxverifier_v1_genesis_proto_depIdxs, - MessageInfos: file_utxverifier_v1_genesis_proto_msgTypes, - }.Build() - File_utxverifier_v1_genesis_proto = out.File - file_utxverifier_v1_genesis_proto_rawDesc = nil - file_utxverifier_v1_genesis_proto_goTypes = nil - file_utxverifier_v1_genesis_proto_depIdxs = nil -} diff --git a/api/utxverifier/v1/query.pulsar.go b/api/utxverifier/v1/query.pulsar.go deleted file mode 100644 index facceae1..00000000 --- a/api/utxverifier/v1/query.pulsar.go +++ /dev/null @@ -1,2122 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package utxverifierv1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "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_utxverifier_v1_query_proto_init() - md_QueryParamsRequest = File_utxverifier_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_utxverifier_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: utxverifier.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message utxverifier.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 utxverifier.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_utxverifier_v1_query_proto_init() - md_QueryParamsResponse = File_utxverifier_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_utxverifier_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 "utxverifier.v1.QueryParamsResponse.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.QueryParamsResponse.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.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: utxverifier.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.QueryParamsResponse.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.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: utxverifier.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.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: utxverifier.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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 utxverifier.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, - } -} - -var ( - md_QueryVerifiedTxHashRequest protoreflect.MessageDescriptor - fd_QueryVerifiedTxHashRequest_chain protoreflect.FieldDescriptor - fd_QueryVerifiedTxHashRequest_tx_hash protoreflect.FieldDescriptor -) - -func init() { - file_utxverifier_v1_query_proto_init() - md_QueryVerifiedTxHashRequest = File_utxverifier_v1_query_proto.Messages().ByName("QueryVerifiedTxHashRequest") - fd_QueryVerifiedTxHashRequest_chain = md_QueryVerifiedTxHashRequest.Fields().ByName("chain") - fd_QueryVerifiedTxHashRequest_tx_hash = md_QueryVerifiedTxHashRequest.Fields().ByName("tx_hash") -} - -var _ protoreflect.Message = (*fastReflection_QueryVerifiedTxHashRequest)(nil) - -type fastReflection_QueryVerifiedTxHashRequest QueryVerifiedTxHashRequest - -func (x *QueryVerifiedTxHashRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryVerifiedTxHashRequest)(x) -} - -func (x *QueryVerifiedTxHashRequest) slowProtoReflect() protoreflect.Message { - mi := &file_utxverifier_v1_query_proto_msgTypes[2] - 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_QueryVerifiedTxHashRequest_messageType fastReflection_QueryVerifiedTxHashRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryVerifiedTxHashRequest_messageType{} - -type fastReflection_QueryVerifiedTxHashRequest_messageType struct{} - -func (x fastReflection_QueryVerifiedTxHashRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryVerifiedTxHashRequest)(nil) -} -func (x fastReflection_QueryVerifiedTxHashRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryVerifiedTxHashRequest) -} -func (x fastReflection_QueryVerifiedTxHashRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryVerifiedTxHashRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryVerifiedTxHashRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryVerifiedTxHashRequest -} - -// 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_QueryVerifiedTxHashRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryVerifiedTxHashRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryVerifiedTxHashRequest) New() protoreflect.Message { - return new(fastReflection_QueryVerifiedTxHashRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryVerifiedTxHashRequest) Interface() protoreflect.ProtoMessage { - return (*QueryVerifiedTxHashRequest)(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_QueryVerifiedTxHashRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Chain != "" { - value := protoreflect.ValueOfString(x.Chain) - if !f(fd_QueryVerifiedTxHashRequest_chain, value) { - return - } - } - if x.TxHash != "" { - value := protoreflect.ValueOfString(x.TxHash) - if !f(fd_QueryVerifiedTxHashRequest_tx_hash, 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_QueryVerifiedTxHashRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashRequest.chain": - return x.Chain != "" - case "utxverifier.v1.QueryVerifiedTxHashRequest.tx_hash": - return x.TxHash != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashRequest")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashRequest 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_QueryVerifiedTxHashRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashRequest.chain": - x.Chain = "" - case "utxverifier.v1.QueryVerifiedTxHashRequest.tx_hash": - x.TxHash = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashRequest")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashRequest 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_QueryVerifiedTxHashRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashRequest.chain": - value := x.Chain - return protoreflect.ValueOfString(value) - case "utxverifier.v1.QueryVerifiedTxHashRequest.tx_hash": - value := x.TxHash - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashRequest")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashRequest 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_QueryVerifiedTxHashRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashRequest.chain": - x.Chain = value.Interface().(string) - case "utxverifier.v1.QueryVerifiedTxHashRequest.tx_hash": - x.TxHash = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashRequest")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashRequest 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_QueryVerifiedTxHashRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashRequest.chain": - panic(fmt.Errorf("field chain of message utxverifier.v1.QueryVerifiedTxHashRequest is not mutable")) - case "utxverifier.v1.QueryVerifiedTxHashRequest.tx_hash": - panic(fmt.Errorf("field tx_hash of message utxverifier.v1.QueryVerifiedTxHashRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashRequest")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashRequest 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_QueryVerifiedTxHashRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashRequest.chain": - return protoreflect.ValueOfString("") - case "utxverifier.v1.QueryVerifiedTxHashRequest.tx_hash": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashRequest")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashRequest 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_QueryVerifiedTxHashRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in utxverifier.v1.QueryVerifiedTxHashRequest", 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_QueryVerifiedTxHashRequest) 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_QueryVerifiedTxHashRequest) 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_QueryVerifiedTxHashRequest) 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_QueryVerifiedTxHashRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryVerifiedTxHashRequest) - 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.Chain) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.TxHash) - 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().(*QueryVerifiedTxHashRequest) - 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.TxHash) > 0 { - i -= len(x.TxHash) - copy(dAtA[i:], x.TxHash) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TxHash))) - i-- - dAtA[i] = 0x12 - } - if len(x.Chain) > 0 { - i -= len(x.Chain) - copy(dAtA[i:], x.Chain) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Chain))) - 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().(*QueryVerifiedTxHashRequest) - 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: QueryVerifiedTxHashRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryVerifiedTxHashRequest: 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 Chain", 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.Chain = 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 TxHash", 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.TxHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_QueryVerifiedTxHashResponse protoreflect.MessageDescriptor - fd_QueryVerifiedTxHashResponse_metadata protoreflect.FieldDescriptor - fd_QueryVerifiedTxHashResponse_found protoreflect.FieldDescriptor -) - -func init() { - file_utxverifier_v1_query_proto_init() - md_QueryVerifiedTxHashResponse = File_utxverifier_v1_query_proto.Messages().ByName("QueryVerifiedTxHashResponse") - fd_QueryVerifiedTxHashResponse_metadata = md_QueryVerifiedTxHashResponse.Fields().ByName("metadata") - fd_QueryVerifiedTxHashResponse_found = md_QueryVerifiedTxHashResponse.Fields().ByName("found") -} - -var _ protoreflect.Message = (*fastReflection_QueryVerifiedTxHashResponse)(nil) - -type fastReflection_QueryVerifiedTxHashResponse QueryVerifiedTxHashResponse - -func (x *QueryVerifiedTxHashResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryVerifiedTxHashResponse)(x) -} - -func (x *QueryVerifiedTxHashResponse) slowProtoReflect() protoreflect.Message { - mi := &file_utxverifier_v1_query_proto_msgTypes[3] - 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_QueryVerifiedTxHashResponse_messageType fastReflection_QueryVerifiedTxHashResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryVerifiedTxHashResponse_messageType{} - -type fastReflection_QueryVerifiedTxHashResponse_messageType struct{} - -func (x fastReflection_QueryVerifiedTxHashResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryVerifiedTxHashResponse)(nil) -} -func (x fastReflection_QueryVerifiedTxHashResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryVerifiedTxHashResponse) -} -func (x fastReflection_QueryVerifiedTxHashResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryVerifiedTxHashResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryVerifiedTxHashResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryVerifiedTxHashResponse -} - -// 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_QueryVerifiedTxHashResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryVerifiedTxHashResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryVerifiedTxHashResponse) New() protoreflect.Message { - return new(fastReflection_QueryVerifiedTxHashResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryVerifiedTxHashResponse) Interface() protoreflect.ProtoMessage { - return (*QueryVerifiedTxHashResponse)(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_QueryVerifiedTxHashResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Metadata != nil { - value := protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) - if !f(fd_QueryVerifiedTxHashResponse_metadata, value) { - return - } - } - if x.Found != false { - value := protoreflect.ValueOfBool(x.Found) - if !f(fd_QueryVerifiedTxHashResponse_found, 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_QueryVerifiedTxHashResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashResponse.metadata": - return x.Metadata != nil - case "utxverifier.v1.QueryVerifiedTxHashResponse.found": - return x.Found != false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashResponse")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashResponse 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_QueryVerifiedTxHashResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashResponse.metadata": - x.Metadata = nil - case "utxverifier.v1.QueryVerifiedTxHashResponse.found": - x.Found = false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashResponse")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashResponse 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_QueryVerifiedTxHashResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashResponse.metadata": - value := x.Metadata - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "utxverifier.v1.QueryVerifiedTxHashResponse.found": - value := x.Found - return protoreflect.ValueOfBool(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashResponse")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashResponse 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_QueryVerifiedTxHashResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashResponse.metadata": - x.Metadata = value.Message().Interface().(*VerifiedTxMetadata) - case "utxverifier.v1.QueryVerifiedTxHashResponse.found": - x.Found = value.Bool() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashResponse")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashResponse 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_QueryVerifiedTxHashResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashResponse.metadata": - if x.Metadata == nil { - x.Metadata = new(VerifiedTxMetadata) - } - return protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) - case "utxverifier.v1.QueryVerifiedTxHashResponse.found": - panic(fmt.Errorf("field found of message utxverifier.v1.QueryVerifiedTxHashResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashResponse")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashResponse 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_QueryVerifiedTxHashResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "utxverifier.v1.QueryVerifiedTxHashResponse.metadata": - m := new(VerifiedTxMetadata) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "utxverifier.v1.QueryVerifiedTxHashResponse.found": - return protoreflect.ValueOfBool(false) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.QueryVerifiedTxHashResponse")) - } - panic(fmt.Errorf("message utxverifier.v1.QueryVerifiedTxHashResponse 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_QueryVerifiedTxHashResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in utxverifier.v1.QueryVerifiedTxHashResponse", 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_QueryVerifiedTxHashResponse) 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_QueryVerifiedTxHashResponse) 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_QueryVerifiedTxHashResponse) 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_QueryVerifiedTxHashResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryVerifiedTxHashResponse) - 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.Metadata != nil { - l = options.Size(x.Metadata) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Found { - n += 2 - } - 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().(*QueryVerifiedTxHashResponse) - 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.Found { - i-- - if x.Found { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if x.Metadata != nil { - encoded, err := options.Marshal(x.Metadata) - 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().(*QueryVerifiedTxHashResponse) - 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: QueryVerifiedTxHashResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryVerifiedTxHashResponse: 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 Metadata", 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.Metadata == nil { - x.Metadata = &VerifiedTxMetadata{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Metadata); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Found", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Found = bool(v != 0) - 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: utxverifier/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_utxverifier_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_utxverifier_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_utxverifier_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_utxverifier_v1_query_proto_rawDescGZIP(), []int{1} -} - -func (x *QueryParamsResponse) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -// QueryVerifiedTxHashRequest is the request type for querying if a transaction hash is verified. -type QueryVerifiedTxHashRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // chain is the identifier of the chain to query. - Chain string `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` - // hash is the hash of the transaction to query. - TxHash string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` -} - -func (x *QueryVerifiedTxHashRequest) Reset() { - *x = QueryVerifiedTxHashRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_utxverifier_v1_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryVerifiedTxHashRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryVerifiedTxHashRequest) ProtoMessage() {} - -// Deprecated: Use QueryVerifiedTxHashRequest.ProtoReflect.Descriptor instead. -func (*QueryVerifiedTxHashRequest) Descriptor() ([]byte, []int) { - return file_utxverifier_v1_query_proto_rawDescGZIP(), []int{2} -} - -func (x *QueryVerifiedTxHashRequest) GetChain() string { - if x != nil { - return x.Chain - } - return "" -} - -func (x *QueryVerifiedTxHashRequest) GetTxHash() string { - if x != nil { - return x.TxHash - } - return "" -} - -// QueryVerifiedTxHashResponse is the response type for the Query/VerifiedTxHash RPC method. -type QueryVerifiedTxHashResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // metadata contains full details if the transaction hash is verified. - Metadata *VerifiedTxMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - // found indicates whether the tx was found in the store. - Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` -} - -func (x *QueryVerifiedTxHashResponse) Reset() { - *x = QueryVerifiedTxHashResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_utxverifier_v1_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryVerifiedTxHashResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryVerifiedTxHashResponse) ProtoMessage() {} - -// Deprecated: Use QueryVerifiedTxHashResponse.ProtoReflect.Descriptor instead. -func (*QueryVerifiedTxHashResponse) Descriptor() ([]byte, []int) { - return file_utxverifier_v1_query_proto_rawDescGZIP(), []int{3} -} - -func (x *QueryVerifiedTxHashResponse) GetMetadata() *VerifiedTxMetadata { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *QueryVerifiedTxHashResponse) GetFound() bool { - if x != nil { - return x.Found - } - return false -} - -var File_utxverifier_v1_query_proto protoreflect.FileDescriptor - -var file_utxverifier_v1_query_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x76, 0x31, - 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x75, 0x74, - 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x75, 0x74, 0x78, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x65, 0x72, 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, 0x45, 0x0a, 0x13, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x22, 0x4b, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x73, - 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, - 0x78, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, - 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, - 0x75, 0x6e, 0x64, 0x32, 0xa2, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x71, 0x0a, - 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x75, 0x74, - 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x75, 0x74, 0x78, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0xa5, 0x01, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x78, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x2a, 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, - 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2b, 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x78, - 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x74, - 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x2f, 0x7b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x7d, 0x2f, 0x7b, - 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x7d, 0x42, 0xc0, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, - 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, - 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x2d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2d, 0x6e, - 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x55, 0x74, 0x78, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x55, 0x74, - 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x55, - 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x55, 0x74, 0x78, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_utxverifier_v1_query_proto_rawDescOnce sync.Once - file_utxverifier_v1_query_proto_rawDescData = file_utxverifier_v1_query_proto_rawDesc -) - -func file_utxverifier_v1_query_proto_rawDescGZIP() []byte { - file_utxverifier_v1_query_proto_rawDescOnce.Do(func() { - file_utxverifier_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_utxverifier_v1_query_proto_rawDescData) - }) - return file_utxverifier_v1_query_proto_rawDescData -} - -var file_utxverifier_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_utxverifier_v1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: utxverifier.v1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: utxverifier.v1.QueryParamsResponse - (*QueryVerifiedTxHashRequest)(nil), // 2: utxverifier.v1.QueryVerifiedTxHashRequest - (*QueryVerifiedTxHashResponse)(nil), // 3: utxverifier.v1.QueryVerifiedTxHashResponse - (*Params)(nil), // 4: utxverifier.v1.Params - (*VerifiedTxMetadata)(nil), // 5: utxverifier.v1.VerifiedTxMetadata -} -var file_utxverifier_v1_query_proto_depIdxs = []int32{ - 4, // 0: utxverifier.v1.QueryParamsResponse.params:type_name -> utxverifier.v1.Params - 5, // 1: utxverifier.v1.QueryVerifiedTxHashResponse.metadata:type_name -> utxverifier.v1.VerifiedTxMetadata - 0, // 2: utxverifier.v1.Query.Params:input_type -> utxverifier.v1.QueryParamsRequest - 2, // 3: utxverifier.v1.Query.VerifiedTxHash:input_type -> utxverifier.v1.QueryVerifiedTxHashRequest - 1, // 4: utxverifier.v1.Query.Params:output_type -> utxverifier.v1.QueryParamsResponse - 3, // 5: utxverifier.v1.Query.VerifiedTxHash:output_type -> utxverifier.v1.QueryVerifiedTxHashResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_utxverifier_v1_query_proto_init() } -func file_utxverifier_v1_query_proto_init() { - if File_utxverifier_v1_query_proto != nil { - return - } - file_utxverifier_v1_genesis_proto_init() - file_utxverifier_v1_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_utxverifier_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_utxverifier_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 - } - } - file_utxverifier_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryVerifiedTxHashRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_utxverifier_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryVerifiedTxHashResponse); 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_utxverifier_v1_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_utxverifier_v1_query_proto_goTypes, - DependencyIndexes: file_utxverifier_v1_query_proto_depIdxs, - MessageInfos: file_utxverifier_v1_query_proto_msgTypes, - }.Build() - File_utxverifier_v1_query_proto = out.File - file_utxverifier_v1_query_proto_rawDesc = nil - file_utxverifier_v1_query_proto_goTypes = nil - file_utxverifier_v1_query_proto_depIdxs = nil -} diff --git a/api/utxverifier/v1/query_grpc.pb.go b/api/utxverifier/v1/query_grpc.pb.go deleted file mode 100644 index 9a025c87..00000000 --- a/api/utxverifier/v1/query_grpc.pb.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: utxverifier/v1/query.proto - -package utxverifierv1 - -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 = "/utxverifier.v1.Query/Params" - Query_VerifiedTxHash_FullMethodName = "/utxverifier.v1.Query/VerifiedTxHash" -) - -// 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 all parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // VerifiedTxHash queries if a transaction hash is verified on a specific chain. - VerifiedTxHash(ctx context.Context, in *QueryVerifiedTxHashRequest, opts ...grpc.CallOption) (*QueryVerifiedTxHashResponse, 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 -} - -func (c *queryClient) VerifiedTxHash(ctx context.Context, in *QueryVerifiedTxHashRequest, opts ...grpc.CallOption) (*QueryVerifiedTxHashResponse, error) { - out := new(QueryVerifiedTxHashResponse) - err := c.cc.Invoke(ctx, Query_VerifiedTxHash_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 all parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // VerifiedTxHash queries if a transaction hash is verified on a specific chain. - VerifiedTxHash(context.Context, *QueryVerifiedTxHashRequest) (*QueryVerifiedTxHashResponse, 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) VerifiedTxHash(context.Context, *QueryVerifiedTxHashRequest) (*QueryVerifiedTxHashResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifiedTxHash 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) -} - -func _Query_VerifiedTxHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVerifiedTxHashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).VerifiedTxHash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_VerifiedTxHash_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).VerifiedTxHash(ctx, req.(*QueryVerifiedTxHashRequest)) - } - 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: "utxverifier.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "VerifiedTxHash", - Handler: _Query_VerifiedTxHash_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "utxverifier/v1/query.proto", -} diff --git a/api/utxverifier/v1/tx.pulsar.go b/api/utxverifier/v1/tx.pulsar.go deleted file mode 100644 index d8b470d0..00000000 --- a/api/utxverifier/v1/tx.pulsar.go +++ /dev/null @@ -1,1089 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package utxverifierv1 - -import ( - _ "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_utxverifier_v1_tx_proto_init() - md_MsgUpdateParams = File_utxverifier_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_utxverifier_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 "utxverifier.v1.MsgUpdateParams.authority": - return x.Authority != "" - case "utxverifier.v1.MsgUpdateParams.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.MsgUpdateParams.authority": - x.Authority = "" - case "utxverifier.v1.MsgUpdateParams.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.MsgUpdateParams.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "utxverifier.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: utxverifier.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.MsgUpdateParams.authority": - x.Authority = value.Interface().(string) - case "utxverifier.v1.MsgUpdateParams.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.MsgUpdateParams.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "utxverifier.v1.MsgUpdateParams.authority": - panic(fmt.Errorf("field authority of message utxverifier.v1.MsgUpdateParams is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message utxverifier.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 "utxverifier.v1.MsgUpdateParams.authority": - return protoreflect.ValueOfString("") - case "utxverifier.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: utxverifier.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message utxverifier.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 utxverifier.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_utxverifier_v1_tx_proto_init() - md_MsgUpdateParamsResponse = File_utxverifier_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_utxverifier_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: utxverifier.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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: utxverifier.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message utxverifier.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 utxverifier.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: utxverifier/v1/tx.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // authority is the address of the governance account. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the 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_utxverifier_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_utxverifier_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. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParamsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgUpdateParamsResponse) Reset() { - *x = MsgUpdateParamsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_utxverifier_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_utxverifier_v1_tx_proto_rawDescGZIP(), []int{1} -} - -var File_utxverifier_v1_tx_proto protoreflect.FileDescriptor - -var file_utxverifier_v1_tx_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x76, 0x31, - 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x75, 0x74, 0x78, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 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, 0x1c, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, - 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 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, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x8f, 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, 0x34, 0x0a, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x66, - 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x58, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x72, 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, 0xbd, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x75, - 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, - 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x70, - 0x75, 0x73, 0x68, 0x2d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x76, - 0x31, 0x3b, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x55, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_utxverifier_v1_tx_proto_rawDescOnce sync.Once - file_utxverifier_v1_tx_proto_rawDescData = file_utxverifier_v1_tx_proto_rawDesc -) - -func file_utxverifier_v1_tx_proto_rawDescGZIP() []byte { - file_utxverifier_v1_tx_proto_rawDescOnce.Do(func() { - file_utxverifier_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_utxverifier_v1_tx_proto_rawDescData) - }) - return file_utxverifier_v1_tx_proto_rawDescData -} - -var file_utxverifier_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_utxverifier_v1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: utxverifier.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: utxverifier.v1.MsgUpdateParamsResponse - (*Params)(nil), // 2: utxverifier.v1.Params -} -var file_utxverifier_v1_tx_proto_depIdxs = []int32{ - 2, // 0: utxverifier.v1.MsgUpdateParams.params:type_name -> utxverifier.v1.Params - 0, // 1: utxverifier.v1.Msg.UpdateParams:input_type -> utxverifier.v1.MsgUpdateParams - 1, // 2: utxverifier.v1.Msg.UpdateParams:output_type -> utxverifier.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_utxverifier_v1_tx_proto_init() } -func file_utxverifier_v1_tx_proto_init() { - if File_utxverifier_v1_tx_proto != nil { - return - } - file_utxverifier_v1_genesis_proto_init() - if !protoimpl.UnsafeEnabled { - file_utxverifier_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_utxverifier_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_utxverifier_v1_tx_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_utxverifier_v1_tx_proto_goTypes, - DependencyIndexes: file_utxverifier_v1_tx_proto_depIdxs, - MessageInfos: file_utxverifier_v1_tx_proto_msgTypes, - }.Build() - File_utxverifier_v1_tx_proto = out.File - file_utxverifier_v1_tx_proto_rawDesc = nil - file_utxverifier_v1_tx_proto_goTypes = nil - file_utxverifier_v1_tx_proto_depIdxs = nil -} diff --git a/api/utxverifier/v1/tx_grpc.pb.go b/api/utxverifier/v1/tx_grpc.pb.go deleted file mode 100644 index 77099d78..00000000 --- a/api/utxverifier/v1/tx_grpc.pb.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: utxverifier/v1/tx.proto - -package utxverifierv1 - -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 = "/utxverifier.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 a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, 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 a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: 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: "utxverifier.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "utxverifier/v1/tx.proto", -} diff --git a/api/utxverifier/v1/types.pulsar.go b/api/utxverifier/v1/types.pulsar.go deleted file mode 100644 index 57efe769..00000000 --- a/api/utxverifier/v1/types.pulsar.go +++ /dev/null @@ -1,1391 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package utxverifierv1 - -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_USDValue protoreflect.MessageDescriptor - fd_USDValue_amount protoreflect.FieldDescriptor - fd_USDValue_decimals protoreflect.FieldDescriptor -) - -func init() { - file_utxverifier_v1_types_proto_init() - md_USDValue = File_utxverifier_v1_types_proto.Messages().ByName("USDValue") - fd_USDValue_amount = md_USDValue.Fields().ByName("amount") - fd_USDValue_decimals = md_USDValue.Fields().ByName("decimals") -} - -var _ protoreflect.Message = (*fastReflection_USDValue)(nil) - -type fastReflection_USDValue USDValue - -func (x *USDValue) ProtoReflect() protoreflect.Message { - return (*fastReflection_USDValue)(x) -} - -func (x *USDValue) slowProtoReflect() protoreflect.Message { - mi := &file_utxverifier_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_USDValue_messageType fastReflection_USDValue_messageType -var _ protoreflect.MessageType = fastReflection_USDValue_messageType{} - -type fastReflection_USDValue_messageType struct{} - -func (x fastReflection_USDValue_messageType) Zero() protoreflect.Message { - return (*fastReflection_USDValue)(nil) -} -func (x fastReflection_USDValue_messageType) New() protoreflect.Message { - return new(fastReflection_USDValue) -} -func (x fastReflection_USDValue_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_USDValue -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_USDValue) Descriptor() protoreflect.MessageDescriptor { - return md_USDValue -} - -// 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_USDValue) Type() protoreflect.MessageType { - return _fastReflection_USDValue_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_USDValue) New() protoreflect.Message { - return new(fastReflection_USDValue) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_USDValue) Interface() protoreflect.ProtoMessage { - return (*USDValue)(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_USDValue) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Amount != "" { - value := protoreflect.ValueOfString(x.Amount) - if !f(fd_USDValue_amount, value) { - return - } - } - if x.Decimals != uint32(0) { - value := protoreflect.ValueOfUint32(x.Decimals) - if !f(fd_USDValue_decimals, 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_USDValue) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "utxverifier.v1.USDValue.amount": - return x.Amount != "" - case "utxverifier.v1.USDValue.decimals": - return x.Decimals != uint32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.USDValue")) - } - panic(fmt.Errorf("message utxverifier.v1.USDValue 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_USDValue) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "utxverifier.v1.USDValue.amount": - x.Amount = "" - case "utxverifier.v1.USDValue.decimals": - x.Decimals = uint32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.USDValue")) - } - panic(fmt.Errorf("message utxverifier.v1.USDValue 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_USDValue) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "utxverifier.v1.USDValue.amount": - value := x.Amount - return protoreflect.ValueOfString(value) - case "utxverifier.v1.USDValue.decimals": - value := x.Decimals - return protoreflect.ValueOfUint32(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.USDValue")) - } - panic(fmt.Errorf("message utxverifier.v1.USDValue 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_USDValue) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "utxverifier.v1.USDValue.amount": - x.Amount = value.Interface().(string) - case "utxverifier.v1.USDValue.decimals": - x.Decimals = uint32(value.Uint()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.USDValue")) - } - panic(fmt.Errorf("message utxverifier.v1.USDValue 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_USDValue) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "utxverifier.v1.USDValue.amount": - panic(fmt.Errorf("field amount of message utxverifier.v1.USDValue is not mutable")) - case "utxverifier.v1.USDValue.decimals": - panic(fmt.Errorf("field decimals of message utxverifier.v1.USDValue is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.USDValue")) - } - panic(fmt.Errorf("message utxverifier.v1.USDValue 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_USDValue) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "utxverifier.v1.USDValue.amount": - return protoreflect.ValueOfString("") - case "utxverifier.v1.USDValue.decimals": - return protoreflect.ValueOfUint32(uint32(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.USDValue")) - } - panic(fmt.Errorf("message utxverifier.v1.USDValue 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_USDValue) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in utxverifier.v1.USDValue", 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_USDValue) 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_USDValue) 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_USDValue) 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_USDValue) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*USDValue) - 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.Amount) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Decimals != 0 { - n += 1 + runtime.Sov(uint64(x.Decimals)) - } - 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().(*USDValue) - 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.Decimals != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Decimals)) - i-- - dAtA[i] = 0x10 - } - if len(x.Amount) > 0 { - i -= len(x.Amount) - copy(dAtA[i:], x.Amount) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) - 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().(*USDValue) - 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: USDValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: USDValue: 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 Amount", 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.Amount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - x.Decimals = 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.Decimals |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_VerifiedTxMetadata_2_list)(nil) - -type _VerifiedTxMetadata_2_list struct { - list *[]string -} - -func (x *_VerifiedTxMetadata_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_VerifiedTxMetadata_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_VerifiedTxMetadata_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_VerifiedTxMetadata_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_VerifiedTxMetadata_2_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message VerifiedTxMetadata at list field PayloadHashes as it is not of Message kind")) -} - -func (x *_VerifiedTxMetadata_2_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_VerifiedTxMetadata_2_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_VerifiedTxMetadata_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_VerifiedTxMetadata protoreflect.MessageDescriptor - fd_VerifiedTxMetadata_minted protoreflect.FieldDescriptor - fd_VerifiedTxMetadata_payload_hashes protoreflect.FieldDescriptor - fd_VerifiedTxMetadata_usd_value protoreflect.FieldDescriptor - fd_VerifiedTxMetadata_sender protoreflect.FieldDescriptor -) - -func init() { - file_utxverifier_v1_types_proto_init() - md_VerifiedTxMetadata = File_utxverifier_v1_types_proto.Messages().ByName("VerifiedTxMetadata") - fd_VerifiedTxMetadata_minted = md_VerifiedTxMetadata.Fields().ByName("minted") - fd_VerifiedTxMetadata_payload_hashes = md_VerifiedTxMetadata.Fields().ByName("payload_hashes") - fd_VerifiedTxMetadata_usd_value = md_VerifiedTxMetadata.Fields().ByName("usd_value") - fd_VerifiedTxMetadata_sender = md_VerifiedTxMetadata.Fields().ByName("sender") -} - -var _ protoreflect.Message = (*fastReflection_VerifiedTxMetadata)(nil) - -type fastReflection_VerifiedTxMetadata VerifiedTxMetadata - -func (x *VerifiedTxMetadata) ProtoReflect() protoreflect.Message { - return (*fastReflection_VerifiedTxMetadata)(x) -} - -func (x *VerifiedTxMetadata) slowProtoReflect() protoreflect.Message { - mi := &file_utxverifier_v1_types_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_VerifiedTxMetadata_messageType fastReflection_VerifiedTxMetadata_messageType -var _ protoreflect.MessageType = fastReflection_VerifiedTxMetadata_messageType{} - -type fastReflection_VerifiedTxMetadata_messageType struct{} - -func (x fastReflection_VerifiedTxMetadata_messageType) Zero() protoreflect.Message { - return (*fastReflection_VerifiedTxMetadata)(nil) -} -func (x fastReflection_VerifiedTxMetadata_messageType) New() protoreflect.Message { - return new(fastReflection_VerifiedTxMetadata) -} -func (x fastReflection_VerifiedTxMetadata_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_VerifiedTxMetadata -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_VerifiedTxMetadata) Descriptor() protoreflect.MessageDescriptor { - return md_VerifiedTxMetadata -} - -// 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_VerifiedTxMetadata) Type() protoreflect.MessageType { - return _fastReflection_VerifiedTxMetadata_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_VerifiedTxMetadata) New() protoreflect.Message { - return new(fastReflection_VerifiedTxMetadata) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_VerifiedTxMetadata) Interface() protoreflect.ProtoMessage { - return (*VerifiedTxMetadata)(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_VerifiedTxMetadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Minted != false { - value := protoreflect.ValueOfBool(x.Minted) - if !f(fd_VerifiedTxMetadata_minted, value) { - return - } - } - if len(x.PayloadHashes) != 0 { - value := protoreflect.ValueOfList(&_VerifiedTxMetadata_2_list{list: &x.PayloadHashes}) - if !f(fd_VerifiedTxMetadata_payload_hashes, value) { - return - } - } - if x.UsdValue != nil { - value := protoreflect.ValueOfMessage(x.UsdValue.ProtoReflect()) - if !f(fd_VerifiedTxMetadata_usd_value, value) { - return - } - } - if x.Sender != "" { - value := protoreflect.ValueOfString(x.Sender) - if !f(fd_VerifiedTxMetadata_sender, 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_VerifiedTxMetadata) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "utxverifier.v1.VerifiedTxMetadata.minted": - return x.Minted != false - case "utxverifier.v1.VerifiedTxMetadata.payload_hashes": - return len(x.PayloadHashes) != 0 - case "utxverifier.v1.VerifiedTxMetadata.usd_value": - return x.UsdValue != nil - case "utxverifier.v1.VerifiedTxMetadata.sender": - return x.Sender != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.VerifiedTxMetadata")) - } - panic(fmt.Errorf("message utxverifier.v1.VerifiedTxMetadata 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_VerifiedTxMetadata) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "utxverifier.v1.VerifiedTxMetadata.minted": - x.Minted = false - case "utxverifier.v1.VerifiedTxMetadata.payload_hashes": - x.PayloadHashes = nil - case "utxverifier.v1.VerifiedTxMetadata.usd_value": - x.UsdValue = nil - case "utxverifier.v1.VerifiedTxMetadata.sender": - x.Sender = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.VerifiedTxMetadata")) - } - panic(fmt.Errorf("message utxverifier.v1.VerifiedTxMetadata 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_VerifiedTxMetadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "utxverifier.v1.VerifiedTxMetadata.minted": - value := x.Minted - return protoreflect.ValueOfBool(value) - case "utxverifier.v1.VerifiedTxMetadata.payload_hashes": - if len(x.PayloadHashes) == 0 { - return protoreflect.ValueOfList(&_VerifiedTxMetadata_2_list{}) - } - listValue := &_VerifiedTxMetadata_2_list{list: &x.PayloadHashes} - return protoreflect.ValueOfList(listValue) - case "utxverifier.v1.VerifiedTxMetadata.usd_value": - value := x.UsdValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "utxverifier.v1.VerifiedTxMetadata.sender": - value := x.Sender - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.VerifiedTxMetadata")) - } - panic(fmt.Errorf("message utxverifier.v1.VerifiedTxMetadata 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_VerifiedTxMetadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "utxverifier.v1.VerifiedTxMetadata.minted": - x.Minted = value.Bool() - case "utxverifier.v1.VerifiedTxMetadata.payload_hashes": - lv := value.List() - clv := lv.(*_VerifiedTxMetadata_2_list) - x.PayloadHashes = *clv.list - case "utxverifier.v1.VerifiedTxMetadata.usd_value": - x.UsdValue = value.Message().Interface().(*USDValue) - case "utxverifier.v1.VerifiedTxMetadata.sender": - x.Sender = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.VerifiedTxMetadata")) - } - panic(fmt.Errorf("message utxverifier.v1.VerifiedTxMetadata 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_VerifiedTxMetadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "utxverifier.v1.VerifiedTxMetadata.payload_hashes": - if x.PayloadHashes == nil { - x.PayloadHashes = []string{} - } - value := &_VerifiedTxMetadata_2_list{list: &x.PayloadHashes} - return protoreflect.ValueOfList(value) - case "utxverifier.v1.VerifiedTxMetadata.usd_value": - if x.UsdValue == nil { - x.UsdValue = new(USDValue) - } - return protoreflect.ValueOfMessage(x.UsdValue.ProtoReflect()) - case "utxverifier.v1.VerifiedTxMetadata.minted": - panic(fmt.Errorf("field minted of message utxverifier.v1.VerifiedTxMetadata is not mutable")) - case "utxverifier.v1.VerifiedTxMetadata.sender": - panic(fmt.Errorf("field sender of message utxverifier.v1.VerifiedTxMetadata is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.VerifiedTxMetadata")) - } - panic(fmt.Errorf("message utxverifier.v1.VerifiedTxMetadata 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_VerifiedTxMetadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "utxverifier.v1.VerifiedTxMetadata.minted": - return protoreflect.ValueOfBool(false) - case "utxverifier.v1.VerifiedTxMetadata.payload_hashes": - list := []string{} - return protoreflect.ValueOfList(&_VerifiedTxMetadata_2_list{list: &list}) - case "utxverifier.v1.VerifiedTxMetadata.usd_value": - m := new(USDValue) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "utxverifier.v1.VerifiedTxMetadata.sender": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: utxverifier.v1.VerifiedTxMetadata")) - } - panic(fmt.Errorf("message utxverifier.v1.VerifiedTxMetadata 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_VerifiedTxMetadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in utxverifier.v1.VerifiedTxMetadata", 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_VerifiedTxMetadata) 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_VerifiedTxMetadata) 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_VerifiedTxMetadata) 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_VerifiedTxMetadata) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*VerifiedTxMetadata) - 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.Minted { - n += 2 - } - if len(x.PayloadHashes) > 0 { - for _, s := range x.PayloadHashes { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.UsdValue != nil { - l = options.Size(x.UsdValue) - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Sender) - 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().(*VerifiedTxMetadata) - 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.Sender) > 0 { - i -= len(x.Sender) - copy(dAtA[i:], x.Sender) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) - i-- - dAtA[i] = 0x22 - } - if x.UsdValue != nil { - encoded, err := options.Marshal(x.UsdValue) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - if len(x.PayloadHashes) > 0 { - for iNdEx := len(x.PayloadHashes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.PayloadHashes[iNdEx]) - copy(dAtA[i:], x.PayloadHashes[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PayloadHashes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if x.Minted { - i-- - if x.Minted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - 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().(*VerifiedTxMetadata) - 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: VerifiedTxMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VerifiedTxMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Minted", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Minted = bool(v != 0) - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PayloadHashes", 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.PayloadHashes = append(x.PayloadHashes, 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 UsdValue", 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.UsdValue == nil { - x.UsdValue = &USDValue{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UsdValue); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = 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: utxverifier/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 USDValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Amount string `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` - Decimals uint32 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` -} - -func (x *USDValue) Reset() { - *x = USDValue{} - if protoimpl.UnsafeEnabled { - mi := &file_utxverifier_v1_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *USDValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*USDValue) ProtoMessage() {} - -// Deprecated: Use USDValue.ProtoReflect.Descriptor instead. -func (*USDValue) Descriptor() ([]byte, []int) { - return file_utxverifier_v1_types_proto_rawDescGZIP(), []int{0} -} - -func (x *USDValue) GetAmount() string { - if x != nil { - return x.Amount - } - return "" -} - -func (x *USDValue) GetDecimals() uint32 { - if x != nil { - return x.Decimals - } - return 0 -} - -// VerifiedTxMetadata is a format to store verifiedTxs -type VerifiedTxMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Minted bool `protobuf:"varint,1,opt,name=minted,proto3" json:"minted,omitempty"` // is tokens minted for the tx hash - PayloadHashes []string `protobuf:"bytes,2,rep,name=payload_hashes,json=payloadHashes,proto3" json:"payload_hashes,omitempty"` // payload_hashes emitted in the tx - UsdValue *USDValue `protobuf:"bytes,3,opt,name=usd_value,json=usdValue,proto3" json:"usd_value,omitempty"` // usd value emitted in the tx - Sender string `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"` // sender of the tx -} - -func (x *VerifiedTxMetadata) Reset() { - *x = VerifiedTxMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_utxverifier_v1_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VerifiedTxMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VerifiedTxMetadata) ProtoMessage() {} - -// Deprecated: Use VerifiedTxMetadata.ProtoReflect.Descriptor instead. -func (*VerifiedTxMetadata) Descriptor() ([]byte, []int) { - return file_utxverifier_v1_types_proto_rawDescGZIP(), []int{1} -} - -func (x *VerifiedTxMetadata) GetMinted() bool { - if x != nil { - return x.Minted - } - return false -} - -func (x *VerifiedTxMetadata) GetPayloadHashes() []string { - if x != nil { - return x.PayloadHashes - } - return nil -} - -func (x *VerifiedTxMetadata) GetUsdValue() *USDValue { - if x != nil { - return x.UsdValue - } - return nil -} - -func (x *VerifiedTxMetadata) GetSender() string { - if x != nil { - return x.Sender - } - return "" -} - -var File_utxverifier_v1_types_proto protoreflect.FileDescriptor - -var file_utxverifier_v1_types_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x76, 0x31, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x75, 0x74, - 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x08, 0x55, 0x53, 0x44, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, - 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x63, - 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x54, 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, - 0x6d, 0x69, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6d, 0x69, - 0x6e, 0x74, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x75, - 0x73, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, - 0x55, 0x53, 0x44, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x75, 0x73, 0x64, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0xc0, 0x01, 0x0a, 0x12, 0x63, - 0x6f, 0x6d, 0x2e, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x76, - 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x75, 0x73, 0x68, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x2d, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x55, - 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, - 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x1a, 0x55, 0x74, 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x55, 0x74, - 0x78, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_utxverifier_v1_types_proto_rawDescOnce sync.Once - file_utxverifier_v1_types_proto_rawDescData = file_utxverifier_v1_types_proto_rawDesc -) - -func file_utxverifier_v1_types_proto_rawDescGZIP() []byte { - file_utxverifier_v1_types_proto_rawDescOnce.Do(func() { - file_utxverifier_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_utxverifier_v1_types_proto_rawDescData) - }) - return file_utxverifier_v1_types_proto_rawDescData -} - -var file_utxverifier_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_utxverifier_v1_types_proto_goTypes = []interface{}{ - (*USDValue)(nil), // 0: utxverifier.v1.USDValue - (*VerifiedTxMetadata)(nil), // 1: utxverifier.v1.VerifiedTxMetadata -} -var file_utxverifier_v1_types_proto_depIdxs = []int32{ - 0, // 0: utxverifier.v1.VerifiedTxMetadata.usd_value:type_name -> utxverifier.v1.USDValue - 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_utxverifier_v1_types_proto_init() } -func file_utxverifier_v1_types_proto_init() { - if File_utxverifier_v1_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_utxverifier_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*USDValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_utxverifier_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerifiedTxMetadata); 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_utxverifier_v1_types_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_utxverifier_v1_types_proto_goTypes, - DependencyIndexes: file_utxverifier_v1_types_proto_depIdxs, - MessageInfos: file_utxverifier_v1_types_proto_msgTypes, - }.Build() - File_utxverifier_v1_types_proto = out.File - file_utxverifier_v1_types_proto_rawDesc = nil - file_utxverifier_v1_types_proto_goTypes = nil - file_utxverifier_v1_types_proto_depIdxs = nil -} diff --git a/app/app.go b/app/app.go index 94d3153f..094a876b 100755 --- a/app/app.go +++ b/app/app.go @@ -158,7 +158,6 @@ import ( chainante "github.com/pushchain/push-chain-node/app/ante" usigverifierprecompile "github.com/pushchain/push-chain-node/precompiles/usigverifier" - utxhashverifierprecompile "github.com/pushchain/push-chain-node/precompiles/utxhashverifier" pushtypes "github.com/pushchain/push-chain-node/types" uexecutor "github.com/pushchain/push-chain-node/x/uexecutor" uexecutorkeeper "github.com/pushchain/push-chain-node/x/uexecutor/keeper" @@ -169,9 +168,6 @@ import ( utss "github.com/pushchain/push-chain-node/x/utss" utsskeeper "github.com/pushchain/push-chain-node/x/utss/keeper" utsstypes "github.com/pushchain/push-chain-node/x/utss/types" - utxverifier "github.com/pushchain/push-chain-node/x/utxverifier" - utxverifierkeeper "github.com/pushchain/push-chain-node/x/utxverifier/keeper" - utxverifiertypes "github.com/pushchain/push-chain-node/x/utxverifier/types" uvalidator "github.com/pushchain/push-chain-node/x/uvalidator" uvalidatorkeeper "github.com/pushchain/push-chain-node/x/uvalidator/keeper" uvalidatortypes "github.com/pushchain/push-chain-node/x/uvalidator/types" @@ -319,7 +315,6 @@ type ChainApp struct { ScopedWasmKeeper capabilitykeeper.ScopedKeeper UexecutorKeeper uexecutorkeeper.Keeper - UtxverifierKeeper utxverifierkeeper.Keeper UregistryKeeper uregistrykeeper.Keeper UvalidatorKeeper uvalidatorkeeper.Keeper UtssKeeper utsskeeper.Keeper @@ -434,7 +429,6 @@ func NewChainApp( feemarkettypes.StoreKey, erc20types.StoreKey, uexecutortypes.StoreKey, - utxverifiertypes.StoreKey, uregistrytypes.StoreKey, uvalidatortypes.StoreKey, utsstypes.StoreKey, @@ -732,19 +726,9 @@ func NewChainApp( app.BankKeeper, app.AccountKeeper, app.UregistryKeeper, - &app.UtxverifierKeeper, &app.UvalidatorKeeper, ) - // Create the utxverifier Keeper - app.UtxverifierKeeper = utxverifierkeeper.NewKeeper( - appCodec, - runtime.NewKVStoreService(keys[utxverifiertypes.StoreKey]), - logger, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - app.UregistryKeeper, - ) - // Create the uvalidator Keeper app.UvalidatorKeeper = uvalidatorkeeper.NewKeeper( appCodec, @@ -801,13 +785,6 @@ func NewChainApp( } corePrecompiles[usigverifierPrecompile.Address()] = usigverifierPrecompile - // Add the utxhashverifier precompile for Payload verification (old address: 0xCB) - utxhashverifierPrecompile, err := utxhashverifierprecompile.NewPrecompileWithUtv(&app.UtxverifierKeeper) - if err != nil { - panic(fmt.Errorf("failed to instantiate utxhashverifier precompile: %w", err)) - } - corePrecompiles[utxhashverifierPrecompile.Address()] = utxhashverifierPrecompile - // New address (0xEC..01) — reserved Push precompile range. // Both old and new addresses are registered simultaneously for backward compatibility // with deployed contracts that have old addresses hardcoded in their bytecode. @@ -1053,8 +1030,7 @@ func NewChainApp( vm.NewAppModule(app.EVMKeeper, app.AccountKeeper), feemarket.NewAppModule(app.FeeMarketKeeper), erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper), - uexecutor.NewAppModule(appCodec, app.UexecutorKeeper, app.EVMKeeper, app.FeeMarketKeeper, app.BankKeeper, app.AccountKeeper, app.UregistryKeeper, app.UtxverifierKeeper, app.UvalidatorKeeper), - utxverifier.NewAppModule(appCodec, app.UtxverifierKeeper, app.UregistryKeeper), + uexecutor.NewAppModule(appCodec, app.UexecutorKeeper, app.EVMKeeper, app.FeeMarketKeeper, app.BankKeeper, app.AccountKeeper, app.UregistryKeeper, app.UvalidatorKeeper), uregistry.NewAppModule(appCodec, app.UregistryKeeper, app.EVMKeeper), uvalidator.NewAppModule(appCodec, app.UvalidatorKeeper, app.BankKeeper, app.AccountKeeper, app.DistrKeeper, app.StakingKeeper, app.SlashingKeeper, &app.UtssKeeper), utss.NewAppModule(appCodec, app.UtssKeeper, app.UvalidatorKeeper), @@ -1105,7 +1081,6 @@ func NewChainApp( wasmlctypes.ModuleName, ratelimittypes.ModuleName, uexecutortypes.ModuleName, - utxverifiertypes.ModuleName, uregistrytypes.ModuleName, utsstypes.ModuleName, ) @@ -1128,7 +1103,6 @@ func NewChainApp( wasmlctypes.ModuleName, ratelimittypes.ModuleName, uexecutortypes.ModuleName, - utxverifiertypes.ModuleName, uregistrytypes.ModuleName, uvalidatortypes.ModuleName, utsstypes.ModuleName, @@ -1179,7 +1153,6 @@ func NewChainApp( wasmlctypes.ModuleName, ratelimittypes.ModuleName, uexecutortypes.ModuleName, - utxverifiertypes.ModuleName, uregistrytypes.ModuleName, uvalidatortypes.ModuleName, utsstypes.ModuleName, @@ -1625,7 +1598,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(feemarkettypes.ModuleName) paramsKeeper.Subspace(erc20types.ModuleName) paramsKeeper.Subspace(uexecutortypes.ModuleName) - paramsKeeper.Subspace(utxverifiertypes.ModuleName) paramsKeeper.Subspace(uregistrytypes.ModuleName) paramsKeeper.Subspace(uvalidatortypes.ModuleName) paramsKeeper.Subspace(utsstypes.ModuleName) diff --git a/app/txpolicy/gasless.go b/app/txpolicy/gasless.go index 168fd358..40acd8f1 100644 --- a/app/txpolicy/gasless.go +++ b/app/txpolicy/gasless.go @@ -20,6 +20,7 @@ func IsGaslessTx(tx sdk.Tx) bool { sdk.MsgTypeURL(&uexecutortypes.MsgVoteInbound{}), sdk.MsgTypeURL(&uexecutortypes.MsgVoteOutbound{}), sdk.MsgTypeURL(&utsstypes.MsgVoteTssKeyProcess{}), + sdk.MsgTypeURL(&utsstypes.MsgVoteFundMigration{}), sdk.MsgTypeURL(&uexecutortypes.MsgVoteChainMeta{}), } ) diff --git a/app/upgrades.go b/app/upgrades.go index d174cb1a..d9e6fc8e 100755 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -9,6 +9,7 @@ import ( aiauditfixes "github.com/pushchain/push-chain-node/app/upgrades/ai-audit-fixes" aiauditfixes2 "github.com/pushchain/push-chain-node/app/upgrades/ai-audit-fixes-2" purgeexpiredoutbounds "github.com/pushchain/push-chain-node/app/upgrades/purge-expired-outbounds" + removeutxverifier "github.com/pushchain/push-chain-node/app/upgrades/remove-utxverifier" tssmigration "github.com/pushchain/push-chain-node/app/upgrades/tss-migration" ueamigration "github.com/pushchain/push-chain-node/app/upgrades/uea-migration" ceagasandpayload "github.com/pushchain/push-chain-node/app/upgrades/cea-gas-and-payload" @@ -61,6 +62,7 @@ var Upgrades = []upgrades.Upgrade{ ueamigration.NewUpgrade(), tssmigration.NewUpgrade(), purgeexpiredoutbounds.NewUpgrade(), + removeutxverifier.NewUpgrade(), } // RegisterUpgradeHandlers registers the chain upgrade handlers @@ -83,7 +85,6 @@ func (app *ChainApp) RegisterUpgradeHandlers() { // Module keepers UExecutorKeeper: &app.UexecutorKeeper, - UTxVerifierKeeper: &app.UtxverifierKeeper, URegistryKeeper: &app.UregistryKeeper, UValidatorKeeper: &app.UvalidatorKeeper, UTssKeeper: &app.UtssKeeper, diff --git a/app/upgrades/purge-expired-outbounds/upgrade_test.go b/app/upgrades/purge-expired-outbounds/upgrade_test.go index 99629997..e1a8959d 100644 --- a/app/upgrades/purge-expired-outbounds/upgrade_test.go +++ b/app/upgrades/purge-expired-outbounds/upgrade_test.go @@ -118,7 +118,6 @@ func setupKeepers(t *testing.T) (sdk.Context, *uexecutorkeeper.Keeper, *uvalidat nil, // bankKeeper authkeeper.AccountKeeper{}, nil, // uregistryKeeper - nil, // utxverifierKeeper &vk, ) diff --git a/app/upgrades/remove-utxverifier/upgrade.go b/app/upgrades/remove-utxverifier/upgrade.go new file mode 100644 index 00000000..6bd219cb --- /dev/null +++ b/app/upgrades/remove-utxverifier/upgrade.go @@ -0,0 +1,90 @@ +package removeutxverifier + +import ( + "context" + "fmt" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + "github.com/pushchain/push-chain-node/app/upgrades" +) + +const UpgradeName = "remove-utxverifier" + +func NewUpgrade() upgrades.Upgrade { + return upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{ + Added: []string{}, + Deleted: []string{"utxverifier"}, + }, + } +} + +func CreateUpgradeHandler( + mm upgrades.ModuleManager, + configurator module.Configurator, + ak *upgrades.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + logger := sdkCtx.Logger().With("upgrade", UpgradeName) + logger.Info("Starting upgrade handler") + + // 1. Remove utxverifier module from version map so RunMigrations doesn't try to migrate it. + // The store is deleted via StoreUpgrades.Deleted above. + delete(fromVM, "utxverifier") + + // 2. Run module migrations + versionMap, err := mm.RunMigrations(ctx, configurator, fromVM) + if err != nil { + return nil, fmt.Errorf("RunMigrations: %w", err) + } + + // 3. Deregister utxhashverifier precompile from EVM ActiveStaticPrecompiles + if err := deregisterUtxHashVerifierPrecompile(sdkCtx, ak, logger); err != nil { + return nil, fmt.Errorf("deregisterUtxHashVerifierPrecompile: %w", err) + } + + logger.Info("Upgrade complete") + return versionMap, nil + } +} + +// deregisterUtxHashVerifierPrecompile removes the utxhashverifier precompile address +// from EVM ActiveStaticPrecompiles so the EVM no longer routes calls to it. +func deregisterUtxHashVerifierPrecompile(sdkCtx sdk.Context, ak *upgrades.AppKeepers, logger log.Logger) error { + const utxHashVerifierAddr = "0x00000000000000000000000000000000000000CB" + + evmParams := ak.EVMKeeper.GetParams(sdkCtx) + + filtered := make([]string, 0, len(evmParams.ActiveStaticPrecompiles)) + removed := false + for _, addr := range evmParams.ActiveStaticPrecompiles { + if addr == utxHashVerifierAddr { + removed = true + continue + } + filtered = append(filtered, addr) + } + + if !removed { + logger.Info("utxhashverifier precompile not found in EVM params, skipping") + return nil + } + + evmParams.ActiveStaticPrecompiles = filtered + + if err := ak.EVMKeeper.SetParams(sdkCtx, evmParams); err != nil { + return fmt.Errorf("failed to set EVM params after removing precompile: %w", err) + } + + logger.Info("Deregistered utxhashverifier precompile from EVM params", "address", utxHashVerifierAddr) + return nil +} diff --git a/app/upgrades/types.go b/app/upgrades/types.go index 6755d442..4c3b5317 100755 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -18,7 +18,6 @@ import ( evmkeeper "github.com/cosmos/evm/x/vm/keeper" uexecutorkeeper "github.com/pushchain/push-chain-node/x/uexecutor/keeper" uregistrykeeper "github.com/pushchain/push-chain-node/x/uregistry/keeper" - utxverifierkeeper "github.com/pushchain/push-chain-node/x/utxverifier/keeper" utsskeeper "github.com/pushchain/push-chain-node/x/utss/keeper" uvalidatorkeeper "github.com/pushchain/push-chain-node/x/uvalidator/keeper" ) @@ -35,9 +34,8 @@ type AppKeepers struct { BankKeeper bankkeeper.BaseKeeper // Module keepers - UExecutorKeeper *uexecutorkeeper.Keeper - UTxVerifierKeeper *utxverifierkeeper.Keeper - URegistryKeeper *uregistrykeeper.Keeper + UExecutorKeeper *uexecutorkeeper.Keeper + URegistryKeeper *uregistrykeeper.Keeper UValidatorKeeper *uvalidatorkeeper.Keeper UTssKeeper *utsskeeper.Keeper } diff --git a/precompiles/utxhashverifier/README.md b/precompiles/utxhashverifier/README.md deleted file mode 100644 index 1d07a67d..00000000 --- a/precompiles/utxhashverifier/README.md +++ /dev/null @@ -1,253 +0,0 @@ -# UTxHashVerifier (Universal Tx Hash Verifier) Precompile - -The UTxHashVerifier precompile provides transaction verification functionality for multiple chains, specifically Ethereum and Solana. It verifies that a transaction hash contains an event with a specific payload hash, ensuring cross-chain transaction integrity. - -## Address - -``` -0x00000000000000000000000000000000000000CB -``` - -## Functions - -### `verifyTxHash` - -Verifies that a transaction contains a `FundsAdded` event with the specified payload hash. - -```solidity -function verifyTxHash( - string chainNamespace, - string chainId, - bytes owner, - bytes32 payloadHash, - bytes txHash -) external returns (bool); -``` - -#### Parameters - -- `chainNamespace`: The chain namespace ("eip155" for Ethereum, "solana" for Solana) -- `chainId`: The specific chain ID ("11155111" for Sepolia, "devnet" for Solana devnet) -- `owner`: The owner's address/key as bytes -- `payloadHash`: The expected payload hash as bytes32 -- `txHash`: The transaction hash as bytes (supports both Ethereum hex and Solana base58 formats) - -#### Returns - -- `bool`: `true` if verification succeeds, `false` otherwise - -## Verification Process - -### Architecture Overview - -The UTxHashVerifier precompile delegates verification to the UTxVerifier (Universal Transaction Verification) module for gas efficiency. The verification process involves: - -1. **Chain Detection**: Extracts chain information from chainNamespace parameter -2. **Owner Verification**: Ensures the transaction sender matches the provided owner -3. **Event Parsing**: Extracts payload hash from blockchain events -4. **Hash Comparison**: Compares provided hash with emitted hash -5. **Transaction Hash Processing**: Converts bytes to appropriate string format based on chain type - -### Chain-Specific Implementation - -#### Ethereum (EIP155) -- **RPC Endpoint**: `https://eth-sepolia.public.blastapi.io` -- **Gateway Contract**: `0x28E0F09bE2321c1420Dc60Ee146aACbD68B335Fe` -- **Event Parsing**: Uses `FundsAdded(address,bytes32,(uint256,uint8))` event signature -- **Hash Extraction**: Retrieves transaction hash from event topics[2] -- **txHash Format**: Bytes are converted to hex string format - -#### Solana -- **RPC Endpoint**: `https://api.devnet.solana.com` -- **Gateway Contract**: `3zrWaMknHTRQpZSxY4BvQxw9TStSXiHcmcp3NMPTFkke` -- **Event Parsing**: Decodes base64 "Program data:" logs using binary structure -- **Hash Extraction**: Parses FundsAddedEvent struct at specific byte offsets -- **txHash Format**: Bytes are converted to base58 string format - -### Solana Event Structure - -The Solana verification parses the `FundsAddedEvent` with the following structure: - -```rust -#[event] -pub struct FundsAddedEvent { - pub user: Pubkey, // [8:40] - 32 bytes - pub sol_amount: u64, // [40:48] - 8 bytes - pub usd_equivalent: i128, // [48:64] - 16 bytes - pub usd_exponent: i32, // [64:68] - 4 bytes - pub transaction_hash: [u8; 32], // [68:100] - 32 bytes (target field) -} -``` - -The precompile extracts the `transaction_hash` field from bytes 68-100 of the decoded event data. - -## Usage Examples - -### Ethereum Verification -```bash -cast call 0x00000000000000000000000000000000000000CB \ - "verifyTxHash(string,string,bytes,bytes32,bytes)" \ - "eip155" \ - "11155111" \ - "0x498ad773E5dAd9388268c1477A7df26Bf03114A0" \ - "0xfdb80105de4e3eafa1f1d2c3b7a513752acb21e1ccd19d87ba8e413d670e1e27" \ - "0xc6e1abcfc0898fd9426904336a2a565908ab934b979ddd85a19044ab813a84d4" -``` - -### Solana Verification -```bash -cast call 0x00000000000000000000000000000000000000CB \ - "verifyTxHash(string,string,bytes,bytes32,bytes)" \ - "solana" \ - "EtWTRABZaYq6iMfeYKouRu166VU2xqa1" \ - "0x123f8bdd2850b76cd7d612ba9f5b4a1d05a66e39805048ccd12b7fbef3f69bbc" \ - "0xfdb80105de4e3eafa1f1d2c3b7a513752acb21e1ccd19d87ba8e413d670e1e27" \ - "0xfae0e6094f6af71e3816187c6d137cdee22bb0ae81921a2890c2c9ef466f4b56b99b1cd022d8f9631de1acb463ec8a67b8b2ac5cca717fba57c4e0245093160b" -``` - -## Key Implementation Features - -### 1. Flattened Parameter Structure -- **Direct Parameters**: Uses individual parameters instead of tuple structure -- **Type Safety**: Proper type matching for Solidity contract integration -- **Simplified Encoding**: No complex struct creation required - -### 2. Multi-Format Transaction Hash Support -- **Ethereum**: Expects transaction hash as hex-encoded bytes -- **Solana**: Expects transaction hash as base58-decoded bytes -- **Automatic Conversion**: Precompile converts bytes to appropriate string format based on chain - -### 3. Efficient Architecture -- **Single RPC Call**: Fetches transaction data once and performs all verifications -- **Gas Optimization**: Delegates to UtxverifierKeeper moduledule to avoid expensive precompile operations -- **Error Handling**: Comprehensive error messages for debugging - -### 4. Robust Event Parsing -- **Ethereum**: Uses event signature matching and topic extraction -- **Solana**: Binary parsing of base64-encoded event data with proper struct layout -- **Type Safety**: Validates data lengths and formats before parsing - -## Transaction Hash Format Handling - -### Ethereum -Your contract should convert hex string to bytes: -```solidity -string memory ethTxHash = "0xc6e1abcfc0898fd9426904336a2a565908ab934b979ddd85a19044ab813a84d4"; -bytes memory txHashBytes = hex"c6e1abcfc0898fd9426904336a2a565908ab934b979ddd85a19044ab813a84d4"; -``` - -### Solana -Your contract should convert base58 string to bytes (requires base58 library): -```solidity -string memory solanaTxHash = "61vNSsAFmLAifCKauxUM8bhCJHLkesxszkQNjL9iqRbZ3E9SWVA8r3biz3BjEgZHvykfMivAV5uu83po5Metxg8J"; -bytes memory txHashBytes = base58.decode(solanaTxHash); -``` - -## Contract Integration - -```solidity -struct UniversalAccountId { - string chainNamespace; - string chainId; - bytes owner; -} - -function verifyTransaction( - UniversalAccountId memory id, - bytes32 payloadHash, - bytes memory txHashBytes -) external returns (bool) { - (bool success, bytes memory result) = UTxHashVerifier_PRECOMPILE.staticcall( - abi.encodeWithSignature( - "verifyTxHash(string,string,bytes,bytes32,bytes)", - id.chainNamespace, - id.chainId, - id.owner, - payloadHash, - txHashBytes - ) - ); - - require(success, "Precompile call failed"); - return abi.decode(result, (bool)); -} -``` - -## Error Handling - -The precompile returns `false` and logs detailed error information for: - -- **Invalid Parameters**: Malformed chainNamespace, chainId, or owner format -- **Chain Configuration**: Unsupported chains or missing RPC endpoints -- **Transaction Verification**: Invalid transaction hashes or network errors -- **Owner Mismatch**: Transaction sender doesn't match provided owner -- **Event Parsing**: Missing or malformed FundsAdded events -- **Hash Mismatch**: Provided payload hash doesn't match emitted hash - -## Configuration - -### Supported Chains - -| Chain Namespace | Chain ID | Network | RPC Endpoint | -|----------------|----------|---------|--------------| -| `eip155` | `11155111` | Ethereum Sepolia | `https://eth-sepolia.public.blastapi.io` | -| `solana` | `devnet` | Solana Devnet | `https://api.devnet.solana.com` | - -### Gateway Contracts - -| Chain | Contract Address | -|-------|------------------| -| Ethereum Sepolia | `0x28E0F09bE2321c1420Dc60Ee146aACbD68B335Fe` | -| Solana Devnet | `3zrWaMknHTRQpZSxY4BvQxw9TStSXiHcmcp3NMPTFkke` | - -## Implementation Details - -### Dependencies -- **UtxverifierKeeper moduledule**: Core verification logic and RPC utilities -- **EVM RPC**: Ethereum transaction and receipt fetching -- **SVM RPC**: Solana transaction and log parsing -- **Context Support**: Proper timeout and cancellation handling -- **Base58 Encoding**: For Solana transaction hash conversion - -### Code Structure -``` -precompiles/utxhashverifier/ -├── abi.json # Contract ABI definition -├── utxhashverifier.go # Main precompile logic -├── query.go # VerifyTxHash implementation -├── types.go # Type definitions and interfaces -└── README.md # This documentation -``` - -### Key Functions -- `VerifyTxHash`: Main verification entry point with flattened parameters -- `NewPrecompileWithUtv`: Factory with UTV keeper injection -- `RequiredGas`: Gas cost calculation (4000 gas units) - -## Integration with UtxverifierKeeper moduledule - -The UTxHashVerifier precompile integrates with the UtxVerifier (Universal Transaction Verification) module: - -```go -// UtxverifierKeeper moduledule provides the core verification logic -func (k Keeper) VerifyTxHashWithPayload( - ctx context.Context, - universalAccountId UniversalAccount, - payloadHash, txHash string -) (bool, error) -``` - -This delegation ensures: -- **Gas Efficiency**: Expensive operations run in native Go code -- **Code Reuse**: Shared verification logic across modules -- **Maintainability**: Centralized chain configuration and RPC handling - -## Testing - -The precompile can be tested using: - -1. **Unit Tests**: Verify ABI encoding/decoding and input validation -2. **Integration Tests**: Test with real blockchain transactions -3. **Cast Commands**: Direct precompile calls for manual testing - -Example test transaction hashes are provided in the usage examples above for both Ethereum and Solana networks. \ No newline at end of file diff --git a/precompiles/utxhashverifier/UTxHashVerifier.sol b/precompiles/utxhashverifier/UTxHashVerifier.sol deleted file mode 100644 index fe3c6b3d..00000000 --- a/precompiles/utxhashverifier/UTxHashVerifier.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.18; - -/// @dev The UTxHashVerifier contract's address. -address constant UTxHashVerifier_PRECOMPILE_ADDRESS = 0x00000000000000000000000000000000000000CB; - -/// @dev The IUTxHashVerifier contract's instance. -IUTxHashVerifier constant UTxHashVerifier_CONTRACT = IUTxHashVerifier(UTxHashVerifier_PRECOMPILE_ADDRESS); - -/// @dev The IUTxHashVerifier contract's interface. -interface IUTxHashVerifier { - /// @notice Verifies whether a transaction hash is valid using a UniversalPayload scheme. - /// @dev This function compares the transaction hash against the passed payload hash and verifies the owner on the specified chain. - /// @param chainNamespace The namespace of the chain (e.g., "eip155", "solana") where the transaction was executed. - /// @param chainId The chainId of the chain where the transaction was executed. - /// @param owner The bytes owner key that is expected to have signed or authorized the transaction. - /// @param payloadHash The hash of the expected universal payload parameters. - /// @param txHash The transaction hash to be verified. - /// @return isValid A boolean indicating whether the transaction hash is valid and correctly signed by the owner. - function verifyTxHash( - string calldata chainNamespace, - string calldata chainId, - bytes calldata owner, - bytes32 payloadHash, - bytes calldata txHash - ) external returns (bool); -} diff --git a/precompiles/utxhashverifier/abi.json b/precompiles/utxhashverifier/abi.json deleted file mode 100644 index ed138e1a..00000000 --- a/precompiles/utxhashverifier/abi.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "UTxHashVerifier", - "sourceName": "precompiles/UTxHashVerifier.sol", - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {}, - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "chainNamespace", - "type": "string" - }, - { - "internalType": "string", - "name": "chainId", - "type": "string" - }, - { - "internalType": "bytes", - "name": "owner", - "type": "bytes" - }, - { - "internalType": "bytes32", - "name": "payloadHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "txHash", - "type": "bytes" - } - ], - "name": "verifyTxHash", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ] -} \ No newline at end of file diff --git a/precompiles/utxhashverifier/query.go b/precompiles/utxhashverifier/query.go deleted file mode 100644 index 8deebe80..00000000 --- a/precompiles/utxhashverifier/query.go +++ /dev/null @@ -1,93 +0,0 @@ -package utxhashverifier - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ethereum/go-ethereum/accounts/abi" - uexecutortypes "github.com/pushchain/push-chain-node/x/uexecutor/types" -) - -const VerifyTxHashMethod = "verifyTxHash" - -func (p Precompile) VerifyTxHash( - ctx sdk.Context, - method *abi.Method, - args []interface{}, -) ([]byte, error) { - if len(args) != 5 { - return nil, fmt.Errorf("expected 5 args, got %d", len(args)) - } - - // Parse individual parameters - chainNamespace, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("invalid chainNamespace type: expected string, got %T", args[0]) - } - - chainId, ok := args[1].(string) - if !ok { - return nil, fmt.Errorf("invalid chainId type: expected string, got %T", args[1]) - } - - owner, ok := args[2].([]byte) - if !ok { - return nil, fmt.Errorf("invalid owner type: expected []byte, got %T", args[2]) - } - - // Parse payloadHash as bytes32 (will be [32]byte) - payloadHashBytes32, ok := args[3].([32]byte) - if !ok { - return nil, fmt.Errorf("invalid payloadHash type: expected [32]byte, got %T", args[3]) - } - - // Parse txHash as bytes - txHashBytes, ok := args[4].([]byte) - if !ok { - return nil, fmt.Errorf("invalid txHash type: expected []byte, got %T", args[4]) - } - - // Convert bytes32 to hex string - payloadHash := fmt.Sprintf("0x%x", payloadHashBytes32[:]) - ownerHex := fmt.Sprintf("0x%x", owner) - txHash := fmt.Sprintf("0x%x", txHashBytes) - - fmt.Printf("[UTxHashVerifier] VerifyTxHash called with chainNamespace=%s, chainId=%s, owner=%s, payloadHash=%s, txHash=%s\n", - chainNamespace, chainId, ownerHex, payloadHash, txHash) - - fmt.Printf("[UTxHashVerifier] Delegating verification to UtxverifierKeeper moduledule for gas efficiency\n") - - // Convert to Uexecutor module format - universalAccountId := uexecutortypes.UniversalAccountId{ - ChainNamespace: chainNamespace, - ChainId: chainId, - Owner: ownerHex, - } - - // Build full chain caip2: "namespace:chain" - chainCaip2 := fmt.Sprintf("%s:%s", universalAccountId.ChainNamespace, universalAccountId.ChainId) - - // Delegate all verification to UtxverifierKeeper moduledule (much more gas efficient) - verifiedPayload, err := p.utxverifierKeeper.VerifyAndGetPayloadHash(ctx, universalAccountId.Owner, txHash, chainCaip2) - if err != nil { - fmt.Printf("[UTxHashVerifier] Verification failed: %v\n", err) - return method.Outputs.Pack(false) - } - - matched := false - for _, ph := range verifiedPayload { - if ph == payloadHash { - matched = true - break - } - } - - if !matched { - fmt.Printf("[UTxHashVerifier] Payload mismatch: expected %s, got %v\n", payloadHash, verifiedPayload) - return method.Outputs.Pack(false) - } - - fmt.Printf("[UTxHashVerifier] ✅ Verification successful via UtxverifierKeeper moduledule\n") - - return method.Outputs.Pack(true) -} diff --git a/precompiles/utxhashverifier/types.go b/precompiles/utxhashverifier/types.go deleted file mode 100644 index df7a316f..00000000 --- a/precompiles/utxhashverifier/types.go +++ /dev/null @@ -1,10 +0,0 @@ -package utxhashverifier - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// UtxverifierKeeper defines the expected interface for the Utxverifier keeper -type UtxverifierKeeper interface { - VerifyAndGetPayloadHash(ctx sdk.Context, ownerKey, txHash, chain string) ([]string, error) -} diff --git a/precompiles/utxhashverifier/utxhashverifier.go b/precompiles/utxhashverifier/utxhashverifier.go deleted file mode 100644 index a367a75b..00000000 --- a/precompiles/utxhashverifier/utxhashverifier.go +++ /dev/null @@ -1,124 +0,0 @@ -package utxhashverifier - -import ( - "embed" - "fmt" - - storetypes "cosmossdk.io/store/types" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm" - - cmn "github.com/cosmos/evm/precompiles/common" -) - -const ( - UTxHashVerifierPrecompileAddress = "0x00000000000000000000000000000000000000CB" - // VerifyTxHashGas is the gas cost for verifying transaction hash. - VerifyTxHashGas uint64 = 4000 -) - -var _ vm.PrecompiledContract = &Precompile{} - -// Embed abi json file to the executable binary. Needed when importing as dependency. -// -//go:embed abi.json -var f embed.FS - -// Precompile defines the precompile -type Precompile struct { - cmn.Precompile - utxverifierKeeper UtxverifierKeeper -} - -// return address of the precompile -func GetAddress() common.Address { - return common.HexToAddress(UTxHashVerifierPrecompileAddress) -} - -func NewPrecompile() (*Precompile, error) { - utxhashverifierABI, err := cmn.LoadABI(f, "abi.json") - - if err != nil { - return nil, err - } - - p := &Precompile{ - Precompile: cmn.Precompile{ - ABI: utxhashverifierABI, - KvGasConfig: storetypes.KVGasConfig(), - TransientKVGasConfig: storetypes.TransientGasConfig(), - }, - } - - p.SetAddress(GetAddress()) - - return p, nil -} - -// NewPrecompileWithUtv creates a new UTxHashVerifier precompile with Utxverifier keeper dependency -func NewPrecompileWithUtv(utxverifierKeeper UtxverifierKeeper) (*Precompile, error) { - p, err := NewPrecompile() - if err != nil { - return nil, err - } - - p.utxverifierKeeper = utxverifierKeeper - return p, nil -} - -func (p Precompile) RequiredGas(input []byte) uint64 { - // NOTE: This check avoid panicking when trying to decode the method ID - if len(input) < 4 { - return 0 - } - - methodID := input[:4] - method, err := p.MethodById(methodID) - if err != nil { - return 0 - } - - switch method.Name { - case VerifyTxHashMethod: - return VerifyTxHashGas - default: - return p.Precompile.RequiredGas(input, p.IsTransaction(method)) - } -} - -func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz []byte, err error) { - ctx, stateDB, snapshot, method, initialGas, args, err := p.RunSetup(evm, contract, readOnly, p.IsTransaction) - if err != nil { - return nil, err - } - - // This handles any out of gas errors that may occur during the execution of a precompile tx or query. - // It avoids panics and returns the out of gas error so the EVM can continue gracefully. - defer cmn.HandleGasError(ctx, contract, initialGas, &err, stateDB, snapshot)() - - switch method.Name { - case VerifyTxHashMethod: - fmt.Println("VerifyTxHashMethod called") - bz, err = p.VerifyTxHash(ctx, method, args) - default: - return nil, fmt.Errorf(cmn.ErrUnknownMethod, method.Name) - } - - if err != nil { - return nil, err - } - - cost := ctx.GasMeter().GasConsumed() - initialGas - - if !contract.UseGas(cost) { - return nil, vm.ErrOutOfGas - } - - return bz, nil -} - -// IsTransaction checks if the given method name corresponds to a transaction or query. -func (Precompile) IsTransaction(method *abi.Method) bool { - return false // default is false as there are no txs in this precompile -} diff --git a/proto/utxverifier/module/v1/module.proto b/proto/utxverifier/module/v1/module.proto deleted file mode 100755 index 57b53b1a..00000000 --- a/proto/utxverifier/module/v1/module.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -package utxverifier.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the app config object of the module. -// Learn more: https://docs.cosmos.network/main/building-modules/depinject -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import : "github.com/pushchain/push-chain-node" - }; -} \ No newline at end of file diff --git a/proto/utxverifier/v1/genesis.proto b/proto/utxverifier/v1/genesis.proto deleted file mode 100755 index ceb40665..00000000 --- a/proto/utxverifier/v1/genesis.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package utxverifier.v1; - -import "gogoproto/gogo.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/pushchain/push-chain-node/x/utxverifier/types"; - -// GenesisState defines the module genesis state -message GenesisState { - // Params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// Params defines the set of module parameters. -message Params { - option (amino.name) = "utxverifier/params"; - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - bool some_value = 2; -} \ No newline at end of file diff --git a/proto/utxverifier/v1/query.proto b/proto/utxverifier/v1/query.proto deleted file mode 100755 index 4d6b521d..00000000 --- a/proto/utxverifier/v1/query.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; -package utxverifier.v1; - -import "google/api/annotations.proto"; -import "utxverifier/v1/genesis.proto"; -import "utxverifier/v1/types.proto"; - -option go_package = "github.com/pushchain/push-chain-node/x/utxverifier/types"; - -// Query provides defines the gRPC querier service. -service Query { - // Params queries all parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/utxverifier/v1/params"; - } - - // VerifiedTxHash queries if a transaction hash is verified on a specific chain. - rpc VerifiedTxHash(QueryVerifiedTxHashRequest) returns (QueryVerifiedTxHashResponse) { - option (google.api.http).get = "/utxverifier/v1/verified_tx_hash/{chain}/{tx_hash}"; - } -} - -// 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; -} - -// QueryVerifiedTxHashRequest is the request type for querying if a transaction hash is verified. -message QueryVerifiedTxHashRequest { - // chain is the identifier of the chain to query. - string chain = 1; - - // hash is the hash of the transaction to query. - string tx_hash = 2; -} - -// QueryVerifiedTxHashResponse is the response type for the Query/VerifiedTxHash RPC method. -message QueryVerifiedTxHashResponse { - // metadata contains full details if the transaction hash is verified. - VerifiedTxMetadata metadata = 1; - - // found indicates whether the tx was found in the store. - bool found = 2; -} \ No newline at end of file diff --git a/proto/utxverifier/v1/tx.proto b/proto/utxverifier/v1/tx.proto deleted file mode 100755 index 061684fa..00000000 --- a/proto/utxverifier/v1/tx.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; -package utxverifier.v1; - -import "cosmos/msg/v1/msg.proto"; -import "utxverifier/v1/genesis.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/pushchain/push-chain-node/x/utxverifier/types"; - -// Msg defines the Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - - // authority is the address of the governance account. - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {} diff --git a/proto/utxverifier/v1/types.proto b/proto/utxverifier/v1/types.proto deleted file mode 100644 index 5aefa236..00000000 --- a/proto/utxverifier/v1/types.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; -package utxverifier.v1; - -import "gogoproto/gogo.proto"; -import "amino/amino.proto"; - -option go_package = "github.com/pushchain/push-chain-node/x/utxverifier/types"; - -message USDValue { - string amount = 1; - uint32 decimals = 2; -} - -// VerifiedTxMetadata is a format to store verifiedTxs -message VerifiedTxMetadata { - bool minted = 1; // is tokens minted for the tx hash - repeated string payload_hashes = 2; // payload_hashes emitted in the tx - USDValue usd_value = 3; // usd value emitted in the tx - string sender = 4; // sender of the tx -} diff --git a/test/integration/uexecutor/execute_inbound_gas_test.go b/test/integration/uexecutor/execute_inbound_gas_test.go index a7fce207..67b82107 100644 --- a/test/integration/uexecutor/execute_inbound_gas_test.go +++ b/test/integration/uexecutor/execute_inbound_gas_test.go @@ -293,6 +293,11 @@ func TestInboundGas(t *testing.T) { "revert outbound asset must match inbound asset") require.Equal(t, uexecutortypes.Status_PENDING, ob.OutboundStatus, "revert outbound should start in PENDING status") + + // Gas fields are populated from UniversalCore if chain meta is set. + // In test env without VoteChainMeta, they may be zero/empty — that's OK, + // the outbound is still created (graceful degradation). + // When chain meta IS set, these will be populated. break } } diff --git a/test/integration/uexecutor/inbound_cea_gas_and_payload_test.go b/test/integration/uexecutor/inbound_cea_gas_and_payload_test.go index 887d3dbf..ef87ceeb 100644 --- a/test/integration/uexecutor/inbound_cea_gas_and_payload_test.go +++ b/test/integration/uexecutor/inbound_cea_gas_and_payload_test.go @@ -492,8 +492,6 @@ func TestInboundCEAGasAndPayload(t *testing.T) { chainApp, ctx, vals, _, coreVals, ueaAddrHex := setupInboundCEAGasAndPayloadTest(t, 4) usdcAddress := utils.GetDefaultAddresses().ExternalUSDCAddr prc20Address := utils.GetDefaultAddresses().PRC20USDCAddr - testAddress := utils.GetDefaultAddresses().DefaultTestAddr - // Register a second chain (eip155:97) so we can send a CEA inbound from a different chain chainApp.UregistryKeeper.AddChainConfig(ctx, &uregistrytypes.ChainConfig{ Chain: "eip155:97", @@ -566,22 +564,5 @@ func TestInboundCEAGasAndPayload(t *testing.T) { require.NoError(t, err) } - // Payload hash should be stored under UEA origin chain (eip155:11155111), NOT source chain (eip155:97) - ueaOriginChain := "eip155:11155111" - verified, found, err := chainApp.UtxverifierKeeper.GetVerifiedInboundTxMetadata(ctx, ueaOriginChain, ceaInbound.TxHash) - require.NoError(t, err) - require.True(t, found, "verified tx metadata should be stored under UEA origin chain") - require.NotEmpty(t, verified.PayloadHashes, "payload hashes should be stored") - - // Should NOT be found under source chain - _, foundUnderSource, err := chainApp.UtxverifierKeeper.GetVerifiedInboundTxMetadata(ctx, ceaInbound.SourceChain, ceaInbound.TxHash) - require.NoError(t, err) - require.False(t, foundUnderSource, "verified tx metadata should NOT be stored under inbound source chain for CEA") - - // The sender should be the UEA owner (testAddress), NOT personBSender - require.NotEqual(t, personBSender, verified.Sender, - "stored sender should NOT be the CEA executor") - require.Equal(t, common.HexToAddress(testAddress).Hex(), common.HexToAddress(verified.Sender).Hex(), - "stored sender should be the UEA owner for CEA inbounds") }) } diff --git a/test/integration/uexecutor/inbound_cea_payload_test.go b/test/integration/uexecutor/inbound_cea_payload_test.go index 07e0b534..b0ad0ae7 100644 --- a/test/integration/uexecutor/inbound_cea_payload_test.go +++ b/test/integration/uexecutor/inbound_cea_payload_test.go @@ -720,8 +720,6 @@ func TestInboundCEAFundsAndPayload(t *testing.T) { chainApp, ctx, vals, _, coreVals, ueaAddrHex := setupInboundCEAPayloadTest(t, 4) usdcAddress := utils.GetDefaultAddresses().ExternalUSDCAddr prc20Address := utils.GetDefaultAddresses().PRC20USDCAddr - testAddress := utils.GetDefaultAddresses().DefaultTestAddr - // Register a second chain (eip155:97) so we can send a CEA inbound from a different chain chainApp.UregistryKeeper.AddChainConfig(ctx, &uregistrytypes.ChainConfig{ Chain: "eip155:97", @@ -794,22 +792,5 @@ func TestInboundCEAFundsAndPayload(t *testing.T) { require.NoError(t, err) } - // Payload hash should be stored under UEA origin chain (eip155:11155111), NOT source chain (eip155:97) - ueaOriginChain := "eip155:11155111" - verified, found, err := chainApp.UtxverifierKeeper.GetVerifiedInboundTxMetadata(ctx, ueaOriginChain, ceaInbound.TxHash) - require.NoError(t, err) - require.True(t, found, "verified tx metadata should be stored under UEA origin chain") - require.NotEmpty(t, verified.PayloadHashes, "payload hashes should be stored") - - // Should NOT be found under source chain - _, foundUnderSource, err := chainApp.UtxverifierKeeper.GetVerifiedInboundTxMetadata(ctx, ceaInbound.SourceChain, ceaInbound.TxHash) - require.NoError(t, err) - require.False(t, foundUnderSource, "verified tx metadata should NOT be stored under inbound source chain for CEA") - - // The sender should be the UEA owner (testAddress), NOT personBSender - require.NotEqual(t, personBSender, verified.Sender, - "stored sender should NOT be the CEA executor") - require.Equal(t, common.HexToAddress(testAddress).Hex(), common.HexToAddress(verified.Sender).Hex(), - "stored sender should be the UEA owner for CEA inbounds") }) } diff --git a/test/integration/uexecutor/inbound_synthetic_bridge_payload_test.go b/test/integration/uexecutor/inbound_synthetic_bridge_payload_test.go index ae9b1a52..ae92c1d7 100644 --- a/test/integration/uexecutor/inbound_synthetic_bridge_payload_test.go +++ b/test/integration/uexecutor/inbound_synthetic_bridge_payload_test.go @@ -296,36 +296,4 @@ func TestInboundSyntheticBridgePayload(t *testing.T) { require.NoError(t, err) }) - t.Run("payload hash stored correctly before payload execution", func(t *testing.T) { - app, ctx, vals, inbound, coreVals, ueaAddrHex := setupInboundBridgePayloadTest(t, 4) - - // Reach quorum - for i := 0; i < 3; i++ { - valAddr, err := sdk.ValAddressFromBech32(coreVals[i].OperatorAddress) - require.NoError(t, err) - coreValAcc := sdk.AccAddress(valAddr).String() - - err = utils.ExecVoteInbound(t, ctx, app, vals[i], coreValAcc, inbound) - require.NoError(t, err) - } - - // Get the universal tx - utxKey := uexecutortypes.GetInboundUniversalTxKey(*inbound) - utx, found, err := app.UexecutorKeeper.GetUniversalTx(ctx, utxKey) - require.NoError(t, err) - require.True(t, found) - - // Call your function to compute and store payload hash - ueModuleAddr, _ := app.UexecutorKeeper.GetUeModuleAddress(ctx) - err = app.UexecutorKeeper.StoreVerifiedPayloadHash(ctx, utx, ueaAddrHex, ueModuleAddr, utx.InboundTx.Sender, utx.InboundTx.SourceChain) - require.NoError(t, err) - - // Verify payload hash stored in utxverifier - verified, found, err := app.UtxverifierKeeper.GetVerifiedInboundTxMetadata(ctx, inbound.SourceChain, inbound.TxHash) - require.NoError(t, err) - fmt.Println(verified) - require.True(t, found) - require.Len(t, verified.PayloadHashes, 1) - require.Equal(t, inbound.Sender, verified.Sender) - }) } diff --git a/test/integration/utss/fund_migration_test.go b/test/integration/utss/fund_migration_test.go index c26f53bb..f0019708 100644 --- a/test/integration/utss/fund_migration_test.go +++ b/test/integration/utss/fund_migration_test.go @@ -155,29 +155,6 @@ func TestInitiateFundMigration(t *testing.T) { require.ErrorContains(t, err, "not found in TssKeyHistory") }) - t.Run("Fails if old key was not from keygen", func(t *testing.T) { - app, ctx, universalVals, _ := setupFundMigrationTest(t, 3, false) - - // Initiate a refresh process and finalize it - err := app.UtssKeeper.InitiateTssKeyProcess(ctx, utsstypes.TssProcessType_TSS_PROCESS_REFRESH) - require.NoError(t, err) - - refreshKeyId := "refresh-key-1" - refreshPubkey := "refresh-pubkey-1" - - process, err := app.UtssKeeper.CurrentTssProcess.Get(ctx) - require.NoError(t, err) - - for _, val := range universalVals { - valAddr, _ := sdk.ValAddressFromBech32(val) - _ = app.UtssKeeper.VoteTssKeyProcess(ctx, valAddr, refreshPubkey, refreshKeyId, process.Id) - } - - // Try to migrate from the refresh key — should fail - _, err = app.UtssKeeper.InitiateFundMigration(ctx, refreshKeyId, testChain) - require.ErrorContains(t, err, "not keygen") - }) - t.Run("Fails if old key is the current key", func(t *testing.T) { app, ctx, _, _ := setupFundMigrationTest(t, 3, false) diff --git a/x/uexecutor/depinject.go b/x/uexecutor/depinject.go index 1d35ec00..69f832cf 100755 --- a/x/uexecutor/depinject.go +++ b/x/uexecutor/depinject.go @@ -49,9 +49,8 @@ type ModuleInputs struct { FeeMarketKeeper types.FeeMarketKeeper BankKeeper types.BankKeeper AccountKeeper types.AccountKeeper - UregistryKeeper types.UregistryKeeper - UtxverifierKeeper types.UtxverifierKeeper - UvalidatorKeeper types.UValidatorKeeper + UregistryKeeper types.UregistryKeeper + UvalidatorKeeper types.UValidatorKeeper } type ModuleOutputs struct { @@ -64,8 +63,8 @@ type ModuleOutputs struct { func ProvideModule(in ModuleInputs) ModuleOutputs { govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() - k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.EVMKeeper, in.FeeMarketKeeper, in.BankKeeper, in.AccountKeeper, in.UregistryKeeper, in.UtxverifierKeeper, in.UvalidatorKeeper) - m := NewAppModule(in.Cdc, k, in.EVMKeeper, in.FeeMarketKeeper, in.BankKeeper, in.AccountKeeper, in.UregistryKeeper, in.UtxverifierKeeper, in.UvalidatorKeeper) + k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.EVMKeeper, in.FeeMarketKeeper, in.BankKeeper, in.AccountKeeper, in.UregistryKeeper, in.UvalidatorKeeper) + m := NewAppModule(in.Cdc, k, in.EVMKeeper, in.FeeMarketKeeper, in.BankKeeper, in.AccountKeeper, in.UregistryKeeper, in.UvalidatorKeeper) return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}} } diff --git a/x/uexecutor/keeper/build_revert_outbound.go b/x/uexecutor/keeper/build_revert_outbound.go new file mode 100644 index 00000000..d7a81cf9 --- /dev/null +++ b/x/uexecutor/keeper/build_revert_outbound.go @@ -0,0 +1,56 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/pushchain/push-chain-node/x/uexecutor/types" +) + +// buildRevertOutbound creates an INBOUND_REVERT outbound with gas fields populated +// from the UniversalCore contract via getOutboundTxGasAndFees. +func (k Keeper) buildRevertOutbound(sdkCtx sdk.Context, inbound *types.Inbound) *types.OutboundTx { + recipient := inbound.Sender + if inbound.RevertInstructions != nil && inbound.RevertInstructions.FundRecipient != "" { + recipient = inbound.RevertInstructions.FundRecipient + } + + outbound := &types.OutboundTx{ + DestinationChain: inbound.SourceChain, + Recipient: recipient, + Amount: inbound.Amount, + ExternalAssetAddr: inbound.AssetAddr, + Sender: inbound.Sender, + TxType: types.TxType_INBOUND_REVERT, + OutboundStatus: types.Status_PENDING, + Id: types.GetOutboundRevertId(inbound.SourceChain, inbound.TxHash), + } + + // Look up the PRC20 address for this external token + tokenCfg, err := k.uregistryKeeper.GetTokenConfig(sdkCtx, inbound.SourceChain, inbound.AssetAddr) + if err != nil || tokenCfg.NativeRepresentation == nil || tokenCfg.NativeRepresentation.ContractAddress == "" { + k.Logger().Warn("failed to get PRC20 for revert outbound gas lookup, proceeding without gas fields", + "chain", inbound.SourceChain, + "asset", inbound.AssetAddr, + "error", err, + ) + return outbound + } + + // Fetch gas fields from UniversalCore.getOutboundTxGasAndFees(prc20, 0) + // 0 means use the contract's baseLimit for this chain + gasToken, gasFee, gasPrice, gasLimit, err := k.GetGasFeeInfoForRevertOutbound(sdkCtx, tokenCfg.NativeRepresentation.ContractAddress) + if err != nil { + k.Logger().Warn("failed to fetch gas fee info for revert outbound, proceeding without gas fields", + "chain", inbound.SourceChain, + "prc20", tokenCfg.NativeRepresentation.ContractAddress, + "error", err, + ) + return outbound + } + + outbound.GasToken = gasToken + outbound.GasFee = gasFee + outbound.GasPrice = gasPrice + outbound.GasLimit = gasLimit + + return outbound +} diff --git a/x/uexecutor/keeper/execute_inbound_funds.go b/x/uexecutor/keeper/execute_inbound_funds.go index 0f2a996b..fa3901ef 100644 --- a/x/uexecutor/keeper/execute_inbound_funds.go +++ b/x/uexecutor/keeper/execute_inbound_funds.go @@ -74,22 +74,8 @@ func (k Keeper) ExecuteInboundFunds(ctx context.Context, utx types.UniversalTx) // isCEA failures never create an INBOUND_REVERT outbound // (consistent with execute_inbound_funds_and_payload.go and execute_inbound_gas_and_payload.go) if err != nil && !inbound.IsCEA { - revertOutbound := types.OutboundTx{ - DestinationChain: inbound.SourceChain, - Recipient: func() string { - if inbound.RevertInstructions != nil && inbound.RevertInstructions.FundRecipient != "" { - return inbound.RevertInstructions.FundRecipient - } - return inbound.Sender - }(), - Amount: inbound.Amount, - ExternalAssetAddr: inbound.AssetAddr, - Sender: inbound.Sender, - TxType: types.TxType_INBOUND_REVERT, - OutboundStatus: types.Status_PENDING, - Id: types.GetOutboundRevertId(inbound.SourceChain, inbound.TxHash), - } - if attachErr := k.attachOutboundsToUtx(sdkCtx, utx.Id, []*types.OutboundTx{&revertOutbound}, err.Error()); attachErr != nil { + revertOutbound := k.buildRevertOutbound(sdkCtx, inbound) + if attachErr := k.attachOutboundsToUtx(sdkCtx, utx.Id, []*types.OutboundTx{revertOutbound}, err.Error()); attachErr != nil { if storeErr := k.UpdateUniversalTx(sdkCtx, utx.Id, func(u *types.UniversalTx) error { u.RevertError = attachErr.Error() return nil diff --git a/x/uexecutor/keeper/execute_inbound_funds_and_payload.go b/x/uexecutor/keeper/execute_inbound_funds_and_payload.go index e2f42070..0073d6d1 100644 --- a/x/uexecutor/keeper/execute_inbound_funds_and_payload.go +++ b/x/uexecutor/keeper/execute_inbound_funds_and_payload.go @@ -45,9 +45,6 @@ func (k Keeper) ExecuteInboundFundsAndPayload(ctx context.Context, utx types.Uni var receipt *evmtypes.MsgEthereumTxResponse var ueaAddr common.Address var isSmartContract bool - payloadSender := utx.InboundTx.Sender // default: inbound sender; overridden to UEA owner for CEA - payloadChain := utx.InboundTx.SourceChain // default: inbound source chain; overridden to UEA origin chain for CEA - // Parse amount to check for zero-amount path // Amount is already validated in ValidateForExecution before reaching here inboundAmount := new(big.Int) @@ -64,13 +61,10 @@ func (k Keeper) ExecuteInboundFundsAndPayload(ctx context.Context, utx types.Uni } else { ueaAddr = common.HexToAddress(utx.InboundTx.Recipient) - origin, isUEA, ueaCheckErr := k.CallFactoryGetOriginForUEA(sdkCtx, ueModuleAccAddress, factoryAddress, ueaAddr) + _, isUEA, ueaCheckErr := k.CallFactoryGetOriginForUEA(sdkCtx, ueModuleAccAddress, factoryAddress, ueaAddr) if ueaCheckErr != nil { execErr = fmt.Errorf("failed to verify UEA: %w", ueaCheckErr) } else if isUEA { - // Use UEA owner and origin chain for payload hash verification - payloadSender = origin.Owner - payloadChain = fmt.Sprintf("%s:%s", origin.ChainNamespace, origin.ChainId) // UEA path: deposit PRC20 into the UEA (if amount > 0), then execute payload via UEA if inboundAmount.Sign() > 0 { receipt, execErr = k.depositPRC20( @@ -193,21 +187,7 @@ func (k Keeper) ExecuteInboundFundsAndPayload(ctx context.Context, utx types.Uni // If deposit failed, stop here. if execErr != nil { if shouldRevert { - revertOutbound := &types.OutboundTx{ - DestinationChain: utx.InboundTx.SourceChain, - Recipient: func() string { - if utx.InboundTx.RevertInstructions != nil && utx.InboundTx.RevertInstructions.FundRecipient != "" { - return utx.InboundTx.RevertInstructions.FundRecipient - } - return utx.InboundTx.Sender - }(), - Amount: utx.InboundTx.Amount, - ExternalAssetAddr: utx.InboundTx.AssetAddr, - Sender: utx.InboundTx.Sender, - TxType: types.TxType_INBOUND_REVERT, - OutboundStatus: types.Status_PENDING, - Id: types.GetOutboundRevertId(utx.InboundTx.SourceChain, utx.InboundTx.TxHash), - } + revertOutbound := k.buildRevertOutbound(sdkCtx, utx.InboundTx) if attachErr := k.attachOutboundsToUtx( sdkCtx, universalTxKey, @@ -293,25 +273,7 @@ func (k Keeper) ExecuteInboundFundsAndPayload(ctx context.Context, utx types.Uni ueModuleAddr, _ := k.GetUeModuleAddress(ctx) - // --- Step 3: compute and store payload hash - payloadHashErr := k.StoreVerifiedPayloadHash(sdkCtx, utx, ueaAddr, ueModuleAddr, payloadSender, payloadChain) - if payloadHashErr != nil { - errorPcTx := types.PCTx{ - Sender: ueModuleAddressStr, - BlockHeight: uint64(sdkCtx.BlockHeight()), - Status: "FAILED", - ErrorMsg: fmt.Sprintf("payload hash failed: %v", payloadHashErr), - } - if updateErr := k.UpdateUniversalTx(ctx, universalTxKey, func(utx *types.UniversalTx) error { - utx.PcTx = append(utx.PcTx, &errorPcTx) - return nil - }); updateErr != nil { - return updateErr - } - return nil - } - - // --- Step 4: execute payload via UEA + // --- Step 3: execute payload via UEA k.Logger().Debug("executing payload via UEA", "utx_key", universalTxKey, "uea", ueaAddr.Hex()) var payloadErr error receipt, payloadErr = k.ExecutePayloadV2(ctx, ueModuleAddr, ueaAddr, utx.InboundTx.UniversalPayload, utx.InboundTx.VerificationData) diff --git a/x/uexecutor/keeper/execute_inbound_gas.go b/x/uexecutor/keeper/execute_inbound_gas.go index 563d96de..9a9d194d 100644 --- a/x/uexecutor/keeper/execute_inbound_gas.go +++ b/x/uexecutor/keeper/execute_inbound_gas.go @@ -190,21 +190,7 @@ func (k Keeper) ExecuteInboundGas(ctx context.Context, inbound types.Inbound) er } if execErr != nil && shouldRevert { - revertOutbound := &types.OutboundTx{ - DestinationChain: inbound.SourceChain, - Recipient: func() string { - if inbound.RevertInstructions != nil && inbound.RevertInstructions.FundRecipient != "" { - return inbound.RevertInstructions.FundRecipient - } - return inbound.Sender - }(), - Amount: inbound.Amount, - ExternalAssetAddr: inbound.AssetAddr, - Sender: inbound.Sender, - TxType: types.TxType_INBOUND_REVERT, - OutboundStatus: types.Status_PENDING, - Id: types.GetOutboundRevertId(inbound.SourceChain, inbound.TxHash), - } + revertOutbound := k.buildRevertOutbound(sdkCtx, &inbound) if attachErr := k.attachOutboundsToUtx( sdkCtx, diff --git a/x/uexecutor/keeper/execute_inbound_gas_and_payload.go b/x/uexecutor/keeper/execute_inbound_gas_and_payload.go index f351824c..8f7949c0 100644 --- a/x/uexecutor/keeper/execute_inbound_gas_and_payload.go +++ b/x/uexecutor/keeper/execute_inbound_gas_and_payload.go @@ -40,8 +40,6 @@ func (k Keeper) ExecuteInboundGasAndPayload(ctx context.Context, utx types.Unive var receipt *evmtypes.MsgEthereumTxResponse var ueaAddr common.Address var isSmartContract bool - payloadSender := utx.InboundTx.Sender // default: inbound sender; overridden to UEA owner for CEA - payloadChain := utx.InboundTx.SourceChain // default: inbound source chain; overridden to UEA origin chain for CEA shouldRevert := false var revertReason string @@ -71,13 +69,10 @@ func (k Keeper) ExecuteInboundGasAndPayload(ctx context.Context, utx types.Unive } else { ueaAddr = common.HexToAddress(utx.InboundTx.Recipient) - origin, isUEA, ueaCheckErr := k.CallFactoryGetOriginForUEA(sdkCtx, ueModuleAccAddress, factoryAddress, ueaAddr) + _, isUEA, ueaCheckErr := k.CallFactoryGetOriginForUEA(sdkCtx, ueModuleAccAddress, factoryAddress, ueaAddr) if ueaCheckErr != nil { execErr = fmt.Errorf("failed to verify UEA: %w", ueaCheckErr) } else if isUEA { - // Use UEA owner and origin chain for payload hash verification - payloadSender = origin.Owner - payloadChain = fmt.Sprintf("%s:%s", origin.ChainNamespace, origin.ChainId) // UEA path: deposit + autoswap into the UEA (if amount > 0), then execute payload via UEA if amount.Sign() > 0 { prc20AddrHex := common.HexToAddress(tokenConfig.NativeRepresentation.ContractAddress) @@ -194,21 +189,7 @@ func (k Keeper) ExecuteInboundGasAndPayload(ctx context.Context, utx types.Unive // --- create revert ONLY for pre-deposit / deposit failures (non-isCEA path) if execErr != nil && shouldRevert { - revertOutbound := &types.OutboundTx{ - DestinationChain: utx.InboundTx.SourceChain, - Recipient: func() string { - if utx.InboundTx.RevertInstructions != nil && utx.InboundTx.RevertInstructions.FundRecipient != "" { - return utx.InboundTx.RevertInstructions.FundRecipient - } - return utx.InboundTx.Sender - }(), - Amount: utx.InboundTx.Amount, - ExternalAssetAddr: utx.InboundTx.AssetAddr, - Sender: utx.InboundTx.Sender, - TxType: types.TxType_INBOUND_REVERT, - OutboundStatus: types.Status_PENDING, - Id: types.GetOutboundRevertId(utx.InboundTx.SourceChain, utx.InboundTx.TxHash), - } + revertOutbound := k.buildRevertOutbound(sdkCtx, utx.InboundTx) if attachErr := k.attachOutboundsToUtx( sdkCtx, @@ -293,26 +274,7 @@ func (k Keeper) ExecuteInboundGasAndPayload(ctx context.Context, utx types.Unive ueModuleAddr, _ := k.GetUeModuleAddress(ctx) - // --- Step 6: payload hash - payloadHashErr := k.StoreVerifiedPayloadHash(sdkCtx, utx, ueaAddr, ueModuleAddr, payloadSender, payloadChain) - if payloadHashErr != nil { - errorPcTx := types.PCTx{ - Sender: ueModuleAddressStr, - BlockHeight: uint64(sdkCtx.BlockHeight()), - Status: "FAILED", - ErrorMsg: fmt.Sprintf("payload hash failed: %v", payloadHashErr), - } - if updateErr := k.UpdateUniversalTx(ctx, universalTxKey, func(utx *types.UniversalTx) error { - utx.PcTx = append(utx.PcTx, &errorPcTx) - - return nil - }); updateErr != nil { - return updateErr - } - return nil - } - - // --- Step 7: execute payload + // --- Step 6: execute payload k.Logger().Debug("executing payload via UEA (gas+payload)", "utx_key", universalTxKey, "uea", ueaAddr.Hex()) receipt, err = k.ExecutePayloadV2( ctx, diff --git a/x/uexecutor/keeper/gas_fee.go b/x/uexecutor/keeper/gas_fee.go new file mode 100644 index 00000000..5ff064e1 --- /dev/null +++ b/x/uexecutor/keeper/gas_fee.go @@ -0,0 +1,78 @@ +package keeper + +import ( + "fmt" + "math/big" + + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + uregistrytypes "github.com/pushchain/push-chain-node/x/uregistry/types" + + "github.com/pushchain/push-chain-node/x/uexecutor/types" +) + +// GasFeeInfo holds gas-related fields fetched from the UniversalCore contract. +type GasFeeInfo struct { + GasToken common.Address + GasFee *big.Int + GasPrice *big.Int + GasLimit *big.Int +} + +// GetOutboundTxGasAndFees calls UniversalCore.getOutboundTxGasAndFees(prc20, gasLimitWithBaseLimit) +// to get gasToken, gasFee, protocolFee, gasPrice, and chainNamespace. +// Pass gasLimitWithBaseLimit=0 to use the contract's baseLimit. +func (k Keeper) GetOutboundTxGasAndFees(ctx sdk.Context, prc20 common.Address, gasLimitWithBaseLimit *big.Int) (*GasFeeInfo, error) { + handlerAddr := common.HexToAddress(uregistrytypes.SYSTEM_CONTRACTS["UNIVERSAL_CORE"].Address) + + ucABI, err := types.ParseUniversalCoreABI() + if err != nil { + return nil, errors.Wrap(err, "failed to parse UniversalCore ABI") + } + + ueModuleAccAddress, _ := k.GetUeModuleAddress(ctx) + + receipt, err := k.evmKeeper.CallEVM(ctx, ucABI, ueModuleAccAddress, handlerAddr, false, + "getOutboundTxGasAndFees", prc20, gasLimitWithBaseLimit) + if err != nil { + return nil, errors.Wrap(err, "failed to call getOutboundTxGasAndFees") + } + + results, err := ucABI.Methods["getOutboundTxGasAndFees"].Outputs.Unpack(receipt.Ret) + if err != nil { + return nil, errors.Wrap(err, "failed to unpack getOutboundTxGasAndFees result") + } + + gasToken := results[0].(common.Address) + gasFee := results[1].(*big.Int) + // protocolFee := results[2].(*big.Int) — not needed for outbound fields + gasPrice := results[3].(*big.Int) + + // Derive gasLimit from gasFee / gasPrice + var gasLimit *big.Int + if gasPrice.Sign() > 0 { + gasLimit = new(big.Int).Div(gasFee, gasPrice) + } else { + gasLimit = big.NewInt(0) + } + + return &GasFeeInfo{ + GasToken: gasToken, + GasFee: gasFee, + GasPrice: gasPrice, + GasLimit: gasLimit, + }, nil +} + +// GetGasFeeInfoForRevertOutbound fetches gas info for an INBOUND_REVERT outbound using the +// inbound's PRC20 token address. Returns string values ready for OutboundTx fields. +func (k Keeper) GetGasFeeInfoForRevertOutbound(ctx sdk.Context, prc20Addr string) (gasToken, gasFee, gasPrice, gasLimit string, err error) { + prc20 := common.HexToAddress(prc20Addr) + info, err := k.GetOutboundTxGasAndFees(ctx, prc20, big.NewInt(0)) // 0 = use baseLimit + if err != nil { + return "", "", "", "", fmt.Errorf("failed to get gas fee info: %w", err) + } + + return info.GasToken.Hex(), info.GasFee.String(), info.GasPrice.String(), info.GasLimit.String(), nil +} diff --git a/x/uexecutor/keeper/handle_failed_inbound_validation.go b/x/uexecutor/keeper/handle_failed_inbound_validation.go index 2ff9604a..0713aaa3 100644 --- a/x/uexecutor/keeper/handle_failed_inbound_validation.go +++ b/x/uexecutor/keeper/handle_failed_inbound_validation.go @@ -44,21 +44,7 @@ func (k Keeper) handleFailedInboundValidation(sdkCtx sdk.Context, utx types.Univ "source_chain", inbound.SourceChain, "amount", inbound.Amount, ) - revertRecipient := inbound.Sender - if inbound.RevertInstructions != nil && inbound.RevertInstructions.FundRecipient != "" { - revertRecipient = inbound.RevertInstructions.FundRecipient - } - - revertOutbound := &types.OutboundTx{ - DestinationChain: inbound.SourceChain, - Recipient: revertRecipient, - Amount: inbound.Amount, - ExternalAssetAddr: inbound.AssetAddr, - Sender: inbound.Sender, - TxType: types.TxType_INBOUND_REVERT, - OutboundStatus: types.Status_PENDING, - Id: types.GetOutboundRevertId(inbound.SourceChain, inbound.TxHash), - } + revertOutbound := k.buildRevertOutbound(sdkCtx, inbound) if attachErr := k.attachOutboundsToUtx( sdkCtx, diff --git a/x/uexecutor/keeper/keeper.go b/x/uexecutor/keeper/keeper.go index 0900a82e..722df00f 100755 --- a/x/uexecutor/keeper/keeper.go +++ b/x/uexecutor/keeper/keeper.go @@ -32,9 +32,8 @@ type Keeper struct { feemarketKeeper types.FeeMarketKeeper bankKeeper types.BankKeeper accountKeeper types.AccountKeeper - uregistryKeeper types.UregistryKeeper - utxverifierKeeper types.UtxverifierKeeper - uvalidatorKeeper types.UValidatorKeeper + uregistryKeeper types.UregistryKeeper + uvalidatorKeeper types.UValidatorKeeper // Inbound trackers PendingInbounds collections.KeySet[string] @@ -67,7 +66,6 @@ func NewKeeper( bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, uregistryKeeper types.UregistryKeeper, - utxverifierKeeper types.UtxverifierKeeper, uvalidatorKeeper types.UValidatorKeeper, ) Keeper { logger = logger.With(log.ModuleKey, "x/"+types.ModuleName) @@ -90,9 +88,8 @@ func NewKeeper( feemarketKeeper: feemarketKeeper, bankKeeper: bankKeeper, accountKeeper: accountKeeper, - uregistryKeeper: uregistryKeeper, - utxverifierKeeper: utxverifierKeeper, - uvalidatorKeeper: uvalidatorKeeper, + uregistryKeeper: uregistryKeeper, + uvalidatorKeeper: uvalidatorKeeper, PendingInbounds: collections.NewKeySet( sb, diff --git a/x/uexecutor/keeper/keeper_test.go b/x/uexecutor/keeper/keeper_test.go index 0058bcc1..d9910862 100755 --- a/x/uexecutor/keeper/keeper_test.go +++ b/x/uexecutor/keeper/keeper_test.go @@ -72,7 +72,6 @@ type testFixture struct { ctrl *gomock.Controller mockBankKeeper *mocks.MockBankKeeper - mockUTVKeeper *mocks.MockUtxverifierKeeper mockEVMKeeper *mocks.MockEVMKeeper mockUregistryKeeper *mocks.MockUregistryKeeper } @@ -85,7 +84,6 @@ func SetupTest(t *testing.T) *testFixture { t.Cleanup(f.ctrl.Finish) f.mockBankKeeper = mocks.NewMockBankKeeper(f.ctrl) - f.mockUTVKeeper = mocks.NewMockUtxverifierKeeper(f.ctrl) f.mockEVMKeeper = mocks.NewMockEVMKeeper(f.ctrl) f.mockUregistryKeeper = mocks.NewMockUregistryKeeper(f.ctrl) @@ -119,10 +117,10 @@ func SetupTest(t *testing.T) *testFixture { registerBaseSDKModules(logger, f, encCfg, keys, accountAddressCodec, validatorAddressCodec, consensusAddressCodec) // Setup Keeper. - f.k = keeper.NewKeeper(encCfg.Codec, runtime.NewKVStoreService(keys[types.ModuleName]), logger, f.govModAddr, f.mockEVMKeeper, &feemarketkeeper.Keeper{}, f.mockBankKeeper, authkeeper.AccountKeeper{}, f.mockUregistryKeeper, f.mockUTVKeeper, &uvalidatorKeeper.Keeper{}) + f.k = keeper.NewKeeper(encCfg.Codec, runtime.NewKVStoreService(keys[types.ModuleName]), logger, f.govModAddr, f.mockEVMKeeper, &feemarketkeeper.Keeper{}, f.mockBankKeeper, authkeeper.AccountKeeper{}, f.mockUregistryKeeper, &uvalidatorKeeper.Keeper{}) f.msgServer = keeper.NewMsgServerImpl(f.k) f.queryServer = keeper.NewQuerier(f.k) - f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.mockEVMKeeper, &feemarketkeeper.Keeper{}, f.mockBankKeeper, authkeeper.AccountKeeper{}, f.mockUregistryKeeper, f.mockUTVKeeper, &uvalidatorKeeper.Keeper{}) + f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.mockEVMKeeper, &feemarketkeeper.Keeper{}, f.mockBankKeeper, authkeeper.AccountKeeper{}, f.mockUregistryKeeper, &uvalidatorKeeper.Keeper{}) return f } diff --git a/x/uexecutor/keeper/payload.go b/x/uexecutor/keeper/payload.go deleted file mode 100644 index 07d77b28..00000000 --- a/x/uexecutor/keeper/payload.go +++ /dev/null @@ -1,140 +0,0 @@ -package keeper - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/pushchain/push-chain-node/x/uexecutor/types" - utxverifiertypes "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -var UNIVERSAL_PAYLOAD_TYPEHASH = common.HexToHash("0x1d8b43e5066bd20bfdacf7b8f4790c0309403b18434e3699ce3c5e57502ed8c4") - -// GetPayloadHashEVM computes the EIP-712 style payload hash using the UEA contract's domainSeparator -func (k Keeper) GetPayloadHashEVM( - ctx sdk.Context, - from, ueaAddr common.Address, - payload types.AbiUniversalPayload, -) (common.Hash, error) { - // Fetch the domainSeparator from the UEA contract - domainSep, err := k.CallUEADomainSeparator(ctx, from, ueaAddr) - if err != nil { - return common.Hash{}, err - } - - // Hash payload.data - dataHash := crypto.Keccak256Hash(payload.Data) - - // ABI encode the struct like Solidity abi.encode(...) - arguments := AbiArgumentsForPayload() - - packed, err := arguments.Pack( - UNIVERSAL_PAYLOAD_TYPEHASH, - payload.To, - payload.Value, - dataHash, - payload.GasLimit, - payload.MaxFeePerGas, - payload.MaxPriorityFeePerGas, - payload.Nonce, - payload.Deadline, - payload.VType, - ) - if err != nil { - return common.Hash{}, err - } - - // structHash = keccak256(encoded struct) - structHash := crypto.Keccak256Hash(packed) - - // Final payload hash = keccak256("\x19\x01" || domainSeparator || structHash) - finalBytes := append([]byte{0x19, 0x01}, append(domainSep[:], structHash.Bytes()...)...) - return crypto.Keccak256Hash(finalBytes), nil -} - -// StoreVerifiedPayloadHash stores one payload hash for a given inbound tx. -// sender is the address to record as the verified sender (UEA owner for CEA, inbound sender otherwise). -// chain is the CAIP-2 chain identifier to store under (UEA origin chain for CEA, inbound source chain otherwise). -func (k Keeper) StoreVerifiedPayloadHash( - ctx sdk.Context, - utx types.UniversalTx, // struct containing InboundTx - ueaAddr common.Address, - ueModuleAccAddress common.Address, - sender string, - chain string, -) error { - // Convert to AbiUniversalPayload - abiPayload, err := types.NewAbiUniversalPayload(utx.InboundTx.UniversalPayload) - if err != nil { - return fmt.Errorf("failed to convert UniversalPayload: %w", err) - } - - // Compute payload hash - payloadHash, err := k.GetPayloadHashEVM(ctx, ueModuleAccAddress, ueaAddr, abiPayload) - if err != nil { - return fmt.Errorf("failed to compute payload hash: %w", err) - } - - k.Logger().Debug("payload hash computed", - "utx_key", utx.Id, - "uea", ueaAddr.Hex(), - "chain", chain, - "sender", sender, - "payload_hash", payloadHash.Hex(), - ) - - // Construct VerifiedTxMetadata - verified := utxverifiertypes.VerifiedTxMetadata{ - Minted: false, - PayloadHashes: []string{ - payloadHash.Hex(), // store as string - }, - UsdValue: &utxverifiertypes.USDValue{ - Amount: "0", - Decimals: 0, - }, - Sender: sender, - } - - // Store in utxverifierKeeper - err = k.utxverifierKeeper.StoreVerifiedInboundTx(ctx, chain, utx.InboundTx.TxHash, verified) - if err != nil { - return fmt.Errorf("failed to store verified tx: %w", err) - } - - k.Logger().Debug("verified payload hash stored", - "utx_key", utx.Id, - "chain", chain, - "tx_hash", utx.InboundTx.TxHash, - ) - - return nil -} - -// helper: parse ABI type strings safely -func mustType(t string) abi.Type { - ty, err := abi.NewType(t, "", nil) - if err != nil { - panic(err) - } - return ty -} - -// AbiArgumentsForPayload returns the abi.Arguments for encoding a UniversalPayload struct -func AbiArgumentsForPayload() abi.Arguments { - return abi.Arguments{ - {Type: mustType("bytes32")}, // typehash - {Type: mustType("address")}, - {Type: mustType("uint256")}, - {Type: mustType("bytes32")}, // keccak256(data) - {Type: mustType("uint256")}, // gasLimit - {Type: mustType("uint256")}, // maxFeePerGas - {Type: mustType("uint256")}, // maxPriorityFeePerGas - {Type: mustType("uint256")}, // nonce - {Type: mustType("uint256")}, // deadline - {Type: mustType("uint8")}, // vType - } -} diff --git a/x/uexecutor/mocks/mock_utvkeeper.go b/x/uexecutor/mocks/mock_utvkeeper.go deleted file mode 100644 index 31cefef3..00000000 --- a/x/uexecutor/mocks/mock_utvkeeper.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: x/ue/keeper/interfaces.go - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - gomock "github.com/golang/mock/gomock" - types2 "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -// MockUtxverifierKeeper is a mock of UtxverifierKeeper interface. -type MockUtxverifierKeeper struct { - ctrl *gomock.Controller - recorder *MockUtxverifierKeeperMockRecorder -} - -// MockUtxverifierKeeperMockRecorder is the mock recorder for MockUtxverifierKeeper. -type MockUtxverifierKeeperMockRecorder struct { - mock *MockUtxverifierKeeper -} - -// NewMockUtxverifierKeeper creates a new mock instance. -func NewMockUtxverifierKeeper(ctrl *gomock.Controller) *MockUtxverifierKeeper { - mock := &MockUtxverifierKeeper{ctrl: ctrl} - mock.recorder = &MockUtxverifierKeeperMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockUtxverifierKeeper) EXPECT() *MockUtxverifierKeeperMockRecorder { - return m.recorder -} - -// StoreVerifiedInboundTx mocks base method. -func (m *MockUtxverifierKeeper) StoreVerifiedInboundTx(ctx context.Context, chain, txHash string, verifiedTxMetadata types2.VerifiedTxMetadata) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StoreVerifiedInboundTx", ctx, chain, txHash, verifiedTxMetadata) - ret0, _ := ret[0].(error) - return ret0 -} - -// StoreVerifiedInboundTx indicates an expected call of StoreVerifiedInboundTx. -func (mr *MockUtxverifierKeeperMockRecorder) StoreVerifiedInboundTx(ctx, chain, txHash, verifiedTxMetadata interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreVerifiedInboundTx", reflect.TypeOf((*MockUtxverifierKeeper)(nil).StoreVerifiedInboundTx), ctx, chain, txHash, verifiedTxMetadata) -} diff --git a/x/uexecutor/module.go b/x/uexecutor/module.go index 1fe9b66d..b5530a67 100755 --- a/x/uexecutor/module.go +++ b/x/uexecutor/module.go @@ -55,9 +55,8 @@ type AppModule struct { feemarketKeeper types.FeeMarketKeeper bankKeeper types.BankKeeper accountKeeper types.AccountKeeper - uregistryKeeper types.UregistryKeeper - utxverifierKeeper types.UtxverifierKeeper - uvalidatorKeeper types.UValidatorKeeper + uregistryKeeper types.UregistryKeeper + uvalidatorKeeper types.UValidatorKeeper } // NewAppModule constructor @@ -69,7 +68,6 @@ func NewAppModule( bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, uregistryKeeper types.UregistryKeeper, - utxverifierKeeper types.UtxverifierKeeper, uvalidatorKeeper types.UValidatorKeeper, ) *AppModule { return &AppModule{ @@ -79,9 +77,8 @@ func NewAppModule( feemarketKeeper: feemarketKeeper, bankKeeper: bankKeeper, accountKeeper: accountKeeper, - uregistryKeeper: uregistryKeeper, - utxverifierKeeper: utxverifierKeeper, - uvalidatorKeeper: uvalidatorKeeper, + uregistryKeeper: uregistryKeeper, + uvalidatorKeeper: uvalidatorKeeper, } } diff --git a/x/uexecutor/types/abi.go b/x/uexecutor/types/abi.go index d7359680..8cb59cc0 100644 --- a/x/uexecutor/types/abi.go +++ b/x/uexecutor/types/abi.go @@ -366,6 +366,58 @@ const UNIVERSAL_CORE_ABI = `[ ], "outputs": [], "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "getOutboundTxGasAndFees", + "inputs": [ + { "name": "_prc20", "type": "address", "internalType": "address" }, + { "name": "gasLimitWithBaseLimit", "type": "uint256", "internalType": "uint256" } + ], + "outputs": [ + { "name": "gasToken", "type": "address", "internalType": "address" }, + { "name": "gasFee", "type": "uint256", "internalType": "uint256" }, + { "name": "protocolFee", "type": "uint256", "internalType": "uint256" }, + { "name": "gasPrice", "type": "uint256", "internalType": "uint256" }, + { "name": "chainNamespace", "type": "string", "internalType": "string" } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getRescueFundsGasLimit", + "inputs": [ + { "name": "_prc20", "type": "address", "internalType": "address" } + ], + "outputs": [ + { "name": "gasToken", "type": "address", "internalType": "address" }, + { "name": "gasFee", "type": "uint256", "internalType": "uint256" }, + { "name": "rescueGasLimit", "type": "uint256", "internalType": "uint256" }, + { "name": "gasPrice", "type": "uint256", "internalType": "uint256" }, + { "name": "chainNamespace", "type": "string", "internalType": "string" } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "baseGasLimitByChainNamespace", + "inputs": [{ "name": "", "type": "string", "internalType": "string" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view" + }, + { + "type": "function", + "name": "gasTokenPRC20ByChainNamespace", + "inputs": [{ "name": "", "type": "string", "internalType": "string" }], + "outputs": [{ "name": "", "type": "address", "internalType": "address" }], + "stateMutability": "view" + }, + { + "type": "function", + "name": "rescueFundsGasLimitByChainNamespace", + "inputs": [{ "name": "", "type": "string", "internalType": "string" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view" } ]` @@ -598,28 +650,6 @@ const PRC20ABI = `[ "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "nonpayable" }, - { - "type": "function", - "name": "withdrawGasFee", - "inputs": [], - "outputs": [ - { "name": "gasToken", "type": "address", "internalType": "address" }, - { "name": "gasFee", "type": "uint256", "internalType": "uint256" } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "withdrawGasFeeWithGasLimit", - "inputs": [ - { "name": "gasLimit_", "type": "uint256", "internalType": "uint256" } - ], - "outputs": [ - { "name": "gasToken", "type": "address", "internalType": "address" }, - { "name": "gasFee", "type": "uint256", "internalType": "uint256" } - ], - "stateMutability": "view" - }, { "type": "event", "name": "Approval", diff --git a/x/uexecutor/types/expected_keepers.go b/x/uexecutor/types/expected_keepers.go index 864f6ec5..bc3a0c9c 100644 --- a/x/uexecutor/types/expected_keepers.go +++ b/x/uexecutor/types/expected_keepers.go @@ -12,7 +12,6 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" uregistrytypes "github.com/pushchain/push-chain-node/x/uregistry/types" - utxverifiertypes "github.com/pushchain/push-chain-node/x/utxverifier/types" uvalidatortypes "github.com/pushchain/push-chain-node/x/uvalidator/types" ) @@ -96,11 +95,6 @@ type AccountKeeper interface { GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI } -// UtxverifierKeeper defines the expected interface for the UtxverifierKeeper moduledule. -type UtxverifierKeeper interface { - StoreVerifiedInboundTx(ctx context.Context, chain, txHash string, verifiedTxMetadata utxverifiertypes.VerifiedTxMetadata) error -} - type UValidatorKeeper interface { IsTombstonedUniversalValidator(ctx context.Context, universalValidator string) (bool, error) IsBondedUniversalValidator(ctx context.Context, universalValidator string) (bool, error) diff --git a/x/utss/keeper/msg_initiate_fund_migration.go b/x/utss/keeper/msg_initiate_fund_migration.go index e3c5b18c..14fb51ed 100644 --- a/x/utss/keeper/msg_initiate_fund_migration.go +++ b/x/utss/keeper/msg_initiate_fund_migration.go @@ -21,17 +21,7 @@ func (k Keeper) InitiateFundMigration(ctx context.Context, oldKeyId, chain strin return 0, fmt.Errorf("old key %s not found in TssKeyHistory: %w", oldKeyId, err) } - // 2. Verify old key was produced by keygen (not refresh or quorum change) - process, err := k.ProcessHistory.Get(ctx, oldKey.ProcessId) - if err != nil { - return 0, fmt.Errorf("process %d for key %s not found: %w", oldKey.ProcessId, oldKeyId, err) - } - if process.ProcessType != types.TssProcessType_TSS_PROCESS_KEYGEN { - return 0, fmt.Errorf("key %s was produced by %s, not keygen; migration only needed after keygen", - oldKeyId, process.ProcessType.String()) - } - - // 3. Verify old key != current key + // 2. Verify old key != current key currentKey, err := k.CurrentTssKey.Get(ctx) if err != nil { return 0, fmt.Errorf("no current TSS key set: %w", err) diff --git a/x/utxverifier/README.md b/x/utxverifier/README.md deleted file mode 100755 index 826f449a..00000000 --- a/x/utxverifier/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Universal Transaction Verification (UTxVerifier) Module - -This is UTxVerifier (Universal Transaction Verification) module. - -## Responsibilities - -- Verifying transaction hashes of funds locked on source chains -- Performing RPC calls to external chains -- Storing verified transaction hashes for reference and validation - -## Overview - -The UTxVerifier module acts as the verification layer in a universal system, ensuring the authenticity of transactions before execution on the destination chain. \ No newline at end of file diff --git a/x/utxverifier/autocli.go b/x/utxverifier/autocli.go deleted file mode 100755 index 9fea4fcd..00000000 --- a/x/utxverifier/autocli.go +++ /dev/null @@ -1,36 +0,0 @@ -package module - -import ( - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - modulev1 "github.com/pushchain/push-chain-node/api/utxverifier/v1" -) - -// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. -func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { - return &autocliv1.ModuleOptions{ - Query: &autocliv1.ServiceCommandDescriptor{ - Service: modulev1.Query_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "Params", - Use: "params", - Short: "Query the current consensus parameters", - }, - { - RpcMethod: "VerifiedTxHash", - Use: "verified-tx-hash --chain-id --hash ", - Short: "Check if a transaction hash has been verified on the chain", - }, - }, - }, - Tx: &autocliv1.ServiceCommandDescriptor{ - Service: modulev1.Msg_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "UpdateParams", - Skip: false, // set to true if authority gated - }, - }, - }, - } -} diff --git a/x/utxverifier/client/cli/query.go b/x/utxverifier/client/cli/query.go deleted file mode 100755 index dcff96ec..00000000 --- a/x/utxverifier/client/cli/query.go +++ /dev/null @@ -1,50 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - - "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -// !NOTE: Must enable in module.go (disabled in favor of autocli.go) - -func GetQueryCmd() *cobra.Command { - queryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for " + types.ModuleName, - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - queryCmd.AddCommand( - GetCmdParams(), - ) - return queryCmd -} - -func GetCmdParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Show all module params", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - return cmd -} diff --git a/x/utxverifier/client/cli/tx.go b/x/utxverifier/client/cli/tx.go deleted file mode 100755 index 91328b07..00000000 --- a/x/utxverifier/client/cli/tx.go +++ /dev/null @@ -1,71 +0,0 @@ -package cli - -import ( - "strconv" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - - "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -// !NOTE: Must enable in module.go (disabled in favor of autocli.go) - -// NewTxCmd returns a root CLI command handler for certain modules -// transaction commands. -func NewTxCmd() *cobra.Command { - txCmd := &cobra.Command{ - Use: types.ModuleName, - Short: types.ModuleName + " subcommands.", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - txCmd.AddCommand( - MsgUpdateParams(), - ) - return txCmd -} - -// Returns a CLI command handler for registering a -// contract for the module. -func MsgUpdateParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "update-params [some-value]", - Short: "Update the params (must be submitted from the authority)", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - cliCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - senderAddress := cliCtx.GetFromAddress() - - someValue, err := strconv.ParseBool(args[0]) - if err != nil { - return err - } - - msg := &types.MsgUpdateParams{ - Authority: senderAddress.String(), - Params: types.Params{ - SomeValue: someValue, - }, - } - - if err := msg.Validate(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd -} diff --git a/x/utxverifier/depinject.go b/x/utxverifier/depinject.go deleted file mode 100755 index bd2e6a6a..00000000 --- a/x/utxverifier/depinject.go +++ /dev/null @@ -1,65 +0,0 @@ -package module - -import ( - "os" - - "github.com/cosmos/cosmos-sdk/codec" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - - "cosmossdk.io/core/address" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/store" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - - modulev1 "github.com/pushchain/push-chain-node/api/utxverifier/module/v1" - "github.com/pushchain/push-chain-node/x/utxverifier/keeper" - "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -var _ appmodule.AppModule = AppModule{} - -// IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} - -// IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} - -func init() { - appmodule.Register( - &modulev1.Module{}, - appmodule.Provide(ProvideModule), - ) -} - -type ModuleInputs struct { - depinject.In - - Cdc codec.Codec - StoreService store.KVStoreService - AddressCodec address.Codec - - StakingKeeper stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - UregistryKeeper types.UregistryKeeper -} - -type ModuleOutputs struct { - depinject.Out - - Module appmodule.AppModule - Keeper keeper.Keeper -} - -func ProvideModule(in ModuleInputs) ModuleOutputs { - govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() - - k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.UregistryKeeper) - m := NewAppModule(in.Cdc, k, in.UregistryKeeper) - - return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}} -} diff --git a/x/utxverifier/keeper/evm_helpers.go b/x/utxverifier/keeper/evm_helpers.go deleted file mode 100644 index b0cf03e3..00000000 --- a/x/utxverifier/keeper/evm_helpers.go +++ /dev/null @@ -1,160 +0,0 @@ -// evm_helpers.go -// EVM-specific helper functions used in inbound transaction verification. -package keeper - -import ( - "encoding/hex" - "fmt" - "math/big" - "strings" - - // "github.com/pushchain/push-chain-node/utils/rpc" - // evmrpc "github.com/pushchain/push-chain-node/utils/rpc/evm" - uregistrytypes "github.com/pushchain/push-chain-node/x/uregistry/types" - utxverifiertypes "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -// isValidEVMGateway checks if tx.To equals gateway address -func isValidEVMGateway(toAddress, gatewayAddress string) bool { - return NormalizeEVMAddress(toAddress) == NormalizeEVMAddress(gatewayAddress) -} - -// compares if addresses are equal -func compareEVMAddr(actualAddr, expectedAddr string) bool { - return NormalizeEVMAddress(actualAddr) == NormalizeEVMAddress(expectedAddr) -} - -// isEVMTxCallingAddFunds checks if the txInput is of a addFunds fn -func isEVMTxCallingAddFunds(txInput string, chainConfig uregistrytypes.ChainConfig) (bool, string) { - for _, method := range chainConfig.GatewayMethods { - if method.Name == uregistrytypes.GATEWAY_METHOD.EVM.AddFunds { - selector := method.Identifier - if strings.HasPrefix(txInput, selector) { - return true, selector - } - return false, selector - } - } - return false, "" -} - -// NormalizeEVMAddress returns a lowercase hex address without 0x prefix -func NormalizeEVMAddress(addr string) string { - return strings.ToLower(addr) -} - -// @notice Parses EVM logs to extract amount, decimals and payloadHash from the `FundsAdded` event. -// @dev This function scans logs for a specific event topic and decodes the `amountInUSD`, `payloadHash` fields. -// @param logs The array of raw EVM logs from the transaction receipt. -// @param expectedTopic The hash of the `FundsAdded` event signature (topic[0]) to match. -// @return amount The extracted amount in USD as a big.Int. -// @return decimals The number of decimals used for the USD amount. -// @return error An error if the event was not found or decoding failed. -// -// Emits: -// event FundsAdded( -// -// address indexed user, -// bytes32 indexed payloadHash, -// AmountInUSD AmountInUSD -// -// ); -func ParseEVMFundsAddedEventLogs( - logs []interface{}, - expectedTopic string, -) ([]utxverifiertypes.EVMFundsAddedEventData, error) { - expectedTopic = strings.ToLower(expectedTopic) - - var results []utxverifiertypes.EVMFundsAddedEventData - - for _, rawLog := range logs { - logMap, ok := rawLog.(map[string]interface{}) - if !ok { - continue - } - - // Match the expected event topic - topics, ok := logMap["topics"].([]interface{}) - if !ok || len(topics) < 3 { - continue - } - - topic0, ok := topics[0].(string) - if !ok || strings.ToLower(topic0) != expectedTopic { - continue - } - - // topic[2] is payloadHash (indexed bytes32) - payloadHashHex, ok := topics[2].(string) - if !ok { - return nil, fmt.Errorf("invalid payloadHash format") - } - - // Get data and decode - dataHex, ok := logMap["data"].(string) - if !ok || !strings.HasPrefix(dataHex, "0x") { - continue - } - - dataBytes, err := hex.DecodeString(dataHex[2:]) - if err != nil || len(dataBytes) < 64 { - return nil, fmt.Errorf("error decoding log data: %w", err) - } - - // First 32 bytes: amountInUSD - amount := new(big.Int).SetBytes(dataBytes[:32]) - - // Second 32 bytes: decimals (last byte) - decimals := uint32(uint8(dataBytes[63])) - - results = append(results, utxverifiertypes.EVMFundsAddedEventData{ - AmountInUSD: amount, - Decimals: decimals, - PayloadHash: payloadHashHex, - }) - } - - if len(results) == 0 { - return nil, fmt.Errorf("amount not found with expected topic %s", expectedTopic) - } - - return results, nil -} - -// Checks if a given evm tx hash has enough confirmations -// func CheckEVMBlockConfirmations( -// ctx context.Context, -// txHash string, -// rpcCfg rpc.RpcCallConfig, -// requiredConfirmations uint64, -// ) error { -// // Fetch transaction receipt -// receipt, err := evmrpc.EVMGetTransactionReceipt(ctx, rpcCfg, txHash) -// if err != nil { -// return fmt.Errorf("fetch receipt failed: %w", err) -// } - -// txBlockNum, ok := new(big.Int).SetString(receipt.BlockNumber[2:], 16) // remove "0x" -// if !ok { -// return fmt.Errorf("invalid block number in receipt: %s", receipt.BlockNumber) -// } - -// latestBlock, err := evmrpc.EVMGetBlockByNumber(ctx, rpcCfg, "latest", false) -// if err != nil { -// return fmt.Errorf("failed to fetch latest block: %w", err) -// } - -// latestBlockNum, ok := new(big.Int).SetString(latestBlock.Number[2:], 16) -// if !ok { -// return fmt.Errorf("invalid latest block number: %s", latestBlock.Number) -// } - -// confirmations := new(big.Int).Sub(latestBlockNum, txBlockNum) -// required := big.NewInt(int64(requiredConfirmations)) - -// if confirmations.Cmp(required) < 0 { -// return fmt.Errorf("insufficient confirmations: got %s, need %d", confirmations.String(), requiredConfirmations) -// } - -// return nil -// } diff --git a/x/utxverifier/keeper/genesis_test.go b/x/utxverifier/keeper/genesis_test.go deleted file mode 100755 index 6b21cc06..00000000 --- a/x/utxverifier/keeper/genesis_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/pushchain/push-chain-node/x/utxverifier/types" - "github.com/stretchr/testify/require" -) - -func TestGenesis(t *testing.T) { - f := SetupTest(t) - - genesisState := &types.GenesisState{ - Params: types.DefaultParams(), - } - - f.k.InitGenesis(f.ctx, genesisState) - - got := f.k.ExportGenesis(f.ctx) - require.NotNil(t, got) - -} diff --git a/x/utxverifier/keeper/keeper.go b/x/utxverifier/keeper/keeper.go deleted file mode 100755 index 407625b0..00000000 --- a/x/utxverifier/keeper/keeper.go +++ /dev/null @@ -1,130 +0,0 @@ -package keeper - -import ( - "context" - "errors" - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - - "cosmossdk.io/collections" - storetypes "cosmossdk.io/core/store" - "cosmossdk.io/log" - "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -type Keeper struct { - cdc codec.BinaryCodec - - logger log.Logger - schemaBuilder *collections.SchemaBuilder - - // state management - Params collections.Item[types.Params] - VerifiedInboundTxs collections.Map[string, types.VerifiedTxMetadata] - - // keepers - uregistryKeeper types.UregistryKeeper - - authority string -} - -// NewKeeper creates a new Keeper instance -func NewKeeper( - cdc codec.BinaryCodec, - storeService storetypes.KVStoreService, - logger log.Logger, - authority string, - uregistryKeeper types.UregistryKeeper, -) Keeper { - logger = logger.With(log.ModuleKey, "x/"+types.ModuleName) - - sb := collections.NewSchemaBuilder(storeService) - - if authority == "" { - authority = authtypes.NewModuleAddress(govtypes.ModuleName).String() - } - - k := Keeper{ - cdc: cdc, - logger: logger, - schemaBuilder: sb, - - Params: collections.NewItem(sb, types.ParamsKey, types.ParamsName, codec.CollValue[types.Params](cdc)), - VerifiedInboundTxs: collections.NewMap( - sb, - types.VerifiedInboundTxsKeyPrefix, - types.VerifiedInboundTxsName, - collections.StringKey, - codec.CollValue[types.VerifiedTxMetadata](cdc), - ), - - authority: authority, - uregistryKeeper: uregistryKeeper, - } - - return k -} - -func (k Keeper) Logger() log.Logger { - return k.logger -} - -// InitGenesis initializes the module's state from a genesis state. -func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error { - - if err := data.Params.Validate(); err != nil { - return err - } - - return k.Params.Set(ctx, data.Params) -} - -// ExportGenesis exports the module's state to a genesis state. -func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { - params, err := k.Params.Get(ctx) - if err != nil { - panic(err) - } - - return &types.GenesisState{ - Params: params, - } -} - -func (k Keeper) StoreVerifiedInboundTx(ctx context.Context, chain, txHash string, verifiedTxMetadata types.VerifiedTxMetadata) error { - if chain == "" || txHash == "" { - return fmt.Errorf("chain, and tx_hash are required") - } - - storageKey := types.GetVerifiedInboundTxStorageKey(chain, txHash) - - return k.VerifiedInboundTxs.Set(ctx, storageKey, verifiedTxMetadata) -} - -func (k Keeper) GetVerifiedInboundTxMetadata(ctx context.Context, chain, txHash string) (*types.VerifiedTxMetadata, bool, error) { - storageKey := types.GetVerifiedInboundTxStorageKey(chain, txHash) - - data, err := k.VerifiedInboundTxs.Get(ctx, storageKey) - if err != nil { - if errors.Is(err, collections.ErrNotFound) { - // Not found, but not an actual error - return nil, false, nil - } - // Actual decoding or other storage error - return nil, false, err - } - - return &data, true, nil -} - -func (k Keeper) SchemaBuilder() *collections.SchemaBuilder { - return k.schemaBuilder -} - -func (k Keeper) GetURegistryKeeper() types.UregistryKeeper { - return k.uregistryKeeper -} diff --git a/x/utxverifier/keeper/keeper_test.go b/x/utxverifier/keeper/keeper_test.go deleted file mode 100755 index bafaaba6..00000000 --- a/x/utxverifier/keeper/keeper_test.go +++ /dev/null @@ -1,150 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/suite" - - "cosmossdk.io/core/address" - "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" - - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - sdkaddress "github.com/cosmos/cosmos-sdk/codec/address" - "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/testutil/integration" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - "github.com/pushchain/push-chain-node/app" - module "github.com/pushchain/push-chain-node/x/utxverifier" - "github.com/pushchain/push-chain-node/x/utxverifier/keeper" - "github.com/pushchain/push-chain-node/x/utxverifier/types" - - uregistryKeeper "github.com/pushchain/push-chain-node/x/uregistry/keeper" -) - -var maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - minttypes.ModuleName: {authtypes.Minter}, - govtypes.ModuleName: {authtypes.Burner}, -} - -type testFixture struct { - suite.Suite - - ctx sdk.Context - k keeper.Keeper - msgServer types.MsgServer - queryServer types.QueryServer - appModule *module.AppModule - - accountkeeper authkeeper.AccountKeeper - bankkeeper bankkeeper.BaseKeeper - stakingKeeper *stakingkeeper.Keeper - mintkeeper mintkeeper.Keeper - - addrs []sdk.AccAddress - govModAddr string -} - -func SetupTest(t *testing.T) *testFixture { - t.Helper() - f := new(testFixture) - - cfg := sdk.GetConfig() // do not seal, more set later - cfg.SetBech32PrefixForAccount(app.Bech32PrefixAccAddr, app.Bech32PrefixAccPub) - cfg.SetBech32PrefixForValidator(app.Bech32PrefixValAddr, app.Bech32PrefixValPub) - cfg.SetBech32PrefixForConsensusNode(app.Bech32PrefixConsAddr, app.Bech32PrefixConsPub) - cfg.SetCoinType(app.CoinType) - - validatorAddressCodec := sdkaddress.NewBech32Codec(app.Bech32PrefixValAddr) - accountAddressCodec := sdkaddress.NewBech32Codec(app.Bech32PrefixAccAddr) - consensusAddressCodec := sdkaddress.NewBech32Codec(app.Bech32PrefixConsAddr) - - // Base setup - logger := log.NewTestLogger(t) - encCfg := moduletestutil.MakeTestEncodingConfig() - - f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String() - f.addrs = simtestutil.CreateIncrementalAccounts(3) - - keys := storetypes.NewKVStoreKeys(authtypes.ModuleName, banktypes.ModuleName, stakingtypes.ModuleName, minttypes.ModuleName, types.ModuleName) - f.ctx = sdk.NewContext(integration.CreateMultiStore(keys, logger), cmtproto.Header{}, false, logger) - - // Register SDK modules. - registerBaseSDKModules(logger, f, encCfg, keys, accountAddressCodec, validatorAddressCodec, consensusAddressCodec) - - // Setup Keeper. - f.k = keeper.NewKeeper(encCfg.Codec, runtime.NewKVStoreService(keys[types.ModuleName]), logger, f.govModAddr, &uregistryKeeper.Keeper{}) - f.msgServer = keeper.NewMsgServerImpl(f.k) - f.queryServer = keeper.NewQuerier(f.k) - f.appModule = module.NewAppModule(encCfg.Codec, f.k, &uregistryKeeper.Keeper{}) - - return f -} - -func registerModuleInterfaces(encCfg moduletestutil.TestEncodingConfig) { - authtypes.RegisterInterfaces(encCfg.InterfaceRegistry) - stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry) - banktypes.RegisterInterfaces(encCfg.InterfaceRegistry) - minttypes.RegisterInterfaces(encCfg.InterfaceRegistry) - - types.RegisterInterfaces(encCfg.InterfaceRegistry) -} - -func registerBaseSDKModules( - logger log.Logger, - f *testFixture, - encCfg moduletestutil.TestEncodingConfig, - keys map[string]*storetypes.KVStoreKey, - ac address.Codec, - validator address.Codec, - consensus address.Codec, -) { - registerModuleInterfaces(encCfg) - - // Auth Keeper. - f.accountkeeper = authkeeper.NewAccountKeeper( - encCfg.Codec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), - authtypes.ProtoBaseAccount, - maccPerms, - ac, app.Bech32PrefixAccAddr, - f.govModAddr, - ) - - // Bank Keeper. - f.bankkeeper = bankkeeper.NewBaseKeeper( - encCfg.Codec, runtime.NewKVStoreService(keys[banktypes.StoreKey]), - f.accountkeeper, - nil, - f.govModAddr, logger, - ) - - // Staking Keeper. - f.stakingKeeper = stakingkeeper.NewKeeper( - encCfg.Codec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), - f.accountkeeper, f.bankkeeper, f.govModAddr, - validator, - consensus, - ) - - // Mint Keeper. - f.mintkeeper = mintkeeper.NewKeeper( - encCfg.Codec, runtime.NewKVStoreService(keys[minttypes.StoreKey]), - f.stakingKeeper, f.accountkeeper, f.bankkeeper, - authtypes.FeeCollectorName, f.govModAddr, - ) -} diff --git a/x/utxverifier/keeper/msg_server.go b/x/utxverifier/keeper/msg_server.go deleted file mode 100755 index 1d709c03..00000000 --- a/x/utxverifier/keeper/msg_server.go +++ /dev/null @@ -1,29 +0,0 @@ -package keeper - -import ( - "context" - - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - - "cosmossdk.io/errors" - "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -type msgServer struct { - k Keeper -} - -var _ types.MsgServer = msgServer{} - -// NewMsgServerImpl returns an implementation of the module MsgServer interface. -func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{k: keeper} -} - -func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { - if ms.k.authority != msg.Authority { - return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) - } - - return nil, ms.k.Params.Set(ctx, msg.Params) -} diff --git a/x/utxverifier/keeper/msg_server_test.go b/x/utxverifier/keeper/msg_server_test.go deleted file mode 100755 index 21869a7c..00000000 --- a/x/utxverifier/keeper/msg_server_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -func TestParams(t *testing.T) { - f := SetupTest(t) - require := require.New(t) - - testCases := []struct { - name string - request *types.MsgUpdateParams - err bool - }{ - { - name: "fail; invalid authority", - request: &types.MsgUpdateParams{ - Authority: f.addrs[0].String(), - Params: types.DefaultParams(), - }, - err: true, - }, - { - name: "success", - request: &types.MsgUpdateParams{ - Authority: f.govModAddr, - Params: types.DefaultParams(), - }, - err: false, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - _, err := f.msgServer.UpdateParams(f.ctx, tc.request) - - if tc.err { - require.Error(err) - } else { - require.NoError(err) - - r, err := f.queryServer.Params(f.ctx, &types.QueryParamsRequest{}) - require.NoError(err) - - require.EqualValues(&tc.request.Params, r.Params) - } - - }) - } -} diff --git a/x/utxverifier/keeper/query_server.go b/x/utxverifier/keeper/query_server.go deleted file mode 100755 index ca1a30c1..00000000 --- a/x/utxverifier/keeper/query_server.go +++ /dev/null @@ -1,57 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -var _ types.QueryServer = Querier{} - -type Querier struct { - Keeper -} - -func NewQuerier(keeper Keeper) Querier { - return Querier{Keeper: keeper} -} - -func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - - p, err := k.Keeper.Params.Get(ctx) - if err != nil { - return nil, err - } - - return &types.QueryParamsResponse{Params: &p}, nil -} - -// VerifiedTxHash returns the verified metadata (if any) for a given txHash on a chain. -func (q Querier) VerifiedTxHash( - goCtx context.Context, - req *types.QueryVerifiedTxHashRequest, -) (*types.QueryVerifiedTxHashResponse, error) { - if req.Chain == "" || req.TxHash == "" { - return nil, fmt.Errorf("chain and tx_hash are required") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - meta, found, err := q.Keeper.GetVerifiedInboundTxMetadata(ctx, req.Chain, req.TxHash) - if err != nil { - return nil, err - } - - resp := &types.QueryVerifiedTxHashResponse{ - Found: found, - } - if found { - resp.Metadata = meta - } - - return resp, nil -} diff --git a/x/utxverifier/keeper/svm_helpers.go b/x/utxverifier/keeper/svm_helpers.go deleted file mode 100644 index 00ee1f7a..00000000 --- a/x/utxverifier/keeper/svm_helpers.go +++ /dev/null @@ -1,215 +0,0 @@ -// svm_helpers.go -// SVM-specific helper functions used in inbound transaction verification. -package keeper - -import ( - "bytes" - "encoding/base64" - "encoding/binary" - "fmt" - "math/big" - "strings" - - "github.com/decred/base58" - // "github.com/pushchain/push-chain-node/utils/rpc" - // svmrpc "github.com/pushchain/push-chain-node/utils/rpc/svm" - - utxverifiertypes "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -func IsValidSVMSender(accountKeys []string, expectedHex string) (string, error) { - if len(accountKeys) == 0 { - return "", fmt.Errorf("no accounts found in transaction") - } - - sender := accountKeys[0] - senderBytes := base58.Decode(sender) - if senderBytes == nil { - return "", fmt.Errorf("failed to decode Solana address: %s", sender) - } - - senderHex := fmt.Sprintf("0x%x", senderBytes) - - if senderHex != expectedHex { - return "", fmt.Errorf("transaction sender %s (hex: %s) does not match expected %s", sender, senderHex, expectedHex) - } - - return senderHex, nil -} - -// compareSVMAddresses compares two Solana addresses by decoding them to raw bytes -func compareSVMAddresses(addr1, addr2 string) bool { - bytes1 := base58.Decode(addr1) - bytes2 := base58.Decode(addr2) - return bytes1 != nil && bytes2 != nil && bytes.Equal(bytes1, bytes2) -} - -// func IsValidSVMAddFundsInstruction( -// instructions []svmrpc.Instruction, -// accountKeys []string, -// chainConfig uregistrytypes.ChainConfig, -// ) error { -// for _, inst := range instructions { -// if inst.ProgramIDIndex < 0 || inst.ProgramIDIndex >= len(accountKeys) { -// return fmt.Errorf("invalid program ID index: %d", inst.ProgramIDIndex) -// } -// programID := accountKeys[inst.ProgramIDIndex] -// if !compareSVMAddresses(programID, chainConfig.GatewayAddress) { -// continue -// } - -// if len(inst.Accounts) == 0 { -// return fmt.Errorf("gateway instruction missing accounts") -// } -// if inst.Data == "" { -// return fmt.Errorf("gateway instruction missing data") -// } - -// dataBytes := base58.Decode(inst.Data) -// if dataBytes == nil || len(dataBytes) < 8 { -// return fmt.Errorf("invalid instruction data format") -// } -// actual := dataBytes[:8] - -// var expected []byte -// for _, method := range chainConfig.GatewayMethods { -// if method.Name == uregistrytypes.GATEWAY_METHOD.SVM.AddFunds { -// var err error -// expected, err = hex.DecodeString(method.Identifier) -// if err != nil { -// return fmt.Errorf("invalid expected discriminator: %w", err) -// } -// break -// } -// } -// if expected == nil { -// return fmt.Errorf("add_funds method not found in config") -// } -// if !bytes.Equal(actual, expected) { -// return fmt.Errorf("discriminator mismatch: expected %x, got %x", expected, actual) -// } -// return nil // ✅ Valid instruction found -// } -// return fmt.Errorf("no instruction found calling gateway address %s", chainConfig.GatewayAddress) -// } - -// // Checks if a given svm tx hash has enough confirmations -// func CheckSVMBlockConfirmations( -// ctx context.Context, -// txHashBase58 string, -// rpcCfg rpc.RpcCallConfig, -// requiredConfirmations uint64, -// ) error { -// // Fetch transaction receipt -// tx, err := svmrpc.SVMGetTransactionBySig(ctx, rpcCfg, txHashBase58) -// if err != nil { -// return fmt.Errorf("fetch tx failed: %w", err) -// } - -// currentSlot, err := svmrpc.SVMGetCurrentSlot(ctx, rpcCfg) -// if err != nil { -// return fmt.Errorf("fetch current slot failed: %w", err) -// } - -// confirmations := currentSlot - tx.Slot -// if confirmations < uint64(requiredConfirmations) { -// return fmt.Errorf("insufficient confirmations: got %d, need %d", confirmations, requiredConfirmations) -// } - -// return nil -// } - -// ParseSVMFundsAddedLog parses Solana log messages to extract the FundsAddedEvent -// @param logMessages Program logs from the transaction -// @param expectedDiscriminator First 8 bytes of event identifier -// @return event data or error if not found or corrupted -func ParseSVMFundsAddedEventLog( - logMessages []string, - expectedDiscriminator []byte, -) ([]utxverifiertypes.SVMFundsAddedEventData, error) { - - var results []utxverifiertypes.SVMFundsAddedEventData - - for _, log := range logMessages { - if strings.HasPrefix(log, "Program data: ") { - encoded := strings.TrimPrefix(log, "Program data: ") - - // Decode base64 - raw, err := base64.StdEncoding.DecodeString(encoded) - if err != nil || len(raw) < 92 { - continue - } - - // Check discriminator match - if !bytes.Equal(raw[:8], expectedDiscriminator) { - continue - } - - eventBytes := raw[8:] - - // Check event length for all fields: 32 + 8 + 16 + 4 + 32 = 92 bytes - if len(eventBytes) < 92 { - continue - } - - usdAmount := readI128LE(eventBytes[40:56]) - usdExponent := int32(binary.LittleEndian.Uint32(eventBytes[56:60])) - txHashBytes := eventBytes[60:92] - - // Normalize exponent into decimals - var decimals uint32 - if usdExponent < 0 { - decimals = uint32(-usdExponent) - // no scaling needed - } else { - decimals = uint32(usdExponent) - multiplier := new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(usdExponent)), nil) - usdAmount = new(big.Int).Mul(usdAmount, multiplier) - } - - results = append(results, utxverifiertypes.SVMFundsAddedEventData{ - AmountInUSD: usdAmount, - Decimals: decimals, - PayloadHash: fmt.Sprintf("0x%x", txHashBytes), - }) - } - } - - if len(results) == 0 { - return nil, fmt.Errorf("amount not found with expected discriminator %s", expectedDiscriminator) - } - - return results, nil -} - -// readI128LE decodes a little-endian i128 value from Anchor logs -func readI128LE(b []byte) *big.Int { - if len(b) != 16 { - panic("i128 must be 16 bytes") - } - - // Interpret as little-endian - // Copy bytes into 16-byte array - var le [16]byte - copy(le[:], b[:16]) - - // Convert to big.Int (will be positive) - i := new(big.Int).SetBytes(reverseBytes(le[:])) - - // Check if it's negative (signed i128) - if le[15]&0x80 != 0 { - // 2's complement negative: i - 2^128 - two128 := new(big.Int).Lsh(big.NewInt(1), 128) - i.Sub(i, two128) - } - return i -} - -// reverseBytes reverses a byte slice (from little to big-endian) -func reverseBytes(b []byte) []byte { - out := make([]byte, len(b)) - for i := range b { - out[i] = b[len(b)-1-i] - } - return out -} diff --git a/x/utxverifier/keeper/verify_and_get_payload.go b/x/utxverifier/keeper/verify_and_get_payload.go deleted file mode 100644 index da3fb138..00000000 --- a/x/utxverifier/keeper/verify_and_get_payload.go +++ /dev/null @@ -1,38 +0,0 @@ -package keeper - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - uregistrytypes "github.com/pushchain/push-chain-node/x/uregistry/types" -) - -// VerifyAndGetLockedFunds verifies if the user has interacted with the gateway on the source chain and send the locked funds amount. -func (k Keeper) VerifyAndGetPayloadHash(ctx sdk.Context, ownerKey, txHash, chain string) ([]string, error) { - // Step 1: Load chain config - chainConfig, err := k.uregistryKeeper.GetChainConfig(ctx, chain) - if err != nil { - return nil, err - } - - if !chainConfig.Enabled.IsInboundEnabled { - return nil, fmt.Errorf("chain %s is not enabled", chain) - } - - switch chainConfig.VmType { - case uregistrytypes.VmType_EVM: - payloadHashes, err := k.verifyEVMAndGetPayload(ctx, ownerKey, txHash, chainConfig) - if err != nil { - return nil, fmt.Errorf("evm tx verification failed: %w", err) - } - return payloadHashes, nil - case uregistrytypes.VmType_SVM: - payloadHashes, err := k.verifySVMAndGetPayload(ctx, ownerKey, txHash, chainConfig) - if err != nil { - return nil, fmt.Errorf("svm tx verification failed: %w", err) - } - return payloadHashes, nil - default: - return nil, fmt.Errorf("unsupported VM type %s for chain %s", chainConfig.VmType.String(), chain) - } -} diff --git a/x/utxverifier/keeper/verify_and_send_funds_tx.go b/x/utxverifier/keeper/verify_and_send_funds_tx.go deleted file mode 100644 index 19353e35..00000000 --- a/x/utxverifier/keeper/verify_and_send_funds_tx.go +++ /dev/null @@ -1,41 +0,0 @@ -package keeper - -// VerifyAndGetLockedFunds verifies if the user has interacted with the gateway on the source chain and send the locked funds amount. -// func (k Keeper) VerifyAndGetLockedFunds(ctx context.Context, ownerKey, txHash, chain string) (big.Int, uint32, error) { -// // Step 1: Load chain config -// chainConfig, err := k.uregistryKeeper.GetChainConfig(ctx, chain) -// if err != nil { -// return *big.NewInt(0), 0, err -// } - -// if !chainConfig.Enabled.IsInboundEnabled { -// return *big.NewInt(0), 0, fmt.Errorf("chain %s is not enabled", chain) -// } - -// switch chainConfig.VmType { -// case uregistrytypes.VmType_EVM: -// usdValue, err := k.verifyEVMAndGetFunds(ctx, ownerKey, txHash, chainConfig) -// if err != nil { -// return *big.NewInt(0), 0, fmt.Errorf("evm tx verification failed: %w", err) -// } -// usdAmount := new(big.Int) -// usdAmount, ok := usdAmount.SetString(usdValue.Amount, 10) // base 10 -// if !ok { -// return *big.NewInt(0), 0, fmt.Errorf("invalid amount string: %s", usdValue.Amount) -// } -// return *usdAmount, usdValue.Decimals, nil -// case uregistrytypes.VmType_SVM: -// usdValue, err := k.verifySVMAndGetFunds(ctx, ownerKey, txHash, chainConfig) -// if err != nil { -// return *big.NewInt(0), 0, fmt.Errorf("svm tx verification failed: %w", err) -// } -// usdAmount := new(big.Int) -// usdAmount, ok := usdAmount.SetString(usdValue.Amount, 10) // base 10 -// if !ok { -// return *big.NewInt(0), 0, fmt.Errorf("invalid amount string: %s", usdValue.Amount) -// } -// return *usdAmount, usdValue.Decimals, nil -// default: -// return *big.NewInt(0), 0, fmt.Errorf("unsupported VM type %s for chain %s", chainConfig.VmType.String(), chain) -// } -// } diff --git a/x/utxverifier/keeper/verify_gateway_interaction_tx.go b/x/utxverifier/keeper/verify_gateway_interaction_tx.go deleted file mode 100644 index 6f828cc9..00000000 --- a/x/utxverifier/keeper/verify_gateway_interaction_tx.go +++ /dev/null @@ -1,28 +0,0 @@ -package keeper - -// VerifyGatewayInteractionTx only verifies if the user has interacted with the gateway on the source chain. -// func (k Keeper) VerifyGatewayInteractionTx(ctx context.Context, ownerKey, txHash, chain string) error { -// // Step 1: Load chain config -// chainConfig, err := k.uregistryKeeper.GetChainConfig(ctx, chain) -// if err != nil { -// return err -// } - -// if !chainConfig.Enabled.IsInboundEnabled { -// return fmt.Errorf("chain %s is not enabled", chain) -// } - -// switch chainConfig.VmType { -// case uregistrytypes.VmType_EVM: -// if err := k.verifyEVMInteraction(ctx, ownerKey, txHash, chainConfig); err != nil { -// return fmt.Errorf("evm tx verification failed: %w", err) -// } -// case uregistrytypes.VmType_SVM: -// if err := k.verifySVMInteraction(ctx, ownerKey, txHash, chainConfig); err != nil { -// return fmt.Errorf("svm tx verification failed: %w", err) -// } -// default: -// return fmt.Errorf("unsupported VM type %s for chain %s", chainConfig.VmType.String(), chain) -// } -// return nil -// } diff --git a/x/utxverifier/keeper/verify_tx_evm.go b/x/utxverifier/keeper/verify_tx_evm.go deleted file mode 100644 index ae5442eb..00000000 --- a/x/utxverifier/keeper/verify_tx_evm.go +++ /dev/null @@ -1,179 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - // "github.com/pushchain/push-chain-node/utils/rpc" - // evmrpc "github.com/pushchain/push-chain-node/utils/rpc/evm" - uregistrytypes "github.com/pushchain/push-chain-node/x/uregistry/types" - utxverifiertypes "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -// verifyEVMInteraction verifies user interacted with gateway by checking tx sent by ownerKey to gateway contract -func (k Keeper) verifyEVMInteraction(ctx context.Context, ownerKey, txHash string, chainConfig uregistrytypes.ChainConfig) error { - _, err := k.VerifyEVMInboundTx(ctx, ownerKey, txHash, chainConfig) - if err != nil { - return err - } - - return nil -} - -// verifyEVMAndGetPayload verifies and extracts payloadHash sent by the user in the tx -func (k Keeper) verifyEVMAndGetPayload(ctx context.Context, ownerKey, txHash string, chainConfig uregistrytypes.ChainConfig) ([]string, error) { - metadata, err := k.VerifyEVMInboundTx(ctx, ownerKey, txHash, chainConfig) - if err != nil { - return nil, err - } - - return metadata.PayloadHashes, err -} - -// Verifies and extracts locked amount (used in mint) -func (k Keeper) verifyEVMAndGetFunds(ctx context.Context, ownerKey, txHash string, chainConfig uregistrytypes.ChainConfig) (*utxverifiertypes.USDValue, error) { - // Fetch stored metadata - metadata, err := k.VerifyEVMInboundTx(ctx, ownerKey, txHash, chainConfig) - if err != nil { - return nil, err - } - - // Check if already minted - if metadata.Minted { - return nil, fmt.Errorf("tokens already minted for txHash %s on chain %s", txHash, chainConfig.Chain) - } - - // rpcCfg := rpc.RpcCallConfig{ - // PrivateRPC: utils.GetEnvRPCOverride(chainConfig.Chain), - // PublicRPC: chainConfig.PublicRpcUrl, - // } - - // Check for valid block confirmations - // err = CheckEVMBlockConfirmations(ctx, txHash, rpcCfg, uint64(chainConfig.BlockConfirmation.FastInbound)) - // if err != nil { - // return nil, err - // } - - // Mutate the original metadata - metadata.Minted = true - - // Step 4: Mutate Minted to true in the stored metadata - err = k.StoreVerifiedInboundTx(ctx, chainConfig.Chain, txHash, *metadata) - if err != nil { - return nil, err - } - - return metadata.UsdValue, nil -} - -func (k Keeper) VerifyEVMInboundTx( - ctx context.Context, - ownerKey, txHash string, - chainConfig uregistrytypes.ChainConfig, -) (*utxverifiertypes.VerifiedTxMetadata, error) { - meta, found, err := k.GetVerifiedInboundTxMetadata(ctx, chainConfig.Chain, txHash) - if err != nil { - return nil, fmt.Errorf("failed to fetch metadata: %w", err) - } - - if found { - ok := compareEVMAddr(meta.Sender, ownerKey) - if !ok { - return nil, fmt.Errorf("ownerKey and sender of the tx mismatched: expected %s, got %s", meta.Sender, ownerKey) - } - return meta, nil - } - - // If not found, perform verification - return nil, fmt.Errorf("removed rpc calls") -} - -// func (k Keeper) EVMProcessUnverifiedInboundTx( -// ctx context.Context, -// ownerKey, txHash string, -// chainConfig uregistrytypes.ChainConfig, -// ) (*utxverifiertypes.VerifiedTxMetadata, error) { -// rpcCfg := rpc.RpcCallConfig{ -// PrivateRPC: utils.GetEnvRPCOverride(chainConfig.Chain), -// PublicRPC: chainConfig.PublicRpcUrl, -// } - -// // Step 1: Fetch transaction receipt -// receipt, err := evmrpc.EVMGetTransactionReceipt(ctx, rpcCfg, txHash) -// if err != nil { -// return nil, fmt.Errorf("fetch receipt failed: %w", err) -// } - -// // Step 2: Fetch transaction details -// tx, err := evmrpc.EVMGetTransactionByHash(ctx, rpcCfg, txHash) -// if err != nil { -// return nil, fmt.Errorf("failed to fetch transaction: %w", err) -// } - -// // Normalize addresses for comparison -// from := NormalizeEVMAddress(receipt.From) -// to := NormalizeEVMAddress(receipt.To) -// expectedFrom := NormalizeEVMAddress(ownerKey) -// expectedTo := NormalizeEVMAddress(chainConfig.GatewayAddress) -// // fmt.Print(to) -// // fmt.Print(expectedTo) - -// // INPUT CHECKS -// // Check 1: Verify if ownerKey is Valid From address -// if !compareEVMAddr(from, expectedFrom) { -// return nil, fmt.Errorf("transaction sender %s does not match ownerKey %s", tx.From, expectedFrom) -// } - -// // Check 2: Verify if tx.To is Valid gateway address -// if !isValidEVMGateway(to, expectedTo) { -// return nil, fmt.Errorf("transaction recipient %s is not gateway address %s", tx.To, expectedTo) -// } - -// // Check 3: Verify if transaction is calling addFunds method -// // ok, selector := isEVMTxCallingAddFunds(tx.Input, chainConfig) -// // if !ok { -// // return nil, fmt.Errorf("transaction is not calling addFunds, expected selector %s but got input %s", selector, tx.Input) -// // } - -// // Step 3: Extract values from logs -// eventTopic := "" -// for _, method := range chainConfig.GatewayMethods { -// if method.Name == uregistrytypes.GATEWAY_METHOD.EVM.AddFunds { -// eventTopic = method.EventIdentifier -// break -// } -// } -// if eventTopic == "" { -// return nil, fmt.Errorf("addFunds method not found in gateway methods") -// } - -// fundsAddedEventLogs, err := ParseEVMFundsAddedEventLogs(receipt.Logs, eventTopic) -// if err != nil { -// return nil, fmt.Errorf("amount extract failed: %w", err) -// } - -// // Collect all payload hashes -// payloadHashes := make([]string, len(fundsAddedEventLogs)) -// for i, log := range fundsAddedEventLogs { -// payloadHashes[i] = log.PayloadHash -// } - -// metadata := utxverifiertypes.VerifiedTxMetadata{ -// Minted: false, -// PayloadHashes: payloadHashes, -// UsdValue: &utxverifiertypes.USDValue{ -// Amount: fundsAddedEventLogs[0].AmountInUSD.String(), -// Decimals: fundsAddedEventLogs[0].Decimals, -// }, -// Sender: ownerKey, -// } - -// // Step 4: Store verified inbound tx in storage -// err = k.StoreVerifiedInboundTx(ctx, chainConfig.Chain, txHash, metadata) -// if err != nil { -// return nil, err -// } - -// // Step 5: Return the metadata -// return &metadata, nil -// } diff --git a/x/utxverifier/keeper/verify_tx_svm.go b/x/utxverifier/keeper/verify_tx_svm.go deleted file mode 100644 index afb673c3..00000000 --- a/x/utxverifier/keeper/verify_tx_svm.go +++ /dev/null @@ -1,184 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - // "github.com/pushchain/push-chain-node/utils/rpc" - // svmrpc "github.com/pushchain/push-chain-node/utils/rpc/svm" - uregistrytypes "github.com/pushchain/push-chain-node/x/uregistry/types" - utxverifiertypes "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -// verifySVMInteraction verifies user interacted with gateway by checking tx sent by ownerKey to gateway contract -func (k Keeper) verifySVMInteraction(ctx context.Context, ownerKey, txHash string, chainConfig uregistrytypes.ChainConfig) error { - _, err := k.VerifySVMInboundTx(ctx, ownerKey, txHash, chainConfig) - if err != nil { - return err - } - - return nil -} - -// verifyEVMAndGetPayload verifies and extracts payloadHash sent by the user in the tx -func (k Keeper) verifySVMAndGetPayload(ctx context.Context, ownerKey, txHash string, chainConfig uregistrytypes.ChainConfig) ([]string, error) { - metadata, err := k.VerifySVMInboundTx(ctx, ownerKey, txHash, chainConfig) - if err != nil { - return nil, err - } - - return metadata.PayloadHashes, err -} - -// verifySVMAndGetFunds verifies transaction and extracts locked amount -// func (k Keeper) verifySVMAndGetFunds(ctx context.Context, ownerKey, txHash string, chainConfig uregistrytypes.ChainConfig) (*utxverifiertypes.USDValue, error) { -// // Fetch stored metadata -// metadata, err := k.VerifySVMInboundTx(ctx, ownerKey, txHash, chainConfig) -// if err != nil { -// return nil, err -// } - -// // Check if already minted -// if metadata.Minted { -// return nil, fmt.Errorf("tokens already minted for txHash %s on chain %s", txHash, chainConfig.Chain) -// } - -// // rpcCfg := rpc.RpcCallConfig{ -// // PrivateRPC: utils.GetEnvRPCOverride(chainConfig.Chain), -// // PublicRPC: chainConfig.PublicRpcUrl, -// // } - -// // txHashBase58, err := utxverifiertypes.NormalizeTxHash(txHash, chainConfig.VmType) -// // if err != nil { -// // return nil, fmt.Errorf("failed to normalize tx hash: %w", err) -// // } - -// // Check for valid block confirmations -// // err = CheckSVMBlockConfirmations(ctx, txHashBase58, rpcCfg, uint64(chainConfig.BlockConfirmation.FastInbound)) -// // if err != nil { -// // return nil, err -// // } - -// // Mutate the original metadata -// metadata.Minted = true - -// // Step 4: Mutate Minted to true in the stored metadata -// err = k.StoreVerifiedInboundTx(ctx, chainConfig.Chain, txHash, *metadata) -// if err != nil { -// return nil, err -// } - -// return metadata.UsdValue, nil -// } - -func (k Keeper) VerifySVMInboundTx( - ctx context.Context, - ownerKey, txHash string, - chainConfig uregistrytypes.ChainConfig, -) (*utxverifiertypes.VerifiedTxMetadata, error) { - meta, found, err := k.GetVerifiedInboundTxMetadata(ctx, chainConfig.Chain, txHash) - if err != nil { - return nil, fmt.Errorf("failed to fetch metadata: %w", err) - } - - if found { - ok := compareSVMAddresses(meta.Sender, ownerKey) - if !ok { - return nil, fmt.Errorf("ownerKey and sender of the tx mismatched: expected %s, got %s", meta.Sender, ownerKey) - } - return meta, nil - } - - // If not found, perform verification - return nil, fmt.Errorf("removed rpc calls") -} - -// func (k Keeper) SVMProcessUnverifiedInboundTx( -// ctx context.Context, -// ownerKey, txHash string, -// chainConfig uregistrytypes.ChainConfig, -// ) (*utxverifiertypes.VerifiedTxMetadata, error) { -// rpcCfg := rpc.RpcCallConfig{ -// PrivateRPC: utils.GetEnvRPCOverride(chainConfig.Chain), -// PublicRPC: chainConfig.PublicRpcUrl, -// } - -// txHashBase58, err := utxverifiertypes.NormalizeTxHash(txHash, chainConfig.VmType) -// if err != nil { -// return nil, fmt.Errorf("failed to normalize tx hash: %w", err) -// } - -// // Step 1: Fetch transaction receipt -// tx, err := svmrpc.SVMGetTransactionBySig(ctx, rpcCfg, txHashBase58) -// if err != nil { -// return nil, fmt.Errorf("failed to fetch transaction: %w", err) -// } - -// // Verify transaction status -// if tx.Meta.Err != nil { -// return nil, fmt.Errorf("transaction failed with error: %v", tx.Meta.Err) -// } - -// // Check 1: Check 1: Verify if ownerKey is Valid sender address -// _, err = IsValidSVMSender(tx.Transaction.Message.AccountKeys, ownerKey) -// if err != nil { -// return nil, err -// } - -// // Verify program ID -// if len(tx.Transaction.Message.Instructions) == 0 { -// return nil, fmt.Errorf("no instructions found in transaction") -// } - -// // Check2: Check if any instruction calls the gateway contract -// // err = IsValidSVMAddFundsInstruction(tx.Transaction.Message.Instructions, tx.Transaction.Message.AccountKeys, chainConfig) -// // if err != nil { -// // return nil, err -// // } - -// // Step 3: Parse logs for FundsAddedEvent -// // Get the event discriminator from chain config -// var eventDiscriminator []byte -// for _, method := range chainConfig.GatewayMethods { -// if method.Name == uregistrytypes.GATEWAY_METHOD.SVM.AddFunds { -// eventDiscriminator, err = hex.DecodeString(method.EventIdentifier) -// if err != nil { -// return nil, fmt.Errorf("invalid event discriminator in chain config: %w", err) -// } -// break -// } -// } -// if eventDiscriminator == nil { -// return nil, fmt.Errorf("add_funds method not found in chain config") -// } - -// fundsAddedEventLogs, err := ParseSVMFundsAddedEventLog(tx.Meta.LogMessages, eventDiscriminator) -// if err != nil { -// return nil, fmt.Errorf("amount extract failed: %w", err) -// } - -// // Collect all payload hashes -// payloadHashes := make([]string, len(fundsAddedEventLogs)) -// for i, log := range fundsAddedEventLogs { -// payloadHashes[i] = log.PayloadHash -// } - -// metadata := utxverifiertypes.VerifiedTxMetadata{ -// Minted: false, -// PayloadHashes: payloadHashes, -// UsdValue: &utxverifiertypes.USDValue{ -// Amount: fundsAddedEventLogs[0].AmountInUSD.String(), -// Decimals: fundsAddedEventLogs[0].Decimals, -// }, -// Sender: ownerKey, -// } - -// // Step 4: Store verified inbound tx in storage -// err = k.StoreVerifiedInboundTx(ctx, chainConfig.Chain, txHash, metadata) -// if err != nil { -// return nil, err -// } - -// // Step 5: Return the metadata -// return &metadata, nil -// } diff --git a/x/utxverifier/migrations/v2/migrate.go b/x/utxverifier/migrations/v2/migrate.go deleted file mode 100644 index ef747dbe..00000000 --- a/x/utxverifier/migrations/v2/migrate.go +++ /dev/null @@ -1,80 +0,0 @@ -package v2 - -import ( - "fmt" - - "cosmossdk.io/collections" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/pushchain/push-chain-node/x/utxverifier/keeper" - utxverifiertypes "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -// OldVerifiedTxMetadata matches the old on-disk protobuf shape (single PayloadHash) -type OldVerifiedTxMetadata struct { - Minted bool `protobuf:"varint,1,opt,name=minted,proto3" json:"minted,omitempty"` - PayloadHash string `protobuf:"bytes,2,opt,name=payload_hash,proto3" json:"payload_hash,omitempty"` - UsdValue *utxverifiertypes.USDValue `protobuf:"bytes,3,opt,name=usd_value,proto3" json:"usd_value,omitempty"` - Sender string `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"` -} - -func (*OldVerifiedTxMetadata) ProtoMessage() {} -func (m *OldVerifiedTxMetadata) Reset() { *m = OldVerifiedTxMetadata{} } -func (m *OldVerifiedTxMetadata) String() string { return fmt.Sprintf("%+v", *m) } - -// MigrateVerifiedInboundTxs converts old VerifiedTxMetadata (single PayloadHash) to the new shape -// (PayloadHashes []string) using the keeper's collections API. -func MigrateVerifiedInboundTxs(ctx sdk.Context, k *keeper.Keeper, cdc codec.BinaryCodec) error { - // Build a schema builder – use the keeper's SchemaBuilder so it points to the same store service. - sb := k.SchemaBuilder() - - // Create a temporary map that decodes values using the OLD struct type. - oldMap := collections.NewMap( - sb, - utxverifiertypes.VerifiedInboundTxsKeyPrefix, - utxverifiertypes.VerifiedInboundTxsName, - collections.StringKey, - codec.CollValue[OldVerifiedTxMetadata](cdc), - ) - - // Iterate old map - iter, err := oldMap.Iterate(ctx, nil) // nil => iterate all keys - if err != nil { - return err - } - defer iter.Close() - - for ; iter.Valid(); iter.Next() { - key, err := iter.Key() - if err != nil { - return err - } - - oldMeta, err := iter.Value() - if err != nil { - return err - } - - // Construct the new metadata type - newMeta := utxverifiertypes.VerifiedTxMetadata{ - Minted: oldMeta.Minted, - UsdValue: oldMeta.UsdValue, - Sender: oldMeta.Sender, - } - - // Wrap the old single payload hash into a slice (if present) - if oldMeta.PayloadHash != "" { - newMeta.PayloadHashes = []string{oldMeta.PayloadHash} - } else { - newMeta.PayloadHashes = []string{} - } - - // Persist using the keeper's new collection - if err := k.VerifiedInboundTxs.Set(ctx, key, newMeta); err != nil { - return err - } - } - - return nil -} diff --git a/x/utxverifier/module.go b/x/utxverifier/module.go deleted file mode 100755 index 837f8b75..00000000 --- a/x/utxverifier/module.go +++ /dev/null @@ -1,168 +0,0 @@ -package module - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - - abci "github.com/cometbft/cometbft/abci/types" - - "cosmossdk.io/client/v2/autocli" - errorsmod "cosmossdk.io/errors" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - - "github.com/pushchain/push-chain-node/x/utxverifier/keeper" - v2 "github.com/pushchain/push-chain-node/x/utxverifier/migrations/v2" - "github.com/pushchain/push-chain-node/x/utxverifier/types" -) - -const ( - // ConsensusVersion defines the current x/utxverifier module consensus version. - ConsensusVersion = 2 -) - -var ( - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleGenesis = AppModule{} - _ module.AppModule = AppModule{} - - _ autocli.HasAutoCLIConfig = AppModule{} -) - -// AppModuleBasic defines the basic application module used by the wasm module. -type AppModuleBasic struct { - cdc codec.Codec -} - -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper - uregistryKeeper types.UregistryKeeper -} - -// NewAppModule constructor -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - uregistryKeeper types.UregistryKeeper, -) *AppModule { - return &AppModule{ - AppModuleBasic: AppModuleBasic{cdc: cdc}, - keeper: keeper, - uregistryKeeper: uregistryKeeper, - } -} - -func (a AppModuleBasic) Name() string { - return types.ModuleName -} - -func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(&types.GenesisState{ - Params: types.DefaultParams(), - }) -} - -func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error { - var data types.GenesisState - err := marshaler.UnmarshalJSON(message, &data) - if err != nil { - return err - } - if err := data.Params.Validate(); err != nil { - return errorsmod.Wrap(err, "params") - } - return nil -} - -func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { -} - -func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) - if err != nil { - // same behavior as in cosmos-sdk - panic(err) - } -} - -// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods. -/* -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() -} - -func (a AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} -*/ - -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterLegacyAminoCodec(cdc) -} - -func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) { - types.RegisterInterfaces(r) -} - -func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { - var genesisState types.GenesisState - marshaler.MustUnmarshalJSON(message, &genesisState) - - if err := a.keeper.Params.Set(ctx, genesisState.Params); err != nil { - panic(err) - } - - if err := a.keeper.InitGenesis(ctx, &genesisState); err != nil { - panic(err) - } - - return nil -} - -func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage { - genState := a.keeper.ExportGenesis(ctx) - return marshaler.MustMarshalJSON(genState) -} - -func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { -} - -func (a AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -func (a AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(a.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(a.keeper)) - - // Register UExecutor custom migration for v2 (from version 1 → 2) - if err := cfg.RegisterMigration(types.ModuleName, 1, a.migrateToV2()); err != nil { - panic(fmt.Sprintf("failed to migrate %s from version 1 to 2: %v", types.ModuleName, err)) - } -} - -func (a AppModule) migrateToV2() module.MigrationHandler { - return func(ctx sdk.Context) error { - ctx.Logger().Info("🔧 Running uexecutor module migration: v1 → v2") - - return v2.MigrateVerifiedInboundTxs(ctx, &a.keeper, a.AppModuleBasic.cdc) - } -} - -// 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 (a AppModule) ConsensusVersion() uint64 { - return ConsensusVersion -} diff --git a/x/utxverifier/types/codec.go b/x/utxverifier/types/codec.go deleted file mode 100755 index 6d57a9e3..00000000 --- a/x/utxverifier/types/codec.go +++ /dev/null @@ -1,35 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" -) - -var ( - amino = codec.NewLegacyAmino() - AminoCdc = codec.NewAminoCodec(amino) -) - -func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - sdk.RegisterLegacyAminoCodec(amino) -} - -// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil) -} - -func RegisterInterfaces(registry types.InterfaceRegistry) { - - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgUpdateParams{}, - ) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} diff --git a/x/utxverifier/types/events.go b/x/utxverifier/types/events.go deleted file mode 100644 index 24ae013b..00000000 --- a/x/utxverifier/types/events.go +++ /dev/null @@ -1,17 +0,0 @@ -package types - -import "math/big" - -// EVMFundsAddedEventData represents decoded data from the `FundsAdded` EVM event. -type EVMFundsAddedEventData struct { - AmountInUSD *big.Int - Decimals uint32 - PayloadHash string -} - -// SVMFundsAddedEventData represents decoded FundsAdded event from Solana -type SVMFundsAddedEventData struct { - AmountInUSD *big.Int - Decimals uint32 - PayloadHash string // hex-encoded -} diff --git a/x/utxverifier/types/expected_keepers.go b/x/utxverifier/types/expected_keepers.go deleted file mode 100644 index 2d58bee3..00000000 --- a/x/utxverifier/types/expected_keepers.go +++ /dev/null @@ -1,12 +0,0 @@ -package types - -import ( - "context" - - "github.com/pushchain/push-chain-node/x/uregistry/types" -) - -// UregistryKeeper defines the expected interface for the Uregistry module. -type UregistryKeeper interface { - GetChainConfig(ctx context.Context, chain string) (types.ChainConfig, error) -} diff --git a/x/utxverifier/types/genesis.go b/x/utxverifier/types/genesis.go deleted file mode 100755 index 97cad761..00000000 --- a/x/utxverifier/types/genesis.go +++ /dev/null @@ -1,19 +0,0 @@ -package types - -// DefaultIndex is the default global index -const DefaultIndex uint64 = 1 - -// DefaultGenesis returns the default genesis state -func DefaultGenesis() *GenesisState { - return &GenesisState{ - - Params: DefaultParams(), - } -} - -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - - return gs.Params.Validate() -} diff --git a/x/utxverifier/types/genesis.pb.go b/x/utxverifier/types/genesis.pb.go deleted file mode 100644 index 1409815e..00000000 --- a/x/utxverifier/types/genesis.pb.go +++ /dev/null @@ -1,511 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: utxverifier/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 defines the module genesis state -type GenesisState struct { - // Params defines all the parameters of the module. - 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_f1dbfd8715cad179, []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{} -} - -// Params defines the set of module parameters. -type Params struct { - SomeValue bool `protobuf:"varint,2,opt,name=some_value,json=someValue,proto3" json:"some_value,omitempty"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_f1dbfd8715cad179, []int{1} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetSomeValue() bool { - if m != nil { - return m.SomeValue - } - return false -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "utxverifier.v1.GenesisState") - proto.RegisterType((*Params)(nil), "utxverifier.v1.Params") -} - -func init() { proto.RegisterFile("utxverifier/v1/genesis.proto", fileDescriptor_f1dbfd8715cad179) } - -var fileDescriptor_f1dbfd8715cad179 = []byte{ - // 259 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0x2d, 0xa9, 0x28, - 0x4b, 0x2d, 0xca, 0x4c, 0xcb, 0x4c, 0x2d, 0xd2, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, - 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x43, 0x92, 0xd5, 0x2b, 0x33, 0x94, - 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xe9, 0x83, 0x58, 0x10, 0x55, 0x52, 0x82, 0x89, 0xb9, - 0x99, 0x79, 0xf9, 0xfa, 0x60, 0x12, 0x22, 0xa4, 0xe4, 0xc2, 0xc5, 0xe3, 0x0e, 0x31, 0x29, 0xb8, - 0x24, 0xb1, 0x24, 0x55, 0xc8, 0x84, 0x8b, 0xad, 0x20, 0xb1, 0x28, 0x31, 0xb7, 0x58, 0x82, 0x51, - 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4c, 0x0f, 0xd5, 0x64, 0xbd, 0x00, 0xb0, 0xac, 0x13, 0xcb, 0x89, - 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0xb5, 0x4a, 0x1e, 0x5c, 0x6c, 0x10, 0x71, 0x21, 0x59, 0x2e, 0xae, - 0xe2, 0xfc, 0xdc, 0xd4, 0xf8, 0xb2, 0xc4, 0x9c, 0xd2, 0x54, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x8e, - 0x20, 0x4e, 0x90, 0x48, 0x18, 0x48, 0xc0, 0x4a, 0x7e, 0xc6, 0x02, 0x79, 0x86, 0x17, 0x0b, 0xe4, - 0x19, 0xbb, 0x9e, 0x6f, 0xd0, 0x12, 0x42, 0xf6, 0x12, 0xc4, 0x24, 0xa7, 0xa0, 0x13, 0x8f, 0xe4, - 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, - 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xb2, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, - 0xce, 0xcf, 0xd5, 0x2f, 0x28, 0x2d, 0xce, 0x48, 0xce, 0x48, 0xcc, 0xcc, 0x03, 0xb3, 0x74, 0xc1, - 0x4c, 0xdd, 0xbc, 0xfc, 0x94, 0x54, 0xfd, 0x0a, 0x7d, 0x64, 0x43, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, - 0x93, 0xd8, 0xc0, 0x5e, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x86, 0x82, 0x39, 0x79, 0x43, - 0x01, 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.SomeValue != that1.SomeValue { - return false - } - return true -} -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 (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.SomeValue { - i-- - if m.SomeValue { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - 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 (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SomeValue { - n += 2 - } - 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 (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 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: 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 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SomeValue", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SomeValue = bool(v != 0) - 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/utxverifier/types/genesis_test.go b/x/utxverifier/types/genesis_test.go deleted file mode 100755 index 69cb47d8..00000000 --- a/x/utxverifier/types/genesis_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/pushchain/push-chain-node/x/utxverifier/types" - - "github.com/stretchr/testify/require" -) - -func TestGenesisState_Validate(t *testing.T) { - tests := []struct { - desc string - genState *types.GenesisState - valid bool - }{ - { - desc: "default is valid", - genState: types.DefaultGenesis(), - valid: true, - }, - { - desc: "valid genesis state", - genState: &types.GenesisState{}, - valid: true, - }, - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } -} diff --git a/x/utxverifier/types/keys.go b/x/utxverifier/types/keys.go deleted file mode 100755 index 6bc02a2d..00000000 --- a/x/utxverifier/types/keys.go +++ /dev/null @@ -1,36 +0,0 @@ -package types - -import ( - "fmt" - "strings" - - "cosmossdk.io/collections" -) - -var ( - // ParamsKey saves the current module params. - ParamsKey = collections.NewPrefix(0) - - // ParamsName is the name of the params collection. - ParamsName = "params" - - // VerifiedInboundTxsKey saves the verified transactions collection prefix - VerifiedInboundTxsKeyPrefix = collections.NewPrefix(1) - - // VerifiedInboundTxsName is the name of the verified transactions collection. - VerifiedInboundTxsName = "verified_inbound_txs" -) - -const ( - ModuleName = "utxverifier" - - StoreKey = ModuleName - - QuerierRoute = ModuleName -) - -// GetVerifiedTxStorageKey returns the storage key for a verified transaction hash using the format "chain:txHash". -func GetVerifiedInboundTxStorageKey(chain, txHash string) string { - // Normalize to lowercase and strip whitespace - return fmt.Sprintf("%s:%s", chain, strings.TrimSpace(txHash)) -} diff --git a/x/utxverifier/types/msgs.go b/x/utxverifier/types/msgs.go deleted file mode 100755 index e93e95b0..00000000 --- a/x/utxverifier/types/msgs.go +++ /dev/null @@ -1,49 +0,0 @@ -package types - -import ( - "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - _ sdk.Msg = &MsgUpdateParams{} -) - -// NewMsgUpdateParams creates new instance of MsgUpdateParams -func NewMsgUpdateParams( - sender sdk.Address, - someValue bool, -) *MsgUpdateParams { - return &MsgUpdateParams{ - Authority: sender.String(), - Params: Params{ - SomeValue: someValue, - }, - } -} - -// Route returns the name of the module -func (msg MsgUpdateParams) Route() string { return ModuleName } - -// Type returns the action -func (msg MsgUpdateParams) Type() string { return "update_params" } - -// GetSignBytes implements the LegacyMsg interface. -func (msg MsgUpdateParams) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) -} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{addr} -} - -// ValidateBasic does a sanity check on the provided data. -func (msg *MsgUpdateParams) Validate() error { - if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { - return errors.Wrap(err, "invalid authority address") - } - - return msg.Params.Validate() -} diff --git a/x/utxverifier/types/params.go b/x/utxverifier/types/params.go deleted file mode 100755 index d9be77ae..00000000 --- a/x/utxverifier/types/params.go +++ /dev/null @@ -1,29 +0,0 @@ -package types - -import ( - "encoding/json" -) - -// DefaultParams returns default module parameters. -func DefaultParams() Params { - // TODO: - return Params{ - SomeValue: true, - } -} - -// Stringer method for Params. -func (p Params) String() string { - bz, err := json.Marshal(p) - if err != nil { - panic(err) - } - - return string(bz) -} - -// Validate does the sanity check on the params. -func (p Params) Validate() error { - // TODO: - return nil -} diff --git a/x/utxverifier/types/query.pb.go b/x/utxverifier/types/query.pb.go deleted file mode 100644 index 8b0d83e8..00000000 --- a/x/utxverifier/types/query.pb.go +++ /dev/null @@ -1,1034 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: utxverifier/v1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - 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_6ef6ecf42317a307, []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,omitempty"` -} - -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_6ef6ecf42317a307, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - -// QueryVerifiedTxHashRequest is the request type for querying if a transaction hash is verified. -type QueryVerifiedTxHashRequest struct { - // chain is the identifier of the chain to query. - Chain string `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` - // hash is the hash of the transaction to query. - TxHash string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` -} - -func (m *QueryVerifiedTxHashRequest) Reset() { *m = QueryVerifiedTxHashRequest{} } -func (m *QueryVerifiedTxHashRequest) String() string { return proto.CompactTextString(m) } -func (*QueryVerifiedTxHashRequest) ProtoMessage() {} -func (*QueryVerifiedTxHashRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6ef6ecf42317a307, []int{2} -} -func (m *QueryVerifiedTxHashRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVerifiedTxHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVerifiedTxHashRequest.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 *QueryVerifiedTxHashRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVerifiedTxHashRequest.Merge(m, src) -} -func (m *QueryVerifiedTxHashRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryVerifiedTxHashRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVerifiedTxHashRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVerifiedTxHashRequest proto.InternalMessageInfo - -func (m *QueryVerifiedTxHashRequest) GetChain() string { - if m != nil { - return m.Chain - } - return "" -} - -func (m *QueryVerifiedTxHashRequest) GetTxHash() string { - if m != nil { - return m.TxHash - } - return "" -} - -// QueryVerifiedTxHashResponse is the response type for the Query/VerifiedTxHash RPC method. -type QueryVerifiedTxHashResponse struct { - // metadata contains full details if the transaction hash is verified. - Metadata *VerifiedTxMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - // found indicates whether the tx was found in the store. - Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` -} - -func (m *QueryVerifiedTxHashResponse) Reset() { *m = QueryVerifiedTxHashResponse{} } -func (m *QueryVerifiedTxHashResponse) String() string { return proto.CompactTextString(m) } -func (*QueryVerifiedTxHashResponse) ProtoMessage() {} -func (*QueryVerifiedTxHashResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6ef6ecf42317a307, []int{3} -} -func (m *QueryVerifiedTxHashResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVerifiedTxHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVerifiedTxHashResponse.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 *QueryVerifiedTxHashResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVerifiedTxHashResponse.Merge(m, src) -} -func (m *QueryVerifiedTxHashResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryVerifiedTxHashResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVerifiedTxHashResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVerifiedTxHashResponse proto.InternalMessageInfo - -func (m *QueryVerifiedTxHashResponse) GetMetadata() *VerifiedTxMetadata { - if m != nil { - return m.Metadata - } - return nil -} - -func (m *QueryVerifiedTxHashResponse) GetFound() bool { - if m != nil { - return m.Found - } - return false -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "utxverifier.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "utxverifier.v1.QueryParamsResponse") - proto.RegisterType((*QueryVerifiedTxHashRequest)(nil), "utxverifier.v1.QueryVerifiedTxHashRequest") - proto.RegisterType((*QueryVerifiedTxHashResponse)(nil), "utxverifier.v1.QueryVerifiedTxHashResponse") -} - -func init() { proto.RegisterFile("utxverifier/v1/query.proto", fileDescriptor_6ef6ecf42317a307) } - -var fileDescriptor_6ef6ecf42317a307 = []byte{ - // 413 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x4a, 0xeb, 0x40, - 0x14, 0x6e, 0x0a, 0xcd, 0xed, 0x9d, 0x0b, 0x5d, 0xcc, 0x2d, 0xbd, 0x25, 0xb7, 0x84, 0x4b, 0xee, - 0x46, 0x94, 0x66, 0x68, 0x75, 0x21, 0x2e, 0x5c, 0x08, 0x82, 0x20, 0x82, 0x06, 0x71, 0xe1, 0xa6, - 0x4c, 0x9b, 0x69, 0x12, 0xb0, 0x33, 0x69, 0x66, 0x52, 0x52, 0x4a, 0x37, 0x3e, 0x81, 0xe0, 0x1b, - 0x08, 0xbe, 0x8b, 0xcb, 0x82, 0x1b, 0x97, 0xd2, 0xfa, 0x20, 0xd2, 0xc9, 0xf8, 0x93, 0xb4, 0x88, - 0xbb, 0x33, 0xe7, 0x7c, 0xe7, 0xfb, 0xbe, 0x39, 0xe7, 0x00, 0x23, 0x16, 0xc9, 0x88, 0x44, 0x41, - 0x3f, 0x20, 0x11, 0x1a, 0xb5, 0xd0, 0x30, 0x26, 0xd1, 0xd8, 0x0e, 0x23, 0x26, 0x18, 0xac, 0x7c, - 0xaa, 0xd9, 0xa3, 0x96, 0xd1, 0xf0, 0x18, 0xf3, 0xae, 0x08, 0xc2, 0x61, 0x80, 0x30, 0xa5, 0x4c, - 0x60, 0x11, 0x30, 0xca, 0x53, 0xb4, 0xd1, 0xc8, 0x31, 0x79, 0x84, 0x12, 0x1e, 0xbc, 0x55, 0xf3, - 0x3a, 0x62, 0x1c, 0x12, 0x55, 0xb3, 0xaa, 0x00, 0x9e, 0x2d, 0x65, 0x4f, 0x71, 0x84, 0x07, 0xdc, - 0x21, 0xc3, 0x98, 0x70, 0x61, 0x1d, 0x82, 0xdf, 0x99, 0x2c, 0x0f, 0x19, 0xe5, 0x04, 0xda, 0x40, - 0x0f, 0x65, 0xa6, 0xae, 0xfd, 0xd3, 0x36, 0x7e, 0xb5, 0x6b, 0x76, 0xd6, 0xa5, 0xad, 0xf0, 0x0a, - 0x65, 0x1d, 0x03, 0x43, 0xd2, 0x5c, 0xa4, 0x10, 0xf7, 0x3c, 0x39, 0xc2, 0xdc, 0x57, 0x22, 0xb0, - 0x0a, 0x4a, 0x3d, 0x1f, 0x07, 0x54, 0x92, 0xfd, 0x74, 0xd2, 0x07, 0xfc, 0x03, 0x7e, 0x88, 0xa4, - 0xe3, 0x63, 0xee, 0xd7, 0x8b, 0x32, 0xaf, 0x0b, 0xd9, 0x65, 0x71, 0xf0, 0x77, 0x2d, 0x99, 0xf2, - 0xb6, 0x0f, 0xca, 0x03, 0x22, 0xb0, 0x8b, 0x05, 0x56, 0xee, 0xac, 0xbc, 0xbb, 0x8f, 0xce, 0x13, - 0x85, 0x74, 0xde, 0x7b, 0x96, 0x6e, 0xfa, 0x2c, 0xa6, 0xae, 0x54, 0x2d, 0x3b, 0xe9, 0xa3, 0x7d, - 0x57, 0x04, 0x25, 0xa9, 0x0a, 0x87, 0x40, 0x4f, 0x7f, 0x07, 0x57, 0x78, 0x57, 0x07, 0x68, 0xfc, - 0xff, 0x12, 0x93, 0x5a, 0xb6, 0xcc, 0xeb, 0xc7, 0x97, 0xdb, 0x62, 0x1d, 0xd6, 0x50, 0x6e, 0x41, - 0xe9, 0xf8, 0xe0, 0xbd, 0x06, 0x2a, 0xd9, 0xdf, 0xc2, 0xcd, 0xb5, 0xbc, 0x6b, 0xe7, 0x6b, 0x6c, - 0x7d, 0x0b, 0xab, 0xbc, 0xec, 0x49, 0x2f, 0x3b, 0xb0, 0x9d, 0xf7, 0xa2, 0x62, 0xb7, 0xa3, 0xb6, - 0x82, 0x26, 0x72, 0x4f, 0x53, 0x34, 0x51, 0x89, 0xe9, 0x81, 0xf3, 0x30, 0x37, 0xb5, 0xd9, 0xdc, - 0xd4, 0x9e, 0xe7, 0xa6, 0x76, 0xb3, 0x30, 0x0b, 0xb3, 0x85, 0x59, 0x78, 0x5a, 0x98, 0x85, 0xcb, - 0x5d, 0x2f, 0x10, 0x7e, 0xdc, 0xb5, 0x7b, 0x6c, 0x80, 0xc2, 0x98, 0xfb, 0xb2, 0x55, 0x46, 0x4d, - 0x19, 0x36, 0x29, 0x73, 0x09, 0x4a, 0x32, 0x9a, 0xf2, 0x3a, 0xbb, 0xba, 0x3c, 0xcf, 0xed, 0xd7, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xd3, 0x8d, 0xc2, 0x24, 0x03, 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 all parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // VerifiedTxHash queries if a transaction hash is verified on a specific chain. - VerifiedTxHash(ctx context.Context, in *QueryVerifiedTxHashRequest, opts ...grpc.CallOption) (*QueryVerifiedTxHashResponse, 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, "/utxverifier.v1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) VerifiedTxHash(ctx context.Context, in *QueryVerifiedTxHashRequest, opts ...grpc.CallOption) (*QueryVerifiedTxHashResponse, error) { - out := new(QueryVerifiedTxHashResponse) - err := c.cc.Invoke(ctx, "/utxverifier.v1.Query/VerifiedTxHash", 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 all parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // VerifiedTxHash queries if a transaction hash is verified on a specific chain. - VerifiedTxHash(context.Context, *QueryVerifiedTxHashRequest) (*QueryVerifiedTxHashResponse, 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 (*UnimplementedQueryServer) VerifiedTxHash(ctx context.Context, req *QueryVerifiedTxHashRequest) (*QueryVerifiedTxHashResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifiedTxHash 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: "/utxverifier.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) -} - -func _Query_VerifiedTxHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVerifiedTxHashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).VerifiedTxHash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/utxverifier.v1.Query/VerifiedTxHash", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).VerifiedTxHash(ctx, req.(*QueryVerifiedTxHashRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "utxverifier.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "VerifiedTxHash", - Handler: _Query_VerifiedTxHash_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "utxverifier/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 - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryVerifiedTxHashRequest) 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 *QueryVerifiedTxHashRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVerifiedTxHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TxHash) > 0 { - i -= len(m.TxHash) - copy(dAtA[i:], m.TxHash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.TxHash))) - i-- - dAtA[i] = 0x12 - } - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryVerifiedTxHashResponse) 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 *QueryVerifiedTxHashResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVerifiedTxHashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Found { - i-- - if m.Found { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Metadata != nil { - { - size, err := m.Metadata.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 - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryVerifiedTxHashRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Chain) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.TxHash) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryVerifiedTxHashResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.Found { - n += 2 - } - 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 m.Params == nil { - m.Params = &Params{} - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - 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 *QueryVerifiedTxHashRequest) 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: QueryVerifiedTxHashRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVerifiedTxHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVerifiedTxHashResponse) 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: QueryVerifiedTxHashResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVerifiedTxHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &VerifiedTxMetadata{} - } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Found", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Found = bool(v != 0) - 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/utxverifier/types/query.pb.gw.go b/x/utxverifier/types/query.pb.gw.go deleted file mode 100644 index 4ce960f8..00000000 --- a/x/utxverifier/types/query.pb.gw.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: utxverifier/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 - -} - -func request_Query_VerifiedTxHash_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVerifiedTxHashRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["chain"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") - } - - protoReq.Chain, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", err) - } - - val, ok = pathParams["tx_hash"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tx_hash") - } - - protoReq.TxHash, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tx_hash", err) - } - - msg, err := client.VerifiedTxHash(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_VerifiedTxHash_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVerifiedTxHashRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["chain"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") - } - - protoReq.Chain, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", err) - } - - val, ok = pathParams["tx_hash"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tx_hash") - } - - protoReq.TxHash, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tx_hash", err) - } - - msg, err := server.VerifiedTxHash(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()...) - - }) - - mux.Handle("GET", pattern_Query_VerifiedTxHash_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_VerifiedTxHash_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_VerifiedTxHash_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()...) - - }) - - mux.Handle("GET", pattern_Query_VerifiedTxHash_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_VerifiedTxHash_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_VerifiedTxHash_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}, []string{"utxverifier", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_VerifiedTxHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"utxverifier", "v1", "verified_tx_hash", "chain", "tx_hash"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_VerifiedTxHash_0 = runtime.ForwardResponseMessage -) diff --git a/x/utxverifier/types/tx.pb.go b/x/utxverifier/types/tx.pb.go deleted file mode 100644 index 56cae3d4..00000000 --- a/x/utxverifier/types/tx.pb.go +++ /dev/null @@ -1,602 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: utxverifier/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/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. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParams struct { - // authority is the address of the governance account. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the 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_3be36cee831b2b33, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3be36cee831b2b33, []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), "utxverifier.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "utxverifier.v1.MsgUpdateParamsResponse") -} - -func init() { proto.RegisterFile("utxverifier/v1/tx.proto", fileDescriptor_3be36cee831b2b33) } - -var fileDescriptor_3be36cee831b2b33 = []byte{ - // 333 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0x2d, 0xa9, 0x28, - 0x4b, 0x2d, 0xca, 0x4c, 0xcb, 0x4c, 0x2d, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x43, 0x92, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x4f, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0xcf, 0x2d, 0x4e, 0x07, 0xa9, 0xcb, 0x2d, 0x4e, 0x87, 0x28, 0x94, 0x92, 0x41, - 0x33, 0x21, 0x3d, 0x35, 0x2f, 0xb5, 0x38, 0xb3, 0x18, 0x2a, 0x2b, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, - 0x66, 0xea, 0x83, 0x58, 0x50, 0x51, 0x49, 0x88, 0x61, 0xf1, 0x10, 0x09, 0x08, 0x07, 0x22, 0xa5, - 0xd4, 0xcf, 0xc8, 0xc5, 0xef, 0x5b, 0x9c, 0x1e, 0x5a, 0x90, 0x92, 0x58, 0x92, 0x1a, 0x90, 0x58, - 0x94, 0x98, 0x5b, 0x2c, 0x64, 0xc6, 0xc5, 0x99, 0x58, 0x5a, 0x92, 0x91, 0x5f, 0x94, 0x59, 0x52, - 0x29, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0x71, 0x69, 0x8b, 0xae, 0x08, 0x54, 0xa3, 0x63, - 0x4a, 0x4a, 0x51, 0x6a, 0x71, 0x71, 0x70, 0x49, 0x51, 0x66, 0x5e, 0x7a, 0x10, 0x42, 0xa9, 0x90, - 0x09, 0x17, 0x5b, 0x01, 0xd8, 0x04, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x31, 0x3d, 0x54, - 0x4f, 0xe9, 0x41, 0xcc, 0x77, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0xd6, 0x8a, 0xaf, - 0xe9, 0xf9, 0x06, 0x2d, 0x84, 0x29, 0x4a, 0x92, 0x5c, 0xe2, 0x68, 0x0e, 0x0a, 0x4a, 0x2d, 0x2e, - 0xc8, 0xcf, 0x2b, 0x4e, 0x35, 0x4a, 0xe3, 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0x8a, 0xe0, 0xe2, 0x41, - 0x71, 0xaf, 0x3c, 0xba, 0x3d, 0x68, 0xfa, 0xa5, 0xd4, 0x09, 0x28, 0x80, 0x59, 0x20, 0xc5, 0xda, - 0xf0, 0x7c, 0x83, 0x16, 0xa3, 0x53, 0xd0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, - 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, - 0x44, 0x59, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x17, 0x94, 0x16, - 0x67, 0x24, 0x67, 0x24, 0x66, 0xe6, 0x81, 0x59, 0xba, 0x60, 0xa6, 0x6e, 0x5e, 0x7e, 0x4a, 0xaa, - 0x7e, 0x85, 0x3e, 0x72, 0x24, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xc3, 0xdb, 0x18, - 0x10, 0x00, 0x00, 0xff, 0xff, 0x02, 0x2b, 0x61, 0x59, 0x02, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - 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, "/utxverifier.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 a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} - -func RegisterMsgServer(s 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: "/utxverifier.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: "utxverifier.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "utxverifier/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/utxverifier/types/txhash.go b/x/utxverifier/types/txhash.go deleted file mode 100644 index 55494c79..00000000 --- a/x/utxverifier/types/txhash.go +++ /dev/null @@ -1,44 +0,0 @@ -package types - -import ( - "encoding/hex" - "fmt" - "strings" - - "github.com/decred/base58" - uregistrytypes "github.com/pushchain/push-chain-node/x/uregistry/types" -) - -func NormalizeTxHash(txHash string, vmType uregistrytypes.VmType) (string, error) { - txHash = strings.TrimSpace(txHash) - - // Strip "0x" prefix if present - if strings.HasPrefix(txHash, "0x") { - txHash = txHash[2:] - } - - // Decode the hex string into bytes - decodedBytes, err := hex.DecodeString(txHash) - if err != nil { - return "", fmt.Errorf("invalid hex input: %w", err) - } - - switch vmType { - case uregistrytypes.VmType_EVM: - if len(decodedBytes) != 32 { - return "", fmt.Errorf("invalid EVM tx hash length: got %d bytes, expected 32", len(decodedBytes)) - } - // Reconstruct normalized hex with 0x and lowercase - return "0x" + txHash, nil - - case uregistrytypes.VmType_SVM: - if len(decodedBytes) != 64 { - return "", fmt.Errorf("invalid Solana tx signature: expected 64 bytes, got %d", len(decodedBytes)) - } - // Encode to base58 - return base58.Encode(decodedBytes), nil - - default: - return "", fmt.Errorf("unsupported VM type: %s", vmType.String()) - } -} diff --git a/x/utxverifier/types/txhash_test.go b/x/utxverifier/types/txhash_test.go deleted file mode 100644 index 7ace732d..00000000 --- a/x/utxverifier/types/txhash_test.go +++ /dev/null @@ -1,99 +0,0 @@ -package types_test - -import ( - "testing" - - uregistrytypes "github.com/pushchain/push-chain-node/x/uregistry/types" - utxverifiertypes "github.com/pushchain/push-chain-node/x/utxverifier/types" - "github.com/stretchr/testify/require" -) - -func TestNormalizeTxHash_EVM(t *testing.T) { - tests := []struct { - name string - input string - expected string - wantErr bool - }{ - { - name: "valid hex with 0x prefix", - input: "0x65586d3dca140f89b5ebe7103b9b4da55c463e88132dd1f5f0ffe4cd4e11a35d", - expected: "0x65586d3dca140f89b5ebe7103b9b4da55c463e88132dd1f5f0ffe4cd4e11a35d", - }, - { - name: "valid hex without 0x prefix and uppercase", - input: "65586d3dca140f89b5ebe7103b9b4da55c463e88132dd1f5f0ffe4cd4e11a35d", - expected: "0x65586d3dca140f89b5ebe7103b9b4da55c463e88132dd1f5f0ffe4cd4e11a35d", - }, - { - name: "invalid hex string", - input: "0xxyz123", - wantErr: true, - }, - { - name: "too short hex", - input: "0x123", - wantErr: true, - }, - { - name: "not hex at all", - input: "hello_world", - wantErr: true, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - res, err := utxverifiertypes.NormalizeTxHash(tc.input, uregistrytypes.VmType_EVM) - if tc.wantErr { - require.Error(t, err) - } else { - require.NoError(t, err) - require.Equal(t, tc.expected, res) - } - }) - } -} - -func TestNormalizeTxHash_SVM(t *testing.T) { - tests := []struct { - name string - input string - expected string - wantErr bool - }{ - { - name: "valid base58 (64 bytes)", - input: "0x46c673d6dda4695f38495e7863875687b40f9c56591bc2013c9907605244067bc11f50b0680a9379c37f57725a87b6568943eee30d9505e116f3ec5089787000", - expected: "2R58yZhQiitzU33ACpeikF4XdRpRfxxoBHviFhZV5ABM99a8h6gmDGWkE4VgJfBsivfp2znhNAmVNkhsqL9s3Hod", - wantErr: false, - }, - { - name: "too short base58 string", - input: "123abcXYZ", - wantErr: true, - }, - { - name: "non-base58 characters", - input: "!@#^&*(", - wantErr: true, - }, - { - name: "empty string", - input: "", - wantErr: true, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - res, err := utxverifiertypes.NormalizeTxHash(tc.input, uregistrytypes.VmType_SVM) - if tc.wantErr { - require.Error(t, err) - } else { - require.NoError(t, err) - require.Equal(t, tc.expected, res) - } - }) - } -} diff --git a/x/utxverifier/types/types.pb.go b/x/utxverifier/types/types.pb.go deleted file mode 100644 index a40adb92..00000000 --- a/x/utxverifier/types/types.pb.go +++ /dev/null @@ -1,688 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: utxverifier/v1/types.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 - -type USDValue struct { - Amount string `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` - Decimals uint32 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` -} - -func (m *USDValue) Reset() { *m = USDValue{} } -func (m *USDValue) String() string { return proto.CompactTextString(m) } -func (*USDValue) ProtoMessage() {} -func (*USDValue) Descriptor() ([]byte, []int) { - return fileDescriptor_61e5135c2dbfa234, []int{0} -} -func (m *USDValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *USDValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_USDValue.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 *USDValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_USDValue.Merge(m, src) -} -func (m *USDValue) XXX_Size() int { - return m.Size() -} -func (m *USDValue) XXX_DiscardUnknown() { - xxx_messageInfo_USDValue.DiscardUnknown(m) -} - -var xxx_messageInfo_USDValue proto.InternalMessageInfo - -func (m *USDValue) GetAmount() string { - if m != nil { - return m.Amount - } - return "" -} - -func (m *USDValue) GetDecimals() uint32 { - if m != nil { - return m.Decimals - } - return 0 -} - -// VerifiedTxMetadata is a format to store verifiedTxs -type VerifiedTxMetadata struct { - Minted bool `protobuf:"varint,1,opt,name=minted,proto3" json:"minted,omitempty"` - PayloadHashes []string `protobuf:"bytes,2,rep,name=payload_hashes,json=payloadHashes,proto3" json:"payload_hashes,omitempty"` - UsdValue *USDValue `protobuf:"bytes,3,opt,name=usd_value,json=usdValue,proto3" json:"usd_value,omitempty"` - Sender string `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"` -} - -func (m *VerifiedTxMetadata) Reset() { *m = VerifiedTxMetadata{} } -func (m *VerifiedTxMetadata) String() string { return proto.CompactTextString(m) } -func (*VerifiedTxMetadata) ProtoMessage() {} -func (*VerifiedTxMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_61e5135c2dbfa234, []int{1} -} -func (m *VerifiedTxMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VerifiedTxMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VerifiedTxMetadata.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 *VerifiedTxMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_VerifiedTxMetadata.Merge(m, src) -} -func (m *VerifiedTxMetadata) XXX_Size() int { - return m.Size() -} -func (m *VerifiedTxMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_VerifiedTxMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_VerifiedTxMetadata proto.InternalMessageInfo - -func (m *VerifiedTxMetadata) GetMinted() bool { - if m != nil { - return m.Minted - } - return false -} - -func (m *VerifiedTxMetadata) GetPayloadHashes() []string { - if m != nil { - return m.PayloadHashes - } - return nil -} - -func (m *VerifiedTxMetadata) GetUsdValue() *USDValue { - if m != nil { - return m.UsdValue - } - return nil -} - -func (m *VerifiedTxMetadata) GetSender() string { - if m != nil { - return m.Sender - } - return "" -} - -func init() { - proto.RegisterType((*USDValue)(nil), "utxverifier.v1.USDValue") - proto.RegisterType((*VerifiedTxMetadata)(nil), "utxverifier.v1.VerifiedTxMetadata") -} - -func init() { proto.RegisterFile("utxverifier/v1/types.proto", fileDescriptor_61e5135c2dbfa234) } - -var fileDescriptor_61e5135c2dbfa234 = []byte{ - // 311 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x50, 0xc1, 0x4a, 0x33, 0x31, - 0x18, 0x6c, 0xfe, 0xfe, 0x94, 0x6d, 0xa4, 0x05, 0x83, 0xc8, 0xb2, 0x87, 0x50, 0x0a, 0xc2, 0x5e, - 0xba, 0xa1, 0x8a, 0xe0, 0xc9, 0x83, 0x78, 0xf0, 0xe2, 0x25, 0x6a, 0x0f, 0x5e, 0x4a, 0xda, 0xc4, - 0x6e, 0xa0, 0x9b, 0x2c, 0x9b, 0x64, 0x69, 0xdf, 0xc2, 0x67, 0xf0, 0x69, 0x3c, 0xf6, 0xe8, 0x51, - 0xba, 0x2f, 0x22, 0x9b, 0x5d, 0x4b, 0xbd, 0x84, 0x99, 0xf9, 0xc2, 0x7c, 0xdf, 0x0c, 0x8c, 0x9c, - 0xdd, 0x94, 0xa2, 0x90, 0x6f, 0x52, 0x14, 0xa4, 0x9c, 0x12, 0xbb, 0xcd, 0x85, 0x49, 0xf2, 0x42, - 0x5b, 0x8d, 0x86, 0x47, 0xb3, 0xa4, 0x9c, 0x46, 0x67, 0x2b, 0xbd, 0xd2, 0x7e, 0x44, 0x6a, 0xd4, - 0xfc, 0x8a, 0x4e, 0x59, 0x26, 0x95, 0x26, 0xfe, 0x6d, 0xa4, 0xf1, 0x2d, 0x0c, 0x5e, 0x9e, 0xee, - 0x67, 0x6c, 0xed, 0x04, 0x3a, 0x87, 0x3d, 0x96, 0x69, 0xa7, 0x6c, 0x08, 0x46, 0x20, 0xee, 0xd3, - 0x96, 0xa1, 0x08, 0x06, 0x5c, 0x2c, 0x65, 0xc6, 0xd6, 0x26, 0xfc, 0x37, 0x02, 0xf1, 0x80, 0x1e, - 0xf8, 0xf8, 0x03, 0x40, 0x34, 0x6b, 0x16, 0xf3, 0xe7, 0xcd, 0xa3, 0xb0, 0x8c, 0x33, 0xcb, 0x6a, - 0xab, 0x4c, 0x2a, 0x2b, 0xb8, 0xb7, 0x0a, 0x68, 0xcb, 0xd0, 0x05, 0x1c, 0xe6, 0x6c, 0xbb, 0xd6, - 0x8c, 0xcf, 0x53, 0x66, 0x52, 0x51, 0x1b, 0x76, 0xe3, 0x3e, 0x1d, 0xb4, 0xea, 0x83, 0x17, 0xd1, - 0x35, 0xec, 0x3b, 0xc3, 0xe7, 0x65, 0x7d, 0x56, 0xd8, 0x1d, 0x81, 0xf8, 0xe4, 0x32, 0x4c, 0xfe, - 0x46, 0x4c, 0x7e, 0xcf, 0xa6, 0x81, 0x33, 0xfc, 0x10, 0xc0, 0x08, 0xc5, 0x45, 0x11, 0xfe, 0x6f, - 0x02, 0x34, 0xec, 0x8e, 0x7e, 0xee, 0x31, 0xd8, 0xed, 0x31, 0xf8, 0xde, 0x63, 0xf0, 0x5e, 0xe1, - 0xce, 0xae, 0xc2, 0x9d, 0xaf, 0x0a, 0x77, 0x5e, 0x6f, 0x56, 0xd2, 0xa6, 0x6e, 0x91, 0x2c, 0x75, - 0x46, 0x72, 0x67, 0xd2, 0x65, 0xca, 0xa4, 0xf2, 0x68, 0xe2, 0xe1, 0x44, 0x69, 0x2e, 0xc8, 0x86, - 0x1c, 0x57, 0xef, 0x7b, 0x5f, 0xf4, 0x7c, 0x7f, 0x57, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x86, - 0x8f, 0x73, 0xe0, 0x96, 0x01, 0x00, 0x00, -} - -func (m *USDValue) 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 *USDValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *USDValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Decimals != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Decimals)) - i-- - dAtA[i] = 0x10 - } - if len(m.Amount) > 0 { - i -= len(m.Amount) - copy(dAtA[i:], m.Amount) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Amount))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VerifiedTxMetadata) 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 *VerifiedTxMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VerifiedTxMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0x22 - } - if m.UsdValue != nil { - { - size, err := m.UsdValue.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.PayloadHashes) > 0 { - for iNdEx := len(m.PayloadHashes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PayloadHashes[iNdEx]) - copy(dAtA[i:], m.PayloadHashes[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.PayloadHashes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.Minted { - i-- - if m.Minted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - 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 *USDValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Amount) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Decimals != 0 { - n += 1 + sovTypes(uint64(m.Decimals)) - } - return n -} - -func (m *VerifiedTxMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Minted { - n += 2 - } - if len(m.PayloadHashes) > 0 { - for _, s := range m.PayloadHashes { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.UsdValue != nil { - l = m.UsdValue.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - 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 *USDValue) 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: USDValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: USDValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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 - } - m.Amount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - m.Decimals = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decimals |= uint32(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 (m *VerifiedTxMetadata) 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: VerifiedTxMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VerifiedTxMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Minted", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Minted = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PayloadHashes", 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 - } - m.PayloadHashes = append(m.PayloadHashes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsdValue", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UsdValue == nil { - m.UsdValue = &USDValue{} - } - if err := m.UsdValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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 - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - 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") -)