diff --git a/api/uregistry/v1/types.pulsar.go b/api/uregistry/v1/types.pulsar.go index 8c29453c..50d04888 100644 --- a/api/uregistry/v1/types.pulsar.go +++ b/api/uregistry/v1/types.pulsar.go @@ -1031,6 +1031,602 @@ func (x *fastReflection_GatewayMethods) ProtoMethods() *protoiface.Methods { } } +var ( + md_VaultMethods protoreflect.MessageDescriptor + fd_VaultMethods_name protoreflect.FieldDescriptor + fd_VaultMethods_identifier protoreflect.FieldDescriptor + fd_VaultMethods_event_identifier protoreflect.FieldDescriptor + fd_VaultMethods_confirmation_type protoreflect.FieldDescriptor +) + +func init() { + file_uregistry_v1_types_proto_init() + md_VaultMethods = File_uregistry_v1_types_proto.Messages().ByName("VaultMethods") + fd_VaultMethods_name = md_VaultMethods.Fields().ByName("name") + fd_VaultMethods_identifier = md_VaultMethods.Fields().ByName("identifier") + fd_VaultMethods_event_identifier = md_VaultMethods.Fields().ByName("event_identifier") + fd_VaultMethods_confirmation_type = md_VaultMethods.Fields().ByName("confirmation_type") +} + +var _ protoreflect.Message = (*fastReflection_VaultMethods)(nil) + +type fastReflection_VaultMethods VaultMethods + +func (x *VaultMethods) ProtoReflect() protoreflect.Message { + return (*fastReflection_VaultMethods)(x) +} + +func (x *VaultMethods) slowProtoReflect() protoreflect.Message { + mi := &file_uregistry_v1_types_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_VaultMethods_messageType fastReflection_VaultMethods_messageType +var _ protoreflect.MessageType = fastReflection_VaultMethods_messageType{} + +type fastReflection_VaultMethods_messageType struct{} + +func (x fastReflection_VaultMethods_messageType) Zero() protoreflect.Message { + return (*fastReflection_VaultMethods)(nil) +} +func (x fastReflection_VaultMethods_messageType) New() protoreflect.Message { + return new(fastReflection_VaultMethods) +} +func (x fastReflection_VaultMethods_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_VaultMethods +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_VaultMethods) Descriptor() protoreflect.MessageDescriptor { + return md_VaultMethods +} + +// 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_VaultMethods) Type() protoreflect.MessageType { + return _fastReflection_VaultMethods_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_VaultMethods) New() protoreflect.Message { + return new(fastReflection_VaultMethods) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_VaultMethods) Interface() protoreflect.ProtoMessage { + return (*VaultMethods)(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_VaultMethods) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_VaultMethods_name, value) { + return + } + } + if x.Identifier != "" { + value := protoreflect.ValueOfString(x.Identifier) + if !f(fd_VaultMethods_identifier, value) { + return + } + } + if x.EventIdentifier != "" { + value := protoreflect.ValueOfString(x.EventIdentifier) + if !f(fd_VaultMethods_event_identifier, value) { + return + } + } + if x.ConfirmationType != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.ConfirmationType)) + if !f(fd_VaultMethods_confirmation_type, 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_VaultMethods) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "uregistry.v1.VaultMethods.name": + return x.Name != "" + case "uregistry.v1.VaultMethods.identifier": + return x.Identifier != "" + case "uregistry.v1.VaultMethods.event_identifier": + return x.EventIdentifier != "" + case "uregistry.v1.VaultMethods.confirmation_type": + return x.ConfirmationType != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.VaultMethods")) + } + panic(fmt.Errorf("message uregistry.v1.VaultMethods 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_VaultMethods) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "uregistry.v1.VaultMethods.name": + x.Name = "" + case "uregistry.v1.VaultMethods.identifier": + x.Identifier = "" + case "uregistry.v1.VaultMethods.event_identifier": + x.EventIdentifier = "" + case "uregistry.v1.VaultMethods.confirmation_type": + x.ConfirmationType = 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.VaultMethods")) + } + panic(fmt.Errorf("message uregistry.v1.VaultMethods 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_VaultMethods) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "uregistry.v1.VaultMethods.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "uregistry.v1.VaultMethods.identifier": + value := x.Identifier + return protoreflect.ValueOfString(value) + case "uregistry.v1.VaultMethods.event_identifier": + value := x.EventIdentifier + return protoreflect.ValueOfString(value) + case "uregistry.v1.VaultMethods.confirmation_type": + value := x.ConfirmationType + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.VaultMethods")) + } + panic(fmt.Errorf("message uregistry.v1.VaultMethods 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_VaultMethods) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "uregistry.v1.VaultMethods.name": + x.Name = value.Interface().(string) + case "uregistry.v1.VaultMethods.identifier": + x.Identifier = value.Interface().(string) + case "uregistry.v1.VaultMethods.event_identifier": + x.EventIdentifier = value.Interface().(string) + case "uregistry.v1.VaultMethods.confirmation_type": + x.ConfirmationType = (ConfirmationType)(value.Enum()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.VaultMethods")) + } + panic(fmt.Errorf("message uregistry.v1.VaultMethods 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_VaultMethods) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "uregistry.v1.VaultMethods.name": + panic(fmt.Errorf("field name of message uregistry.v1.VaultMethods is not mutable")) + case "uregistry.v1.VaultMethods.identifier": + panic(fmt.Errorf("field identifier of message uregistry.v1.VaultMethods is not mutable")) + case "uregistry.v1.VaultMethods.event_identifier": + panic(fmt.Errorf("field event_identifier of message uregistry.v1.VaultMethods is not mutable")) + case "uregistry.v1.VaultMethods.confirmation_type": + panic(fmt.Errorf("field confirmation_type of message uregistry.v1.VaultMethods is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.VaultMethods")) + } + panic(fmt.Errorf("message uregistry.v1.VaultMethods 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_VaultMethods) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "uregistry.v1.VaultMethods.name": + return protoreflect.ValueOfString("") + case "uregistry.v1.VaultMethods.identifier": + return protoreflect.ValueOfString("") + case "uregistry.v1.VaultMethods.event_identifier": + return protoreflect.ValueOfString("") + case "uregistry.v1.VaultMethods.confirmation_type": + return protoreflect.ValueOfEnum(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.VaultMethods")) + } + panic(fmt.Errorf("message uregistry.v1.VaultMethods 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_VaultMethods) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in uregistry.v1.VaultMethods", 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_VaultMethods) 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_VaultMethods) 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_VaultMethods) 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_VaultMethods) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*VaultMethods) + 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.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Identifier) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.EventIdentifier) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ConfirmationType != 0 { + n += 1 + runtime.Sov(uint64(x.ConfirmationType)) + } + 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().(*VaultMethods) + 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.ConfirmationType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ConfirmationType)) + i-- + dAtA[i] = 0x20 + } + if len(x.EventIdentifier) > 0 { + i -= len(x.EventIdentifier) + copy(dAtA[i:], x.EventIdentifier) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EventIdentifier))) + i-- + dAtA[i] = 0x1a + } + if len(x.Identifier) > 0 { + i -= len(x.Identifier) + copy(dAtA[i:], x.Identifier) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Identifier))) + i-- + dAtA[i] = 0x12 + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + 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().(*VaultMethods) + 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: VaultMethods: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VaultMethods: 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 Name", 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.Name = 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 Identifier", 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.Identifier = 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 EventIdentifier", 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.EventIdentifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConfirmationType", wireType) + } + x.ConfirmationType = 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.ConfirmationType |= ConfirmationType(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var ( md_BlockConfirmation protoreflect.MessageDescriptor fd_BlockConfirmation_fast_inbound protoreflect.FieldDescriptor @@ -1053,7 +1649,7 @@ func (x *BlockConfirmation) ProtoReflect() protoreflect.Message { } func (x *BlockConfirmation) slowProtoReflect() protoreflect.Message { - mi := &file_uregistry_v1_types_proto_msgTypes[2] + mi := &file_uregistry_v1_types_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1505,7 +2101,7 @@ func (x *ChainEnabled) ProtoReflect() protoreflect.Message { } func (x *ChainEnabled) slowProtoReflect() protoreflect.Message { - mi := &file_uregistry_v1_types_proto_msgTypes[3] + mi := &file_uregistry_v1_types_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1998,6 +2594,57 @@ func (x *_ChainConfig_6_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_ChainConfig_9_list)(nil) + +type _ChainConfig_9_list struct { + list *[]*VaultMethods +} + +func (x *_ChainConfig_9_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ChainConfig_9_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ChainConfig_9_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VaultMethods) + (*x.list)[i] = concreteValue +} + +func (x *_ChainConfig_9_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*VaultMethods) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ChainConfig_9_list) AppendMutable() protoreflect.Value { + v := new(VaultMethods) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ChainConfig_9_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ChainConfig_9_list) NewElement() protoreflect.Value { + v := new(VaultMethods) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ChainConfig_9_list) IsValid() bool { + return x.list != nil +} + var ( md_ChainConfig protoreflect.MessageDescriptor fd_ChainConfig_chain protoreflect.FieldDescriptor @@ -2008,6 +2655,7 @@ var ( fd_ChainConfig_gateway_methods protoreflect.FieldDescriptor fd_ChainConfig_enabled protoreflect.FieldDescriptor fd_ChainConfig_gas_oracle_fetch_interval protoreflect.FieldDescriptor + fd_ChainConfig_vault_methods protoreflect.FieldDescriptor ) func init() { @@ -2021,6 +2669,7 @@ func init() { fd_ChainConfig_gateway_methods = md_ChainConfig.Fields().ByName("gateway_methods") fd_ChainConfig_enabled = md_ChainConfig.Fields().ByName("enabled") fd_ChainConfig_gas_oracle_fetch_interval = md_ChainConfig.Fields().ByName("gas_oracle_fetch_interval") + fd_ChainConfig_vault_methods = md_ChainConfig.Fields().ByName("vault_methods") } var _ protoreflect.Message = (*fastReflection_ChainConfig)(nil) @@ -2032,7 +2681,7 @@ func (x *ChainConfig) ProtoReflect() protoreflect.Message { } func (x *ChainConfig) slowProtoReflect() protoreflect.Message { - mi := &file_uregistry_v1_types_proto_msgTypes[4] + mi := &file_uregistry_v1_types_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2136,6 +2785,12 @@ func (x *fastReflection_ChainConfig) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.VaultMethods) != 0 { + value := protoreflect.ValueOfList(&_ChainConfig_9_list{list: &x.VaultMethods}) + if !f(fd_ChainConfig_vault_methods, value) { + return + } + } } // Has reports whether a field is populated. @@ -2167,6 +2822,8 @@ func (x *fastReflection_ChainConfig) Has(fd protoreflect.FieldDescriptor) bool { return x.Enabled != nil case "uregistry.v1.ChainConfig.gas_oracle_fetch_interval": return x.GasOracleFetchInterval != nil + case "uregistry.v1.ChainConfig.vault_methods": + return len(x.VaultMethods) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.ChainConfig")) @@ -2199,6 +2856,8 @@ func (x *fastReflection_ChainConfig) Clear(fd protoreflect.FieldDescriptor) { x.Enabled = nil case "uregistry.v1.ChainConfig.gas_oracle_fetch_interval": x.GasOracleFetchInterval = nil + case "uregistry.v1.ChainConfig.vault_methods": + x.VaultMethods = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.ChainConfig")) @@ -2242,6 +2901,12 @@ func (x *fastReflection_ChainConfig) Get(descriptor protoreflect.FieldDescriptor case "uregistry.v1.ChainConfig.gas_oracle_fetch_interval": value := x.GasOracleFetchInterval return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "uregistry.v1.ChainConfig.vault_methods": + if len(x.VaultMethods) == 0 { + return protoreflect.ValueOfList(&_ChainConfig_9_list{}) + } + listValue := &_ChainConfig_9_list{list: &x.VaultMethods} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.ChainConfig")) @@ -2280,6 +2945,10 @@ func (x *fastReflection_ChainConfig) Set(fd protoreflect.FieldDescriptor, value x.Enabled = value.Message().Interface().(*ChainEnabled) case "uregistry.v1.ChainConfig.gas_oracle_fetch_interval": x.GasOracleFetchInterval = value.Message().Interface().(*durationpb.Duration) + case "uregistry.v1.ChainConfig.vault_methods": + lv := value.List() + clv := lv.(*_ChainConfig_9_list) + x.VaultMethods = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.ChainConfig")) @@ -2321,6 +2990,12 @@ func (x *fastReflection_ChainConfig) Mutable(fd protoreflect.FieldDescriptor) pr x.GasOracleFetchInterval = new(durationpb.Duration) } return protoreflect.ValueOfMessage(x.GasOracleFetchInterval.ProtoReflect()) + case "uregistry.v1.ChainConfig.vault_methods": + if x.VaultMethods == nil { + x.VaultMethods = []*VaultMethods{} + } + value := &_ChainConfig_9_list{list: &x.VaultMethods} + return protoreflect.ValueOfList(value) case "uregistry.v1.ChainConfig.chain": panic(fmt.Errorf("field chain of message uregistry.v1.ChainConfig is not mutable")) case "uregistry.v1.ChainConfig.vm_type": @@ -2362,6 +3037,9 @@ func (x *fastReflection_ChainConfig) NewField(fd protoreflect.FieldDescriptor) p case "uregistry.v1.ChainConfig.gas_oracle_fetch_interval": m := new(durationpb.Duration) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "uregistry.v1.ChainConfig.vault_methods": + list := []*VaultMethods{} + return protoreflect.ValueOfList(&_ChainConfig_9_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: uregistry.v1.ChainConfig")) @@ -2464,6 +3142,12 @@ func (x *fastReflection_ChainConfig) ProtoMethods() *protoiface.Methods { l = options.Size(x.GasOracleFetchInterval) n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.VaultMethods) > 0 { + for _, e := range x.VaultMethods { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2493,6 +3177,22 @@ func (x *fastReflection_ChainConfig) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.VaultMethods) > 0 { + for iNdEx := len(x.VaultMethods) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VaultMethods[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x4a + } + } if x.GasOracleFetchInterval != nil { encoded, err := options.Marshal(x.GasOracleFetchInterval) if err != nil { @@ -2883,6 +3583,40 @@ func (x *fastReflection_ChainConfig) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VaultMethods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.VaultMethods = append(x.VaultMethods, &VaultMethods{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VaultMethods[len(x.VaultMethods)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2940,7 +3674,7 @@ func (x *NativeRepresentation) ProtoReflect() protoreflect.Message { } func (x *NativeRepresentation) slowProtoReflect() protoreflect.Message { - mi := &file_uregistry_v1_types_proto_msgTypes[5] + mi := &file_uregistry_v1_types_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3438,7 +4172,7 @@ func (x *TokenConfig) ProtoReflect() protoreflect.Message { } func (x *TokenConfig) slowProtoReflect() protoreflect.Message { - mi := &file_uregistry_v1_types_proto_msgTypes[6] + mi := &file_uregistry_v1_types_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4595,6 +5329,66 @@ func (x *GatewayMethods) GetConfirmationType() ConfirmationType { return ConfirmationType_CONFIRMATION_UNKNOWN } +// VaultMethods defines the configuration for a method exposed by the vault contract +type VaultMethods struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Human-readable method name (e.g. "deposit") + Identifier string `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` // Hex-encoded selector or discriminator for the method + EventIdentifier string `protobuf:"bytes,3,opt,name=event_identifier,json=eventIdentifier,proto3" json:"event_identifier,omitempty"` // Hex-encoded topic or identifier for emitted event + ConfirmationType ConfirmationType `protobuf:"varint,4,opt,name=confirmation_type,json=confirmationType,proto3,enum=uregistry.v1.ConfirmationType" json:"confirmation_type,omitempty"` // Which block confirmation to use for this method +} + +func (x *VaultMethods) Reset() { + *x = VaultMethods{} + if protoimpl.UnsafeEnabled { + mi := &file_uregistry_v1_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VaultMethods) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VaultMethods) ProtoMessage() {} + +// Deprecated: Use VaultMethods.ProtoReflect.Descriptor instead. +func (*VaultMethods) Descriptor() ([]byte, []int) { + return file_uregistry_v1_types_proto_rawDescGZIP(), []int{2} +} + +func (x *VaultMethods) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *VaultMethods) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +func (x *VaultMethods) GetEventIdentifier() string { + if x != nil { + return x.EventIdentifier + } + return "" +} + +func (x *VaultMethods) GetConfirmationType() ConfirmationType { + if x != nil { + return x.ConfirmationType + } + return ConfirmationType_CONFIRMATION_UNKNOWN +} + // BlockConfirmation defines the number of blocks to wait for confirmation on the external chain type BlockConfirmation struct { state protoimpl.MessageState @@ -4608,7 +5402,7 @@ type BlockConfirmation struct { func (x *BlockConfirmation) Reset() { *x = BlockConfirmation{} if protoimpl.UnsafeEnabled { - mi := &file_uregistry_v1_types_proto_msgTypes[2] + mi := &file_uregistry_v1_types_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4622,7 +5416,7 @@ func (*BlockConfirmation) ProtoMessage() {} // Deprecated: Use BlockConfirmation.ProtoReflect.Descriptor instead. func (*BlockConfirmation) Descriptor() ([]byte, []int) { - return file_uregistry_v1_types_proto_rawDescGZIP(), []int{2} + return file_uregistry_v1_types_proto_rawDescGZIP(), []int{3} } func (x *BlockConfirmation) GetFastInbound() uint32 { @@ -4652,7 +5446,7 @@ type ChainEnabled struct { func (x *ChainEnabled) Reset() { *x = ChainEnabled{} if protoimpl.UnsafeEnabled { - mi := &file_uregistry_v1_types_proto_msgTypes[3] + mi := &file_uregistry_v1_types_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4666,7 +5460,7 @@ func (*ChainEnabled) ProtoMessage() {} // Deprecated: Use ChainEnabled.ProtoReflect.Descriptor instead. func (*ChainEnabled) Descriptor() ([]byte, []int) { - return file_uregistry_v1_types_proto_rawDescGZIP(), []int{3} + return file_uregistry_v1_types_proto_rawDescGZIP(), []int{4} } func (x *ChainEnabled) GetIsInboundEnabled() bool { @@ -4697,12 +5491,13 @@ type ChainConfig struct { GatewayMethods []*GatewayMethods `protobuf:"bytes,6,rep,name=gateway_methods,json=gatewayMethods,proto3" json:"gateway_methods,omitempty"` // List of methods that can be used for universal operations Enabled *ChainEnabled `protobuf:"bytes,7,opt,name=enabled,proto3" json:"enabled,omitempty"` // Whether this chain is currently enabled or not GasOracleFetchInterval *durationpb.Duration `protobuf:"bytes,8,opt,name=gas_oracle_fetch_interval,json=gasOracleFetchInterval,proto3" json:"gas_oracle_fetch_interval,omitempty"` // how often relayers should fetch gas prices + VaultMethods []*VaultMethods `protobuf:"bytes,9,rep,name=vault_methods,json=vaultMethods,proto3" json:"vault_methods,omitempty"` // List of methods exposed by the vault contract (optional) } func (x *ChainConfig) Reset() { *x = ChainConfig{} if protoimpl.UnsafeEnabled { - mi := &file_uregistry_v1_types_proto_msgTypes[4] + mi := &file_uregistry_v1_types_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4716,7 +5511,7 @@ func (*ChainConfig) ProtoMessage() {} // Deprecated: Use ChainConfig.ProtoReflect.Descriptor instead. func (*ChainConfig) Descriptor() ([]byte, []int) { - return file_uregistry_v1_types_proto_rawDescGZIP(), []int{4} + return file_uregistry_v1_types_proto_rawDescGZIP(), []int{5} } func (x *ChainConfig) GetChain() string { @@ -4775,6 +5570,13 @@ func (x *ChainConfig) GetGasOracleFetchInterval() *durationpb.Duration { return nil } +func (x *ChainConfig) GetVaultMethods() []*VaultMethods { + if x != nil { + return x.VaultMethods + } + return nil +} + type NativeRepresentation struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4787,7 +5589,7 @@ type NativeRepresentation struct { func (x *NativeRepresentation) Reset() { *x = NativeRepresentation{} if protoimpl.UnsafeEnabled { - mi := &file_uregistry_v1_types_proto_msgTypes[5] + mi := &file_uregistry_v1_types_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4801,7 +5603,7 @@ func (*NativeRepresentation) ProtoMessage() {} // Deprecated: Use NativeRepresentation.ProtoReflect.Descriptor instead. func (*NativeRepresentation) Descriptor() ([]byte, []int) { - return file_uregistry_v1_types_proto_rawDescGZIP(), []int{5} + return file_uregistry_v1_types_proto_rawDescGZIP(), []int{6} } func (x *NativeRepresentation) GetDenom() string { @@ -4837,7 +5639,7 @@ type TokenConfig struct { func (x *TokenConfig) Reset() { *x = TokenConfig{} if protoimpl.UnsafeEnabled { - mi := &file_uregistry_v1_types_proto_msgTypes[6] + mi := &file_uregistry_v1_types_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4851,7 +5653,7 @@ func (*TokenConfig) ProtoMessage() {} // Deprecated: Use TokenConfig.ProtoReflect.Descriptor instead. func (*TokenConfig) Descriptor() ([]byte, []int) { - return file_uregistry_v1_types_proto_rawDescGZIP(), []int{6} + return file_uregistry_v1_types_proto_rawDescGZIP(), []int{7} } func (x *TokenConfig) GetChain() string { @@ -4945,121 +5747,139 @@ var file_uregistry_v1_types_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x26, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x19, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, - 0x0c, 0x66, 0x61, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x66, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x12, 0x29, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x6e, - 0x64, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x29, 0x98, 0xa0, 0x1f, - 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, - 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x73, 0x49, 0x6e, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x10, 0x69, 0x73, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x69, 0x73, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, - 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, - 0x69, 0x73, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x3a, 0x24, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, - 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0xf3, 0x03, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x2d, 0x0a, - 0x07, 0x76, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, - 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6d, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x76, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0e, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x70, 0x63, 0x55, - 0x72, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x67, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x12, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x0f, 0x67, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x73, 0x52, 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x5e, 0x0a, 0x19, 0x67, 0x61, 0x73, 0x5f, - 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, - 0x52, 0x16, 0x67, 0x61, 0x73, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x46, 0x65, 0x74, 0x63, 0x68, - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3a, 0x23, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, - 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x85, 0x01, - 0x0a, 0x14, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x29, 0x0a, 0x10, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x2c, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, - 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, - 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xfa, 0x02, 0x0a, 0x0b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, - 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x18, 0x0a, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x69, 0x71, 0x75, 0x69, - 0x64, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x61, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x43, 0x61, 0x70, 0x12, 0x36, 0x0a, 0x0a, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x17, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x57, 0x0a, 0x15, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x72, - 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x2e, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, - 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, - 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x23, 0x98, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x75, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2a, 0x91, 0x01, 0x0a, 0x06, 0x56, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, - 0x0a, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x56, 0x4d, 0x10, 0x00, 0x12, 0x07, 0x0a, - 0x03, 0x45, 0x56, 0x4d, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x56, 0x4d, 0x10, 0x02, 0x12, - 0x0b, 0x0a, 0x07, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x56, 0x4d, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, - 0x57, 0x41, 0x53, 0x4d, 0x5f, 0x56, 0x4d, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x41, 0x49, - 0x52, 0x4f, 0x5f, 0x56, 0x4d, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x52, 0x4f, 0x4e, 0x5f, - 0x56, 0x4d, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x45, 0x4c, 0x4c, 0x41, 0x52, 0x5f, - 0x56, 0x4d, 0x10, 0x07, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x49, 0x54, 0x43, 0x4f, 0x49, 0x4e, 0x5f, - 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10, 0x08, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x54, 0x48, 0x45, - 0x52, 0x5f, 0x56, 0x4d, 0x10, 0x09, 0x2a, 0x4b, 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x54, - 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x43, 0x32, 0x30, 0x10, - 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x52, 0x43, 0x37, 0x32, 0x31, 0x10, 0x02, 0x12, 0x0b, 0x0a, - 0x07, 0x45, 0x52, 0x43, 0x31, 0x31, 0x35, 0x35, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x50, - 0x4c, 0x10, 0x04, 0x2a, 0x68, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4e, 0x46, 0x49, - 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, - 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x53, 0x54, 0x10, 0x02, 0x42, 0xb2, 0x01, - 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x41, 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, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x55, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x55, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x55, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0d, 0x55, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x0c, 0x56, 0x61, 0x75, 0x6c, + 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x3a, 0x24, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, + 0xb0, 0x2a, 0x17, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x61, 0x75, + 0x6c, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x11, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x61, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x66, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, + 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x73, + 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x29, + 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x75, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x0c, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x73, + 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x73, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x69, 0x73, 0x4f, 0x75, 0x74, 0x62, + 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x11, 0x69, 0x73, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x24, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, + 0xb0, 0x2a, 0x17, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0xb4, 0x04, 0x0a, 0x0b, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x12, 0x2d, 0x0a, 0x07, 0x76, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x14, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x56, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x76, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x24, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, + 0x70, 0x63, 0x55, 0x72, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, + 0x0a, 0x12, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x75, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, + 0x0a, 0x0f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x5e, 0x0a, 0x19, 0x67, + 0x61, 0x73, 0x5f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, + 0xdf, 0x1f, 0x01, 0x52, 0x16, 0x67, 0x61, 0x73, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x3f, 0x0a, 0x0d, 0x76, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x0c, + 0x76, 0x61, 0x75, 0x6c, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x3a, 0x23, 0x98, 0xa0, + 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x75, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x22, 0x85, 0x01, 0x0a, 0x14, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x70, 0x72, + 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x2c, 0x98, 0xa0, 0x1f, + 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x72, 0x79, 0x2f, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x72, 0x65, + 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xfa, 0x02, 0x0a, 0x0b, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, + 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6c, + 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x61, 0x70, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x43, 0x61, 0x70, + 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x57, 0x0a, 0x15, 0x6e, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x70, + 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x6e, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x3a, 0x23, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, + 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x91, 0x01, 0x0a, 0x06, 0x56, 0x6d, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x56, 0x4d, 0x10, + 0x00, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x56, 0x4d, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x56, + 0x4d, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x56, 0x4d, 0x10, 0x03, + 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x53, 0x4d, 0x5f, 0x56, 0x4d, 0x10, 0x04, 0x12, 0x0c, 0x0a, + 0x08, 0x43, 0x41, 0x49, 0x52, 0x4f, 0x5f, 0x56, 0x4d, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x54, + 0x52, 0x4f, 0x4e, 0x5f, 0x56, 0x4d, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x45, 0x4c, + 0x4c, 0x41, 0x52, 0x5f, 0x56, 0x4d, 0x10, 0x07, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x49, 0x54, 0x43, + 0x4f, 0x49, 0x4e, 0x5f, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10, 0x08, 0x12, 0x0c, 0x0a, 0x08, + 0x4f, 0x54, 0x48, 0x45, 0x52, 0x5f, 0x56, 0x4d, 0x10, 0x09, 0x2a, 0x4b, 0x0a, 0x09, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, + 0x43, 0x32, 0x30, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x52, 0x43, 0x37, 0x32, 0x31, 0x10, + 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x52, 0x43, 0x31, 0x31, 0x35, 0x35, 0x10, 0x03, 0x12, 0x07, + 0x0a, 0x03, 0x53, 0x50, 0x4c, 0x10, 0x04, 0x2a, 0x68, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, + 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4e, 0x44, + 0x41, 0x52, 0x44, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x53, 0x54, 0x10, + 0x02, 0x42, 0xb2, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 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, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x58, 0x58, 0xaa, 0x02, 0x0c, + 0x55, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x55, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x55, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x55, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5075,34 +5895,37 @@ func file_uregistry_v1_types_proto_rawDescGZIP() []byte { } var file_uregistry_v1_types_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_uregistry_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_uregistry_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_uregistry_v1_types_proto_goTypes = []interface{}{ (VmType)(0), // 0: uregistry.v1.VmType (TokenType)(0), // 1: uregistry.v1.TokenType (ConfirmationType)(0), // 2: uregistry.v1.ConfirmationType (*Params)(nil), // 3: uregistry.v1.Params (*GatewayMethods)(nil), // 4: uregistry.v1.GatewayMethods - (*BlockConfirmation)(nil), // 5: uregistry.v1.BlockConfirmation - (*ChainEnabled)(nil), // 6: uregistry.v1.ChainEnabled - (*ChainConfig)(nil), // 7: uregistry.v1.ChainConfig - (*NativeRepresentation)(nil), // 8: uregistry.v1.NativeRepresentation - (*TokenConfig)(nil), // 9: uregistry.v1.TokenConfig - (*durationpb.Duration)(nil), // 10: google.protobuf.Duration + (*VaultMethods)(nil), // 5: uregistry.v1.VaultMethods + (*BlockConfirmation)(nil), // 6: uregistry.v1.BlockConfirmation + (*ChainEnabled)(nil), // 7: uregistry.v1.ChainEnabled + (*ChainConfig)(nil), // 8: uregistry.v1.ChainConfig + (*NativeRepresentation)(nil), // 9: uregistry.v1.NativeRepresentation + (*TokenConfig)(nil), // 10: uregistry.v1.TokenConfig + (*durationpb.Duration)(nil), // 11: google.protobuf.Duration } var file_uregistry_v1_types_proto_depIdxs = []int32{ 2, // 0: uregistry.v1.GatewayMethods.confirmation_type:type_name -> uregistry.v1.ConfirmationType - 0, // 1: uregistry.v1.ChainConfig.vm_type:type_name -> uregistry.v1.VmType - 5, // 2: uregistry.v1.ChainConfig.block_confirmation:type_name -> uregistry.v1.BlockConfirmation - 4, // 3: uregistry.v1.ChainConfig.gateway_methods:type_name -> uregistry.v1.GatewayMethods - 6, // 4: uregistry.v1.ChainConfig.enabled:type_name -> uregistry.v1.ChainEnabled - 10, // 5: uregistry.v1.ChainConfig.gas_oracle_fetch_interval:type_name -> google.protobuf.Duration - 1, // 6: uregistry.v1.TokenConfig.token_type:type_name -> uregistry.v1.TokenType - 8, // 7: uregistry.v1.TokenConfig.native_representation:type_name -> uregistry.v1.NativeRepresentation - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 2, // 1: uregistry.v1.VaultMethods.confirmation_type:type_name -> uregistry.v1.ConfirmationType + 0, // 2: uregistry.v1.ChainConfig.vm_type:type_name -> uregistry.v1.VmType + 6, // 3: uregistry.v1.ChainConfig.block_confirmation:type_name -> uregistry.v1.BlockConfirmation + 4, // 4: uregistry.v1.ChainConfig.gateway_methods:type_name -> uregistry.v1.GatewayMethods + 7, // 5: uregistry.v1.ChainConfig.enabled:type_name -> uregistry.v1.ChainEnabled + 11, // 6: uregistry.v1.ChainConfig.gas_oracle_fetch_interval:type_name -> google.protobuf.Duration + 5, // 7: uregistry.v1.ChainConfig.vault_methods:type_name -> uregistry.v1.VaultMethods + 1, // 8: uregistry.v1.TokenConfig.token_type:type_name -> uregistry.v1.TokenType + 9, // 9: uregistry.v1.TokenConfig.native_representation:type_name -> uregistry.v1.NativeRepresentation + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_uregistry_v1_types_proto_init() } @@ -5136,7 +5959,7 @@ func file_uregistry_v1_types_proto_init() { } } file_uregistry_v1_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockConfirmation); i { + switch v := v.(*VaultMethods); i { case 0: return &v.state case 1: @@ -5148,7 +5971,7 @@ func file_uregistry_v1_types_proto_init() { } } file_uregistry_v1_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChainEnabled); i { + switch v := v.(*BlockConfirmation); i { case 0: return &v.state case 1: @@ -5160,7 +5983,7 @@ func file_uregistry_v1_types_proto_init() { } } file_uregistry_v1_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChainConfig); i { + switch v := v.(*ChainEnabled); i { case 0: return &v.state case 1: @@ -5172,7 +5995,7 @@ func file_uregistry_v1_types_proto_init() { } } file_uregistry_v1_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NativeRepresentation); i { + switch v := v.(*ChainConfig); i { case 0: return &v.state case 1: @@ -5184,6 +6007,18 @@ func file_uregistry_v1_types_proto_init() { } } file_uregistry_v1_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NativeRepresentation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_uregistry_v1_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TokenConfig); i { case 0: return &v.state @@ -5202,7 +6037,7 @@ func file_uregistry_v1_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_uregistry_v1_types_proto_rawDesc, NumEnums: 3, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/app/upgrades.go b/app/upgrades.go index 70cb9b47..4ad2a032 100755 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -15,6 +15,7 @@ import ( pcmintcap "github.com/pushchain/push-chain-node/app/upgrades/pc-mint-cap" proxybytecodefix "github.com/pushchain/push-chain-node/app/upgrades/proxy-bytecode-fix" supplyslash "github.com/pushchain/push-chain-node/app/upgrades/supply-slash" + supplyburn "github.com/pushchain/push-chain-node/app/upgrades/supply-burn" removefeeabsv1 "github.com/pushchain/push-chain-node/app/upgrades/remove-fee-abs-v1" solanafix "github.com/pushchain/push-chain-node/app/upgrades/solana-fix" tsscore "github.com/pushchain/push-chain-node/app/upgrades/tss-core" @@ -41,6 +42,7 @@ var Upgrades = []upgrades.Upgrade{ universaltxv1.NewUpgrade(), proxybytecodefix.NewUpgrade(), supplyslash.NewUpgrade(), + supplyburn.NewUpgrade(), } // RegisterUpgradeHandlers registers the chain upgrade handlers diff --git a/app/upgrades/supply-burn/burn_targets.json b/app/upgrades/supply-burn/burn_targets.json new file mode 100644 index 00000000..b51b6947 --- /dev/null +++ b/app/upgrades/supply-burn/burn_targets.json @@ -0,0 +1,27 @@ +[ + { + "address": "push1p9wxp8uczwdmt0d5f4nzayqezhha5lrxv0heqg", + "keep_pc": 0, + "note": "Hegemon — burn all spendable" + }, + { + "address": "push1fv2fm76q7cjnr58wdwyntzrjgtc7qya6ctk0zm", + "keep_pc": 0, + "note": "Dev Donut operator — burn all spendable" + }, + { + "address": "push12jzrpp4pkucxxvj6hw4dfxsnhcpy6ddt0ljtrn", + "keep_pc": 0, + "note": "Trader's Espresso operator — burn all spendable" + }, + { + "address": "push1vzuw2x3k2ccme70zcgswv8d88kyc07grx5h6v7", + "keep_pc": 0, + "note": "Validator's Valhalla operator — burn all spendable (incl. 296B PC liquid)" + }, + { + "address": "push1wvy6j98pkuj4pua96ctm0y59w6nv64x2dwuzqx", + "keep_pc": 0, + "note": "User's Utopia operator — burn all spendable" + } +] diff --git a/app/upgrades/supply-burn/upgrades.go b/app/upgrades/supply-burn/upgrades.go new file mode 100644 index 00000000..e24e3f86 --- /dev/null +++ b/app/upgrades/supply-burn/upgrades.go @@ -0,0 +1,138 @@ +package supplyburn + +import ( + "context" + _ "embed" + "encoding/json" + + sdkmath "cosmossdk.io/math" + 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" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + + "github.com/pushchain/push-chain-node/app/upgrades" + pchaintypes "github.com/pushchain/push-chain-node/types" + uexecutortypes "github.com/pushchain/push-chain-node/x/uexecutor/types" +) + +const UpgradeName = "supply-burn" + +// BurnEntry specifies one address and how much PC to keep (in whole PC tokens). +// The handler burns: spendable_balance - keep_pc * 10^18 upc. +// Set keep_pc = 0 to burn the entire spendable balance. +type BurnEntry struct { + Address string `json:"address"` + KeepPC int64 `json:"keep_pc"` // whole PC to keep liquid (0 = burn all spendable) +} + +//go:embed burn_targets.json +var burnTargetsJSON []byte + +// NewUpgrade constructs the upgrade definition. +func NewUpgrade() upgrades.Upgrade { + return upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{}, + } +} + +// CreateUpgradeHandler burns spendable balances of all addresses in burn_targets.json, +// keeping keep_pc * 10^18 upc per address. +// Burn amount is computed from the live spendable balance at upgrade time — +// not from a snapshot — so it works correctly regardless of accrued rewards. +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) + sdkCtx.Logger().Info("Running upgrade", "name", UpgradeName) + + var entries []BurnEntry + if err := json.Unmarshal(burnTargetsJSON, &entries); err != nil { + panic("supply-burn: failed to parse burn_targets.json: " + err.Error()) + } + + totalBurned, success, skipped, errCount := ExecuteBurnEntries(sdkCtx, ak.BankKeeper, entries) + sdkCtx.Logger().Info("supply-burn: upgrade complete", + "total_burned_upc", totalBurned.String(), + "success", success, + "skipped", skipped, + "errors", errCount, + ) + + return mm.RunMigrations(ctx, configurator, fromVM) + } +} + +// ExecuteBurnEntries burns (spendable_balance - keep_pc * 10^18) upc from each address. +// Returns total burned and per-outcome counts. +// +// Entries are skipped (not errors) when: +// - spendable balance <= keep amount (nothing to burn) +// +// Entries are counted as errors when: +// - address fails bech32 decoding +// +// Panics if BurnCoins fails after SendCoinsFromAccountToModule succeeds. +func ExecuteBurnEntries( + ctx sdk.Context, + bk bankkeeper.BaseKeeper, + entries []BurnEntry, +) (totalBurned sdkmath.Int, success, skipped, errCount int) { + totalBurned = sdkmath.ZeroInt() + upcPerPC := sdkmath.NewInt(1_000_000_000_000_000_000) + + for _, entry := range entries { + addr, err := sdk.AccAddressFromBech32(entry.Address) + if err != nil { + ctx.Logger().Error("supply-burn: invalid address, skipping", + "address", entry.Address, "error", err.Error()) + errCount++ + continue + } + + keepAmt := sdkmath.NewInt(entry.KeepPC).Mul(upcPerPC) + + spendable := bk.SpendableCoins(ctx, addr) + spendableAmt := spendable.AmountOf(pchaintypes.BaseDenom) + + if spendableAmt.LTE(keepAmt) { + ctx.Logger().Info("supply-burn: spendable <= keep amount, skipping", + "address", entry.Address, + "spendable_upc", spendableAmt.String(), + "keep_upc", keepAmt.String()) + skipped++ + continue + } + + burnAmt := spendableAmt.Sub(keepAmt) + burnCoins := sdk.NewCoins(sdk.NewCoin(pchaintypes.BaseDenom, burnAmt)) + + // Two-step burn: send to uexecutor module (has Burner permission), then burn. + if err := bk.SendCoinsFromAccountToModule(ctx, addr, uexecutortypes.ModuleName, burnCoins); err != nil { + ctx.Logger().Error("supply-burn: SendCoinsFromAccountToModule failed, skipping", + "address", entry.Address, "error", err.Error()) + errCount++ + continue + } + + if err := bk.BurnCoins(ctx, uexecutortypes.ModuleName, burnCoins); err != nil { + // Coins left the account but BurnCoins failed: supply accounting is broken. + panic("supply-burn: BurnCoins failed after SendCoinsFromAccountToModule: " + err.Error()) + } + + totalBurned = totalBurned.Add(burnAmt) + success++ + ctx.Logger().Info("supply-burn: burned", + "address", entry.Address, + "burned_upc", burnAmt.String(), + "kept_upc", keepAmt.String()) + } + + return totalBurned, success, skipped, errCount +} diff --git a/proto/uregistry/v1/types.proto b/proto/uregistry/v1/types.proto index 2c9594e9..d0a7dcac 100644 --- a/proto/uregistry/v1/types.proto +++ b/proto/uregistry/v1/types.proto @@ -63,6 +63,18 @@ message GatewayMethods { ConfirmationType confirmation_type = 4; // Which block confirmation to use for this method } +// VaultMethods defines the configuration for a method exposed by the vault contract +message VaultMethods { + option (amino.name) = "uregistry/vault_methods"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + string name = 1; // Human-readable method name (e.g. "deposit") + string identifier = 2; // Hex-encoded selector or discriminator for the method + string event_identifier = 3; // Hex-encoded topic or identifier for emitted event + ConfirmationType confirmation_type = 4; // Which block confirmation to use for this method +} + // BlockConfirmation defines the number of blocks to wait for confirmation on the external chain message BlockConfirmation { option (amino.name) = "uregistry/block_confirmation"; @@ -100,6 +112,8 @@ message ChainConfig { ChainEnabled enabled = 7; // Whether this chain is currently enabled or not google.protobuf.Duration gas_oracle_fetch_interval = 8 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // how often relayers should fetch gas prices + + repeated VaultMethods vault_methods = 9; // List of methods exposed by the vault contract (optional) } message NativeRepresentation { diff --git a/test/integration/uexecutor/vote_outbound_test.go b/test/integration/uexecutor/vote_outbound_test.go index a9479420..55312e7c 100644 --- a/test/integration/uexecutor/vote_outbound_test.go +++ b/test/integration/uexecutor/vote_outbound_test.go @@ -287,4 +287,88 @@ func TestOutboundVoting(t *testing.T) { require.Equal(t, outbound.Sender, ob.PcRevertExecution.Sender) }) + t.Run("vote with 0x-prefixed utxId and txId still finalizes correctly", func(t *testing.T) { + app, ctx, vals, utxId, outbound, coreVals := + setupOutboundVotingTest(t, 4) + + // Simulate UVs submitting IDs with 0x prefix (as observed on testnet). + // The handler strips the prefix exactly once before the keeper lookup. + prefixedUtxId := "0x" + utxId + prefixedOutbound := *outbound + prefixedOutbound.Id = "0x" + outbound.Id + + for i := 0; i < 3; i++ { + valAddr, err := sdk.ValAddressFromBech32(coreVals[i].OperatorAddress) + require.NoError(t, err) + + coreAcc := sdk.AccAddress(valAddr).String() + err = utils.ExecVoteOutbound( + t, + ctx, + app, + vals[i], + coreAcc, + prefixedUtxId, + &prefixedOutbound, + true, + "", + ) + require.NoError(t, err) + } + + utx, _, err := app.UexecutorKeeper.GetUniversalTx(ctx, utxId) + require.NoError(t, err) + + ob := utx.OutboundTx[0] + require.Equal(t, uexecutortypes.Status_OBSERVED, ob.OutboundStatus) + require.NotNil(t, ob.ObservedTx) + require.True(t, ob.ObservedTx.Success) + }) + + t.Run("vote with unknown utxId returns error", func(t *testing.T) { + app, ctx, vals, _, outbound, coreVals := + setupOutboundVotingTest(t, 4) + + valAddr, _ := sdk.ValAddressFromBech32(coreVals[0].OperatorAddress) + coreAcc := sdk.AccAddress(valAddr).String() + + err := utils.ExecVoteOutbound( + t, + ctx, + app, + vals[0], + coreAcc, + "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", + outbound, + true, + "", + ) + require.Error(t, err) + require.Contains(t, err.Error(), "not found") + }) + + t.Run("vote with unknown outboundId returns error", func(t *testing.T) { + app, ctx, vals, utxId, outbound, coreVals := + setupOutboundVotingTest(t, 4) + + valAddr, _ := sdk.ValAddressFromBech32(coreVals[0].OperatorAddress) + coreAcc := sdk.AccAddress(valAddr).String() + + badOutbound := *outbound + badOutbound.Id = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef" + + err := utils.ExecVoteOutbound( + t, + ctx, + app, + vals[0], + coreAcc, + utxId, + &badOutbound, + true, + "", + ) + require.Error(t, err) + require.Contains(t, err.Error(), "not found") + }) } diff --git a/test/integration/upgrades/supply_burn_test.go b/test/integration/upgrades/supply_burn_test.go new file mode 100644 index 00000000..8fd3d66a --- /dev/null +++ b/test/integration/upgrades/supply_burn_test.go @@ -0,0 +1,227 @@ +package integrationtest + +import ( + "testing" + + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + supplyburn "github.com/pushchain/push-chain-node/app/upgrades/supply-burn" + pchaintypes "github.com/pushchain/push-chain-node/types" + utils "github.com/pushchain/push-chain-node/test/utils" +) + +func TestExecuteBurnEntries_BurnAll(t *testing.T) { + chainApp := utils.SetupApp(t) + ctx := chainApp.BaseApp.NewContext(true) + + // Fund account with 1000 PC, keep_pc=0 → burn entire spendable balance + addr := sdk.AccAddress([]byte("test-burn-account-1 ")) + acc := chainApp.AccountKeeper.NewAccountWithAddress(ctx, addr) + chainApp.AccountKeeper.SetAccount(ctx, acc) + + fundAmt := sdkmath.NewInt(1000).Mul(onePCInUPC) + fundCoins := sdk.NewCoins(sdk.NewCoin(pchaintypes.BaseDenom, fundAmt)) + require.NoError(t, chainApp.BankKeeper.MintCoins(ctx, utils.MintModule, fundCoins)) + require.NoError(t, chainApp.BankKeeper.SendCoinsFromModuleToAccount(ctx, utils.MintModule, addr, fundCoins)) + + entries := []supplyburn.BurnEntry{ + {Address: addr.String(), KeepPC: 0}, + } + + totalBurned, success, skipped, errCount := supplyburn.ExecuteBurnEntries(ctx, chainApp.BankKeeper, entries) + + require.Equal(t, fundAmt, totalBurned, "should burn the entire 1000 PC") + require.Equal(t, 1, success) + require.Equal(t, 0, skipped) + require.Equal(t, 0, errCount) + + // Account must be empty + bal := chainApp.BankKeeper.GetAllBalances(ctx, addr).AmountOf(pchaintypes.BaseDenom) + require.True(t, bal.IsZero(), "account should be empty after burn-all") +} + +func TestExecuteBurnEntries_KeepPartial(t *testing.T) { + chainApp := utils.SetupApp(t) + ctx := chainApp.BaseApp.NewContext(true) + + // Fund account with 1000 PC, keep_pc=100 → burn 900 PC + addr := sdk.AccAddress([]byte("test-burn-account-2 ")) + acc := chainApp.AccountKeeper.NewAccountWithAddress(ctx, addr) + chainApp.AccountKeeper.SetAccount(ctx, acc) + + fundAmt := sdkmath.NewInt(1000).Mul(onePCInUPC) + fundCoins := sdk.NewCoins(sdk.NewCoin(pchaintypes.BaseDenom, fundAmt)) + require.NoError(t, chainApp.BankKeeper.MintCoins(ctx, utils.MintModule, fundCoins)) + require.NoError(t, chainApp.BankKeeper.SendCoinsFromModuleToAccount(ctx, utils.MintModule, addr, fundCoins)) + + entries := []supplyburn.BurnEntry{ + {Address: addr.String(), KeepPC: 100}, + } + + totalBurned, success, skipped, errCount := supplyburn.ExecuteBurnEntries(ctx, chainApp.BankKeeper, entries) + + expectedBurn := sdkmath.NewInt(900).Mul(onePCInUPC) + require.Equal(t, expectedBurn, totalBurned, "should burn exactly 900 PC") + require.Equal(t, 1, success) + require.Equal(t, 0, skipped) + require.Equal(t, 0, errCount) + + // Account must have exactly 100 PC + bal := chainApp.BankKeeper.GetAllBalances(ctx, addr).AmountOf(pchaintypes.BaseDenom) + require.Equal(t, sdkmath.NewInt(100).Mul(onePCInUPC), bal, + "account should have exactly 100 PC remaining") +} + +func TestExecuteBurnEntries_SkipWhenSpendableLEKeep(t *testing.T) { + chainApp := utils.SetupApp(t) + ctx := chainApp.BaseApp.NewContext(true) + + // Fund account with 50 PC, keep_pc=100 → spendable <= keep → skip + addr := sdk.AccAddress([]byte("test-burn-account-3 ")) + acc := chainApp.AccountKeeper.NewAccountWithAddress(ctx, addr) + chainApp.AccountKeeper.SetAccount(ctx, acc) + + fundAmt := sdkmath.NewInt(50).Mul(onePCInUPC) + fundCoins := sdk.NewCoins(sdk.NewCoin(pchaintypes.BaseDenom, fundAmt)) + require.NoError(t, chainApp.BankKeeper.MintCoins(ctx, utils.MintModule, fundCoins)) + require.NoError(t, chainApp.BankKeeper.SendCoinsFromModuleToAccount(ctx, utils.MintModule, addr, fundCoins)) + + entries := []supplyburn.BurnEntry{ + {Address: addr.String(), KeepPC: 100}, + } + + totalBurned, success, skipped, errCount := supplyburn.ExecuteBurnEntries(ctx, chainApp.BankKeeper, entries) + + require.Equal(t, sdkmath.ZeroInt(), totalBurned, "nothing should be burned") + require.Equal(t, 0, success) + require.Equal(t, 1, skipped, "entry should be skipped, not errored") + require.Equal(t, 0, errCount) + + // Balance must be unchanged + bal := chainApp.BankKeeper.GetAllBalances(ctx, addr).AmountOf(pchaintypes.BaseDenom) + require.Equal(t, fundAmt, bal, "balance should be unchanged when skipped") +} + +func TestExecuteBurnEntries_SkipZeroBalance(t *testing.T) { + chainApp := utils.SetupApp(t) + ctx := chainApp.BaseApp.NewContext(true) + + // Account exists but has no funds, keep_pc=0 → skip (nothing to burn) + addr := sdk.AccAddress([]byte("test-burn-account-4 ")) + acc := chainApp.AccountKeeper.NewAccountWithAddress(ctx, addr) + chainApp.AccountKeeper.SetAccount(ctx, acc) + + entries := []supplyburn.BurnEntry{ + {Address: addr.String(), KeepPC: 0}, + } + + totalBurned, success, skipped, errCount := supplyburn.ExecuteBurnEntries(ctx, chainApp.BankKeeper, entries) + + require.Equal(t, sdkmath.ZeroInt(), totalBurned) + require.Equal(t, 0, success) + require.Equal(t, 1, skipped) + require.Equal(t, 0, errCount) +} + +func TestExecuteBurnEntries_InvalidAddress(t *testing.T) { + chainApp := utils.SetupApp(t) + ctx := chainApp.BaseApp.NewContext(true) + + entries := []supplyburn.BurnEntry{ + {Address: "not-a-valid-bech32-address", KeepPC: 0}, + } + + totalBurned, success, skipped, errCount := supplyburn.ExecuteBurnEntries(ctx, chainApp.BankKeeper, entries) + + require.Equal(t, sdkmath.ZeroInt(), totalBurned) + require.Equal(t, 0, success) + require.Equal(t, 0, skipped) + require.Equal(t, 1, errCount, "invalid bech32 address should be counted as an error") +} + +func TestExecuteBurnEntries_MultipleEntries(t *testing.T) { + chainApp := utils.SetupApp(t) + ctx := chainApp.BaseApp.NewContext(true) + + // addr1: 1000 PC, keep=0 → burn 1000 PC + addr1 := sdk.AccAddress([]byte("test-burn-account-5 ")) + acc1 := chainApp.AccountKeeper.NewAccountWithAddress(ctx, addr1) + chainApp.AccountKeeper.SetAccount(ctx, acc1) + coins1 := sdk.NewCoins(sdk.NewCoin(pchaintypes.BaseDenom, sdkmath.NewInt(1000).Mul(onePCInUPC))) + require.NoError(t, chainApp.BankKeeper.MintCoins(ctx, utils.MintModule, coins1)) + require.NoError(t, chainApp.BankKeeper.SendCoinsFromModuleToAccount(ctx, utils.MintModule, addr1, coins1)) + + // addr2: 500 PC, keep=200 → burn 300 PC + addr2 := sdk.AccAddress([]byte("test-burn-account-6 ")) + acc2 := chainApp.AccountKeeper.NewAccountWithAddress(ctx, addr2) + chainApp.AccountKeeper.SetAccount(ctx, acc2) + coins2 := sdk.NewCoins(sdk.NewCoin(pchaintypes.BaseDenom, sdkmath.NewInt(500).Mul(onePCInUPC))) + require.NoError(t, chainApp.BankKeeper.MintCoins(ctx, utils.MintModule, coins2)) + require.NoError(t, chainApp.BankKeeper.SendCoinsFromModuleToAccount(ctx, utils.MintModule, addr2, coins2)) + + // addr3: 50 PC, keep=100 → spendable <= keep → skip + addr3 := sdk.AccAddress([]byte("test-burn-account-7 ")) + acc3 := chainApp.AccountKeeper.NewAccountWithAddress(ctx, addr3) + chainApp.AccountKeeper.SetAccount(ctx, acc3) + coins3 := sdk.NewCoins(sdk.NewCoin(pchaintypes.BaseDenom, sdkmath.NewInt(50).Mul(onePCInUPC))) + require.NoError(t, chainApp.BankKeeper.MintCoins(ctx, utils.MintModule, coins3)) + require.NoError(t, chainApp.BankKeeper.SendCoinsFromModuleToAccount(ctx, utils.MintModule, addr3, coins3)) + + entries := []supplyburn.BurnEntry{ + {Address: addr1.String(), KeepPC: 0}, // burn 1000 PC + {Address: addr2.String(), KeepPC: 200}, // burn 300 PC + {Address: addr3.String(), KeepPC: 100}, // skip (50 < 100) + {Address: "bad-addr", KeepPC: 0}, // invalid → error + } + + totalBurned, success, skipped, errCount := supplyburn.ExecuteBurnEntries(ctx, chainApp.BankKeeper, entries) + + // 1000 + 300 = 1300 PC burned + require.Equal(t, sdkmath.NewInt(1300).Mul(onePCInUPC), totalBurned) + require.Equal(t, 2, success) + require.Equal(t, 1, skipped) + require.Equal(t, 1, errCount) + + // addr1 must be empty + bal1 := chainApp.BankKeeper.GetAllBalances(ctx, addr1).AmountOf(pchaintypes.BaseDenom) + require.True(t, bal1.IsZero(), "addr1 should be fully burned") + + // addr2 must have exactly 200 PC + bal2 := chainApp.BankKeeper.GetAllBalances(ctx, addr2).AmountOf(pchaintypes.BaseDenom) + require.Equal(t, sdkmath.NewInt(200).Mul(onePCInUPC), bal2, "addr2 should keep 200 PC") + + // addr3 must be unchanged (50 PC) + bal3 := chainApp.BankKeeper.GetAllBalances(ctx, addr3).AmountOf(pchaintypes.BaseDenom) + require.Equal(t, sdkmath.NewInt(50).Mul(onePCInUPC), bal3, "addr3 should be unchanged") +} + +func TestExecuteBurnEntries_ExactKeepEqualsSpendable(t *testing.T) { + chainApp := utils.SetupApp(t) + ctx := chainApp.BaseApp.NewContext(true) + + // Fund 100 PC, keep=100 → spendable == keep → skip (nothing to burn) + addr := sdk.AccAddress([]byte("test-burn-account-8 ")) + acc := chainApp.AccountKeeper.NewAccountWithAddress(ctx, addr) + chainApp.AccountKeeper.SetAccount(ctx, acc) + + fundAmt := sdkmath.NewInt(100).Mul(onePCInUPC) + fundCoins := sdk.NewCoins(sdk.NewCoin(pchaintypes.BaseDenom, fundAmt)) + require.NoError(t, chainApp.BankKeeper.MintCoins(ctx, utils.MintModule, fundCoins)) + require.NoError(t, chainApp.BankKeeper.SendCoinsFromModuleToAccount(ctx, utils.MintModule, addr, fundCoins)) + + entries := []supplyburn.BurnEntry{ + {Address: addr.String(), KeepPC: 100}, + } + + totalBurned, success, skipped, errCount := supplyburn.ExecuteBurnEntries(ctx, chainApp.BankKeeper, entries) + + require.Equal(t, sdkmath.ZeroInt(), totalBurned) + require.Equal(t, 0, success) + require.Equal(t, 1, skipped, "equal spendable and keep should be skipped") + require.Equal(t, 0, errCount) + + bal := chainApp.BankKeeper.GetAllBalances(ctx, addr).AmountOf(pchaintypes.BaseDenom) + require.Equal(t, fundAmt, bal, "balance should be unchanged") +} diff --git a/x/uexecutor/keeper/create_outbound.go b/x/uexecutor/keeper/create_outbound.go index 1a3fb711..ec6b0122 100644 --- a/x/uexecutor/keeper/create_outbound.go +++ b/x/uexecutor/keeper/create_outbound.go @@ -71,7 +71,7 @@ func (k Keeper) BuildOutboundsFromReceipt( FundRecipient: event.RevertRecipient, }, OutboundStatus: types.Status_PENDING, - Id: event.TxID, + Id: strings.TrimPrefix(event.TxID, "0x"), } outbounds = append(outbounds, outbound) diff --git a/x/uexecutor/keeper/msg_server.go b/x/uexecutor/keeper/msg_server.go index 49dd09f1..5ef96f65 100755 --- a/x/uexecutor/keeper/msg_server.go +++ b/x/uexecutor/keeper/msg_server.go @@ -3,6 +3,7 @@ package keeper import ( "context" "fmt" + "strings" "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -144,6 +145,10 @@ func (ms msgServer) VoteOutbound(ctx context.Context, msg *types.MsgVoteOutbound return nil, fmt.Errorf("invalid signer address: %w", err) } + // Normalize IDs: strip 0x prefix + msg.TxId = strings.TrimPrefix(msg.TxId, "0x") + msg.UtxId = strings.TrimPrefix(msg.UtxId, "0x") + // Convert account to validator operator address signerValAddr := sdk.ValAddress(signerAccAddr) diff --git a/x/uexecutor/keeper/msg_vote_outbound.go b/x/uexecutor/keeper/msg_vote_outbound.go index 7abbcdf2..901e74b3 100644 --- a/x/uexecutor/keeper/msg_vote_outbound.go +++ b/x/uexecutor/keeper/msg_vote_outbound.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pushchain/push-chain-node/x/uexecutor/types" ) @@ -25,10 +24,10 @@ func (k Keeper) VoteOutbound( return err } if !found { - return errors.Wrap(err, "UniversalTx not found") + return fmt.Errorf("UniversalTx not found: %s", utxId) } if utx.OutboundTx == nil { - return errors.Wrap(err, "No outbound tx found in the specified UniversalTx") + return fmt.Errorf("no outbound tx found in UniversalTx %s", utxId) } // Step 2: Find outbound by id @@ -42,7 +41,7 @@ func (k Keeper) VoteOutbound( } } if !found { - return errors.Wrap(err, "Outbound not found") + return fmt.Errorf("outbound %s not found in UniversalTx %s", outboundId, utxId) } // Prevent double-finalization diff --git a/x/uexecutor/keeper/query_server_v2.go b/x/uexecutor/keeper/query_server_v2.go index 86b49a1f..57f6b948 100644 --- a/x/uexecutor/keeper/query_server_v2.go +++ b/x/uexecutor/keeper/query_server_v2.go @@ -3,6 +3,7 @@ package keeper import ( "context" "errors" + "strings" "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" @@ -32,7 +33,7 @@ func (k QuerierV2) GetUniversalTx(goCtx context.Context, req *typesv2.QueryGetUn ctx := sdk.UnwrapSDKContext(goCtx) - currentTx, err := k.UniversalTx.Get(ctx, req.Id) + currentTx, err := k.UniversalTx.Get(ctx, strings.TrimPrefix(req.Id, "0x")) if err != nil { if errors.Is(err, collections.ErrNotFound) { return nil, status.Error(codes.NotFound, "UniversalTx not found") diff --git a/x/uregistry/migrations/v3/migrate.go b/x/uregistry/migrations/v3/migrate.go new file mode 100644 index 00000000..025fad0b --- /dev/null +++ b/x/uregistry/migrations/v3/migrate.go @@ -0,0 +1,59 @@ +package v3 + +import ( + "cosmossdk.io/collections" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/pushchain/push-chain-node/x/uregistry/keeper" + uregistrytypes "github.com/pushchain/push-chain-node/x/uregistry/types" +) + +// MigrateChainConfigs initializes the vault_methods field +// (introduced in v3) to its zero-value default for all existing chain configs. +// Since protobuf already decodes missing fields as zero values, this migration +// is a no-op in terms of data transformation but is registered to satisfy the +// module consensus version bump from 2 → 3. +func MigrateChainConfigs(ctx sdk.Context, k *keeper.Keeper, cdc codec.BinaryCodec, logger log.Logger) error { + logger.Info("Starting ChainConfig migration v3: adding vault_methods field") + + sb := k.SchemaBuilder() + + oldMap := collections.NewMap( + sb, + uregistrytypes.ChainConfigsKey, + uregistrytypes.ChainConfigsName, + collections.StringKey, + codec.CollValue[uregistrytypes.ChainConfig](cdc), + ) + + iter, err := oldMap.Iterate(ctx, nil) + if err != nil { + return err + } + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + chainID, err := iter.Key() + if err != nil { + return err + } + + cfg, err := iter.Value() + if err != nil { + return err + } + + // vault_methods defaults to empty — no transformation needed. + // Re-save to ensure the record is encoded with the current schema. + if err := k.ChainConfigs.Set(ctx, chainID, cfg); err != nil { + return err + } + + logger.Info("Migrated ChainConfig v3", "chain_id", chainID) + } + + logger.Info("Completed ChainConfig migration v3 successfully") + return nil +} diff --git a/x/uregistry/migrations/v3/migrate_test.go b/x/uregistry/migrations/v3/migrate_test.go new file mode 100644 index 00000000..93dbb0cf --- /dev/null +++ b/x/uregistry/migrations/v3/migrate_test.go @@ -0,0 +1,240 @@ +package v3_test + +import ( + "testing" + "time" + + "cosmossdk.io/collections" + "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/codec" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil/integration" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + evmkeeper "github.com/cosmos/evm/x/vm/keeper" + "github.com/stretchr/testify/require" + + "github.com/pushchain/push-chain-node/app" + "github.com/pushchain/push-chain-node/x/uregistry/keeper" + v3 "github.com/pushchain/push-chain-node/x/uregistry/migrations/v3" + "github.com/pushchain/push-chain-node/x/uregistry/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// legacyChainConfig mirrors ChainConfig as it existed before v3 — +// field 9 (vault_methods) is absent. +// The proto field tags are identical to the generated types.pb.go so that +// marshaling produces the exact binary encoding an old node would have written. +type legacyChainConfig struct { + Chain string `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` + VmType types.VmType `protobuf:"varint,2,opt,name=vm_type,json=vmType,proto3,enum=uregistry.v1.VmType" json:"vm_type,omitempty"` + PublicRpcUrl string `protobuf:"bytes,3,opt,name=public_rpc_url,json=publicRpcUrl,proto3" json:"public_rpc_url,omitempty"` + GatewayAddress string `protobuf:"bytes,4,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` + BlockConfirmation *types.BlockConfirmation `protobuf:"bytes,5,opt,name=block_confirmation,json=blockConfirmation,proto3" json:"block_confirmation,omitempty"` + GatewayMethods []*types.GatewayMethods `protobuf:"bytes,6,rep,name=gateway_methods,json=gatewayMethods,proto3" json:"gateway_methods,omitempty"` + Enabled *types.ChainEnabled `protobuf:"bytes,7,opt,name=enabled,proto3" json:"enabled,omitempty"` + GasOracleFetchInterval time.Duration `protobuf:"bytes,8,opt,name=gas_oracle_fetch_interval,json=gasOracleFetchInterval,proto3,stdduration" json:"gas_oracle_fetch_interval"` + // field 9 (vault_methods) deliberately absent +} + +func (m *legacyChainConfig) Reset() {} +func (m *legacyChainConfig) String() string { return m.Chain } +func (m *legacyChainConfig) ProtoMessage() {} + +func setupKeeper(t *testing.T) (sdk.Context, keeper.Keeper, moduletestutil.TestEncodingConfig) { + t.Helper() + + cfg := sdk.GetConfig() + cfg.SetBech32PrefixForAccount(app.Bech32PrefixAccAddr, app.Bech32PrefixAccPub) + cfg.SetBech32PrefixForValidator(app.Bech32PrefixValAddr, app.Bech32PrefixValPub) + cfg.SetBech32PrefixForConsensusNode(app.Bech32PrefixConsAddr, app.Bech32PrefixConsPub) + cfg.SetCoinType(app.CoinType) + + _ = sdkaddress.NewBech32Codec(app.Bech32PrefixAccAddr) + + logger := log.NewTestLogger(t) + encCfg := moduletestutil.MakeTestEncodingConfig() + types.RegisterInterfaces(encCfg.InterfaceRegistry) + + keys := storetypes.NewKVStoreKeys(types.ModuleName) + ctx := sdk.NewContext(integration.CreateMultiStore(keys, logger), cmtproto.Header{}, false, logger) + + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + k := keeper.NewKeeper( + encCfg.Codec, + runtime.NewKVStoreService(keys[types.ModuleName]), + logger, + govAddr, + &evmkeeper.Keeper{}, + ) + + return ctx, k, encCfg +} + +// seedLegacyConfigs writes old-format chain configs (no vault fields) directly +// into the store using a collections.Map typed to legacyChainConfig. +// This produces the exact same binary encoding an old node would have written. +func seedLegacyConfigs(t *testing.T, ctx sdk.Context, k *keeper.Keeper, cdc codec.BinaryCodec, cfgs []legacyChainConfig) { + t.Helper() + + legacyMap := collections.NewMap( + k.SchemaBuilder(), + types.ChainConfigsKey, + types.ChainConfigsName, + collections.StringKey, + codec.CollValue[legacyChainConfig](cdc), + ) + + for _, cfg := range cfgs { + require.NoError(t, legacyMap.Set(ctx, cfg.Chain, cfg)) + } +} + +// TestMigrateChainConfigs_V3_OldData seeds chain configs encoded in the pre-v3 +// binary format (no vault_methods) and verifies that: +// 1. The migration completes without error. +// 2. All pre-existing fields survive unchanged. +// 3. vault_methods is empty after migration. +func TestMigrateChainConfigs_V3_OldData(t *testing.T) { + ctx, k, encCfg := setupKeeper(t) + logger := log.NewTestLogger(t) + + oldConfigs := []legacyChainConfig{ + { + Chain: "eip155:11155111", + VmType: types.VmType_EVM, + PublicRpcUrl: "https://eth-sepolia.public.blastapi.io", + GatewayAddress: "0x05bD7a3D18324c1F7e216f7fBF2b15985aE5281A", + BlockConfirmation: &types.BlockConfirmation{ + FastInbound: 0, + StandardInbound: 1, + }, + GatewayMethods: []*types.GatewayMethods{ + { + Name: "sendFunds", + Identifier: "0x65f4dbe1", + EventIdentifier: "0x33e6cf63a9ddbaee9d86893573e2616fe7a78fc9b7b23acb7da8b58bd0024041", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_STANDARD, + }, + }, + Enabled: &types.ChainEnabled{ + IsInboundEnabled: true, + IsOutboundEnabled: true, + }, + GasOracleFetchInterval: 30 * time.Second, + }, + { + Chain: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", + VmType: types.VmType_SVM, + PublicRpcUrl: "https://api.devnet.solana.com", + GatewayAddress: "CFVSincHYbETh2k7w6u1ENEkjbSLtveRCEBupKidw2VS", + BlockConfirmation: &types.BlockConfirmation{ + FastInbound: 0, + StandardInbound: 1, + }, + GatewayMethods: []*types.GatewayMethods{ + { + Name: "add_funds", + Identifier: "84ed4c39500ab38a", + EventIdentifier: "7f1f6cffbb134644", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_FAST, + }, + }, + Enabled: &types.ChainEnabled{ + IsInboundEnabled: true, + IsOutboundEnabled: false, + }, + GasOracleFetchInterval: 30 * time.Second, + }, + } + + seedLegacyConfigs(t, ctx, &k, encCfg.Codec, oldConfigs) + + // Run the v3 migration against old-format data. + err := v3.MigrateChainConfigs(ctx, &k, encCfg.Codec, logger) + require.NoError(t, err) + + // Verify each config is readable by the new type and vault fields are absent. + for _, old := range oldConfigs { + got, err := k.ChainConfigs.Get(ctx, old.Chain) + require.NoError(t, err, "chain %s should exist after migration", old.Chain) + + // Pre-existing fields must be unchanged. + require.Equal(t, old.Chain, got.Chain) + require.Equal(t, old.VmType, got.VmType) + require.Equal(t, old.PublicRpcUrl, got.PublicRpcUrl) + require.Equal(t, old.GatewayAddress, got.GatewayAddress) + require.Equal(t, old.GasOracleFetchInterval, got.GasOracleFetchInterval) + require.Equal(t, len(old.GatewayMethods), len(got.GatewayMethods)) + for i, gm := range old.GatewayMethods { + require.Equal(t, gm.Name, got.GatewayMethods[i].Name) + require.Equal(t, gm.Identifier, got.GatewayMethods[i].Identifier) + require.Equal(t, gm.EventIdentifier, got.GatewayMethods[i].EventIdentifier) + require.Equal(t, gm.ConfirmationType, got.GatewayMethods[i].ConfirmationType) + } + + // vault_methods must be zero-value — it was never in the old encoding. + require.Empty(t, got.VaultMethods, "vault_methods should be empty for pre-v3 data") + } +} + +// TestMigrateChainConfigs_V3_EmptyStore verifies the migration succeeds when +// there are no chain configs in the store (fresh chain or first-time setup). +func TestMigrateChainConfigs_V3_EmptyStore(t *testing.T) { + ctx, k, encCfg := setupKeeper(t) + logger := log.NewTestLogger(t) + + err := v3.MigrateChainConfigs(ctx, &k, encCfg.Codec, logger) + require.NoError(t, err) + + // Store must still be empty after migration. + iter, err := k.ChainConfigs.Iterate(ctx, nil) + require.NoError(t, err) + defer iter.Close() + require.False(t, iter.Valid(), "store should remain empty after migrating empty state") +} + +// TestMigrateChainConfigs_V3_PreservesNewFields verifies that a config already +// written with the new schema (vault_methods present) is not corrupted by the migration. +func TestMigrateChainConfigs_V3_PreservesNewFields(t *testing.T) { + ctx, k, encCfg := setupKeeper(t) + logger := log.NewTestLogger(t) + + cfg := types.ChainConfig{ + Chain: "eip155:97", + VmType: types.VmType_EVM, + PublicRpcUrl: "https://bsc-testnet-rpc.publicnode.com", + GatewayAddress: "0x44aFFC61983F4348DdddB886349eb992C061EaC0", + BlockConfirmation: &types.BlockConfirmation{ + FastInbound: 0, + StandardInbound: 1, + }, + GasOracleFetchInterval: 30 * time.Second, + VaultMethods: []*types.VaultMethods{ + { + Name: "deposit", + Identifier: "0xb6b55f25", + EventIdentifier: "0x3c4e6c56cc5f2c26c92b91ee2f8bdc4e844b407bd1402b34ac1ef1f875d3c4b5", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_STANDARD, + }, + }, + } + require.NoError(t, k.ChainConfigs.Set(ctx, cfg.Chain, cfg)) + + err := v3.MigrateChainConfigs(ctx, &k, encCfg.Codec, logger) + require.NoError(t, err) + + got, err := k.ChainConfigs.Get(ctx, cfg.Chain) + require.NoError(t, err) + + require.Len(t, got.VaultMethods, 1) + require.Equal(t, cfg.VaultMethods[0].Name, got.VaultMethods[0].Name) + require.Equal(t, cfg.VaultMethods[0].Identifier, got.VaultMethods[0].Identifier) +} diff --git a/x/uregistry/module.go b/x/uregistry/module.go index 71e54d7a..5a0d9044 100755 --- a/x/uregistry/module.go +++ b/x/uregistry/module.go @@ -21,12 +21,13 @@ import ( "github.com/pushchain/push-chain-node/x/uregistry/keeper" v2 "github.com/pushchain/push-chain-node/x/uregistry/migrations/v2" + v3 "github.com/pushchain/push-chain-node/x/uregistry/migrations/v3" "github.com/pushchain/push-chain-node/x/uregistry/types" ) const ( // ConsensusVersion defines the current x/uregistry module consensus version. - ConsensusVersion = 2 + ConsensusVersion = 3 ) var ( @@ -144,20 +145,33 @@ 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) + // Register uregistry 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)) } + + // Register uregistry migration for v3 (from version 2 → 3) + if err := cfg.RegisterMigration(types.ModuleName, 2, a.migrateToV3()); err != nil { + panic(fmt.Sprintf("failed to migrate %s from version 2 to 3: %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") + ctx.Logger().Info("🔧 Running uregistry module migration: v1 → v2") return v2.MigrateChainConfigs(ctx, &a.keeper, a.AppModuleBasic.cdc, a.keeper.Logger()) } } +func (a AppModule) migrateToV3() module.MigrationHandler { + return func(ctx sdk.Context) error { + ctx.Logger().Info("🔧 Running uregistry module migration: v2 → v3 (vault fields)") + + return v3.MigrateChainConfigs(ctx, &a.keeper, a.AppModuleBasic.cdc, a.keeper.Logger()) + } +} + // 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 diff --git a/x/uregistry/types/chain_config.go b/x/uregistry/types/chain_config.go index 3470c16c..72772cb8 100644 --- a/x/uregistry/types/chain_config.go +++ b/x/uregistry/types/chain_config.go @@ -44,11 +44,7 @@ func (p ChainConfig) ValidateBasic() error { return errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid vm_type: %v", p.VmType) } - // Validate gateway methods - if len(p.GatewayMethods) == 0 { - return errors.Wrap(sdkerrors.ErrInvalidRequest, "gateway_methods cannot be empty") - } - + // Validate gateway methods (can be empty, but each provided method must be valid) for _, method := range p.GatewayMethods { if err := method.ValidateBasic(); err != nil { return errors.Wrapf(err, "invalid method in gateway_methods: %s", method.Name) @@ -60,5 +56,11 @@ func (p ChainConfig) ValidateBasic() error { return errors.Wrap(sdkerrors.ErrInvalidRequest, "gas_oracle_fetch_interval must be positive") } + for _, method := range p.VaultMethods { + if err := method.ValidateBasic(); err != nil { + return errors.Wrapf(err, "invalid method in vault_methods: %s", method.Name) + } + } + return p.BlockConfirmation.ValidateBasic() } diff --git a/x/uregistry/types/chain_config_test.go b/x/uregistry/types/chain_config_test.go index e27654d9..f470dea2 100644 --- a/x/uregistry/types/chain_config_test.go +++ b/x/uregistry/types/chain_config_test.go @@ -121,7 +121,7 @@ func TestChainConfig_ValidateBasic(t *testing.T) { errMsg: "invalid vm_type", }, { - name: "invalid - empty gateway methods", + name: "valid - empty gateway methods", config: types.ChainConfig{ Chain: "solana:devnet", VmType: types.VmType_SVM, @@ -129,9 +129,9 @@ func TestChainConfig_ValidateBasic(t *testing.T) { GatewayAddress: "addr", BlockConfirmation: validBlockConfirmation, GatewayMethods: []*types.GatewayMethods{}, + GasOracleFetchInterval: 30, }, - expectErr: true, - errMsg: "gateway_methods cannot be empty", + expectErr: false, }, { name: "invalid - bad method inside gateway_methods", @@ -152,6 +152,69 @@ func TestChainConfig_ValidateBasic(t *testing.T) { expectErr: true, errMsg: "invalid method in gateway_methods", }, + { + name: "valid - with vault methods", + config: types.ChainConfig{ + Chain: "solana:devnet", + VmType: types.VmType_SVM, + PublicRpcUrl: "https://api.devnet.solana.com", + GatewayAddress: "3zrWaMknHTRQpZSxY4BvQxw9TStSXiHcmcp3NMPTFkke", + BlockConfirmation: validBlockConfirmation, + GatewayMethods: []*types.GatewayMethods{validMethod}, + VaultMethods: []*types.VaultMethods{ + { + Name: "deposit", + Identifier: "0xb6b55f25", + EventIdentifier: "0x3c4e6c56cc5f2c26c92b91ee2f8bdc4e844b407bd1402b34ac1ef1f875d3c4b5", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_STANDARD, + }, + }, + Enabled: &types.ChainEnabled{ + IsInboundEnabled: true, + IsOutboundEnabled: true, + }, + GasOracleFetchInterval: 30, + }, + expectErr: false, + }, + { + name: "valid - no vault methods", + config: types.ChainConfig{ + Chain: "solana:devnet", + VmType: types.VmType_SVM, + PublicRpcUrl: "https://api.devnet.solana.com", + GatewayAddress: "3zrWaMknHTRQpZSxY4BvQxw9TStSXiHcmcp3NMPTFkke", + BlockConfirmation: validBlockConfirmation, + GatewayMethods: []*types.GatewayMethods{validMethod}, + Enabled: &types.ChainEnabled{ + IsInboundEnabled: true, + IsOutboundEnabled: true, + }, + GasOracleFetchInterval: 30, + }, + expectErr: false, + }, + { + name: "invalid - bad vault method inside vault_methods", + config: types.ChainConfig{ + Chain: "solana:devnet", + VmType: types.VmType_SVM, + PublicRpcUrl: "url", + GatewayAddress: "addr", + BlockConfirmation: validBlockConfirmation, + GatewayMethods: []*types.GatewayMethods{validMethod}, + VaultMethods: []*types.VaultMethods{ + { + Name: "bad_vault_method", + Identifier: "zzznothex", // invalid + EventIdentifier: "7f1f6cffbb134644", + }, + }, + GasOracleFetchInterval: 30, + }, + expectErr: true, + errMsg: "invalid method in vault_methods", + }, } for _, tc := range tests { diff --git a/x/uregistry/types/types.pb.go b/x/uregistry/types/types.pb.go index 659c8632..3d26d1d8 100644 --- a/x/uregistry/types/types.pb.go +++ b/x/uregistry/types/types.pb.go @@ -256,6 +256,74 @@ func (m *GatewayMethods) GetConfirmationType() ConfirmationType { return ConfirmationType_CONFIRMATION_UNKNOWN } +// VaultMethods defines the configuration for a method exposed by the vault contract +type VaultMethods struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Identifier string `protobuf:"bytes,2,opt,name=identifier,proto3" json:"identifier,omitempty"` + EventIdentifier string `protobuf:"bytes,3,opt,name=event_identifier,json=eventIdentifier,proto3" json:"event_identifier,omitempty"` + ConfirmationType ConfirmationType `protobuf:"varint,4,opt,name=confirmation_type,json=confirmationType,proto3,enum=uregistry.v1.ConfirmationType" json:"confirmation_type,omitempty"` +} + +func (m *VaultMethods) Reset() { *m = VaultMethods{} } +func (*VaultMethods) ProtoMessage() {} +func (*VaultMethods) Descriptor() ([]byte, []int) { + return fileDescriptor_11eea54f17422d86, []int{2} +} +func (m *VaultMethods) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VaultMethods) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VaultMethods.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 *VaultMethods) XXX_Merge(src proto.Message) { + xxx_messageInfo_VaultMethods.Merge(m, src) +} +func (m *VaultMethods) XXX_Size() int { + return m.Size() +} +func (m *VaultMethods) XXX_DiscardUnknown() { + xxx_messageInfo_VaultMethods.DiscardUnknown(m) +} + +var xxx_messageInfo_VaultMethods proto.InternalMessageInfo + +func (m *VaultMethods) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *VaultMethods) GetIdentifier() string { + if m != nil { + return m.Identifier + } + return "" +} + +func (m *VaultMethods) GetEventIdentifier() string { + if m != nil { + return m.EventIdentifier + } + return "" +} + +func (m *VaultMethods) GetConfirmationType() ConfirmationType { + if m != nil { + return m.ConfirmationType + } + return ConfirmationType_CONFIRMATION_UNKNOWN +} + // BlockConfirmation defines the number of blocks to wait for confirmation on the external chain type BlockConfirmation struct { FastInbound uint32 `protobuf:"varint,1,opt,name=fast_inbound,json=fastInbound,proto3" json:"fast_inbound,omitempty"` @@ -265,7 +333,7 @@ type BlockConfirmation struct { func (m *BlockConfirmation) Reset() { *m = BlockConfirmation{} } func (*BlockConfirmation) ProtoMessage() {} func (*BlockConfirmation) Descriptor() ([]byte, []int) { - return fileDescriptor_11eea54f17422d86, []int{2} + return fileDescriptor_11eea54f17422d86, []int{3} } func (m *BlockConfirmation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -317,7 +385,7 @@ type ChainEnabled struct { func (m *ChainEnabled) Reset() { *m = ChainEnabled{} } func (*ChainEnabled) ProtoMessage() {} func (*ChainEnabled) Descriptor() ([]byte, []int) { - return fileDescriptor_11eea54f17422d86, []int{3} + return fileDescriptor_11eea54f17422d86, []int{4} } func (m *ChainEnabled) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -370,12 +438,13 @@ type ChainConfig struct { GatewayMethods []*GatewayMethods `protobuf:"bytes,6,rep,name=gateway_methods,json=gatewayMethods,proto3" json:"gateway_methods,omitempty"` Enabled *ChainEnabled `protobuf:"bytes,7,opt,name=enabled,proto3" json:"enabled,omitempty"` GasOracleFetchInterval time.Duration `protobuf:"bytes,8,opt,name=gas_oracle_fetch_interval,json=gasOracleFetchInterval,proto3,stdduration" json:"gas_oracle_fetch_interval"` + VaultMethods []*VaultMethods `protobuf:"bytes,9,rep,name=vault_methods,json=vaultMethods,proto3" json:"vault_methods,omitempty"` } func (m *ChainConfig) Reset() { *m = ChainConfig{} } func (*ChainConfig) ProtoMessage() {} func (*ChainConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_11eea54f17422d86, []int{4} + return fileDescriptor_11eea54f17422d86, []int{5} } func (m *ChainConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -460,6 +529,13 @@ func (m *ChainConfig) GetGasOracleFetchInterval() time.Duration { return 0 } +func (m *ChainConfig) GetVaultMethods() []*VaultMethods { + if m != nil { + return m.VaultMethods + } + return nil +} + type NativeRepresentation struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` ContractAddress string `protobuf:"bytes,2,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` @@ -468,7 +544,7 @@ type NativeRepresentation struct { func (m *NativeRepresentation) Reset() { *m = NativeRepresentation{} } func (*NativeRepresentation) ProtoMessage() {} func (*NativeRepresentation) Descriptor() ([]byte, []int) { - return fileDescriptor_11eea54f17422d86, []int{5} + return fileDescriptor_11eea54f17422d86, []int{6} } func (m *NativeRepresentation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -526,7 +602,7 @@ type TokenConfig struct { func (m *TokenConfig) Reset() { *m = TokenConfig{} } func (*TokenConfig) ProtoMessage() {} func (*TokenConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_11eea54f17422d86, []int{6} + return fileDescriptor_11eea54f17422d86, []int{7} } func (m *TokenConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -624,6 +700,7 @@ func init() { proto.RegisterEnum("uregistry.v1.ConfirmationType", ConfirmationType_name, ConfirmationType_value) proto.RegisterType((*Params)(nil), "uregistry.v1.Params") proto.RegisterType((*GatewayMethods)(nil), "uregistry.v1.GatewayMethods") + proto.RegisterType((*VaultMethods)(nil), "uregistry.v1.VaultMethods") proto.RegisterType((*BlockConfirmation)(nil), "uregistry.v1.BlockConfirmation") proto.RegisterType((*ChainEnabled)(nil), "uregistry.v1.ChainEnabled") proto.RegisterType((*ChainConfig)(nil), "uregistry.v1.ChainConfig") @@ -634,76 +711,78 @@ func init() { func init() { proto.RegisterFile("uregistry/v1/types.proto", fileDescriptor_11eea54f17422d86) } var fileDescriptor_11eea54f17422d86 = []byte{ - // 1095 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x56, 0xcf, 0x6f, 0xe3, 0xd4, - 0x13, 0x8f, 0x93, 0x36, 0x3f, 0x26, 0x69, 0xea, 0x3c, 0xe5, 0xdb, 0xcd, 0x46, 0xfb, 0x4d, 0x4a, - 0x76, 0x05, 0xdd, 0x6a, 0x37, 0xa1, 0x85, 0x5d, 0xa4, 0x48, 0x1c, 0xd2, 0x34, 0x85, 0xa8, 0x4d, - 0x5c, 0xbd, 0x78, 0x5b, 0xc1, 0x01, 0xeb, 0xc5, 0x7e, 0x75, 0xac, 0xf5, 0x2f, 0x6c, 0x27, 0x90, - 0x3f, 0x80, 0x0b, 0x42, 0x08, 0x6e, 0x7b, 0xdc, 0x3f, 0x81, 0x3f, 0x63, 0x8f, 0x7b, 0xe4, 0x04, - 0xa8, 0x45, 0x82, 0x3b, 0x37, 0x4e, 0xc8, 0xcf, 0x76, 0xe2, 0x34, 0x85, 0x4b, 0xfb, 0xe6, 0x33, - 0x93, 0x99, 0xcf, 0xcc, 0x67, 0x26, 0x2d, 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 0x9f, 0x74, 0x46, 0x22, 0x9f, 0x3c, 0x3a, 0x7f, 0x73, 0x5d, 0xe3, 0xde, - 0x5e, 0xd7, 0xb8, 0xdf, 0xae, 0x6b, 0xdc, 0x0f, 0x37, 0xb5, 0xc4, 0xdb, 0x9b, 0x5a, 0xe2, 0xe7, - 0x9b, 0x5a, 0xe2, 0xf3, 0xe7, 0xaa, 0xe6, 0x4d, 0xa6, 0xe3, 0xa6, 0x6c, 0x19, 0x2d, 0x7b, 0xea, - 0x4e, 0xd8, 0x46, 0xb3, 0xd7, 0x53, 0xf6, 0x7c, 0x6a, 0x5a, 0x0a, 0x6d, 0x7d, 0xdd, 0x8a, 0x69, - 0xe4, 0xff, 0xeb, 0x30, 0x4e, 0xb3, 0xdb, 0xff, 0xe0, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa4, - 0xd1, 0xcb, 0xe2, 0x57, 0x08, 0x00, 0x00, + // 1132 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcd, 0x6e, 0xe3, 0xd4, + 0x17, 0x8f, 0x93, 0x36, 0x1f, 0x27, 0x69, 0xea, 0x5c, 0xe5, 0xdf, 0x71, 0xa3, 0xf9, 0x27, 0x25, + 0x33, 0x82, 0x4e, 0x35, 0x4d, 0x68, 0x61, 0x06, 0xa9, 0x12, 0x42, 0x69, 0x9a, 0x42, 0xd4, 0x26, + 0xa9, 0x6e, 0x3c, 0xa9, 0x60, 0x81, 0x75, 0x63, 0xdf, 0x26, 0xd6, 0xf8, 0x23, 0xd8, 0x4e, 0x20, + 0x0f, 0xc0, 0x06, 0x21, 0x04, 0xbb, 0x59, 0xce, 0x23, 0xb0, 0xe0, 0x21, 0x66, 0x39, 0x4b, 0x56, + 0x30, 0x6a, 0x91, 0xe0, 0x19, 0x58, 0x21, 0x5f, 0xdb, 0x89, 0xdd, 0x74, 0xd8, 0xb3, 0x69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xfc, 0xed, + 0x3f, 0x44, 0x48, 0x80, 0x62, 0xb3, 0xd7, 0x3d, 0x6d, 0xe3, 0x4e, 0x43, 0x6c, 0xf7, 0xba, 0x92, + 0x1f, 0x80, 0x8f, 0xa1, 0x32, 0x94, 0x22, 0x1a, 0xf1, 0xf3, 0x8b, 0x96, 0xd4, 0x17, 0x1b, 0xdd, + 0x93, 0x06, 0x3e, 0xe1, 0x39, 0x54, 0x82, 0xad, 0x55, 0xfd, 0x69, 0xa3, 0x2f, 0xf2, 0xf1, 0xe3, + 0x8b, 0x57, 0xd7, 0x65, 0xee, 0xf5, 0x75, 0x99, 0x7b, 0x73, 0x5d, 0xe6, 0x7e, 0xbc, 0x29, 0xc7, + 0x5e, 0xdf, 0x94, 0x63, 0xbf, 0xde, 0x94, 0x63, 0x5f, 0x3c, 0x1d, 0xa9, 0xce, 0x78, 0x3a, 0xac, + 0xc9, 0xa6, 0x5e, 0x9f, 0x4c, 0xed, 0x31, 0x63, 0x34, 0x7b, 0xed, 0xb3, 0xe7, 0xbe, 0x61, 0x2a, + 0xb4, 0xfe, 0x4d, 0x3d, 0x34, 0x23, 0xf7, 0xdf, 0xab, 0x61, 0x92, 0x1d, 0x8f, 0x0f, 0xfe, 0x09, + 0x00, 0x00, 0xff, 0xff, 0x7e, 0xcd, 0xc1, 0xec, 0x7b, 0x09, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -763,6 +842,39 @@ func (this *GatewayMethods) Equal(that interface{}) bool { } return true } +func (this *VaultMethods) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*VaultMethods) + if !ok { + that2, ok := that.(VaultMethods) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if this.Identifier != that1.Identifier { + return false + } + if this.EventIdentifier != that1.EventIdentifier { + return false + } + if this.ConfirmationType != that1.ConfirmationType { + return false + } + return true +} func (this *BlockConfirmation) Equal(that interface{}) bool { if that == nil { return this == nil @@ -865,6 +977,14 @@ func (this *ChainConfig) Equal(that interface{}) bool { if this.GasOracleFetchInterval != that1.GasOracleFetchInterval { return false } + if len(this.VaultMethods) != len(that1.VaultMethods) { + return false + } + for i := range this.VaultMethods { + if !this.VaultMethods[i].Equal(that1.VaultMethods[i]) { + return false + } + } return true } func (this *NativeRepresentation) Equal(that interface{}) bool { @@ -1021,6 +1141,55 @@ func (m *GatewayMethods) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *VaultMethods) 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 *VaultMethods) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VaultMethods) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConfirmationType != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ConfirmationType)) + i-- + dAtA[i] = 0x20 + } + if len(m.EventIdentifier) > 0 { + i -= len(m.EventIdentifier) + copy(dAtA[i:], m.EventIdentifier) + i = encodeVarintTypes(dAtA, i, uint64(len(m.EventIdentifier))) + i-- + dAtA[i] = 0x1a + } + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *BlockConfirmation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1117,6 +1286,20 @@ func (m *ChainConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.VaultMethods) > 0 { + for iNdEx := len(m.VaultMethods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VaultMethods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.GasOracleFetchInterval, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.GasOracleFetchInterval):]) if err1 != nil { return 0, err1 @@ -1367,6 +1550,30 @@ func (m *GatewayMethods) Size() (n int) { return n } +func (m *VaultMethods) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Identifier) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.EventIdentifier) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.ConfirmationType != 0 { + n += 1 + sovTypes(uint64(m.ConfirmationType)) + } + return n +} + func (m *BlockConfirmation) Size() (n int) { if m == nil { return 0 @@ -1434,6 +1641,12 @@ func (m *ChainConfig) Size() (n int) { } l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.GasOracleFetchInterval) n += 1 + l + sovTypes(uint64(l)) + if len(m.VaultMethods) > 0 { + for _, e := range m.VaultMethods { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } return n } @@ -1749,6 +1962,171 @@ func (m *GatewayMethods) Unmarshal(dAtA []byte) error { } return nil } +func (m *VaultMethods) 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: VaultMethods: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VaultMethods: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identifier", 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.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventIdentifier", 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.EventIdentifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfirmationType", wireType) + } + m.ConfirmationType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ConfirmationType |= ConfirmationType(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 *BlockConfirmation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2210,6 +2588,40 @@ func (m *ChainConfig) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultMethods", 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 + } + m.VaultMethods = append(m.VaultMethods, &VaultMethods{}) + if err := m.VaultMethods[len(m.VaultMethods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/x/uregistry/types/vault_methods.go b/x/uregistry/types/vault_methods.go new file mode 100644 index 00000000..f4579662 --- /dev/null +++ b/x/uregistry/types/vault_methods.go @@ -0,0 +1,55 @@ +package types + +import ( + "encoding/hex" + "encoding/json" + "strings" + + "cosmossdk.io/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// Stringer method for VaultMethods. +func (p VaultMethods) String() string { + bz, err := json.Marshal(p) + if err != nil { + panic(err) + } + + return string(bz) +} + +// ValidateBasic does the sanity check on the params. +func (p VaultMethods) ValidateBasic() error { + // Name must not be empty + if strings.TrimSpace(p.Name) == "" { + return errors.Wrap(sdkerrors.ErrInvalidRequest, "vault method name cannot be empty") + } + + // Identifier must not be empty and must be valid hex + if strings.TrimSpace(p.Identifier) == "" { + return errors.Wrap(sdkerrors.ErrInvalidRequest, "vault method identifier cannot be empty") + } + if _, err := hex.DecodeString(strings.TrimPrefix(p.Identifier, "0x")); err != nil { + return errors.Wrapf(sdkerrors.ErrInvalidRequest, "vault method selector must be valid hex: %s", err.Error()) + } + + // Event Identifier must not be empty and must be valid hex + if strings.TrimSpace(p.EventIdentifier) == "" { + return errors.Wrap(sdkerrors.ErrInvalidRequest, "vault method event_identifier cannot be empty") + } + if _, err := hex.DecodeString(strings.TrimPrefix(p.EventIdentifier, "0x")); err != nil { + return errors.Wrapf(sdkerrors.ErrInvalidRequest, "vault method event_identifier must be valid hex: %s", err.Error()) + } + + // ConfirmationType must be known + switch p.ConfirmationType { + case ConfirmationType_CONFIRMATION_TYPE_STANDARD, + ConfirmationType_CONFIRMATION_TYPE_FAST: + // valid + default: + return errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid vault method confirmation type: %v", p.ConfirmationType) + } + + return nil +} diff --git a/x/uregistry/types/vault_methods_test.go b/x/uregistry/types/vault_methods_test.go new file mode 100644 index 00000000..b2ce2bc1 --- /dev/null +++ b/x/uregistry/types/vault_methods_test.go @@ -0,0 +1,116 @@ +package types_test + +import ( + "testing" + + "github.com/pushchain/push-chain-node/x/uregistry/types" + "github.com/stretchr/testify/require" +) + +func TestVaultMethods_ValidateBasic(t *testing.T) { + tests := []struct { + name string + config types.VaultMethods + expectErr bool + errMsg string + }{ + { + name: "valid - EVM style", + config: types.VaultMethods{ + Name: "deposit", + Identifier: "0xb6b55f25", + EventIdentifier: "0x3c4e6c56cc5f2c26c92b91ee2f8bdc4e844b407bd1402b34ac1ef1f875d3c4b5", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_STANDARD, + }, + expectErr: false, + }, + { + name: "valid - Solana style", + config: types.VaultMethods{ + Name: "deposit_funds", + Identifier: "84ed4c39500ab38a", + EventIdentifier: "7f1f6cffbb134644", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_FAST, + }, + expectErr: false, + }, + { + name: "invalid - empty name", + config: types.VaultMethods{ + Name: "", + Identifier: "a9059cbb", + EventIdentifier: "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a5f8d0b2f29", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_STANDARD, + }, + expectErr: true, + errMsg: "vault method name cannot be empty", + }, + { + name: "invalid - empty identifier", + config: types.VaultMethods{ + Name: "deposit", + Identifier: "", + EventIdentifier: "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a5f8d0b2f29", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_STANDARD, + }, + expectErr: true, + errMsg: "vault method identifier cannot be empty", + }, + { + name: "invalid - malformed identifier", + config: types.VaultMethods{ + Name: "deposit", + Identifier: "0xzzzzzz", + EventIdentifier: "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a5f8d0b2f29", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_STANDARD, + }, + expectErr: true, + errMsg: "vault method selector must be valid hex", + }, + { + name: "invalid - empty event_identifier", + config: types.VaultMethods{ + Name: "deposit", + Identifier: "a9059cbb", + EventIdentifier: "", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_STANDARD, + }, + expectErr: true, + errMsg: "vault method event_identifier cannot be empty", + }, + { + name: "invalid - malformed event_identifier", + config: types.VaultMethods{ + Name: "deposit", + Identifier: "a9059cbb", + EventIdentifier: "not_hex_topic!", + ConfirmationType: types.ConfirmationType_CONFIRMATION_TYPE_STANDARD, + }, + expectErr: true, + errMsg: "vault method event_identifier must be valid hex", + }, + { + name: "invalid - unknown confirmation type", + config: types.VaultMethods{ + Name: "deposit", + Identifier: "a9059cbb", + EventIdentifier: "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a5f8d0b2f29", + ConfirmationType: types.ConfirmationType_CONFIRMATION_UNKNOWN, + }, + expectErr: true, + errMsg: "invalid vault method confirmation type", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + err := tc.config.ValidateBasic() + if tc.expectErr { + require.Error(t, err) + require.Contains(t, err.Error(), tc.errMsg) + } else { + require.NoError(t, err) + } + }) + } +}